getVoteAccounts

Returns the account info and associated stake for all the voting accounts in the current bank.

getVoteAccounts

POST http://srpc.solapi.pro/?api_key=<api-key>

Request:

const response = await fetch('http://srpc.solapi.pro/?api_key=<api-key>', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getVoteAccounts",
      "params": [
        {
          "votePubkey": "3ZT31jkAGhUaw8jsy4bTknwBMP8i4Eueh52By4zXcsVw"
        }
      ]
    }),
});
const data = await response.json();

Response:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "current": [
      {
        "votePubkey": "3ZT31jkAGhUaw8jsy4bTknwBMP8i4Eueh52By4zXcsVw",
        "nodePubkey": "B97CCUW3AEZFGy6uUg6zUdnNYvnVq5VG8PUtb2HayTDD",
        "activatedStake": 42,
        "epochVoteAccount": true,
        "commission": 0,
        "lastVote": 147,
        "epochCredits": [
          [
            1,
            64,
            0
          ]
        ],
        "rootSlot": 42
      }
    ],
    "delinquent": [
      {
        "votePubkey": "3ZT31jkAGhUaw8jsy4bTknwBMP8i4Eueh52By4zXcsVw",
        "nodePubkey": "B97CCUW3AEZFGy6uUg6zUdnNYvnVq5VG8PUtb2HayTDD",
        "activatedStake": 0,
        "epochVoteAccount": false,
        "commission": 0,
        "lastVote": 147,
        "epochCredits": [
          [
            1,
            64,
            0
          ]
        ],
        "rootSlot": 42
      }
    ]
  }
}

Last updated