requestToCancelCloseRequest
Cancel a pending close — back out of a resting close (e.g. a limit close) while the quote is CLOSE_PENDING. The core requestToCancelCloseRequest(quoteId) is 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).
If partyB accepts, the quote returns to OPENED. If partyB stalls, it enters CANCEL_CLOSE_PENDING and waits out the force-cancel-close cooldown before it can be finished with forceCancelCloseRequest.
import { requestToCancelCloseRequest } from "@symmio/trading-core";
const hash = await requestToCancelCloseRequest(config, { account: "0xsub…", quoteId: 42n });Parameters
accountAddressrequiredThe subaccount (partyA) that owns the quote. Routed through the AccountLayer _call proxy so the diamond sees this
subaccount as the caller.
quoteIdbigintrequiredThe on-chain id of the CLOSE_PENDING quote whose close to cancel.
fromAddressoptionalOverride the wallet address that signs. Defaults to the account’s owner.
chainIdnumberoptionalOptional chain override.
Returns
HashMutation options
import { requestToCancelCloseRequestMutationOptions } from "@symmio/trading-core";
import { useMutation } from "@tanstack/react-query";
useMutation(requestToCancelCloseRequestMutationOptions(config));Related
- React
useRequestToCancelCloseRequest— the hook wrapper. - forceCancelCloseRequest — finishes a stalled
CANCEL_CLOSE_PENDINGclose. - Cancel a close — the full lifecycle.