Supported wallets
RainbowKit provides built-in support for popular Web3 wallets:- MetaMask
- WalletConnect
- Coinbase Wallet
- Rainbow Wallet
- Trust Wallet
- And many more via WalletConnect
Supported chains
Bridge Wrapped supports 15 blockchain networks:Ethereum
Mainnet (Chain ID: 1)
Optimism
OP Mainnet (Chain ID: 10)
Arbitrum
Arbitrum One (Chain ID: 42161)
Base
Base Mainnet (Chain ID: 8453)
Polygon
Polygon PoS (Chain ID: 137)
BNB Chain
BSC Mainnet (Chain ID: 56)
Configuration
The wallet configuration is managed through Wagmi’sgetDefaultConfig helper:
src/lib/wagmiConfig.ts
The
ssr: true option enables server-side rendering support for Next.js applications.Provider setup
The application wraps all providers in aProviders component that handles hydration and theming:
src/components/Providers.tsx
Theme customization
The RainbowKit theme uses:- Accent color: Purple (
#8B5CF6) for primary actions - Border radius: Large for a modern, rounded appearance
- Font stack: System fonts for optimal performance
Custom connect button
Bridge Wrapped implements a custom connect button using RainbowKit’sConnectButton.Custom component:
src/components/wallet/ConnectButton.tsx
Button states
The connect button handles three primary states:Connection flow
When a user connects their wallet:- User clicks “Connect Wallet” - Opens RainbowKit’s wallet selection modal
- User selects wallet - Wallet extension prompts for connection approval
- Connection established - Application receives wallet address and chain information
- Stats loading begins - Bridge Wrapped fetches transaction history from all supported bridges
- Wrapped experience starts - User can view their personalized bridging statistics
ENS integration
Bridge Wrapped automatically resolves ENS names for connected wallets:src/hooks/useEnsName.ts
Best practices
Handle connection errors gracefully
Handle connection errors gracefully
Always check the
authenticationStatus and mounted states before rendering wallet-dependent UI. This prevents hydration mismatches and improves user experience.Support network switching
Support network switching
Provide clear UI feedback when users are on unsupported networks. The
chain.unsupported property helps identify this state.Use proper TypeScript types
Use proper TypeScript types
Leverage Wagmi’s type safety for addresses (
0x${string}) and chain IDs to prevent runtime errors.Troubleshooting
Common issues:- Connection rejected: User declined the connection request in their wallet
- Network mismatch: User is on a network not in the supported chains list
- Hydration errors: Ensure the
mountedstate is properly checked before rendering wallet UI