查詢兌換歷史
那些被確認的報價單, 不管最終狀態如何, 該接口都會返回
信息
僅返回通過open api進行兌換的歷史紀錄
HTTP 請求
GET /v5/asset/exchange/query-convert-history
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
accountType | false | string | 錢包類型 eb_convert_funding,eb_convert_uta |
index | false | integer | 頁碼 |
limit | false | integer | 每頁數量 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
list | array<object> | 報價單列表 |
> accountType | string | 錢包類型 |
> exchangeTxId | string | 報價單ID, 和quoteTxId保持一致 |
> userId | string | 用戶ID |
> fromCoin | string | 兌出幣種 |
> fromCoinType | string | 兌出幣種類型. crypto |
> toCoin | string | 兌入幣種 |
> toCoinType | string | 兌入幣種類型. crypto |
> fromAmount | string | 兌出幣種數量 |
> toAmount | string | 兌入幣種數量 |
> exchangeStatus | string | 兌換狀態 |
> extInfo | object | |
>> paramType | string | 如果您在申請報價接口中中有發送該字段, 則這裡會釋出該字段 |
>> paramValue | string | 如果您在申請報價接口中中有發送該字段, 則這裡會釋出該字段 |
> convertRate | string | 兌換率 |
> createdAt | string | 報價單創建時間 |
請求示例
- HTTP
- Python
- Node.js
GET /v5/asset/exchange/query-convert-history?accountType=eb_convert_uta,eb_convert_funding HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1720074159814
X-BAPI-RECV-WINDOW: 5000
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getConvertHistory()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "ok",
"result": {
"list": [
{
"accountType": "eb_convert_funding",
"exchangeTxId": "10100108106409343501030232064",
"userId": "XXXXX",
"fromCoin": "ETH",
"fromCoinType": "crypto",
"fromAmount": "0.1",
"toCoin": "BTC",
"toCoinType": "crypto",
"toAmount": "0.00534882723991",
"exchangeStatus": "success",
"extInfo": {
"paramType": "opFrom",
"paramValue": "broker-id-001"
},
"convertRate": "0.0534882723991",
"createdAt": "1720071899995"
},
{
"accountType": "eb_convert_uta",
"exchangeTxId": "23070eb_convert_uta408933875189391360",
"userId": "XXXXX",
"fromCoin": "BTC",
"fromCoinType": "crypto",
"fromAmount": "0.1",
"toCoin": "ETH",
"toCoinType": "crypto",
"toAmount": "1.773938248611074",
"exchangeStatus": "success",
"extInfo": {},
"convertRate": "17.73938248611074",
"createdAt": "1719974243256"
}
]
},
"retExtInfo": {},
"time": 1720074457715
}