Query Withdrawal Wallet Balance

Get the withdrawal wallet balance. Facilitate to establish a real-time balance monitoring mechanism.

Request

GET /v1/sofa/wallets/{WALLET_ID}/sender/balance

Response Body

FieldTypeDescription
currencyint64Registered coin types. Refer to Currency Definition
wallet_addressstringWallet address
token_addressstringToken contract address
balancestringWithdrawal wallet balance
token_balancestringWithdrawal wallet token balance
unconfirm_balancestringUnconfirmed withdrawal wallet balance
unconfirm_token_balancestringUnconfirmed withdrawal wallet token balance
err_reasonstringError message if fail to get balance

Error Code

HTTP CodeError CodeErrorMessageDescription
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
404304Wallet ID invalid-The wallet is not allowed to perform this request

Sample Request

API

/v1/sofa/wallets/94533/sender/balance

Response Body

{
  "currency": 60,
  "wallet_address": "0xaa0cA2f9bA3A33a915a27e289C9719adB2ad7d73",
  "token_address": "",
  "balance": "0.619673333517576",
  "token_balance": "",
  "unconfirm_balance": "0",
  "unconfirm_token_balance": ""
}

Sample cURL Command

curl -X GET http://localhost:8889/v1/mock/wallets/{WALLET_ID}/sender/balance