getVoteAccounts RPC Method
Returns the account info and associated stake for all the voting accounts in the current bank.
Parameters
object
optional
Configuration object containing the following fields:
commitment string
optional
votePubkey string
optional
Only return results for this validator vote address (base-58 encoded)
keepUnstakedDelinquents bool
optional
Do not filter out delinquent validators with no stake
delinquentSlotDistance u64
optional
Specify the number of slots behind the tip that a validator must fall to be considered delinquent. NOTE: For the sake of consistency between ecosystem products, it is not recommended that this argument be specified.
Result
The result field will be a JSON object of current
and delinquent
accounts,
each containing an array of JSON objects with the following sub fields:
votePubkey: <string>
- Vote account address, as base-58 encoded stringnodePubkey: <string>
- Validator identity, as base-58 encoded stringactivatedStake: <u64>
- the stake, in lamports, delegated to this vote account and active in this epochepochVoteAccount: <bool>
- bool, whether the vote account is staked for this epochcommission: <number>
- percentage (0-100) of rewards payout owed to the vote accountlastVote: <u64>
- Most recent slot voted on by this vote accountepochCredits: <array>
- Latest history of earned credits for up to five epochs, as an array of arrays containing:[epoch, credits, previousCredits]
.rootSlot: <u64>
- Current root slot for this vote account
Code sample
Restrict results to a single validator vote account: