RainbowKit
Set up RainbowKit with Seismic for wallet connection
RainbowKit is the recommended wallet connection library for Seismic React apps. It provides a polished connect modal, chain switching, and account management out of the box.
Prerequisites
npm install @rainbow-me/rainbowkit wagmi viem @tanstack/react-query seismic-react seismic-viemStep 1: Configure wagmi
Create a wagmi config using RainbowKit's getDefaultConfig with Seismic chains:
import { getDefaultConfig } from "@rainbow-me/rainbowkit";
import { seismicTestnet } from "seismic-react/rainbowkit";
const config = getDefaultConfig({
appName: "My Seismic App",
projectId: "YOUR_WALLETCONNECT_PROJECT_ID",
chains: [seismicTestnet],
});Replace YOUR_WALLETCONNECT_PROJECT_ID with a project ID from WalletConnect Cloud.
Step 2: Set Up Providers
Wrap your app with the provider stack. The nesting order matters:
Step 3: Add the Connect Button
RainbowKit provides a pre-built connect button component:
Step 4: Use Shielded Hooks
Once the providers are in place, use seismic-react hooks to interact with shielded contracts:
Next.js Setup
Next.js App Router requires client components for providers. Create a separate providers file:
Then wrap your root layout:
Local Development with Sanvil
For local development, use the sanvil chain (Seismic's local development node) instead of seismicTestnet:
Complete Example
A full working setup in a single file:
See Also
Wallet Guides Overview -- Comparison of wallet libraries
ShieldedWalletProvider -- Provider reference and options
useShieldedWallet -- Access shielded wallet context
Privy Guide -- Email/social login alternative
AppKit Guide -- WalletConnect modal alternative
Last updated

