Classes to interact, analyze and play realms
npm install realms-classesRealms classes is a package coming with many classes related to Realms. It have been made with easy of use in mind.
You may want to use it for 2 reasons
For this we have a sets of classes that help you automatizing some tasks.
For this we have a sets of classes and StarkNet smart contracts to fecth and interpret data easily.
We have set classes that facilitates any calls for every Realms smart contracts in the src/game path.
This is a base contract that is extended by any ERC721 token. It implements all functions and adapt return types to be easily used.
We have a set of classes and smart contracts to help facilitate getting and interpreting data about Realms.
Those classes are built upon the starknet-analyzer package which allow organization of raw StarkNet data.
Those classes basically take raw data from StarkNet, filter it to keep only data about the Realms game, and organize it to use it and interpret it more easily.
You have the Realms_analyzer.cairo contract deployed at 0x054ecb7d11754f0bc2925fa9e2f5f049dfc94779ccfeab89463f584c116c0e2b on goerli (as of 05/07/2022).
This contract makes a multicall to get all holders of a given collection.
The input is either the realms erc721 token address or srealms erc721 token address (could work with other ERC721 as well).
The returned data is of this form ([tokenId_1.low, tokenId_1.high, ownerAddress_1, ...]):
```
[
tokenId_1.low,
tokenId_1.high,
ownerAddress_1,
tokenId_2.low,
tokenId_2.high,
ownerAddress_2,
...,
tokenId_N.low,
tokenId_N.high,
ownerAddress_N
]
Scripts:
Used for development purposes. Should not be useful to you but I've let it for transparency purposes.
index:
uint256ToBigNumber: Convert an uint256 into an ethersjs BigNumber instance
organizeAbi: Convert an hardhat raw ABI into an organized abi that starknet-analyzer can use utils/constats.ts` and connect them to a provider
parseAbi: Parse an abi (typescript helper)
getRealmsContracts: Takes contracts from
getRealmsClasses: Return the correct classes with a contract connected to a provider
Helper:
Regroup helpers functions that any class can need
constants:
Group all constants about the games like addresses.