Before querying assets in the wallet account, you need to determine the balances of which tokens to query and use this interface to add them.
POST https://www.okx.com/api/v5/wallet/asset/add-token
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | No | Unique identifier of the account. If this parameter presents: Add under the specified wallet account Not present: Add under the project (applies to all its wallet accounts) |
chainIndex | String | Yes | Unique identifier of the chain |
tokenAddress | String | Yes | Token contract address |
None
curl --location --request POST 'https://www.okx.com/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"
}