Staking & Voting
getVoteAccounts
Returns the current vote accounts
Parameters
Configuration object containing:
Commitment level (processed, confirmed, finalized)
Public key of a specific vote account to query (base-58 encoded)
Whether to include unstaked delinquent vote accounts
Maximum slot distance to consider a vote account delinquent
Response
Object containing:
Array of current vote account objects containing:
Public key of the vote account (base-58 encoded)
Public key of the validator (base-58 encoded)
Amount of activated stake in lamports
Whether the account voted in the current epoch
Slot of the last vote
Slot of the root
Array of delinquent vote account objects with the same structure as current
Code Examples
Basic Request
Using web3.js
Notes
- Returns the current vote accounts
- The response includes both current and delinquent vote accounts
- The response is immediate as it reads from the current state
- The accounts can change with stake changes and voting
- The vote accounts must be valid
Best Practices
- Use appropriate commitment level based on your needs
- Cache results when appropriate to reduce RPC load
- Monitor for changes in vote accounts
- Consider using websocket subscription for real-time updates
- Handle network errors and retry when appropriate
Common Errors
Code | Message | Solution |
---|---|---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32602 | Invalid params | Check configuration parameters |
-32007 | Vote account not found | Verify the vote account exists |
Use Cases
-
Vote Account Analysis
-
Vote Account Monitoring
-
Vote Account Planning