Query Delegated Address Balance
Query the balace of delegated addresses.
Request
VIEW
POST /v1/sofa/wallets/{WALLET_ID}/receiver/get-balances
Delegated Wallet
Post Body
Field | Type | Note | Description |
---|---|---|---|
address | array | required | Specify the addresses to query balance |
Maximum 10 addresses per inquiry, more than 10 addresses will be discarded automatically. If the address can not be found, it will not be listed in the response.
Response Body
Field | Type | Description |
---|---|---|
balances | key-value pairs | Listed addresses' balance |
balance | string | Address balance. For token wallet this is the mapped wallet’s balance. |
token_balance | string | Wallet token balance |
token_id_balances | array | For ERC1155, ERC721 token wallet |
Error Code
HTTP Code | Error Code | Error | Message | Description |
---|---|---|---|---|
403 | - | Forbidden. Invalid wallet ID | - | No wallet ID found |
403 | - | Forbidden. Header not found | - | Missing X-API-CODE , X-CHECKSUM header or query param t |
403 | - | Forbidden. Invalid timestamp | - | The timestamp t is not in the valid time range |
403 | - | Forbidden. Invalid checksum | - | The request is considered a replay request |
403 | - | Forbidden. Invalid API code | - | X-API-CODE header contains invalid API code |
403 | - | Invalid API code for wallet {WALLET_ID} | - | The API code mismatched |
403 | - | Forbidden. Checksum unmatch | - | X-CHECKSUM header contains wrong checksum |
403 | - | Forbidden. Call too frequently ({THROTTLING_COUNT} calls/minute) | - | Send requests too frequently |
403 | 385 | API Secret not valid | - | Invalid API code permission |
400 | 112 | Invalid parameter | - | Malformatted post body |
404 | 304 | Wallet ID invalid | - | The wallet is not allowed to perform this request |
Sample Request
API
/v1/sofa/wallets/708453/receiver/get-balances
Post Body
{
"addresses": [
"0x6A2969E4496d5b27967a68b411D7e0218943c1B6",
"0x1EA22Ed0347E6C9f852cfcBEFE752A026450164b",
"0x2baB9B3af6041960322a248d5315850fc79a3881"
]
}
Response Body
{
"balances": {
"0x1EA22Ed0347E6C9f852cfcBEFE752A026450164b": {
"balance": "0.009979649723530324",
"token_balance": "1",
"token_id_balances": [
{
"token_id": "9901"
}
]
},
"0x2baB9B3af6041960322a248d5315850fc79a3881": {
"balance": "0",
"token_balance": "0"
},
"0x6A2969E4496d5b27967a68b411D7e0218943c1B6": {
"balance": "0.019979076967554852",
"token_balance": "2",
"token_id_balances": [
{
"token_id": "9903"
},
{
"token_id": "9902"
}
]
}
}
}
Sample cURL Command
Designed for the mock server
curl -X POST -H "Content-Type: application/json" -d '{"addresses":["0x6A2969E4496d5b27967a68b411D7e0218943c1B6","0x1EA22Ed0347E6C9f852cfcBEFE752A026450164b","0x2baB9B3af6041960322a248d5315850fc79a3881"]}' \
http://localhost:8889/v1/mock/wallets/{WALLET_ID}/receiver/get-balances