Simple Bridge
This example demonstrates how to execute a basic bridge transaction, moving USDC from Arbitrum to Hyperliquid’s HyperEVM chain.Overview
The simplest bridge flow involves three steps:- Initialize the Mina SDK
- Get a quote for the bridge
- Execute the bridge with a wallet signer
Prerequisites
Before starting, ensure you have:- Installed the Mina SDK and viem
- A wallet with USDC on Arbitrum
- Basic understanding of TypeScript/JavaScript async patterns
Complete Example
Step-by-Step Breakdown
Initialize the SDK
Create a new Mina instance with your integrator name. The
autoDeposit option controls whether bridged funds are automatically deposited to your Hyperliquid L1 trading account.Set up the wallet signer
The SDK requires a signer that implements
sendTransaction, getAddress, and getChainId. This example uses viem, but any compatible wallet library works.Get a bridge quote
Request a quote specifying the source chain, destination chain, tokens, and amount. The quote includes estimated output, fees, and execution time.
Status Callbacks
Theexecute method accepts two callback functions for monitoring progress:
onStepChange
Called when individual steps (approval, swap, bridge, deposit) change status.onStatusChange
Called when the overall transaction status changes.Common Token Addresses
| Chain | Token | Address |
|---|---|---|
| Arbitrum | USDC | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 |
| Ethereum | USDC | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| Optimism | USDC | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 |
| Base | USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| HyperEVM | USDC | 0xb88339cb7199b77e23db6e890353e22632ba630f |
Always verify token addresses before executing transactions. The SDK’s
getTokens() method returns verified token addresses for each chain.Next Steps
Token Selection
Build a UI for selecting chains and tokens
Quote Display
Display detailed quote information
Error Handling
Handle errors gracefully
Full Integration
Complete bridge widget example
