requestToCancelQuote
Cancel a pending quote — how a partyA cancels a resting LIMIT order. The core requestToCancelQuote(quoteId) must be attributed to the subaccount, so it is encoded and routed through AccountLayer._call(account, …); the connected wallet must be the subaccount’s owner (no session key).
A PENDING (unlocked) quote cancels instantly. A LOCKED quote (a partyB is committed) enters CANCEL_PENDING and waits out the force-cancel cooldown before it can be finished with forceCancelQuote.
import { requestToCancelQuote } from "@symmio/trading-core";
const hash = await requestToCancelQuote(config, { account: "0xsub…", quoteId: 42n });Parameters
accountAddressrequiredThe subaccount (partyA) that owns the quote. The call is routed through the AccountLayer _call proxy so the
diamond sees this subaccount as the caller.
quoteIdbigintrequiredThe on-chain id of the quote to cancel.
fromAddressoptionalOverride the wallet address that signs. Defaults to the account’s owner.
chainIdnumberoptionalOptional chain override.
gaslessboolean | GaslessWriteOptionsoptionalRelay this write through the gasless execution mode instead of the wallet. A
boolean for the common case, or a per-call GaslessWriteOptions bag; omitted, the chain’s execution.mode decides.
Returns
HashMutation options
import { requestToCancelQuoteMutationOptions } from "@symmio/trading-core";
import { useMutation } from "@tanstack/react-query";
useMutation(requestToCancelQuoteMutationOptions(config));Related
- React
useRequestToCancelQuote— the hook wrapper. - forceCancelQuote — finishes a stalled
CANCEL_PENDINGcancel. - Cancel a quote — the full lifecycle.
Gasless execution
requestToCancelQuote is relayable through the gasless execution mode — pass
gasless: true (or set the chain’s execution.mode to "gasless") and the SDK signs the same calldata as an
InstantLayer operation, relays it, and returns the relayer’s broadcast hash; the return type and receipt behavior are
unchanged.