Reading Contract States
In this section, we will cover a few read operations that are useful from a delegator's perspective. These are:
- Current list of SSNs
- List of delegators for a SSN
- Delegator's buffered deposit
- Delegator's stake amount
- Delegator's stake reward
- Delegator's reward history
- Delegator's pending stake withdrawal request
- Delegation history
In order to read the above information from the smart contract, you should use the GetSmartContractSubState
API by querying it from the ssnlist
smart contract.
Getting the Current List of SSNs
Inputs
- Address of
ssnlist
smart contract ssnlist
Output
Map of SSN with the corresponding SSN data type
Map SSN address -> SSN data type
Getting the List of Delegators for a SSN
Inputs
- Address of
ssnlist
smart contract ssn_deleg_amt
- Address of SSN
Example
Output
Map SSN addreess
-> Map delegator address
stake deposit amount
Example
Getting the Delegator's Buffered Deposit
Inputs
- Address of
ssnlist
smart contract buff_deposit_deleg
- Address of delegator
Example
Output
Map of ssn address
with the value being a map of cycle number
and the buffered deposit
at that particular cycle number
Map SSN address
-> Map Cycle number
buffered deposit amount in Qa
info
Cycle number refers to the cycle number of the smart contract when the deposit was submitted to buffered deposit.
Example
Getting the Delegator's Stake Amount
Inputs
- Address of
ssnlist
smart contract deposit_amt_deleg
- Address of
delegator
Example
Output
Map consisting of SSN address and the corresponding delegated amount for a particular delegator
Map ssn address
-> delegated amount
Getting the Delegator's Stake Reward
Coming soon
Getting the Delegator's Reward History
Coming soon
Getting the Delegator's Pending Stake Withdrawal Request
Inputs
- Address of
ssnlist
smart contract withdrawal_pending
- Address of
delegator
Example
Output
Map consisting of the epoch number
when the withdrawal was initiated and the corresponding amount
to withdraw
Map epoch number
-> Pending withdrawal amount
Getting Delegation History
Coming soon