cancel_limit_orders
Cancel multiple limit orders in batches of five, or all open orders at once. Returns unsigned transactions for signing and execution.
Instructions
Cancel multiple limit orders (batched in groups of 5).
This function is FREE to call and does not execute any transactions. It returns unsigned transactions that must be signed and executed.
Args: orders: Array of order account addresses. If None/empty, cancels ALL orders
Returns: Dictionary containing: - success: Boolean indicating if the request was successful - data: Contains 'transactions' (array of unsigned) and 'requestId' - error: Error message if request failed
Note: - Returns multiple transactions if >5 orders - Each transaction needs to be signed and executed separately - Uses configured wallet as maker
Example: >>> # Cancel specific orders >>> result = await api.cancel_limit_orders( ... orders=["order1_address", "order2_address", "order3_address"] ... ) >>> >>> # Cancel ALL orders >>> result = await api.cancel_limit_orders() >>> if result["success"]: ... # Execute each cancellation transaction ... for tx in result["data"]["transactions"]: ... exec_result = await api.execute_limit_order( ... transaction=tx, ... request_id=result["data"]["requestId"] ... )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orders | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||