cancelFlow
Cancels a flow before it has been broadcast to the blockchain. Once cancelled, the flow cannot be resumed — create a new one to start over.
When to call
Call cancelFlow only when executionState is initiated, source_attached, quoted, or signing.
Before retrying a cancellation, call getFlow and check its current state.
You cannot cancel a broadcasted or source_confirmed flow because funds
have already been submitted. Poll the existing flow instead. If the state is
already cancelled, expired, or failed, do not call cancelFlow again;
create a new flow if the user wants another attempt. Calling from an
unsupported state returns 409.
Usage
Parameters
Returns
Promise<Flow> — the cancelled flow with executionState: 'cancelled'.
Examples
Cancel on user action
Cancel on wallet rejection
If a user rejects the signing request in their wallet, cancel the flow to clean up:
React