For the complete documentation index, see llms.txt. This page is also available as Markdown.

getTokenAccountBalance

getTokenAccountBalance — Token account balance

post
/

Returns the token balance of an SPL Token account. Parameters

  1. pubkey (required) — Token account pubkey, base-58.

  2. config (optional) — Optional configuration object. Every field is optional; omit the entire object to use defaults.

Authorizations
AuthorizationstringOptional

Pass Authorization: <api-key> on each request.

Body
jsonrpcstring · enumRequired

JSON-RPC protocol version.

Example: 2.0Possible values:
idone ofRequired

Request identifier echoed back in the response.

Example: 1
stringOptional
or
integerOptional
methodstring · enumRequired

Must be getTokenAccountBalance.

Example: getTokenAccountBalancePossible values:
Responses
200

Successful getTokenAccountBalance response.

application/json

Base envelope of every JSON-RPC 2.0 response.

jsonrpcstring · enumRequiredExample: 2.0Possible values:
idone ofRequired

Echoed request id.

Example: 1
stringOptional
or
integerOptional
post/
curl -X POST https://public.rpc.solanavibestation.com \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenAccountBalance",
    "params": [
      "7UVpfyV3PzWxNw3pcU88WGGgC4XSiTNVTPMK6P7vrqCi",
      {
        "commitment": "finalized"
      }
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 416997240,
      "apiVersion": "3.1.10"
    },
    "value": {
      "amount": "1000000",
      "decimals": 6,
      "uiAmount": 1,
      "uiAmountString": "1"
    }
  }
}

Last updated