Migrate

0.1.0 Breaking changes

The wagmi (opens in a new tab) and viem (opens in a new tab) peer dependencies have reached 2.x.x with breaking changes.

1. Upgrade RabbyKit, @wagmi/core, and viem to their latest versions

npm i @rabby-wallet/rabbykit @wagmi/core viem@2.x @wagmi/connectors

2. Upgrade your RabbyKit and Wagmi configurations

import { createModal, getDefaultConfig } from "@rabby-wallet/rabbykit";
import { createConfig, http } from "@wagmi/core";
import { arbitrum, bsc, mainnet, optimism, polygon } from "@wagmi/core/chains";
 
export const config = createConfig(
  getDefaultConfig({
    appName: "RabbyKit example",
    projectId: "58a22d2bc1c793fc31c117ad9ceba8d9",
    chains: [mainnet, arbitrum, bsc, optimism, polygon],
    transports: {
      [mainnet.id]: http(),
      [arbitrum.id]: http(),
      [bsc.id]: http(),
      [optimism.id]: http(),
      [polygon.id]: http(),
    },
  })
);
 
export const rabbykit = createModal({
  wagmi: config,
});
 
rabbykit.open();
 
console.log("current rabbykit modal open status:", rabbykit.getOpenState());
 
rabbykit.close();

3. wagmi migrate