Description: This API provides the call data for claiming bonus rewards.
POST https://www.okx.com/api/v5/defi/transaction/bonus
Parameter name | Description | Parameter type | Required | Data type |
---|---|---|---|---|
address | User wallet address | Request body | Yes | String |
investmentId | Investment product ID | Request body | Yes | String |
userInputList | User input token information | Request body | Yes | Array[Struct] |
>chainId | Blockchain ID (default: investment product network) | Request body | No | String |
>coinAmount | Subscription quantity | Request body | Yes | String |
>tokenAddress | Smart contract address of the subscription token (default: investment product token address) | Request body | No | String |
expectOutputLIst | User expected profit information | Request body | Yes | Array[Struct] |
>chainId | Blockchain ID | Request body | No | String |
>coinAmount | Subscription quantity | Request body | Yes | String |
>tokenAddress | Smart contract address of the subscription token | Request body | No | String |
extra | See remarks for specific meaning | Request body | No | String |
Usage of extra claiming bonus rewards
{"extra" : "{\"claimIndex\":[\"2\"]}" }
{"extra" : "{\"claimIndex\":[\"2\",\"3\"]}" }
{"extra" : "{\"claimIndex\":[\"2\"]}" }
{"extra": "{\"claimOverdue\":1,\"claimIndex\":[\"2\"]}"}
Parameter name | Description | Data type |
---|---|---|
dataList | Call data information | Array[Struct] |
>from | From (user address) | String |
>to | To (target contract address) | String |
>value | Transfer amount (native token quantity, default is an empty string) | String |
>serializedData | Call data data | String |
>originalData | Original data (JSON) | JSON String |
>callDataType | Operation type (authorization, subscription, redemption, claiming) | String |
>signatureData | Signed Call data information, can be used to verify data generated by OKX | String |
Signature verification method:
curl --location 'https://www.okx.com/api/v5/defi/transaction/bonus' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
"address": "0x7f****da",
"expectOutputList": [
{
"chainId": 1,
"coinAmount": "1065142752604499571",
"tokenAddress": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"
}
],
"investmentId": "10003",
"extra": "{\"claimOverdue\":0,\"claimIndex\":[\"1286\"],\"callDataExtJson\":\"\",\"redeemCalldataExtInfo\":[],\"rewardAddress\":\"\"}"
}'
{
"code": 0,
"msg": "",
"data": {
"dataList": [
{
"callDataType": "CLAIM",
"from": "0x7f****da",
"to": "0x9e****99",
"value": "0x0",
"serializedData": "0x46e04a2f000000000000000000000000000000000000000000000000000000000000042a",
"originalData": "{\"callDataType\":\"CLAIM\",\"methodDefine\":\"claimTokens(uint256)\",\"methodId\":\"0x46e04a2f\",\"methodType\":\"METHOD_ID\",\"params\":{\"params\":[\"1066\"]},\"useAdapter\":false}",
"signatureData": "e35e234d1568e13f5b7a9bd175ae947268dc3e817973120381fc8eecda78f71633ff67564c6460e388a2ca60daab62ce68f8952387e48ce63c19cad38f332c941b"
}
]
}
}