资产明细#
查询钱包账户持有的多个链或指定链的 token 余额列表。 余额查询支持:
- 主链币
- EVM 链的 ERC20 代币
- Bitcoin 生态的 BRC-20、ARC-20、Runes 和 SRC-20 代币
- Fractal Bitcoin 链的 BRC-20 代币
此外,该接口支持过滤风险空投代币。
请求路径#
GET https://web3.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 | 代币数量 | 
| >rawBalance | String | 代币的原始数量。更多的链即将被支持。对于不支持的链,该字段为空。 | 
| >tokenPrice | String | 币种单位价值,以美元计价 | 
| >tokenType | String | 币种类型: 1: 代币2: 铭文 | 
| >isRiskToken | Boolean | true: 命中风险空投币false: 未命中风险空投币 | 
| timeStamp | String | 币种获取的时间,Unix 时间戳,用毫秒表示 | 
请求示例#
shell
curl --location --request GET 'https://web3.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'
响应示例#
200
{
    "code": "0",
    "data": [
        {
            "tokenAssets": [
                {
                    "chainIndex": "1",
                    "tokenAddress": "0xf4d2888d29d722226fafa5d9b24f9164c092421e",
                    "symbol": "LOOKS",
                    "balance": "0.6908810093750312",
                    "rawBalance": "",
                    "tokenPrice": "0.035834243057603148",
                    "tokenType": "1",
                    "isRiskToken": false,
                    "address":"0xa03400e098f4421b34a3a44a1b4e571419517687"
                },
                {
                    "chainIndex": "1",
                    "tokenAddress": "",
                    "symbol": "ETH",
                    "balance": "8",
                    "rawBalance": "",
                    "tokenPrice": "2650.43",
                    "tokenType": "1",
                    "isRiskToken": false,
                    "address":"0xa03400e098f4421b34a3a44a1b4e571419517687"
                }
            ],
            "timeStamp": "1724153197342"
        }
    ],
    "msg": "success"
}
