import {
connectorsForWallets,
RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import { configureChains, createConfig, WagmiConfig } from "wagmi";
import { publicProvider } from "wagmi/providers/public";
import {
B2Connector,
b2test,
b2Wallet,
withB2PublicClient,
} from "@b2network/b2-wallet-connector";
const { chains, publicClient } = configureChains(
[b2test],
[publicProvider()]
);
const connectors = connectorsForWallets([
{
groupName: "Recommended",
wallets: [
b2Wallet(
new B2Connector({
chains,
options: {
shimDisconnect: true,
},
})
),
],
},
]);
// Pass `publicClient` to withB2PublicClient HOF
const wagmiConfig = createConfig({
autoConnect: true,
connectors,
publicClient: withB2PublicClient(publicClient),
});
// Now you can use the config as you use to