Stake RPC API
embedded.stake
- embedded.stake.getEntriesByAddress
- embedded.stake.getUncollectedReward
- embedded.stake.getFrontierRewardByPage
embedded.stake.getEntriesByAddress
This API call will return staking information for a particular address
Request
3 parameters:
- first parameter of type
stringthat represents the address - second parameter of type
numberthat represents the page index - third parameter of type
numberthat represents the number of entries to be displayed on this page
{
"jsonrpc": "2.0",
"id": 19,
"method": "embedded.stake.getEntriesByAddress",
"params": ["z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9", 0, 5]
}
Response
JSON object representing the staking entries:
totalAmountof typeint: total amount of ZNN stakedtotalWeightedAmountof typeint: total weighted amount of ZNN stakedcountof typenumber: number of entrieslistof typearray: list of entries. Each entry is defined by the following fields:amountof typenumber: staking amountweightedAmountof typenumber: ZNN amount that is actually staked calculated based on the number of monthsstartTimestampof typenumber: UNIX timestamp of stake registrationexpirationTimestampof typenumber: UNIX timestamp of stake expirationaddressof typestring: staking addressidof typestring: id of stake, used to cancel the stake
{
"jsonrpc": "2.0",
"id": 19,
"result": {
"totalAmount": "11209634848359",
"totalWeightedAmount": "23540233181553",
"count": 8,
"list": [
{
"amount": "5000000000000",
"weightedAmount": "10500000000000",
"startTimestamp": 1712527460,
"expirationTimestamp": 1743631460,
"address": "z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9",
"id": "b281166fc58402d36beeed739964bde3b4d33c1d51b542adff55d66202c1a73d"
},
{
"amount": "1200000000000",
"weightedAmount": "2520000000000",
"startTimestamp": 1731441270,
"expirationTimestamp": 1762545270,
"address": "z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9",
"id": "bb07b4ba819060ec9282b0d3517262ef016e1982b4605bae3bcdd5b95e1fb9f5"
},
{
"amount": "1000000000000",
"weightedAmount": "2100000000000",
"startTimestamp": 1737932890,
"expirationTimestamp": 1769036890,
"address": "z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9",
"id": "81dc20b47380a3baaa4e783ac9b38c654051a04c758f5f12526498449c7c922a"
}
]
}
}
embedded.stake.getUncollectedReward
This API call will return the uncollected reward(s) for the specified stake.
Request
One parameter of type string that represents the address of the Stake
{
"jsonrpc": "2.0",
"id": 17,
"method": "embedded.stake.getUncollectedReward",
"params": ["z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9"]
}
Response
JSON object representing the uncollected reward:
addressof typestring: address of the StakeznnAmountof typenumber: the ZNN amount that has to be collectedqsrAmountof typenumber: the QSR amount that has to be collected
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"address": "z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9",
"znnAmount": "0",
"qsrAmount": "37716448266"
}
}
embedded.stake.getFrontierRewardByPage
This API call will return reward information the specified stake for a specified range of pages.
Request
3 parameters:
- first parameter of type
stringthat represents the stake address - second parameter of type
numberthat represents the page index - third parameter of type
numberthat represents the number of entries to be displayed on this page
{
"jsonrpc": "2.0",
"id": 7,
"method": "embedded.stake.getFrontierRewardByPage",
"params": ["z1qzpa55k8328ff0ys7jfakfvhw8k2cwm53f5d5u", 0, 2]
}
Response
JSON object representing the rewards:
countof typenumber: the total number of the epochs- an array of entries for the rewards with the following fields:
epochof typenumber: the specified epochznnAmountof typenumber: the ZNN amount that has to be collectedqsrAmountof typenumber: the QSR amount that has to be collected
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"count": 2,
"list": [
{
"epoch": 0,
"znnAmount": 0,
"qsrAmount": 1000000000
},
{
"epoch": 1,
"znnAmount": 0,
"qsrAmount": 1000000000
}
]
}
}