@b2network/b2-wallet-connector
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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

/@b2network/b2-wallet-connector/

    Package Sidebar

    Install

    npm i @b2network/b2-wallet-connector

    Weekly Downloads

    0

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    162 kB

    Total Files

    7

    Last publish

    Collaborators

    • lance10030
    • bsquared_pat