Skip to main content

Overview

Bridge native tokens between any supported chain. Same flow as trading: quote → sign → execute. The execute endpoint handles bridge completion internally and returns once the funds arrive on the destination chain. Supported directions: EVM ↔ EVM, EVM → Solana, Solana → EVM.

EVM → EVM

Bridge 0.001 ETH from Ethereum to Base.

1. Get a quote

const quote = await api<any>(`/api/v1/bridge/quote?` + new URLSearchParams({
  source: 'ETH',
  destination: 'BASE',
  amount: '1000000000000000', // 0.001 ETH in wei
  trader: wallet.address
}))

if (!quote.success) throw new Error(quote.error)
console.log(`${quote.stats.amountInFormatted} ETH → ${quote.stats.amountOutFormatted} ETH on BASE`)
console.log(`Price impact: ${quote.stats.priceImpact}%`)
console.log(`Est. time: ${quote.stats.estimatedTime}s`)

2. Sign the transaction

const signedTrade = await wallet.signTransaction(
  ethers.Transaction.from(quote.transaction.trade)
)

// Sign approval if present (rare for native bridges)
let signedApprove: string | undefined
if (quote.transaction.approve) {
  signedApprove = await wallet.signTransaction(
    ethers.Transaction.from(quote.transaction.approve)
  )
}

3. Execute

const result = await api<any>('/api/v1/bridge/execute', {
  method: 'POST',
  body: JSON.stringify({
    trade: signedTrade,
    sourceChain: 'ETH',
    requestId: quote.transaction.requestId,
    approve: signedApprove
  })
})

console.log(`Status: ${result.status}`)            // SUCCESS, FAILED, or PENDING
console.log(`Source TX: ${result.sourceTxHash}`)
console.log(`Dest TX: ${result.destinationTxHash}`)
console.log(`Track: ${result.trackingUrl}`)

EVM → Solana

Bridge ETH to SOL. Requires a recipient parameter with the Solana wallet address.
const quote = await api<any>(`/api/v1/bridge/quote?` + new URLSearchParams({
  source: 'ETH',
  destination: 'SOL',
  amount: '10000000000000000', // 0.01 ETH
  trader: evmWallet.address,
  recipient: solanaPublicKey     // Solana wallet address
}))

const signed = await evmWallet.signTransaction(
  ethers.Transaction.from(quote.transaction.trade)
)

const result = await api<any>('/api/v1/bridge/execute', {
  method: 'POST',
  body: JSON.stringify({
    trade: signed,
    sourceChain: 'ETH',
    requestId: quote.transaction.requestId
  })
})

Solana → EVM

Bridge SOL to Base. The quote returns a base64-encoded Solana transaction.
import { Keypair, VersionedTransaction } from '@solana/web3.js'
import bs58 from 'bs58'

const keypair = Keypair.fromSecretKey(bs58.decode(process.env.SOL_PRIVATE_KEY!))

// 1. Quote
const quote = await api<any>(`/api/v1/bridge/quote?` + new URLSearchParams({
  source: 'SOL',
  destination: 'BASE',
  amount: '200000000',  // 0.2 SOL in lamports
  trader: keypair.publicKey.toBase58(),
  recipient: evmWalletAddress
}))

// 2. Sign — deserialize base64, sign with keypair
const txBuf = Buffer.from(quote.transaction.trade, 'base64')
const tx = VersionedTransaction.deserialize(txBuf)
tx.sign([keypair])
const signedTrade = Buffer.from(tx.serialize()).toString('base64')

// 3. Execute
const result = await api<any>('/api/v1/bridge/execute', {
  method: 'POST',
  body: JSON.stringify({
    trade: signedTrade,
    sourceChain: 'SOL',
    requestId: quote.transaction.requestId
  })
})

Timeout fallback

The execute endpoint waits up to 5 minutes for completion. In rare cases it may return status: "PENDING" on timeout. If that happens, poll the status endpoint until settled:
const status = await api<any>(
  `/api/v1/bridge/status/${result.requestId}`
)

if (status.status === 'success') {
  console.log(`Dest TX: ${status.txHashes?.[0]}`)
}

Supported networks

Call GET /api/v1/bridge/networks to get all supported networks with min/max amounts. Bridge supports: ETH, BASE, BSC, SOL, ABS, AVAX, HYPE, ARB, INK, STORY, PLASMA, MONAD, UNI, MEGAETH.

Key differences from trading

  • requestId instead of quoteId — used for status tracking
  • sourceChain instead of chain — the chain where the source transaction is signed
  • recipient parameter — required when bridging to a different address format (EVM ↔ Solana)
  • Execute waits for completion — the endpoint handles polling internally, expect responses in 5-30s for most bridges
  • No MEV protection needed — bridge deposits go to a relay contract, not a DEX pool