Skip to main content

Overview

Starkzap supports bidirectional bridging between Starknet and supported external chains:
  • Ethereum (Canonical, CCTP, OFT, OFT-migrated routes)
  • Solana (Hyperlane routes)
Deposit flow (external chain → Starknet):
  1. Configure the SDK (including optional bridging config)
  2. Fetch bridgeable tokens with sdk.getBridgingTokens(...)
  3. Connect an external wallet (ConnectedEthereumWallet or ConnectedSolanaWallet)
  4. Inspect balance, allowance, and estimated fees
  5. Call wallet.deposit(...) to submit the source-chain transaction
Withdraw flow (Starknet → external chain):
  1. Inspect L2 balance and estimated fees with wallet.getWithdrawBalance(...) and wallet.getInitiateWithdrawFeeEstimate(...)
  2. Call wallet.initiateWithdraw(...) to burn/lock tokens on Starknet
  3. Monitor status with wallet.getWithdrawalState(...) or wallet.monitorWithdrawal(...)
  4. For Canonical and CCTP: call wallet.completeWithdraw(...) when state is READY_TO_CLAIM

Install Optional Dependencies

Install only what you use. For Ethereum routes:
For Solana routes:

SDK Configuration

Use bridging config when you need custom external RPCs or OFT support. The SDK uses external RPCs to read source-chain state (balances/allowances), estimate bridge fees, and submit source-chain transactions reliably. Without explicit RPC URLs, these operations can be rate-limited or unavailable depending on your environment:
OFT bridging requires bridging.layerZeroApiKey and is supported on Starknet Mainnet routes only.

Fetch Bridgeable Tokens

Connect External Wallets

Take a look at the Examples. For WalletConnect setup details, see WalletConnect Docs. In practice, you establish the external wallet session first (for example with WalletConnect), then pass its provider/account/chain into ConnectedEthereumWallet.from(...) or ConnectedSolanaWallet.from(...) for bridge calls.

Ethereum (EIP-1193)

Solana

External wallet network and Starknet network must match by environment: Ethereum Mainnet with Starknet Mainnet, Ethereum Sepolia with Starknet Sepolia, Solana Mainnet with Starknet Mainnet, and Solana Testnet with Starknet Sepolia.

Estimate and Deposit

Withdraw from Starknet

Initiate (all protocols)

Complete (Canonical & CCTP only)

OFT and Hyperlane are single-step — a relayer handles L1 delivery automatically. For Canonical and CCTP, a second L1 transaction is required once the state becomes READY_TO_CLAIM.

Auto-withdraw (Canonical only)

Canonical supports an autoWithdraw option where a relayer handles L1 completion — no completeWithdraw call needed.

Monitor Bridge Transfers

WithdrawalState values:
  • PENDING — bridging in progress, no user action needed
  • READY_TO_CLAIM — ready to finalize on L1; call completeWithdraw (CCTP/Canonical)
  • COMPLETED — bridge flow fully complete
  • ERROR — unrecoverable error

Detailed status (advanced use)

Use monitorWithdrawal to get the full status snapshot including CCTP attestation data needed for completeWithdraw:
Similarly for deposits:

Protocol Notes

Common Errors

  • Chain mismatch: token source chain and connected external wallet chain must match.
  • Missing LayerZero key: OFT routes require bridging.layerZeroApiKey.
  • Unsupported chain pair: Ethereum mainnet must pair with Starknet mainnet; testnet pairings must match.
  • CCTP options missing: completeWithdraw requires options with attestation data for CCTP routes — the parameter is non-optional in practice.
  • Attestation expired: CCTP attestations have an expiration block; re-attestation is requested automatically during completeWithdraw.
For additional issues, see Troubleshooting.

Next Steps