Skip to main content

Quick Start

To get started with Brewit Account all we need it brewit.js package.
npm install brewit
pnpm install brewit
yarn add brewit

bun install brewit

Create an Account

import { toAccount } from 'brewit';

const account = await toAccount({
  chainId: 8453,
  rpcEndpoint: 'https://mainnet.base.org',
  signer: privateKeyToAccount('0x...'),
  type: 'main',
  config: { validator: 'ownable' },
});

Send a transaction

import { createAccountClient } from 'brewit';

// You can replace with any bundler URL
const pimlicoAPIKey = "<YOUR_PIMLICO_API_KEY>";
const bundlerUrl = `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`

const client = createAccountClient(account, bundlerUrl);

const tx = await client.sendTransaction({
  account: account,
  to: '0x...',
  value: '0x...',   
});