Migrating to RainbowKit and Wagmi v2
Follow the steps below to migrate.
1. Upgrade RainbowKit,
viem to their latest versions
@tanstack/react-query peer dependency
With Wagmi v2, TanStack Query is now a required peer dependency.
Install it with the following command:
3. Upgrade your RainbowKit and Wagmi configurations
4. Check for breaking changes in
If you use
wagmi hooks and
viem actions in your dApp, you will need to follow the migration guides for v2:
1. Improved behavior for EIP-6963 wallets
Wallets that support the new EIP-6963 connection standard (including Rainbow, MetaMask, and more) will now automatically appear in an
Installed section during the Connect Wallet experience. This ensures that users can always find their favorite wallets and connect to dApps without conflicts or fallback buttons.
Developers continue to have full control over the Custom Wallet List to emphasize preferred wallets for end users. It is encouraged that you continue to include the
walletConnectWallet in your list to supports all platforms.
2. Wagmi configuration with getDefaultConfig
This new API simplifies the configuration experience and replaces the need to use Wagmi's
createConfig directly. Chain configuration is simplified, including inferred public providers for
The default wallet list will be automatically included, deprecating the need to use
You can create a Custom Wallet List by passing imported or Custom Wallet connectors to
wallets. Instantiating wallet connectors and passing
chains is no longer required.
You no longer need to pass
4. Custom Chains
Chain type has changed in accordance with Wagmi v2, and continues to support RainbowKit's
5. Custom Wallets
Wallet connectors also now support the EIP-6963 standard with the
rdns prop. Ensure that this is populated to prevent duplicate references to EIP-6963 supporting wallets in your wallet list.