ledger.read.v1.LedgerReadService
GetBalances
Retrieve the latest balances for an account. Supports optional subaccount scoping and returns asset symbols with decimal amounts on REST.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/ledger.read.v1.LedgerReadService/GetBalances' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"subaccountId": "6789012345678"
}'Responses
{
"balances": [
{
"assetId": 100,
"available": {
"hi": "1",
"lo": "1"
},
"funding": {
"hi": "1",
"lo": "1"
},
"fundingRevision": "1",
"reserved": {
"hi": "1",
"lo": "1"
},
"trading": {
"hi": "1",
"lo": "1"
},
"tradingRevision": "1"
}
]
}ledger.read.v1.GetBalancesRequestledger.read.v1.GetBalancesResponseOptional public subaccount ID. When omitted, subaccount-scoped API keys use their bound subaccount; other callers use their authenticated root account.
Public unified asset id. Resolve symbol from SpotConfig; U128 amounts in this message always use fixed 18-decimal ledger scale.
Most significant 64 bits.
Least significant 64 bits.
Most significant 64 bits.
Least significant 64 bits.
Most significant 64 bits.
Least significant 64 bits.
Most significant 64 bits.
Least significant 64 bits.
Opaque monotonic revision for the atomic trading, reserved, and available values. Higher means newer; zero means no trading state has been observed.
Opaque monotonic revision for the funding value. Higher means newer; zero means no funding state has been observed.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| api-key-action-deny | 403 | permission_denied | API Key Policy Denied | API key policy does not allow this read action. |
| api-key-policy-not-found | 403 | permission_denied | API Key Policy Not Found | API key policy was not found. |
| api-key-policy-required | 403 | permission_denied | API Key Policy Required | API key policy is required for ledger reads. |
| api-key-root-scope-only | 403 | permission_denied | API Key Root Scope Only | This API key is scoped to the root account and cannot read sub-accounts. |
| api-key-subaccount-mismatch | 403 | permission_denied | API Key Sub-account Mismatch | This API key is bound to a different sub-account. |
| api-key-unknown | 403 | permission_denied | API Key Unknown | The authenticated API key has no metadata entry in the API key store. |
| auth-authentication-required | 401 | unauthenticated | Authentication Required | Authentication is required. |
| auth-session-kind-not-allowed | 403 | permission_denied | Interactive Session Required | This read accepts only an interactive session; API keys are refused. |
| bad-request | 400 | invalid_argument | Bad Request | — |
| invalid-account-id | 400 | invalid_argument | Invalid Account ID | — |
| invalid-argument | 400 | invalid_argument | Bad Request | — |
| invalid-subaccount-id | 400 | invalid_argument | Invalid Sub-account ID | — |
| ip-not-allowed | 401 | unauthenticated | API Key IP Not Allowed | API key is not authorized from this IP address. |
| key-disabled | 401 | unauthenticated | API Key Disabled | API key is disabled. |
| key-expired | 401 | unauthenticated | API Key Expired | API key has expired. |
| missing-account-id | 400 | invalid_argument | Missing Account ID | — |
| missing-headers | 400 | invalid_argument | Missing API Key Headers | Missing required API key authentication headers. |
| missing-wallet | 400 | invalid_argument | Missing Wallet | — |
| not-found | 404 | not_found | Not Found | — |
| permission-denied | 403 | permission_denied | Permission Denied | — |
| role-action-deny | 403 | permission_denied | Role Denied | Your role does not allow this read action. |
| server-error | 500 | internal | Server Error | — |
| signature-invalid | 401 | unauthenticated | Invalid API Key Signature | API key signature is invalid. |
| subaccount-policy-deny | 403 | permission_denied | Sub-account Policy Denied | Sub-account policy does not allow this read action. |
| subaccount-read-forbidden | 403 | permission_denied | Sub-account Read Forbidden | You do not have permission to read this sub-account. |
| timestamp-skew | 400 | invalid_argument | API Key Timestamp Skew | API key timestamp is outside the allowed skew window. |
| unauthenticated | 401 | unauthenticated | Unauthenticated | Ledger reads require a valid bearer JWT or signed API-key request. |
| upstream-error | 502 | unavailable | Upstream Error | — |
| wallet-not-found | 404 | not_found | Wallet Not Found | — |
| wallet-resolution-unavailable | 502 | unavailable | Wallet Resolution Unavailable | — |