Get SOL balance
The native SOL balance of any wallet, in lamports and SOL.
GET /wallets/{address}/balanceParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
address | path | string | Yes | The wallet's base58 address. |
confirmation | query | string | No | processed, 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
| Field | Type | Description |
|---|---|---|
address | string | Echo of the requested address. |
lamports | number | Exact balance in lamports (1 SOL = 1,000,000,000 lamports). |
sol | number | The 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
code | When |
|---|---|
invalid_address | The path parameter isn't valid base58. |
Under the hood
Replaces the JSON-RPC getBalance call and the lamports-to-SOL conversion.