algod client
historical indexer client
Return asset object for this market
asset
Return staking contract manager
manager
Return manager address
manager address
Return manager app id
manager app id
Return staking contract market
market
Return the market address
market address
Return the market app id
market app id
Return oracle app id
oracle app id
Return rewards program
rewards program
Return staked amount
staked
Return the staking contract storage address for given address or null if it does not exist
address to get info for
storage account address for user
Return the staking contract local state for storage address
-storage address to get info for
staking contract local state for address
Return the staking contract local state for address
address to get info for
staking contract local state for address
Method to fetch most recent staking contract global state
This is the function that should be called when creating a new staking contract. You pass everything you would to the constructor with an additional staking contract info dictionary, but to this function instead and this returns the new and created staking contract.
//Correct way to instantiate new staking contract
const newStakingContract = await StakingContract.init(algodClient, historicalIndexerClient, stakingContractInfo)
//Incorrect way to instantiate new staking contract
const newStakingContract = new StakingContract(algodClient, historicalIndexerClient)
algod client
historical indexer client
dictionary of information on staking contract
Generated using TypeDoc
This is the constructor for the StakingContract class.
Note, do not call this to create a new staking contract. Instead call the static method init as there are asynchronous set up steps in creating an staking contract and a constructor can only return an instance of the class and not a promise.
Example