Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.21 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.21 KB

DFK Contracts

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.

Installation

Use pip:

pip install dfk_contracts

Usage

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')

Contact

File an issue, write me at [email protected], or find @Athiriyya on the GameFi Devs Discord.