WithdrawService
Get Wallet Balances
Read the zTokens the account's smart account wallet holds on Polyester Chain, such as a rejected withdrawal's refund, live from the chain. An API key needs READ_BALANCES within its scope.
Method
GET
Path
/v1/chain/wallet/balances
Visibility
Authentication
Session token or API key
MFA Requirement
Not required
GET
/v1/chain/wallet/balances Request
Testnet
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/chain/wallet/balances?subaccountId=45LUmqjT' \ --header 'Accept: */*' \ --header 'X-API-KEY-ID: YOUR_API_KEY_ID' \ --header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \ --header 'X-API-SIGNATURE: YOUR_API_SIGNATURE'
Responses
{
"balances": [
{
"amount": "18.446744073709551617",
"chainId": 1,
"unifiedAssetId": 100,
"zippedAssetId": 100,
"ztokenAddress": "0x6666666666666666666666666666666666666666"
}
],
"smartAccountAddress": "0x2222222222222222222222222222222222222222"
} subaccountId string
Public subaccount ID; omit for the caller's root account. Public ID, as a base58 string.
5 fields
amount string
Balance as a decimal string in whole units of the zToken, for example '0.5' for half a unit, with at most 18 decimal places.
Example
18.446744073709551617 chainId integer (int32)
External network of the zipped asset, the chainId of GetDepositWithdrawConfig.
Example
1 unifiedAssetId integer (int32)
Unified asset the zToken stands for.
Example
100 zippedAssetId integer (int32)
Zipped asset of the zToken: the network-specific asset, as chain.lifecycle.v1.AssetIds.zipped_asset_id names it.
Example
100 ztokenAddress string
zToken contract address on Polyester Chain.
Example
0x6666666666666666666666666666666666666666 smartAccountAddress string
Smart account wallet whose balances these are.
Example
0x2222222222222222222222222222222222222222| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |