钱包 API
地址验证

地址验证#

传入地址,判断是否地址格式有效。若有效,会返回是用户地址还是合约地址。

请求路径#

GET https://www.okx.com/api/waas/wallet/pre-transaction/validate-address

请求参数#

ParameterTypeRequiredDescription
chainIndexStringYes链唯一标识
addressStringYes地址

响应参数#

ParameterTypeDescription
resultString0: 无效的地址格式
1: 有效的用户地址
2: 有效的合约地址

请求示例#

shell
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/validate-address?chainIndex=1&address=0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2&addressType=0' \
--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 '{
    "chainIndex": "1",
    "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
}'

响应示例#

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