executeSwapTransaction is the method the Dynamic SDK calls when it needs your wallet to sign and broadcast a transaction. It is used by both the swaps flow (executeSwapTransaction) and Fireblocks Flow (submitFlowTransaction). If your WalletProvider does not implement it, the user can connect and sign messages, but cannot execute a swap or Flow transaction.
What executeSwapTransaction receives
The method receives asigningPayload and a walletAccount, and must return { transactionHash }.
signingPayload— chain-specific transaction data prepared by the SDK.walletAccount— the connected account that should sign.
signingPayload depend on the chain:
- EVM —
evmTransactionand optionalevmApprovalfor ERC-20 allowances. - Solana / Sui —
serializedTransaction. - Bitcoin —
psbt. - Tron —
tronTransaction.
High-level implementation
AddexecuteSwapTransaction to your WalletProvider:
- Parsing the
signingPayloadfor the target chain. - Ensuring the user is on the correct network (the SDK calls
ensureCorrectActiveNetworkbeforeexecuteSwapTransaction, but you can validate again). - Signing and broadcasting the transaction.
- Returning the on-chain transaction hash.
Use the wallet as a Flow source
WithexecuteSwapTransaction implemented, a consumer can use the wallet to pay a Fireblocks Flow:
submitFlowTransaction internally calls prepareFlowSigning, then delegates signing to your provider’s executeSwapTransaction, then calls broadcastFlow with the resulting hash. The only wallet-specific work is inside executeSwapTransaction; everything else is handled by the Dynamic SDK.
Use the wallet for Swaps
The sameexecuteSwapTransaction method is used for generic swaps. The consumer calls executeSwapTransaction directly after fetching a swap quote: