Stake APIs

GetAllStakes

This API returns all stake records.

REST Uri: /stake/all

Returns

stakes: json representation of the stakes

_id: the ID for the stake record

type: this stake is in the Validator candidate pool or the Lightning candidate pool

holder: the holder account's address

source: the source account's address

amount: the staked SPAYWei amount

withdrawn: true returns the stake is withdrawn, false returns the stake is not withdrawn

return_height: the expected height the tokens return to the staking wallet if a node withdraws its stake.

// Request
curl https://explorer.script.tv/api/stake/all
// Result
{
 "type": "stake",
 "body": [{
 "_id": "5eb9f45d38696f556cc3334d",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x4aefa39caeadd662ae31ab0ce7c8c2c9c0a013e8",
 "amount": "20000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc3334e",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x747f15cac97b973290e106ef32d1b6fe65fef5a1",
 "amount": "40000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc33351",
 "type": "vcp",
 "holder": "0xa61abd72cdc50d17a3cbdceb57d3d5e4d8839bce",
 "source": "0x0c9a45926a44a6fc9c8b6f9cb45c20483038698c",
 "amount": "32000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 }
 ...
 ]
}

GetTotalStakedAmount

This API returns the total amount of stakes.

REST Uri: /stake/totalAmount

Returns

totalAmount: the total amount of staked SPAYWei

totalNodes: the total amount of stake nodes

GetStakeByAddress

This API returns the stakes being queried with address.

REST Uri: /stake/:address

Returns

For each stake it is similar to the returns of the GetAllStakes API.

Last updated

Was this helpful?