接口调用
POST
https://api.bridgers.xyz/api/exchangeRecord/getTransDataById
以下参数带*字段为必填,不带*号为选填
Request Body
{
"resCode":100,
"resMsg":"success",
"data":{
"id":283,
"orderId":"kydjhyt5_rec8_tfdi_s67b_td5kpu8qezy0", // 订单号
"fromTokenAddress":"0xa71edc38d189767582c38a3145b5873052c3e47a", // 出售币种的合约地址
"toTokenAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50", // 目标币种的合约地址
"fromTokenAmount":"5", // 出售币种数量
"toTokenAmount":"3.99", // 目标币种预计得到数量
"fromAddress":"0x19...", // 用户出售币种的地址
"slippage":"", // 滑点
"fromChain":"HECO", // 出售币种的链
"toChain":"OKEXCHAIN", // 目标币种的链
"hash":"0x505c3b4ebecb3f9......f171f6f00daa1a", // 存币hash
"depositHashExplore":"https://hecoinfo.com/tx/0x505c3b4ebecb3f95e2d51d140c732be7ac6b57119ff2a08908f171f6f00daa1a", // 存币区块浏览器地址
"dexName":"",
"status":"receive_complete", // 订单状态
"createTime":"2022-01-25 14:24:35", // 订单创建时间
"source":"Bridgers1", // 渠道
"toAddress":"0x19...", // 目标地址
"toHash":"0xf4575d8e99......200a5bb", // 发币hash
"receiveHashExplore":"https://www.oklink.com/oec/tx/0xf4575d8e99474319bbc8f5a849ac8821ace868bc3d4ca93723f2c5ead200a5bb", // 发币区块浏览器地址
"equipmentNo":"0x19b......", // 设备号
"refundCoinAmt":"", // 退币数量
"refundHash":"", // 退币hash
"refundHashExplore":"", // 退币区块浏览器地址
"refundReason": "1", //(1-流动性不足、2-误差超过阈值、3-原币维护、4-黑名单、5-目标币维护、6-兑换数量不在范围内、7-存币超时、8-与风险地址交互)
"fromCoinCode":"USDT(HECO)", // 出售币种
"toCoinCode":"USDT(OKExChain)" // 目标币种
}
}
调用示例
// example
const params = {
orderId: '', //order number
}
const res = await axios.post('https://api.bridgers.xyz/api/exchangeRecord/getTransDataById',params)
console.log(res)
Postman 示例
字段status订单状态解析
wait_deposit_send: '等待存币',
wait_deposit_send_fail: '存币失败',
wait_exchange_push: '正在兑换中...',
wait_exchange_return: '正在兑换中...',
wait_exchange_return_success: '正在兑换中...',
wait_receive_send: '兑换完成,等待发币',
wait_enough_send:'正在发币中...'
wait_receive_confirm: '发币确认中...',
receive_complete: '发币完成',
wait_refund_send: '等待退币',
wait_refund_confirm: '退币确认中...',
refund_complete: '退币完成',
timeout: '兑换超时',
ERROR: '正在兑换中...',
wait_for_information:'请联系客服'