In addition to the existing supported coins, you can add custom coins in the projectId dimension. Once added, any wallet you create can check the specified coin balance.
POST https://www.okx.com/api/v5/waas/asset/add-coin
Parameter | Type | Required | Description |
---|---|---|---|
coins | Array | Yes | Array of tokens to be added |
> chainId | String | Yes | Unique identifier of the chain |
> tokenAddress | String | Yes | Token address |
Parameter | Type | Description |
---|---|---|
coinId | String | Coin unique identifier |
chainId | String | Chain unique identifier |
decimals | String | Coin precision |
tokenAddress | String | Token contract address |
logoUrl | String | Coin logo |
name | String | Full name of coin |
symbol | String | Coin abbreviation |
delFlag | Boolean | Whether to delete |
curl --location --request POST 'https://www.okx.com/api/v5/waas/asset/add-coin' \
--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 '{
"coins":[
{
"chainId": "111"
"tokenAddress": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2"
},
{
"chainId": "222"
"tokenAddress": "0xdf444b6c6195ea4d948d04cfd818d365cf175cee3"
}
]
}'
{
"code": 0,
"data": [{
"chainId": 1,
"coinId": 1001028,
"tokenAddress": "0x4fe5a177c42f3bca6049acf207ab5e863e1e1496",
"name": "HarryPotterObamaSonic10Inu",
"symbol": "HPOS10I",
"logoUrl": "https://static.coinall.ltd/cdn/wallet/logo/icon_custom_default_H.png",
"decimals": 8,
"updateTime": 1699525015585
}],
"msg": ""
}