查询钱包账户持有的多个链或指定链的 token 余额列表。 余额查询支持:
此外,该接口支持过滤风险空投代币。
GET https://www.okx.com/api/v5/wallet/asset/wallet-all-token-balances
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | Yes | 账户唯一标识。 |
chains | String | No | 筛选需要查询资产明细的链,多条链以","分隔。最多支持 50 个 |
filter | String | No | 0 : 过滤风险空投币 1 : 不过滤风险空投币 默认过滤 |
Parameter | Type | Description |
---|---|---|
tokenAssets | Array | 代币余额 |
>chainIndex | String | 链唯一标识 |
>tokenAddress | String | 合约地址 |
>address | String | 钱包地址 |
>symbol | String | 代币简称 |
>balance | String | 代币数量 |
>tokenPrice | String | 币种单位价值,以美元计价 |
>tokenType | String | 币种类型: 1 : 代币 2 : 铭文 |
>isRiskToken | Boolean | true : 命中风险空投币 false : 未命中风险空投币 |
timeStamp | String | 币种获取的时间,Unix 时间戳,用毫秒表示 |
curl --location --request GET 'https://www.okx.com/api/v5/wallet/asset/wallet-all-token-balances?filter=&chains=1&accountId=31f55853-d430-42c5-b4c6-710d39848cd1' \
--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": [
{
"tokenAssets": [
{
"chainIndex": "1",
"tokenAddress": "0xf4d2888d29d722226fafa5d9b24f9164c092421e",
"symbol": "LOOKS",
"balance": "0.6908810093750312",
"tokenPrice": "0.035834243057603148",
"tokenType": "1",
"isRiskToken": false,
"address":"0xa03400e098f4421b34a3a44a1b4e571419517687"
},
{
"chainIndex": "1",
"tokenAddress": "",
"symbol": "ETH",
"balance": "8",
"tokenPrice": "2650.43",
"tokenType": "1",
"isRiskToken": false,
"address":"0xa03400e098f4421b34a3a44a1b4e571419517687"
}
],
"timeStamp": "1724153197342"
}
],
"msg": "success"
}