Wallet API

Get Approvals#

Retrieve details of which projects a single address has approved. Includes approved assets and amounts for each project.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
addressesArrayYesList of addresses, up to 20
>chainIndexStringYesUnique identifier of the blockchain
>addressStringYesAddress information
limitStringNoNumber of records per query, default is 50, max is 100
cursorStringNoCursor position, default is the first

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique identifier of the blockchain
cursorStringCursor
approvalProjectsArrayList of authorized projects
>projectNameStringProject name
>projectIconStringProject icon URL
>approveAddressStringApproved project address
>tokensArrayList of authorized tokens for the project
>coinIdStringCoin identifier
>imageUrlStringToken logo URL
>symbolArrayToken symbol
>statusStringApproval status:
1: Success
2: Pending cancellation
3: Pending approval
>tokenAddressStringToken contract address
>approvalNumStringApproved amount, specific authorization amount = approvalNum / 10 ^ precision

Request Example#

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"
}'

Response Example#

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": ""
                        }
                    ]
                }
            ]
        }
    ]
}