钱包 API
添加币种

添加币种#

用户钱包查询资产前,需要先确定查哪些代币的余额,并使用该接口进行添加。

请求路径#

POST https://www.okx.com/api/v5/waas/wallet/asset/add-token

请求参数#

ParameterTypeRequiredDescription
accountIdStringNo钱包账户的唯一指定标识符

指定该参数: 在指定用户钱包账户下添加
不指定该参数: 在项目下(为所有用户钱包账户)添加
注意
观察钱包暂不支持自定义添加币种,仅展示 OKX WaaS 服务所支持的币种范围,可参考支持的币种
chainIndexStringYes链唯一标识
tokenAddressStringYes代币合约地址

响应参数#

请求示例#

shell
curl --location --request POST 'https://www.okx.com/api/api/v5/waas/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"
}'

响应示例#

200
{
    "code": "0",
    "data": [],
    "msg": "success"
}