Convert Trade
ConvertTradeCreate
创建闪兑交易
POST /viewer/trade
描述
- 创建一笔货币闪兑交易
- 所使用的 API Key 需具备下单相关的权限(scopes)
请求
请求参数
参数名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
from_asset | string | 是 | 源货币符号 | "USDT" |
to_asset | string | 是 | 目标货币符号 | "BTC" |
rfq_size | decimal | 是 | 报价请求的数量 | "333" |
rfq_size_asset | string | 是 | 报价请求数量的货币 | "USDT" |
quote_id | string | 是 | 报价 ID(来自 ConvertQuote 接口) | "97611740-1ae5-4989-812d-2cb1566fd0f3" |
account_type | string | 否 | 账户类型,默认值为 "FUND" | "FUND" |
- 支持两种参数传递方式:
application/json
和 查询参数(query params) quote_id
通过 ConvertQuote 接口获取account_type
可选值包括:FUND
(资金账户)、SPOT
(现货账户)和ALL
(优先资金账户,不足则补充现货账户)
响应示例
- Viewer
- JSON Schema
Loading ....
{
"title": "ConvertTrade",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
},
"additionalProperties": false
}
GetConvertTrades
获取闪兑交易历史
GET /viewer/trades
描述
- 获取当前账户的闪兑交易历史记录
- 所使用的 API Key 需具备读取交易记录的权限(scopes)
请求参数
参数名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
page_token | string | 否 | 指定分页位置,base64 编码的页码 | |
limit | number | 否 | 每页数量,默认 100,最大不超过 1000 |
- 支持
application/json
和 查询参数传递方式 page_token
是基于十进制并通过 base64 编码的页码标识
响应
- Viewer
- JSON Schema
Loading ....
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ConvertTrades",
"type": "array",
"items": {
"type": "object",
"title": "ConvertTrade",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
}
},
"additionalItems": false
}
GetConvertTradeDetail
获取闪兑交易详情
GET /viewer/trade
描述
- 获取一笔闪兑交易的详细信息
- 所使用的 API Key 需具备读取交易记录的权限(scopes)
请求参数
参数名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
id | number | 否 | 交易 ID(id 和 quote_id 必须提供一个) | 11873 |
quote_id | string | 否 | 报价 ID(id 和 quote_id 必须提供一个) | "97611740-1ae5-4989-812d-2cb1566fd0f3" |
quote_id
可通过 ConvertQuote 获取
响应
- Viewer
- JSON Schema
Loading ....
{
"title": "ConvertTrade",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "trade id",
"examples": [
11873
]
},
"from_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"USDT"
]
},
"to_asset": {
"type": "string",
"description": "asset symbol",
"examples": [
"BTC"
]
},
"ts": {
"type": "number",
"description": "trade timestamp",
"examples": [
1741857252000
]
},
"px": {
"type": "string",
"description": "price",
"examples": [
"0.00000578"
]
},
"from_sz": {
"type": "string",
"description": "from size",
"examples": [
"10.5"
]
},
"to_sz": {
"type": "string",
"description": "to size",
"examples": [
"0.00006078"
]
},
"state": {
"type": "string",
"description": "trade state",
"enum": [
"PENDING",
"FULLFILLED",
"FAILED"
],
"examples": [
"FULLFILLED"
]
},
"acct_type": {
"type": "string",
"description": "account type",
"enum": [
"SPOT",
"FUND",
"ALL"
],
"examples": [
"FUND"
]
},
"quote_id": {
"type": "string",
"description": "quote id",
"examples": [
"97611740-1ae5-4989-812d-2cb1566fd0f3"
]
}
},
"additionalProperties": false
}