跳轉到內容

查詢訂單

查詢訂單列表

接口信息

接口: GET /api/v1/takers/orders

描述: 查詢taker鎖定或填充的訂單列表,支持狀態過濾、分頁和排序

鑑權: API Key憑據認證

查詢參數

參數類型必填說明
statusstring訂單狀態,多個狀態用逗號分隔
tickerstring股票代碼
exchangeint交易所ID
is_buyboolean是否買單
created_afterlong創建時間晚於(Unix時間戳)
created_beforelong創建時間早於(Unix時間戳)
sort_bystring排序字段(created_at, locked_at, price),默認created_at
sort_orderstring排序方向(asc, desc),默認desc
pageint頁碼,默認1
page_sizeint每頁數量,默認20,最大100

響應參數

字段類型說明
totalint總記錄數
pageint當前頁碼
page_sizeint每頁數量
total_pagesint總頁數
ordersarray訂單列表

訂單對象字段

字段類型說明
order_hashstring訂單哈希值
makerstring訂單創建者地址
principalstring接收者地址
is_buyboolean是否買單
tickerstring股票代碼
exchangeint交易所ID
assetstring資產代幣地址
pricestring價格(wei單位)
quantitystring數量(wei單位)
incentivestring激勵金額(wei單位)
deadlinelong截止時間戳(Unix時間戳)
noncelong防重放數字
signaturestring訂單簽名
statusstring訂單狀態
created_atstring創建時間(ISO 8601格式)
locked_bystring鎖定者地址(可選)
locked_atstring鎖定時間(可選)
reference_idstring引用ID(可選)
tx_hashstring交易哈希(可選)

請求示例

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_hashstring訂單哈希值

響應參數

字段類型說明
idstring訂單ID(UUID)
makerstring訂單創建者地址
principalstring接收者地址
is_buyboolean是否為買單
tickerstring股票代碼
exchangeint交易所ID
assetstring資產代幣地址
pricestring價格(wei單位)
quantitystring數量(wei單位)
incentivestring激勵金額(wei單位)
deadlineint截止時間(Unix時間戳)
nonceint防重放數字
signaturestring訂單簽名
order_hashstring訂單哈希值
statusstring訂單狀態
filled_quantitystring已成交數量(wei單位)
notesstring備註(可選)
created_atstring創建時間(ISO 8601格式)
updated_atstring更新時間(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已鎖定或已填充的訂單
  • 如果訂單不存在或無權訪問,將返回錯誤
  • 建議使用此接口獲取訂單最新狀態