curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getVoteAccounts",
"params": [
{
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
]
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getVoteAccounts",
"params": [
{
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
]
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": {
"current": [
{
"activatedStake": 351192245566822,
"commission": 0,
"epochCredits": [
[
1013,
2364183921,
2357279421
],
[
1014,
2371091343,
2364183921
],
[
1015,
2377959529,
2371091343
],
[
1016,
2384857170,
2377959529
],
[
1017,
2391322594,
2384857170
]
],
"epochVoteAccount": true,
"inflationRewardsCommissionBps": 0,
"lastVote": 439749154,
"nodePubkey": "Diman2GphWLwECE3swjrAEAJniezpYLxK1edUydiDZau",
"rootSlot": 439749123,
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
],
"delinquent": []
},
"id": 1
}
HTTP methods
getVoteAccounts
Returns the account info and associated stake for all the voting accounts in the current bank.
curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getVoteAccounts",
"params": [
{
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
]
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getVoteAccounts",
"params": [
{
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
]
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": {
"current": [
{
"activatedStake": 351192245566822,
"commission": 0,
"epochCredits": [
[
1013,
2364183921,
2357279421
],
[
1014,
2371091343,
2364183921
],
[
1015,
2377959529,
2371091343
],
[
1016,
2384857170,
2377959529
],
[
1017,
2391322594,
2384857170
]
],
"epochVoteAccount": true,
"inflationRewardsCommissionBps": 0,
"lastVote": 439749154,
"nodePubkey": "Diman2GphWLwECE3swjrAEAJniezpYLxK1edUydiDZau",
"rootSlot": 439749123,
"votePubkey": "voteRnv6PBzmiGP8NicWtQiqEJTwKKq2SxtqtdLUJjd"
}
],
"delinquent": []
},
"id": 1
}
Returns the account info and associated stake for all the voting accounts in the current bank.