Query the balances of certain specified tokens under a user wallet or watch-only wallet.
GET https://www.okx.com/api/waas/wallet/asset/token-balances
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | Yes | Unique identifier of the account |
tokenAddresses | Array | Yes | List of tokens. The maximum number of items in the list is 20 |
>chainIndex | String | Yes | Unique identifier of the chain |
>tokenAddress | String | Yes | Token address. An empty string "" represents the native token |
Parameter | Type | Description |
---|---|---|
chainIndex | String | Unique identifier of the chain |
tokenAddress | String | Contract address |
symbol | String | Abbreviation of the token |
balance | String | Balance of the token |
tokenPrice | String | Price of the token (USD) |
tokenType | String | Token type: 1 : token 2 : inscription 3 : LP token |
curl --location --request POST 'https://www.okx.com/api/v5/waas/wallet/asset/token-balances' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '{
"accountId":"",
"tokenAddresses": [
{
"chainIndex": "5",
"tokenAddress": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2"
},
{
"chainIndex": "7",
"tokenAddress": "0xdf444b6c6195ea4d948d04cfd818d365cf175cee3"
}
]
}'
{
"code": "0",
"data": [
{
"chainIndex": "1",
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"symbol": "USDT",
"balance": "0.688467",
"tokenPrice": "0.99977",
"tokenType": "1"
},
{
"chainIndex": "42161",
"tokenAddress": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
"symbol": "USDT",
"balance": "0.026782",
"tokenPrice": "0.99977",
"tokenType": "1"
}
],
"msg": "success"
}