查询观察钱包持有的多个链或指定链的代币余额列表。
GET https://www.okx.com/api/waas/wallet/asset/all-token-balances-watch-only
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | Yes | 账户唯一标识。 |
chains | Array | No | chainIndex列表,可以链维度过滤查询代币的展示。列表元素上限是 20 个 |
Parameter | Type | Description |
---|---|---|
chainIndex | String | 链唯一标识 |
tokenAddress | String | 合约地址 |
symbol | String | 代币简称 |
balance | String | 代币数量 |
tokenPrice | String | 币种单位价值,以美元计价 |
tokenType | String | 币种类型: 1 : 代币 2 : 铭文 3 : LP 代币 |
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/asset/all-token-balances-watch-only?accountId=44486e05-3235-2f8e-5fe2-a8ab46217863&chains=1,2' \
--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'
{
"code": "0",
"data": [
{
"chainIndex": "1",
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"symbol": "USDT",
"balance": "0.688467",
"tokenPrice": "0.99993",
"tokenType": "1"
},
{
"chainIndex": "1",
"tokenAddress": "0x514910771af9ca656af840dff83e8264ecf986ca",
"symbol": "LINK",
"balance": "0.000000366257612925",
"tokenPrice": "14.108071299717093",
"tokenType": "1"
}
],
"msg": "success"
}