Mainly

Get SOL balance

The native SOL balance of any wallet, in lamports and SOL.

GET /wallets/{address}/balance

Parameters

ParameterInTypeRequiredDescription
addresspathstringYesThe wallet's base58 address.
confirmationquerystringNoprocessed, confirmed (default), or finalized.

Example

curl https://api.sarg.am/v1/solana/wallets/9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM/balance \
  -H "Authorization: Bearer $MAINLY_API_KEY"
{
  "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  "lamports": 1529000000,
  "sol": 1.529
}

Response fields

FieldTypeDescription
addressstringEcho of the requested address.
lamportsnumberExact balance in lamports (1 SOL = 1,000,000,000 lamports).
solnumberThe same balance in SOL, for display.

A wallet that has never received funds returns a 200 with a zero balance — on Solana, "doesn't exist yet" and "has 0 SOL" are the same thing for system accounts.

Errors

codeWhen
invalid_addressThe path parameter isn't valid base58.

Under the hood

Replaces the JSON-RPC getBalance call and the lamports-to-SOL conversion.

On this page