Cancel Order
tronsave_cancel_orderCancels an active order by orderId, marks it non-matchable, and refunds locked balance; use before fulfillment, since fulfilled or unauthorized orders fail.
Instructions
Cancel an open order by orderId. Returns { success, message, code }. Side effect: marks the order non-matchable and refunds locked balance per backend rules; effectively destructive on the live order. Idempotent — cancelling an already-cancelled order is a no-op success. Fails for fulfilled orders or unauthorized callers. Requires a wallet signature identity (the order's owner). Verify state with tronsave_get_order first; prefer tronsave_update_order when only price/receiver should change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Target order id (`MObjectId`) to cancel. Must be an active order owned/authorized by the current session; already-fulfilled or already-cancelled orders are expected to fail. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | GraphQL mutation status code (HTTP-like; `0`/`200` indicates success). Always pair with `success` for routing. | |
| message | No | Human-readable status text. Populated even on success; localized error messages may appear here on failure. | |
| success | No | Whether the mutation succeeded at the backend level. Always check this before reading `data`. |