Skip to main content

Execution

The Mina SDK provides a comprehensive execution system for bridge transactions with step-by-step tracking and status callbacks.

Overview

After obtaining a quote, use the execute() method to perform the bridge transaction. The execution process handles:
  • Token approvals (if needed)
  • Swap transactions
  • Bridge transactions
  • Status monitoring
  • Real-time progress callbacks

Execute Method

execute(options)

Executes a bridge transaction with the provided quote and signer.

Execute Options

ExecuteOptions

Transaction Signer

The SDK requires a signer that implements the TransactionSigner interface:

Using with Viem/Wagmi

Step Types

Bridge execution consists of multiple step types:

Status Callbacks

onStepChange

Called when individual step status changes:

onStatusChange

Called for overall transaction status updates:

Execution Result

ExecutionResult

Example: Complete Execution Flow

Error Handling

The SDK throws specific errors during execution:
Always validate that the quote has not expired before executing. Quotes are valid for 60 seconds.

Token Approvals

For ERC20 tokens, an approval transaction is required before bridging:
Setting infiniteApproval: false (default) approves only the exact amount needed, which is more secure but requires approval for each transaction.

Next Steps

Auto-Deposit

Learn about automatic L1 deposits

Slippage

Configure slippage settings