DFK Contracts is a set of all current contracts for Defi Kingdoms, autogenerated from the contracts' ABI json files (findable on the DFK Devs pages). See the ABI Maker for more info on how this process works.
Use pip:
pip install dfk_contracts
To get access to ALL of a DFK's contracts, there's a special object:
from dfk_contracts.all_dfk_contracts import AllDfkContracts
# Use default Crystalvale RPC
all_cv_contracts = AllDfkContracts('cv')
# Or use a custom Serendale RPC
all_sd_contracts('sd', 'https://alternate.klaytn.rpc.com')
crystals = all_cv_contracts.crystal_core.get_user_crystals('0xYOUR_ADDRESS')
Each contract here can also be instantiated on its own, for example:
from dfk_contracts.contracts import crystal_core
# Use default Crystalvale RPC
cc = crystal_core.CrystalCore('cv')
crystals = cc.get_user_crystals('0xYOUR_ADDRESS')
File an issue, write me at [email protected], or find @Athiriyya on the GameFi Devs Discord.