查询用户钱包或观察钱包下某些指定代币的余额。
GET https://www.okx.com/api/waas/wallet/asset/token-balances
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | Yes | 账户唯一标识 |
tokenAddresses | Array | Yes | 代币列表。列表的上限是20 |
>chainIndex | String | Yes | 链唯一标识 |
>tokenAddress | String | Yes | 代币地址。空字符串"" ,代表主网币 |
Parameter | Type | Description |
---|---|---|
chainIndex | String | 链唯一标识 |
tokenAddress | String | 合约地址 |
symbol | String | 代币简称 |
balance | String | 代币数量 |
tokenPrice | String | 币种单位价值,以美元计价 |
tokenType | String | 币种类型。1 : 代币 2 : 铭文 3 : LP 代币 |
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": "1",
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
{
"chainIndex": "42161",
"tokenAddress": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
}
]
}'
{
"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"
}