# 查询交易记录

### &#x20;接口调用

<mark style="color:green;">`POST`</mark> `https://api.bridgers.xyz/api/exchangeRecord/getTransData`

**以下参数带\*字段为必填，不带\*号为选填**

#### Request Body

| Name                                          | Type    | Description                                                               |
| --------------------------------------------- | ------- | ------------------------------------------------------------------------- |
| equipmentNo<mark style="color:red;">\*</mark> | String  | 设备号设备号（该字段将作为用户的唯一标识，三方可通过自己的方式获得，如fromAddress的前32位字符，或者32位随机数字与字母结合的字符串） |
| sourceType                                    | String  | 设备类型（H5/IOS/Android 该字段为选填，如通过直接通过API调用，可为空)                              |
| sourceFlag<mark style="color:red;">\*</mark>  | String  | 渠道来源（需要双方约定一个名称来代表三方的渠道）                                                  |
| pageNo<mark style="color:red;">\*</mark>      | Integer | 当前页                                                                       |
| pageSize<mark style="color:red;">\*</mark>    | Integer | 条数                                                                        |
| fromAddress<mark style="color:red;">\*</mark> | String  | 用户地址                                                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "resCode":100,
    "resMsg":"success",
    "data":{
        "list":[
            {
                "id":283,
                "orderId":"kydjhyt5_rec8_tfdi_s67b_td5kpu8qezy0",  // 订单号
                "fromTokenAddress":"0xa71edc38d189767582c38a3145b5873052c3e47a",  // 出售币种的合约地址
                "toTokenAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50",    // 目标币种的合约地址
                "fromTokenAmount":"5",  // 出售币种的数量
                "toTokenAmount":"3.99", // 目标币种预计得到的数量
                "fromAddress":"0x20...", //  用户出售币种的地址
                "slippage":"",  // 滑点
                "fromChain":"HECO",  // 出售币种的链
                "toChain":"OKEXCHAIN",  // 目标币种的链
                "hash":"0x505c3b4ebe......cb3f951a",   // 存币hash
                "depositHashExplore":"https://hecoinfo.com/tx/0x505c3b4ebecb3f95e2d51d140c732be7ac6b57119ff2a08908f171f6f00daa1a",  //  存币区块浏览器地址
                "dexName":"",
                "status":"receive_complete",  // 订单状态
                "createTime":"2022-01-25 14:24:32", // 订单创建时间               
                "source":"Bridgers1",  // 渠道
                "toAddress":"0x20...",  //  用户的目标地址
                "toHash":"0xf4575d8e.......ca93723f2c5ead200a5bb",  // 发币hash
                "receiveHashExplore":"https://www.oklink.com/oec/tx/0xf4575d8e99474319bbc8f5a849ac8821ace868bc3d4ca93723f2c5ead200a5bb",  // 发币区块浏览器地址
                "equipmentNo":"0x19b9.....",  // 设备号
                "refundCoinAmt":"",  // 退币数量
                "refundHash":"",  // 退币hash
                "refundHashExplore":"",  //  退币区块浏览器地址
                "refundReason": "1", //（1-流动性不足、2-误差超过阈值、3-原币维护、4-黑名单、5-目标币维护、6-兑换数量不在范围内、7-存币超时、8-与风险地址交互）
                "fromCoinCode":"USDT(HECO)",  //  出售币种
                "toCoinCode":"USDT(OKExChain)"   // 目标币种
            }
        ],
        "total":1,  // 总页数
        "pageNo":"1"  //  当前页
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 调用示例

{% tabs %}
{% tab title="JavaScript" %}

```
//  transData example
  const params = {
    pageNo: 1,
    pageSize: 5,
    fromAddress: '',  //your wallet address
    equipmentNo:'', // your equipment number
    sourceType: 'H5',
    sourceFlag:'widget'
  }
  const res = await axios.post('https://api.bridgers.xyz/api/exchangeRecord/getTransData',params)
  console.log(res)
```

{% endtab %}
{% endtabs %}

### Postman 示例

![](https://2788010628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbvHxRlkSqGfe4qMOuqzl%2Fuploads%2FWfMatSPjDAftqOckR6hp%2F5.jpg?alt=media\&token=21caa30b-2e45-4727-bf38-bad67732034b)

#### 字段status订单状态解析

wait\_deposit\_send: '等待存币',

wait\_deposit\_send\_fail: '存币失败',

wait\_exchange\_push: '正在兑换中...',&#x20;

wait\_exchange\_return: '正在兑换中...',

wait\_exchange\_return\_success: '正在兑换中...',

wait\_receive\_send: '兑换完成，等待发币',&#x20;

wait\_enough\_send:'正在发币中...'

wait\_receive\_confirm: '发币确认中...',&#x20;

receive\_complete: '发币完成',

wait\_refund\_send: '等待退币',&#x20;

wait\_refund\_confirm: '退币确认中...',&#x20;

refund\_complete: '退币完成',

timeout: '兑换超时',

ERROR: '正在兑换中...',

wait\_for\_information:'请联系客服'
