Appearance
限价单历史接口文档
接口信息
| 项目 | 说明 |
|---|---|
| 接口路径 | /api/v1/dex/order/limit_order |
| 请求方法 | GET |
| 代理路径 | /serverproxy/api/v1/dex/order/limit_order |
| 后端服务 | https://api.dev.topo.club |
| 认证方式 | Authorization: ApiKey <key> |
接口返回指定用户的所有限价单数据,包括当前开仓订单和历史订单,不分页。
请求参数
Query 参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| network_id | string | 是 | 网络标识,前端自动注入。topo--164 或 aptos--2 |
| wallet_address | string | 是 | 用户钱包地址 |
请求示例
bash
GET /serverproxy/api/v1/dex/order/limit_order?network_id=topo--164&wallet_address=0x4c25640a96e3b098dcce10bfec9c0a80d7bd38270803d72d3f27f9e871cb5055
Authorization: ApiKey <key>响应数据结构
json
{
"code": 0,
"message": "Success",
"data": {
"tx_list": [
{
"type": "partially_filled",
"tx": "0xabc123...",
"package_id": "0xbcc9eca2...",
"event_type": "0xbcc9eca2...::multi_order_book::OrderExecutedEvent",
"sender": "0x4c25640a...",
"block_time": 1745380000000,
"order_id": "1001",
"owner": "0x4c25640a...",
"pay_coin": "0x1::aptos_coin::AptosCoin",
"target_coin": "0x83556891...::usdc::USDC",
"total_pay_amount": "1000000000",
"rate": "2.1250",
"expire_ts": 1745466400000,
"remaining_amount": "500000000",
"cancel_reason": 0,
"side": "buy",
"token_x": "0x1::aptos_coin::AptosCoin",
"events": [
{
"event_type": "0xbcc9eca2...::multi_order_book::OrderExecutedEvent",
"event_kind": "executed",
"txHash": "0xdef456...",
"sender": "0x4c25640a...",
"block_time": 1745380100000,
"amount_x": "500000000",
"amount_filled": "500000000",
"amount_out": "1062500000",
"remaining": "500000000",
"refunded_amount": "0",
"cancel_reason": 0
}
]
}
],
"total": 1,
"page": 1,
"page_size": 100
},
"timestamp": 1745380000
}响应字段说明
tx_list 数组项字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| type | string | 订单状态类型:pending、completed、partially_filled、cancelled、expired |
| tx | string | 创建交易哈希 |
| package_id | string | 合约部署地址 |
| event_type | string | 顶层归属事件类型,如 OrderCreatedEvent、OrderExecutedEvent、OrderCancelledEvent |
| sender | string | 下单用户地址 |
| block_time | number | 区块时间(毫秒级时间戳) |
| order_id | string | 订单 ID |
| owner | string | 订单所有者地址 |
| pay_coin | string | 支付代币的 Coin Type |
| target_coin | string | 目标代币的 Coin Type |
| total_pay_amount | string | 总支付金额(原始值,未除精度) |
| rate | string | 限价汇率(pay_coin / target_coin) |
| expire_ts | number | 过期时间戳(毫秒) |
| remaining_amount | string | 剩余未成交金额 |
| cancel_reason | number | 取消原因:0 = 未取消,其他值见合约定义 |
| side | string | 方向:buy 或 sell |
| token_x | string | 参考 Token(X 侧)的 Coin Type |
| events | array | 该订单关联的事件列表(见下) |
events 数组项字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| event_type | string | 事件类型 |
| event_kind | string | 事件种类,如 placed、executed、cancelled |
| txHash | string | 触发该事件的交易哈希 |
| sender | string | 触发者地址 |
| block_time | number | 区块时间(毫秒) |
| amount_x | string | X 侧金额 |
| amount_filled | string | 已成交金额 |
| amount_out | string | 输出金额 |
| remaining | string | 剩余未成交金额 |
| refunded_amount | string | 退款金额 |
| cancel_reason | number | 取消原因代码 |
前端调用示例
typescript
import { fetchDexLimitOrders } from '@/lib/request/api'
const result = await fetchDexLimitOrders({
wallet_address: '0x4c25640a96e3b098dcce10bfec9c0a80d7bd38270803d72d3f27f9e871cb5055',
})
const { tx_list } = result.data对应 Hook:apps/web/hooks/use-limit-orders.ts
注意事项
network_id由前端request()自动注入到 GET query 参数- 接口返回该用户全量限价单,无需分页参数
total_pay_amount、remaining_amount为原始链上整数值,展示时需除以代币精度expire_ts = 0表示永不过期