查詢訂單
查詢訂單列表
接口信息
接口: GET /api/v1/takers/orders
描述: 查詢taker鎖定或填充的訂單列表,支持狀態過濾、分頁和排序
鑑權: API Key憑據認證
查詢參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
| status | string | 否 | 訂單狀態,多個狀態用逗號分隔 |
| ticker | string | 否 | 股票代碼 |
| exchange | int | 否 | 交易所ID |
| is_buy | boolean | 否 | 是否買單 |
| created_after | long | 否 | 創建時間晚於(Unix時間戳) |
| created_before | long | 否 | 創建時間早於(Unix時間戳) |
| sort_by | string | 否 | 排序字段(created_at, locked_at, price),默認created_at |
| sort_order | string | 否 | 排序方向(asc, desc),默認desc |
| page | int | 否 | 頁碼,默認1 |
| page_size | int | 否 | 每頁數量,默認20,最大100 |
響應參數
| 字段 | 類型 | 說明 |
|---|---|---|
| total | int | 總記錄數 |
| page | int | 當前頁碼 |
| page_size | int | 每頁數量 |
| total_pages | int | 總頁數 |
| orders | array | 訂單列表 |
訂單對象字段
| 字段 | 類型 | 說明 |
|---|---|---|
| order_hash | string | 訂單哈希值 |
| maker | string | 訂單創建者地址 |
| principal | string | 接收者地址 |
| is_buy | boolean | 是否買單 |
| ticker | string | 股票代碼 |
| exchange | int | 交易所ID |
| asset | string | 資產代幣地址 |
| price | string | 價格(wei單位) |
| quantity | string | 數量(wei單位) |
| incentive | string | 激勵金額(wei單位) |
| deadline | long | 截止時間戳(Unix時間戳) |
| nonce | long | 防重放數字 |
| signature | string | 訂單簽名 |
| status | string | 訂單狀態 |
| created_at | string | 創建時間(ISO 8601格式) |
| locked_by | string | 鎖定者地址(可選) |
| locked_at | string | 鎖定時間(可選) |
| reference_id | string | 引用ID(可選) |
| tx_hash | string | 交易哈希(可選) |
請求示例
bash
curl -X GET "/api/v1/takers/orders?status=locked,partially_filled&page=1&page_size=20" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"響應示例
json
{
"code": 0,
"data": {
"total": 50,
"page": 1,
"page_size": 20,
"total_pages": 3,
"orders": [
{
"order_hash": "0x1234567890abcdef...",
"maker": "0x1234567890123456789012345678901234567890",
"principal": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
"is_buy": true,
"ticker": "AAPL",
"exchange": 0,
"asset": "0x0000000000000000000000000000000000000001",
"price": "150250000000000000000",
"quantity": "10000000000000000000",
"incentive": "1000000000000000000",
"deadline": 1735689600,
"nonce": 1,
"signature": "0x...",
"status": "locked",
"created_at": "2025-01-17T03:00:24Z",
"locked_by": "0xabcdef1234567890...",
"locked_at": "2025-01-17T03:05:00Z",
"reference_id": "REF123456"
}
]
}
}獲取單個訂單
接口信息
接口: GET /api/v1/takers/orders/:order_hash
描述: 根據訂單哈希值獲取單個訂單的詳細信息
鑑權: API Key憑據認證
路徑參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
| order_hash | string | 是 | 訂單哈希值 |
響應參數
| 字段 | 類型 | 說明 |
|---|---|---|
| id | string | 訂單ID(UUID) |
| maker | string | 訂單創建者地址 |
| principal | string | 接收者地址 |
| is_buy | boolean | 是否為買單 |
| ticker | string | 股票代碼 |
| exchange | int | 交易所ID |
| asset | string | 資產代幣地址 |
| price | string | 價格(wei單位) |
| quantity | string | 數量(wei單位) |
| incentive | string | 激勵金額(wei單位) |
| deadline | int | 截止時間(Unix時間戳) |
| nonce | int | 防重放數字 |
| signature | string | 訂單簽名 |
| order_hash | string | 訂單哈希值 |
| status | string | 訂單狀態 |
| filled_quantity | string | 已成交數量(wei單位) |
| notes | string | 備註(可選) |
| created_at | string | 創建時間(ISO 8601格式) |
| updated_at | string | 更新時間(ISO 8601格式) |
請求示例
bash
curl -X GET "/api/v1/takers/orders/0x123456abcdef..." \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"響應示例
json
{
"code": 0,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"maker": "0x1234567890123456789012345678901234567890",
"principal": "0x1234567890123456789012345678901234567890",
"is_buy": true,
"ticker": "AAPL",
"exchange": 0,
"asset": "0x09671802Cc9Bbf6402f2e7a07b220Aa7b43D8c91",
"price": "150250000000000000000",
"quantity": "10000000000000000000",
"incentive": "100000000000000000",
"deadline": 1735660800,
"nonce": 1,
"signature": "0xabcdef123456...",
"order_hash": "0x123456abcdef...",
"status": "locked",
"filled_quantity": "0",
"notes": null,
"created_at": "2025-01-17T03:00:24Z",
"updated_at": "2025-01-17T03:05:00Z"
}
}注意事項
- 只能查詢Taker已鎖定或已填充的訂單
- 如果訂單不存在或無權訪問,將返回錯誤
- 建議使用此接口獲取訂單最新狀態