0.0.11 • Published 10 months ago

burner-connector v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

🔥 Burner Connector

Quickstart

  1. Install the dependencies:
npm install burner-connector

or

yarn add burner-connector

or

pnpm add burner-connector
  1. Using wagmi burner connector:
import { burner } from "burner-connector";
import { mainnet, base } from "viem/chains";

// Configuration options:
// - `useSessionStorage` (optional) : false (default) to persist wallet across browser tabs
//                       true to create a new wallet for each browser tab
// - `rpcUrls` (optional) : custom RPC URLs for specific chain IDs

// Basic usage without options
export const config = createConfig({
  chains: [mainnet, base],
  connectors: [burner()],
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});

// Example with all options
export const config = createConfig({
  chains: [mainnet, base],
  connectors: [
    burner({
      useSessionStorage: true,
      rpcUrls: {
        1: "https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY",
        8453: "https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY",
      },
    }),
  ],
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});
  1. Integrate with rainbowkit:
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import { metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
import { rainbowkitBurnerWallet } from "burner-connector";
import { mainnet, base } from "viem/chains";

// Configure burner wallet options
// Storage configuration:
// - useSessionStorage: false (default) to persist wallet across browser tabs
//                     true to create a new wallet for each browser tab
rainbowkitBurnerWallet.useSessionStorage = true;

// Custom RPC URLs configuration (optional):
rainbowkitBurnerWallet.rpcUrls = {
  1: "https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY",
  8453: "https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY",
};

const wallets = [metaMaskWallet, rainbowkitBurnerWallet];

const wagmiConnectors = connectorsForWallets(
  [
    {
      groupName: "Supported Wallets",
      wallets,
    },
  ],
  {
    appName: "scaffold-eth-2",
    projectId: "YOUR_WALLET_CONNECT_PROJECT_ID",
  },
);

const wagmiConfig = createConfig({
  chains: [mainnet, base],
  connectors: wagmiConnectors,
  ssr: true,
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});

Configuration Options

Burner Connector Options

OptionTypeDefaultDescription
useSessionStorage (optional)booleanfalseWhen true, creates a new wallet for each browser tab. When false, persists wallet across tabs.
rpcUrls (optional)Record<number, string>undefinedOptional custom RPC URLs for specific chain IDs. Falls back to chain's default if not provided.

Checkout CONTRIBUTING.md for more details on how to set it up locally.

0.0.11

10 months ago

0.0.9

11 months ago

0.0.8

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago