@b2network/b2-wallet-connector
v0.0.5
Published
## Getting Started
Downloads
23
Readme
b2-wallet-connector
Getting Started
- Install the package
// with yarn
yarn add @b2network/b2-wallet-connector
// with npm
npm i @b2network/b2-wallet-connector
- Integrate B2 connector with rainbowkit
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