Query Vault Wallet Balance

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

Request

GET /v1/sofa/wallets/{WALLET_ID}/vault/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

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
400112Invalid parameter-Malformatted post body
404304Wallet ID invalid-The wallet is not allowed to perform this request

Sample Request

API

/v1/sofa/wallets/8572/vault/balance

Response Body

BTC vault wallet

{
  "balance": "0.00009798",
  "currency": 0,
  "token_address": "",
  "token_balance": "",
  "unconfirm_balance": "0",
  "unconfirm_token_balance": "",
  "wallet_address": "2Mw1iJnQvAt3hNEvEZKdHkij8TNtzjaF3LH"
}

USDT-Omni vault wallet that mapping to above BTC vault wallet

{
  "balance": "0.00009798",
  "currency": 0,
  "token_address": "31",
  "token_balance": "0.1",
  "unconfirm_balance": "0",
  "unconfirm_token_balance": "",
  "wallet_address": "2Mw1iJnQvAt3hNEvEZKdHkij8TNtzjaF3LH"
}

Sample cURL Command

curl http://localhost:8889/v1/mock/wallets/{WALLET_ID}/vault/balance