执行交易前参数准备#
这是发起申购交易前的必要准备步骤。调用此接口获取"可投币种列表"、"凭证代币"、"收益代币"等信息,这些信息是后续调用 /transaction/enter 或 /transaction/exit 构建 Calldata 时的必要输入。
URL:POST /api/v6/defi/product/detail/prepare
请求参数#
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| investmentId | String | 是 | 投资品ID |
请求示例#
示例 1: 申购初始化#
Json
{
"investmentId": 12345
}
响应参数#
| 字段 | 类型 | 说明 |
|---|---|---|
| investWithTokenList | Array | 可投币种列表,用于申购的enter接口 |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | 代币符号 |
| > tokenName | String | 代币名称 |
| > tokenAddress | String | 合约地址 |
| > tokenPrecision | String | 精度 |
| > chainIndex | String | 链ID |
| > network | String | 网络 |
| > coinAmount | String | 币种数量 |
| > currencyAmount | String | 美元价值 |
| receiveTokenInfo | Object | 收到的凭证代币 |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | 代币符号 |
| > tokenName | String | 代币名称 |
| > tokenAddress | String | 合约地址 |
| > tokenPrecision | String | 精度 |
| > chainIndex | String | 链ID |
| > network | String | 网络 |
| > coinAmount | String | 币种数量 |
| > currencyAmount | String | 美元价值 |
| gainsTokenList | Array | 收益代币列表 |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | 代币符号 |
| > tokenName | String | 代币名称 |
| > tokenAddress | String | 合约地址 |
| > tokenPrecision | String | 精度 |
| > chainIndex | String | 链ID |
| > network | String | 网络 |
| > coinAmount | String | 币种数量 |
| > currencyAmount | String | 美元价值 |
| isAllowSubscribe | Boolean | 是否允许申购(type=1 有值) |
| feeRate | String | 手续费率(dex_pool专属) |
| currentTick | String | 当前 tick(对应当前价格汇率)(dex_pool专属) |
| currentPrice | String | token0 当前价格汇率(dex_pool专属) |
| lowerPrice | String | 加仓时进入初始页面的下限价格(dex_pool专属) |
| upperPrice | String | 加仓时进入初始页面的上限价格(dex_pool专属) |
| tickSpacing | String | tick 间隔(dex_pool专属) |
| underlyingTokenList | Array | 底层资产列表,index0=token0, index1=token1(dex_pool专属) |
| > tokenId | String | NFT Token ID(V3 仓位 NFT 的 tokenId) |
| > tokenSymbol | String | Token 符号,如 USDC、ETH |
| > tokenName | String | Token 全称 |
| > tokenLogo | String | Token Logo 图片 URL |
| > tokenAddress | String | Token 合约地址 |
| > network | String | 所在网络标识,如 eth、bsc |
| > chainIndex | String | 链 ID,如 1(ETH)、56(BSC) |
| > tokenPrecision | String | Token 精度(即 decimals),如 18、6 |
| > isBaseToken | Boolean | 是否为链原生主币(如 ETH、BNB) |
响应示例#
Single Earn:Aave V3 USDC(Ethereum, investmentId=9502)
Json
{
"code": 0,
"msg": "",
"data": {
"investWithTokenList": [
{
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/USDC.png",
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"network": "ETH",
"chainIndex": "1",
"tokenPrecision": "6",
"isBaseToken": false,
"coinAmount": "0",
"currencyAmount": "0",
"browserUrl": "https://web3.okx.com/explorer/eth/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}
],
"receiveTokenInfo": {
"tokenSymbol": "aEthUSDC",
"tokenName": "Aave Ethereum USDC",
"tokenLogo": "https://static.coinall.ltd/cdn/web3/currency/token/1-0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c-97.png/type=png_350_0",
"tokenAddress": "0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c",
"network": "ETH",
"chainIndex": "1",
"tokenPrecision": "6",
"coinAmount": "0"
},
"gainsTokenList": [
{
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/USDC.png",
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"network": "ETH",
"tokenPrecision": "6",
"coinAmount": "0",
"dataType": "0"
}
]
}
}