使用钱包账户查询资产前,需要先确定查哪些代币的余额,并使用该接口进行添加。
POST https://www.okx.com/api/v5/wallet/asset/add-token
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | No | 账户的唯一标识 指定该参数: 在指定钱包账户下添加 不指定该参数: 在项目下(为所有钱包账户)添加 |
chainIndex | String | Yes | 链唯一标识 |
tokenAddress | String | Yes | 代币合约地址 |
无
curl --location --request POST 'https://www.okx.com/api/api/v5/wallet/asset/add-token' \
--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": "44486e05-3235-2f8e-5fe2-a8ab46217863",
"chainIndex": "111",
"tokenAddress": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2"
}'
{
"code": "0",
"data": [],
"msg": "success"
}