---
title: getVoteAccounts
description: >-
  Returns vote accounts visible at the requested commitment, partitioned into
  current and delinquent.
url: /docs/rpc/http/getvoteaccounts
type: reference
hideTableOfContents: true
---

Returns vote accounts visible at the requested commitment, partitioned into
`current` and `delinquent`.

<Callout type="info" title="Source">
  [`get_vote_accounts`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L1139)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getVoteAccounts",
  "params": [
    // !hover(1:4) config
    {
      // !hover commitment
      "commitment": "finalized",
      // !hover votePubkey
      "votePubkey": "i7NyKBMJCA9bLM2nsGyAGCKHECuR2L5eh4GqFciuwNT"
    }
  ]
}
```

```ts !!request title="Kit"
import { address, createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover votePubkey
let votePubkey = address("5ZWgXcyqrrNpQHCme5SdC5hCeYb2o3fEJhF7Gok3bTVN");

let voteAccounts = await rpc
  .getVoteAccounts({
    votePubkey
  })
  .send();

console.log(voteAccounts);
```

```ts !!request title="web3.js"
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

let voteAccounts = await connection.getVoteAccounts();

console.log(voteAccounts);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::{nonblocking::rpc_client::RpcClient, rpc_config::RpcGetVoteAccountsConfig};
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover votePubkey
    let vote_pubkey = String::from("5ZWgXcyqrrNpQHCme5SdC5hCeYb2o3fEJhF7Gok3bTVN");

    let config = RpcGetVoteAccountsConfig {
        vote_pubkey: Some(vote_pubkey),
        commitment: CommitmentConfig::finalized().into(),
        keep_unstaked_delinquents: None,
        delinquent_slot_distance: None,
    };

    let vote_accounts = client.get_vote_accounts_with_config(config).await?;

    println!("{:#?}", vote_accounts);

    Ok(())
}
```

### !params

#### !! config

!type object  
!optional

Configuration object containing the following fields:

##### !! commitment

!type string  
!values processed confirmed finalized  
!default finalized

Solana RPC uses the following commitment levels:

| Value       | Description                                                                                                                                                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `processed` | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks.                                                                                         |
| `confirmed` | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. This is more stable than `processed`, but it is still a weaker guarantee than `finalized`.                                                                       |
| `finalized` | Return data from the highest slot that the cluster recognizes as finalized. In practice, this means the slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |

##### !! votePubkey

!type string

Return only entries for this vote account address, as a base-58 encoded string.

##### !! keepUnstakedDelinquents

!type bool  
!values true false  
!default false

Keep delinquent vote accounts even if their activated stake is zero.

```json title="Example"
{ "keepUnstakedDelinquents": true }
```

##### !! delinquentSlotDistance

!type u64  
!default 128

Number of slots a validator may trail the selected slot before the RPC node
classifies it as delinquent. **Note:** ecosystem tools usually leave this unset
to preserve consistent behavior.

```json title="Example"
{ "delinquentSlotDistance": 256 }
```

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:21) result
  "result": {
    // !hover(1:18) current
    "current": [
      {
        "activatedStake": 38263229364446900,
        "commission": 95,
        "epochCredits": [
          [902, 1383125544, 1376213656],
          [903, 1390037304, 1383125544],
          [904, 1396949288, 1390037304],
          [905, 1403861272, 1396949288],
          [906, 1406766600, 1403861272]
        ],
        "epochVoteAccount": true,
        "lastVote": 391573587,
        "nodePubkey": "dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV",
        "rootSlot": 391573556,
        "votePubkey": "i7NyKBMJCA9bLM2nsGyAGCKHECuR2L5eh4GqFciuwNT"
      }
    ],
    // !hover delinquent
    "delinquent": []
  },
  "id": 1
}
```

!type object

Vote-account status object containing `current` and `delinquent` arrays of vote
account records.

##### !! current

!type array

Vote accounts the RPC node classifies as current at the requested commitment.

##### !! delinquent

!type array

Vote accounts the RPC node classifies as delinquent at the requested commitment.

Each element of `current` and `delinquent` is a vote-account object containing:

| Field              | Type     | Description                                                                                                  |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `activatedStake`   | `u64`    | Stake, in lamports, delegated to this vote account and active in the current epoch.                          |
| `commission`       | `u8`     | Commission rate used for rewards payout, expressed as an 8-bit fraction.                                     |
| `epochCredits`     | `array`  | Recent history of earned credits for up to five epochs. Each element is `[epoch, credits, previousCredits]`. |
| `epochVoteAccount` | `bool`   | Whether this vote account is staked for the current epoch.                                                   |
| `lastVote`         | `u64`    | Most recent slot this vote account voted on. Returns `0` if no votes exist.                                  |
| `nodePubkey`       | `string` | Validator identity pubkey, as a base-58 encoded string.                                                      |
| `rootSlot`         | `u64`    | Current root slot for this vote account. Returns `0` if no root slot exists.                                 |
| `votePubkey`       | `string` | Vote account pubkey, as a base-58 encoded string.                                                            |

</APIMethod>
