Installation
Get an API Key
Connect Wallet
Connect your EVM or Solana wallet to authenticate
Create API Key
Open API Keys → Click + Create New Key → Name your key
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:
| Phase | Description |
|---|
pending | Transaction submitted, awaiting confirmation |
detected | Burn confirmed on source chain |
attested | Attestation received |
minted | Tokens minted on destination chain |
complete | Transfer fully complete |
failed | Transfer failed |
Next Steps