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)
| Header | Required | Description |
|---|---|---|
X-Trader-Address | Yes | Trader wallet address. |
X-API-Key | No | Delegated mode (delegate wallet must be verified). |
Payload
| Field | Type | Required | Description |
|---|---|---|---|
cancels | CancelItem[] | Yes | One or more cancel actions. |
CancelItem
| Field | Type | Required | Description |
|---|---|---|---|
t | string | Yes | Cancel type: limit, open, close. |
a | number | Cond. | Pair index (required for limit). |
i | number | Cond. | Order index (required for limit). |
o | number | Cond. | Order ID (required for open or close timeouts). |
Constraints
cancelsmust contain at least one item.limitcancels requireaandi.openorclosecancels requireo.- Delegated mode supports one cancel per request.
Success Data (unsigned)
| Field | Type | Required | Description |
|---|---|---|---|
transactions | UnsignedTransaction[] | Yes | One 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" }
]
}
}Related
See /docs/http/exchange/cancel for HTTP details.