Sentinel RPC API
embedded.sentinel
- embedded.sentinel.getByOwner
- embedded.sentinel.getAllActive
- embedded.sentinel.getDepositedQsr
- embedded.sentinel.getUncollectedReward
- embedded.sentinel.getFrontierRewardByPage
embedded.sentinel.getByOwner
This API call will return all the Sentinels registered by an address.
Request
One parameter of type string that represents the ownerAddress of the Sentinels.
{
"jsonrpc": "2.0",
"id": 4,
"method": "embedded.sentinel.getByOwner",
"params": ["z1qz5fskcw8q6zndyu2w5eps9cyk3ekn9ecvcngd"]
}
Response
JSON object representing the registered Sentinel:
Same information as embedded.sentinel.getAllActive
{
"id": 4,
"jsonrpc": "2.0",
"result": {
"owner": "z1qz5fskcw8q6zndyu2w5eps9cyk3ekn9ecvcngd",
"registrationTimestamp": 1622025090,
"isRevocable": true,
"revokeCooldown": 12480,
"active": true
}
}
embedded.sentinel.getAllActive
This API call will return a list of all registered Sentinels.
Request
2 parameters:
- first parameter of type
numberthat represents the page - second parameter of type
numberthat represents the number of entries to be displayed on this page
{
"jsonrpc": "2.0",
"id": 15,
"method": "embedded.sentinel.getAllActive",
"params": [0, 100]
}
Response
JSON object representing the registered Sentinels:
countof typenumber: the total number of registered Sentinels- an array of
entrieswith the following fields:ownerof typestring: the address that registered the SentinelregistrationTimestampof typenumber: Sentinel's registration UNIX timestampisRevocableof typebool:trueif the Sentinel can be revoked,falseotherwiserevokeCooldownof typenumber: seconds until the revoke windowactiveof typebool:trueif Sentinel is active,falseif revoked
{
"jsonrpc": "2.0",
"id": 15,
"result": {
"count": 3,
"list": [
{ "owner": "z1qz5fskcw8q6zndyu2w5eps9cyk3ekn9ecvcngd",
"registrationTimestamp": 1622627030,
"isRevocable": false,
"revokeCooldown": 63520,
"active": true
},
{
"owner": "z1qz5fskcw8q6zndyu2w5eps9cyk3ekn9ecvcngd",
"registrationTimestamp": 1622025090,
"isRevocable": false,
"revokeCooldown": 66380,
"active": true
},
{
"owner": "z1qz5fskcw8q6zndyu2w5eps9cyk3ekn9ecvcngd",
"registrationTimestamp": 1623135770,
"isRevocable": false,
"revokeCooldown": 53860,
"active": true
}
]
}
}
embedded.sentinel.getDepositedQsr
This API call will return the amount of QSR the address has deposited in order to create a Sentinel.
Request
One parameter of type string that represents the Sentinel address.
{
"jsonrpc": "2.0",
"id": 14,
"method": "embedded.sentinel.getDepositedQsr",
"params": ["z1qzpa55k8328ff0ys7jfakfvhw8k2cwm53f5d5u"]
}
Response
number that represents the amount of QSR deposited
{
"id": 14,
"jsonrpc": "2.0",
"result": 5000000000000
}
embedded.sentinel.getUncollectedReward
This API call will return the uncollected reward for the specified sentinel.
Request
One parameter of type string that represents the address of the Sentinel
{
"jsonrpc": "2.0",
"id": 17,
"method": "embedded.sentinel.getUncollectedReward",
"params": ["z1qzpa55k8328ff0ys7jfakfvhw8k2cwm53f5d5u"]
}
Response
JSON object representing the uncollected reward:
addressof typestring: address of the SentinelznnAmountof typenumber: the ZNN amount that has to be collectedqsrAmountof typenumber: the QSR amount that has to be collected
{
"id": 6,
"jsonrpc": "2.0",
"result": {
"address": "z1qzpa55k8328ff0ys7jfakfvhw8k2cwm53f5d5u",
"znnAmount": 100000000,
"qsrAmount": 100000000
}
}
embedded.sentinel.getFrontierRewardByPage
This API call will return reward information the specified sentinel for a specified range of pages.
Request
3 parameters:
- first parameter of type
stringthat represents the sentinel 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.sentinel.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
{
"id": 7,
"jsonrpc": "2.0",
"result": {
"count": 2,
"list": [
{
"epoch": 0,
"znnAmount": 100000000,
"qsrAmount": 1000000000
},
{
"epoch": 1,
"znnAmount": 100000000,
"qsrAmount": 1000000000
}
]
}
}