Migration Guide
Migrating RainbowKit
The wagmi and viem peer dependencies have reached 2.x.x
with breaking changes.
Follow the steps below to migrate.
1. Upgrade RainbowKit, wagmi
, and viem
to their latest versions
2. Install @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 wagmi
and viem
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 injectedWallet
and 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 transports
.
The default wallet list will be automatically included, deprecating the need to use getDefaultWallets
and connectorsForWallets
.
You can create a Custom Wallet List by passing imported or Custom Wallet connectors to wallets
. Instantiating wallet connectors and passing projectId
and chains
is no longer required.
3. RainbowKitProvider
You no longer need to pass chains
to <RainbowKitProvider>
.
4. Custom Chains
The Chain
type has changed in accordance with Wagmi v2, and continues to support RainbowKit's iconUrl
and iconBackground
metadata.
Example with getDefaultConfig
:
Example with createConfig
:
5. Custom Wallets
RainbowKit wallet connectors have undergone substantial changes to support Wagmi v2. Reference the updated docs and an example connector to upgrade any Custom Wallet Connectors in your dApp.
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.
The wagmi peer dependency has been updated to 1.x.x
.
Follow the steps below to migrate.
1. Upgrade RainbowKit and wagmi
to their latest version
2. Install viem
peer dependency
wagmi v1 requires the viem
peer dependency. Install it with the following command:
Note: wagmi no longer uses the ethers
package internally. But if you rely on the Authentication API, siwe
will still require ethers
as a peer dependency.
3. Ensure bundler and polyfill compatibility
In previous versions of wagmi that relied on ethers, the fs
, net
, and tls
modules required by WalletConnect were automatically polyfilled. This is no longer the case with RainbowKit v1 + wagmi v1, which are built on viem.
Reference our Next.js Webpack Config and Create React App polyfills samples for configuration guidance for your project.
Additional framework guides for Vite and Remix are available here.
4. Check for breaking changes in wagmi
If you use wagmi
hooks in your application, you will need to follow wagmi
's migration guide to v1.
You can see their migration guide here.
The wagmi peer dependency has been updated to 0.12.x
.
RainbowKit has adopted the WalletConnectLegacyConnector
connector in wagmi
for continued WalletConnect v1 support. Support for WalletConnect v2 and WalletConnectConnector
will soon be available as a patch release, without breaking changes.
Wallets will be transitioned automatically in future releases.
Every dApp must now provide a WalletConnect Cloud projectId
to enable WalletConnect v2. This must be completed before WalletConnect v1 bridge servers are shutdown on June 28, 2023. RainbowKit will quietly prefer v1 for all wallets if projectId
is unspecified.
Follow the steps below to migrate.
Every dApp that relies on WalletConnect now needs to obtain a projectId
from WalletConnect Cloud. This is absolutely free and only takes a few minutes.
Provide the projectId
to getDefaultWallets
and individual RainbowKit wallet connectors like the following:
The wagmi peer dependency has been updated to 0.11.x
.
Follow the steps below to migrate.
If you use wagmi
hooks in your application, you will need to check if your application has been affected by the breaking changes in wagmi
.
You can see their migration guide here.
The wagmi peer dependency has been updated to 0.10.x
.
Follow the steps below to migrate.
If you use wagmi
hooks in your application, you will need to check if your application has been affected by the breaking changes in wagmi
.
You can see their migration guide here.
The wagmi peer dependency has been updated to 0.9.x
.
Follow the steps below to migrate.
If you use wagmi
hooks in your application, you will need to check if your application has been affected by the breaking changes in wagmi
.
You can see their migration guide here.
The wagmi peer dependency has been updated to 0.8.x
.
Follow the steps below to migrate.
If you use wagmi
hooks in your application, you will need to check if your application has been affected by the breaking changes in wagmi
.
You can see their migration guide here.
If you're creating a custom wallet list, you must now import each wallet individually in order to reduce bundle size. Note that since wallets are no longer namespaced via the wallet
object, all wallets now have a Wallet
suffix.
Also note that the Steakwallet backwards compatibility layer has been removed. Omni should be used instead.
RainbowKit has updated the wagmi
peer dependency to 0.5.x
.
Follow the steps below to migrate.
Upgrade RainbowKit and wagmi to their latest version
If you use wagmi
hooks in your application, you will need to check if your application has been affected by the breaking changes in wagmi
.
You can see their migration guide here.
Removed the chainId
parameter from createConnector
on the Wallet
type.
Note that all built-in wallets are using the new API. Most consumers will be unaffected. This change only affects consumers that have created/consumed custom wallets.
If you previously derived RPC URLs from the chainId
on createConnector
, you can now remove that logic as wagmi
now handles RPC URLs internally when used with configureChains
.
RainbowKit has updated the wagmi
peer dependency to ^0.4
.
Follow the steps below to migrate.
Upgrade RainbowKit and wagmi to their latest version
Import configureChains
from wagmi instead of RainbowKit:
RainbowKit no longer exports an apiProvider
API. Replace it with your desired provider from wagmi.
Import alchemyProvider
from wagmi/providers/alchemy
.
Import infuraProvider
from wagmi/providers/infura
.
Import jsonRpcProvider
from wagmi/providers/jsonRpc
.
Import publicProvider
from wagmi/providers/public
.
Rename WagmiProvider
to WagmiConfig
.
And you're done! 🌈