AA Bundler
raw JSON → 0.2.0 verified Sat Apr 25 auth: no javascript
Reference implementation of an EIP-4337 bundler for account abstraction on Ethereum. Current version 0.2.0, built by eth-infinitism. Supports production and debug RPC calls per bundler-spec-tests. Requires a GETH node with debug_traceCall and JavaScript tracer; does not work with Hardhat or Ganache without --unsafe flag. Includes SDK for creating UserOperations and utility contracts. Designed as modular reference for the EIP-4337 standard. Released as open-source with active maintenance.
Common errors
error Error: unsupported tracer ↓
cause Running with non-GETH node without --unsafe
fix
Use GETH or add --unsafe flag
error TypeError: BundlerServer is not a constructor ↓
cause Using require() on ESM-only package
fix
Use import { BundlerServer } from '@account-abstraction/bundler'
error Error: entry point address mismatch ↓
cause Wrong EntryPoint contract address
fix
Set entryPoint to 0x0000000071727De22E5E9d8BAf0edAc6f37da032 for v0.6
Warnings
gotcha Bundler requires GETH node with debug_traceCall; Hardhat and Ganache will not work without --unsafe flag ↓
fix Use a GETH node or pass --unsafe to skip security checks
breaking EntryPoint address must be 0x0000000071727De22E5E9d8BAf0edAc6f37da032 for v0.6 contracts ↓
fix Use correct entry point address for your contract version
deprecated mnemonic file support may be removed in future versions; prefer environment variables ↓
fix Switch to using MNEMONIC env variable instead of --mnemonic file
Install
npm install aa-bundler-1 yarn add aa-bundler-1 pnpm add aa-bundler-1 Imports
- BundlerServer wrong
const BundlerServer = require('@account-abstraction/bundler')correctimport { BundlerServer } from '@account-abstraction/bundler' - UserOperation wrong
import UserOperation from '@account-abstraction/sdk'correctimport { UserOperation } from '@account-abstraction/sdk' - default wrong
import { default } from '@account-abstraction/bundler'correctimport BundlerServer from '@account-abstraction/bundler' - InMemoryBundler wrong
import { InMemoryBundler } from '@account-abstraction/bundler/dist'correctimport { InMemoryBundler } from '@account-abstraction/bundler'
Quickstart
import { BundlerServer } from '@account-abstraction/bundler';
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('http://localhost:8545');
const bundler = new BundlerServer(
provider,
{
entryPoint: '0x0000000071727De22E5E9d8BAf0edAc6f37da032',
beneficiary: '0xYourBeneficiaryAddress',
unsafe: false, // set true if not using GETH
}
);
bundler.start().then(() => {
console.log('Bundler running on http://localhost:3000/rpc');
});