getBalance

Returns the balance of the account of provided Pubkey.

📘

Supported on Solana (mainnet) only.

Parameters

  • <string> - Pubkey of account to query, as base-58 encoded string
  • (optional) <object> - Configuration object containing the following fields:
    • (optional) commitment: <string> - Commitment
    • (optional) minContextSlot: <number> - set the minimum slot that the request can be evaluated at.

Returns

  • RpcResponse<u64> - RpcResponse JSON object with value field set to the balance

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0", "id":1, "method":"getBalance", "params":["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]}'

Result

{
  "jsonrpc": "2.0",
  "result": { "context": { "slot": 1 }, "value": 0 },
  "id": 1
}