OstiumBuilder Service
API ReferenceWebSocket APITrade Actions

WS Action: Cancel

Cancel orders via WebSocket.

Alpha Version

The Ostium Builder Service is in Alpha. API endpoints, specifications, and builder URLs may change without notice. Use with caution in production environments.

Action: cancel

Cancel limit orders or market timeouts. The payload mirrors POST /v1/exchange/cancel.

Headers (in envelope)

HeaderRequiredDescription
X-Trader-AddressYesTrader wallet address.
X-API-KeyNoDelegated mode (delegate wallet must be verified).

Payload

FieldTypeRequiredDescription
cancelsCancelItem[]YesOne or more cancel actions.

CancelItem

FieldTypeRequiredDescription
tstringYesCancel type: limit, open, close.
anumberCond.Pair index (required for limit).
inumberCond.Order index (required for limit).
onumberCond.Order ID (required for open or close timeouts).

Constraints

  • cancels must contain at least one item.
  • limit cancels require a and i.
  • open or close cancels require o.
  • Delegated mode supports one cancel per request.

Success Data (unsigned)

FieldTypeRequiredDescription
transactionsUnsignedTransaction[]YesOne or more unsigned transactions.

Delegated mode returns { "txHash", "smartAccountAddress" } as described in /docs/websocket/trade-actions.

Example

{
  "id": "3",
  "action": "cancel",
  "headers": { "X-Trader-Address": "0xYourWallet" },
  "payload": {
    "cancels": [
      {"t":"limit","a":0,"i":1}
    ]
  }
}

Success Response (unsigned)

{
  "id": "3",
  "ok": true,
  "data": {
    "transactions": [
      { "to": "0x...", "data": "0x...", "value": "0", "from": "0xYourWallet" }
    ]
  }
}

See /docs/http/exchange/cancel for HTTP details.

On this page