Skip to main content

Installation

npm install @sw4p/bridge

Get an API Key

1

Visit Developer Console

2

Connect Wallet

Connect your EVM or Solana wallet to authenticate
3

Create API Key

Open API Keys → Click + Create New Key → Name your key
4

Copy Key

Copy your sk_555_live_... key immediately (shown only once)
Store your API key securely. It cannot be retrieved after you close the modal.

Your First Transfer

import { Sw4pBridge } from '@sw4p/bridge'

const bridge = new Sw4pBridge({ apiKey: 'sk_...' })

// 1. Estimate fees
const estimate = await bridge.estimateFee({
  from: 'BASE',
  to: 'SOLANA',
  amount: '100.00'
})
console.log(`Fee: $${estimate.fee.total}`)
console.log(`You receive: $${estimate.netReceive}`)

// 2. Execute transfer
const result = await bridge.transfer({
  from: 'BASE',
  to: 'SOLANA',
  amount: '100.00',
  recipient: '5abc123...', // Solana address
  permit: signedPermit      // ERC-2612 permit
})
console.log(`Intent ID: ${result.intentId}`)

// 3. Track status
const status = await bridge.getStatus(result.intentId)
console.log(`Status: ${status.status}`)

Transfer Status

Transfers progress through these phases:
PhaseDescription
pendingTransaction submitted, awaiting confirmation
detectedBurn confirmed on source chain
attestedAttestation received
mintedTokens minted on destination chain
completeTransfer fully complete
failedTransfer failed

Next Steps