Skip to main content

submitFlowTransaction

Prepares, signs, and broadcasts a flow transaction in one call. This is the recommended way to submit — it handles the full sequence:
  1. Calls prepareFlowSigning to lock the quote and get the signing payload
  2. Switches the wallet to the correct network
  3. Signs the transaction (including ERC-20 approval if needed)
  4. Calls broadcastFlow with the resulting txHash

When to call

Call submitFlowTransaction when executionState is quoted. The function starts by calling prepareFlowSigning, which requires that state. Before retrying after an interruption or network error, call getFlow:
  • If the flow is still quoted, you can call submitFlowTransaction again.
  • If it is signing, first determine whether the wallet submitted a transaction. If you have its transaction hash, call broadcastFlow to record it. If no transaction was submitted, call getFlowQuote to return to quoted with a new quote, then submit again.
  • If it is broadcasted or source_confirmed, the transaction has already been submitted. Poll the flow instead.
  • If it is cancelled, expired, or failed, create a new flow for another attempt.
Do not retry submitFlowTransaction without checking state. Calling it after the flow has advanced from quoted returns 409 and can prompt the user to repeat signing unnecessarily.

Usage

Parameters

Returns

Promise<Flow> — the flow after broadcast, with executionState: 'broadcasted' and txHash populated.

Examples

Basic submission

With balance assertions and step tracking

Handle wallet rejection

React

Last modified on July 15, 2026