signing, and quote.signingPayload holds the transaction.
Most integrations use
submitFlowTransaction, which prepares, signs, and reports the transaction in one call. Call prepareFlowSigning directly only when you sign and report the transaction yourself.When to call
CallprepareFlowSigning when executionState is quoted and the source is a wallet, right before the payer signs.
Once the flow is in signing, do not prepare it again. Sign the returned transaction and report its hash with broadcastFlow. If the payer declines in the wallet and nothing was sent, call getFlowQuote to return the flow to quoted with a new quote.
Usage
Parameters
Returns
Promise<Flow>: the flow with executionState: 'signing' and quote.signingPayload set. The payload depends on the chain:
Examples
Sign and report the transaction yourself
executeSwapTransaction signs any of these payloads with a connected wallet account. On EVM, it sends the token approval first when the payload has evmApproval, then the payment transaction. Report the resulting hash with broadcastFlow.
evmApproval needs two transactions: approve spenderAddress to spend amount of tokenAddress, then send evmTransaction. Without the approval, the payment transaction can fail on chain. The Flow payments API guide shows the signing steps for each chain.
Errors
A wallet source that screening blocked is rejected without a dedicated class; show
error.message and let the payer attach another source. Handle Flow errors describes each error.
React
usePrepareFlowSigning is a mutation hook. It takes the same parameters, and it writes the returned flow into the useGetFlow cache.
Related
submitFlowTransaction: prepare, sign, and report in one call.broadcastFlow: report the signed transaction.executeSwapTransaction: sign a payload with a wallet account.