查询赎回的预估计算信息#
描述: 该 API 将给你特定投资品的预估赎回详情。内容包括:
- 超级节点名、预估网络费相关;
- 接收代币列表、兑换代币详情列表、代币授权状态列表 (包括是否需要授权);
- 可赎回金额、最小赎回数额、最大赎回数额等。
请求地址#
POST https://web3.okx.com/api/v5/defi/calculator/redeem-info
请求参数#
| 参数名称 | 相关描述 | 参数类型 | 必传 | 数据类型 | 
|---|---|---|---|---|
| address | 用户钱包地址 | 请求体 | 否 | String | 
| inputTokenAmount | 认购代币数量 | 请求体 | 是 | String | 
| investmentCategory | 认购类型:(例如,0:默认类型;1:BRC-20) 获取 | 请求体 | 否 | String | 
| investmentId | 投资品 ID (这里获取) | 请求体 | 是 | String | 
| isSingle | 判断是否为单币投资品:是:单币;否:多币 | 请求体 | 否 | Boolean | 
| outputTokenAddress | 代币智能合约地址 (这里) | 请求体 | 是 | String | 
| slippage | 滑点 | 请求体 | 否 | String | 
响应参数#
| 参数名称 | 相关描述 | 数据类型 | 
|---|---|---|
| isAllowRedeem | 是否允许赎回 | Boolean | 
| estimateGasFee | 预估网络费用上限 | String | 
| isSwapInvest | 是否是兑换投资 | Boolean | 
| inputCurrencyAmount | 输入币种美元价值 | String | 
| receiveTokenList | 获得的币种信息列表 | Array[Struct] | 
| >coinAmount | 币种数量 | String | 
| >currencyAmount | 币种美元价值 | String | 
| >tokenSymbol | 币种标识 | String | 
| >tokenName | 币种名称 | String | 
| >tokenAddress | 币种的智能合约地址 | String | 
| >tokenPrecision | 币种精确小数位 | String | 
| >isBaseToken | 质押代币是否为主网基准代币 | Boolean | 
| >network | 币种网络 | String | 
| >chainId | 币种的链 ID | String | 
| >dataType | 0:利息收益 1:矿币收益 2:手续费 3:奖励金 | String | 
| swapFromTokenList | 赎回过程代币列表:结构同 investWithTokenList | Array[Struct] | 
| mySupply | 可赎回额度:结构同 investWithTokenList | Struct | 
| approveStatusList | 币种授权状态列表 | Array[Struct] | 
| >tokenSymbol | 币种标识 | String | 
| >tokenAddress | 币种的智能合约地址 | String | 
| >tokenPrecision | 币种精确小数位 | String | 
| >isNeedApprove | 是否需要授权 | Boolean | 
| >approveAddress | 需要授权的合约地址 | String | 
| >network | 币种网络 | String | 
| >chainId | 币种的链 ID | String | 
| >orderType | 类型透传给 Call data 的参数 (3:买入授权;4:赎回授权;8:进入 Farm;9:离开 Farm) | String | 
请求示例#
shell
curl --location 'https://web3.okx.com/api/v5/defi/calculator/redeem-info' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
  "address": "0x7f****da",
  "inputTokenAmount": "1.000000146425127036",
  "investmentCategory": "0",
  "investmentId": "21033",
  "isSingle": false,
  "outputTokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "outputTokenDecimal": "18",
  "redeemId": "",
  "slippage": ""
}'
响应示例#
200
{
    "code": 0,
    "msg": "",
    "data": {
        "receiveTokenList": [
            {
                "tokenSymbol": "DAI",
                "tokenName": "Dai Stablecoin",
                "tokenAddress": "0x6b****0f",
                "network": "ETH",
                "chainId": "1",
                "tokenPrecision": "18",
                "isBaseToken": false,
                "coinAmount": "1.000000146425127036",
                "currencyAmount": "0.9993097704396316094231068522159962",
                "dataType": "0"
            }
        ],
        "swapFromTokenList": [
            {
                "tokenSymbol": "DAI",
                "tokenName": "Dai Stablecoin",
                "tokenAddress": "0x6b****0f",
                "network": "ETH",
                "chainId": "1",
                "tokenPrecision": "18",
                "isBaseToken": false,
                "coinAmount": "1.000000146425127036",
                "currencyAmount": "0.9993097704396316094231068522159962"
            }
        ],
        "isSwapInvest": false,
        "estimateGasFee": "276614",
        "isAllowRedeem": true,
        "mySupply": {
            "tokenSymbol": "DAI",
            "tokenName": "Dai Stablecoin",
            "tokenAddress": "0x6b****0f",
            "network": "ETH",
            "chainId": "1",
            "tokenPrecision": "18",
            "isBaseToken": false,
            "coinAmount": "0",
            "currencyAmount": "0"
        },
        "inputCurrencyAmount": "0.9993097704396316094231068522159962"
    }
}
