/accounts/{accountId}/staking-info - Polkadot
Example code for the /accounts/{accountId}/staking-info REST method. Complete guide on how to use /accounts/{accountId}/staking-info REST in GetBlock Web3 documentation.
This endpoint returns the staking information for a stash account, including the controller, reward destination, and the bonded, active, and unlocking amounts.
Endpoint
GET /accounts/{accountId}/staking-infoPath Parameters
accountId
string
SS58 stash account address
Query Parameters
at
string
No
Block height or hash to query at
Request
curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/staking-info'const response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/staking-info');
const data = await response.json();
console.log(data);import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/staking-info')
print(response.json())Response
{
"at": {
"hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
"height": "6754362"
},
"controller": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5",
"rewardDestination": "Staked",
"numSlashingSpans": "0",
"staking": {
"stash": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5",
"total": "100000000000",
"active": "100000000000",
"unlocking": [],
"claimedRewards": [
"1400",
"1401"
]
}
}Response Fields
controller
string
Controller account for the stash
rewardDestination
string
Where staking rewards are sent
staking.total
string
Total bonded amount in Planck
staking.active
string
Actively bonded amount in Planck
staking.unlocking
array
Amounts currently unbonding
Use Cases
Staking Dashboards: Show a nominator's bonded and active stake
Reward Tracking: Read claimed reward eras
Unbonding UX: Display amounts in the unbonding period
Portfolio Tools: Aggregate staking positions
Last updated
Was this helpful?