Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

userHistoricalOrders

Sends a user's order history once, as a snapshot, right after you subscribe. Nothing is pushed after that. Served by the API service at /api-ws.

ChanneluserHistoricalOrdersserver → client · type userHistoricalOrders

Load a user’s order history over /api-ws — one snapshot, no updates.

Subscribe
{
  "method": "subscribe",
  "subscription": {
    "type": "userHistoricalOrders",
    "user": "0xabc123abc123abc123abc123abc123abc123abc1"
  }
}
Try it
WS wss://rpc.txflow-testnet.xyz/api-ws
Subscription parameters
typestringrequired
"userHistoricalOrders"
userstring · addressrequired

Account address (the owner, not an agent).

Server message
channelstring
"userHistoricalOrders"
dataobject
isSnapshotboolean

Always `true`: this is the only push.

orderHistoryobject[]
userstring · address

The account, lower-cased.

Message example
{
  "channel": "userHistoricalOrders",
  "data": {
    "isSnapshot": true,
    "user": "0xabc123abc123abc123abc123abc123abc123abc1",
    "orderHistory": [
      {
        "order": {
          "coin": "BTC",
          "symbol": "BTC-USDC",
          "side": "B",
          "limitPx": "65000.0",
          "sz": "0.01",
          "oid": 123456,
          "timestamp": 1720000000000,
          "triggerCondition": "",
          "isTrigger": false,
          "triggerPx": "0",
          "children": [
            null
          ],
          "isPositionTpsl": false,
          "reduceOnly": false,
          "dir": "Open Long",
          "orderType": "Limit",
          "origSz": "0.01",
          "tif": "Gtc",
          "cloid": "my-order-001",
          "avgFillPrice": "65010.5",
          "positionMode": "OneWay",
          "marginMode": "cross",
          "leverage": 10,
          "pnl": "12.5",
          "entryPrice": "64000.0",
          "roe": "1.95",
          "fee": "0.02",
          "filledAmount": "0.01",
          "cancelSource": "UserCanceled",
          "status": "filled",
          "instrumentId": 1,
          "instrumentType": "perps",
          "marketType": "perps"
        },
        "status": "filled",
        "statusTimestamp": 1720000000000
      }
    ]
  }
}

Rows have the same shape as historicalOrders. To refresh, subscribe again or query historicalOrders, which also supports paging and filters; for live order changes use orderUpdates.