查询地址持有的多个链或指定链的 token 余额列表。 余额查询支持:
此外,该接口支持过滤风险空投代币。
GET https://www.okx.com/api/v5/wallet/asset/all-token-balances-by-address
Parameter | Type | Required | Description |
---|---|---|---|
address | String | Yes | 地址 |
chains | String | Yes | 筛选需要查询资产明细的链,多条链以","分隔。最多支持 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 :token 2 :铭文 |
>transferAmount | String | BRC-20、FBRC-20 等铭文资产可直接转账、交易的余额数量,一般称为可转余额。 |
>availableAmount | String | BRC-20、FBRC-20 等铭文资产需要完成铭刻操作才可以交易、转账的数量,一般称为可用余额或者待铭刻余额。 |
>isRiskToken | Boolean | true :命中风险空投币 false :未命中风险空投币 |
curl --location --request GET 'https://www.okx.com/api/v5/wallet/asset/all-token-balances-by-address?address=0x50c476a139aab23fdaf9bca12614cdd54a4244e3&chains=1&filter=1' \
--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",
"msg": "success",
"data": [
{
"tokenAssets": [
{
"chainIndex": "1",
"tokenAddress": "0xf4d2888d29d722226fafa5d9b24f9164c092421e",
"address":"0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"symbol": "LOOKS",
"balance": "0.6908810093750312",
"tokenPrice": "0.035834243057603148",
"tokenType": "1",
"isRiskToken": false
},
{
"chainIndex": "1",
"tokenAddress": "0x6570ffe19da7e2b425329b157d9109b87f18304b",
"address":"0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"symbol": "UNM",
"balance": "0.00157",
"tokenPrice": "5.401009128680169",
"tokenType": "1",
"isRiskToken": false
},
{
"chainIndex": "1",
"tokenAddress": "0x67542502245eb5df64ef7ea776199ceb79401058",
"address":"0x50c476a139aab23fdaf9bca12614cdd54a4244e3",
"symbol": "$ UniswapLR.com @ 5.75",
"balance": "1000",
"tokenPrice": "0",
"tokenType": "1",
"isRiskToken": true
}
]
}
]
}