钱包 API

查询授权#

分页查询单个地址,授权了哪些项目。以及每个授权项目下,授权的资产和额度。

请求路径#

POST https://www.okx.com/api/v5/wallet/security/approvals

请求参数#

ParameterTypeRequiredDescription
addressesArrayYes地址列表,最多20个
>chainIndexStringYes链唯一标识
>addressStringYes地址信息
limitStringNo每次查询多少条,默认值为 50,最大100
cursorStringNo游标位置,默认为第一个

响应参数#

ParameterTypeDescription
chainIndexString链唯一标识
cursorString游标
approvalProjectsArray授权项目列表
>projectNameString项目名称
>projectIconString项目icon
>approveAddressString授权项目地址
>tokensArray授权币种列表
>>imageUrlString币种logo 地址
>>symbolArray币种简称
>>statusString授权状态:
1: 成功
2: 取消中
3:授权中
>>tokenAddressString代币合约地址
>>approvalNumString授权整数,具体授权数量 = 授权整数 / 10 ^ 精度

请求示例#

shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/security/approvals' \
--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 '{
    addresses:[
        {
            "chainIndex":"0",
            "address":"3HyNd5YsqxyuieicbpKGfV2nBXgMn41dSd",
        }
    ],
    "limit": "10",
    "cursor": "1"
}'

响应示例#

200
{
    "code": "0",
    "msg": "",
    "data": [
        {
            "cursor":"100",
            "chainIndex": "1",
            "approvalProjects": [
                {
                    "projectIcon": "https://static.oklink.com/cdn/explorer/defi/uniswapv2.png",
                    "projectName": "Uniswap",
                    "approvalAddress": "0x2c34a2fb1d0b4f55de51e1d0bdefaddce6b7cdd6",
                    "tokens": [
                        {
                            "approvalNum": "2744484",
                            "imageUrl": "https://static.coinall.ltd/cdn/wallet/logo/tusd.png",
                            "symbol": "TUSD",
                            "status": "1",
                            "tokenAddress": ""
                        }
                    ]
                }
            ]
        }
    ]
}