Skip to main content

executeSwapTransaction

Executes a swap transaction on-chain using the connected wallet. This handles token approvals (when needed) and the main swap transaction signing, delegating to the wallet provider.
When using Flow, submitFlowTransaction calls this function internally. Use executeSwapTransaction directly only when building a standalone swap flow or a custom signing flow.

Usage

Parameters

Returns

Promise<{ transactionHash: string }> - The on-chain transaction hash.

Step Lifecycle

Examples

Standalone swap

With progress UI

This example uses React; the JavaScript SDK is framework-agnostic and can be used with any frontend or in Node.

Supported Chains

executeSwapTransaction supports EVM and Solana chains. Attempting to use an unsupported chain throws an error. On Solana, the signing payload is a serialized versioned transaction and there are no token approvals — only the 'transaction' step fires ('approval' is EVM-only). To quote a Solana swap, pass chain: 'SOL', networkId: '101', and a token mint (or 11111111111111111111111111111111 for native SOL) to getSwapQuote; executeSwapTransaction then signs and broadcasts it with the connected Solana wallet.

React

Last modified on June 29, 2026