Skip to main content

Wallet Setup (RainbowKit + wagmi)

RainbowKit adds wallet connection on top of wagmi and viem. We’ll add the providers and a Connect button.

Install

The Web3 provider

Create one component that wires the three providers in order (WagmiProvider → QueryClientProvider → RainbowKitProvider) and syncs RainbowKit’s modal theme with the app’s light/dark mode.
src/components/web3-provider.tsx
Wrap your app with it (inside ThemeProvider, so it can read the theme):
src/main.tsx
Pick a reliable RPC. With the default RPC, useWaitForTransactionReceipt can get stuck “loading” even after a tx succeeds, and some public RPCs reject transactions with a confusing “gas limit too high”. The fallback([...]) above (dRPC first) avoids both — viem switches RPC automatically if one fails.

The Connect button

Render RainbowKit’s ConnectButton anywhere — e.g. above the main card:
src/App.tsx
getDefaultConfig also auto-detects injected wallets (MetaMask) via EIP-6963, so they work even without a WalletConnect projectId (only WalletConnect/mobile wallets need it).
Make sure MetaMask is on the Sepolia network. Need test ETH? Use a Sepolia faucet (e.g. Google Cloud Web3 faucet or Alchemy).

Next: Smart Contracts

Deploy the RupiahToken + Vault contracts to Sepolia.