This is the ZeroDev SDK v5, a comprehensive SDK for building ERC-4337 (Account Abstraction) applications on Ethereum. The SDK provides utilities for working with smart contract wallets, bundlers, paymasters, and various validation plugins.
- Type: TypeScript SDK for ERC-4337 Account Abstraction
- Package Manager: Bun (with support for npm/yarn)
- Monorepo: Uses workspaces for packages, plugins, and templates
- Build System: TypeScript compiler with ESM, CJS, and types outputs
- Smart Accounts: Kernel-based smart contract wallets supporting multiple versions (v1, v2, v3)
- Validators/Plugins: Modular validation systems (ECDSA, WebAuthn, Session Keys, Permissions)
- Clients: Specialized clients for account operations, bundlers, and paymasters
- Actions: Composable functions for account operations
- Providers: EIP-1193 compatible providers for wallet integration
sdkv5/
├── packages/
│ ├── core/ # Main SDK package (@zerodev/sdk)
│ │ ├── accounts/ # Smart account implementations
│ │ ├── actions/ # Account actions and operations
│ │ ├── clients/ # Client implementations
│ │ ├── providers/ # EIP-1193 providers
│ │ └── types/ # TypeScript type definitions
│ ├── test/ # Test utilities and e2e tests
│ └── presets/ # Pre-configured setups
├── plugins/ # Validator and feature plugins
│ ├── ecdsa/ # ECDSA validator
│ ├── permission/ # Permission-based validators
│ ├── session-key/ # Session key management
│ ├── multi-chain-* # Multi-chain validators
│ ├── webauthn-key/ # WebAuthn/Passkey support
│ ├── weighted-* # Multi-sig validators
│ └── hooks/ # Smart contract hooks
├── templates/ # TypeScript config templates
├── wallet/ # Wallet integration utilities
└── walletconnect/ # WalletConnect integration
# Install dependencies
bun install
# Build all packages
bun run build
# Format code
bun run format
# Lint code
bun run lint
bun run lint:fix
# Run tests (requires .env setup)
bun test
# Changeset for versioning
bun run changeset
bun run changeset:version
bun run changeset:release# Build individual package (run from package directory)
bun run build:cjs # CommonJS build
bun run build:esm # ES Modules build
bun run build:types # TypeScript declarationsCopy .env.example to .env and configure:
# Essential variables
TEST_PRIVATE_KEY=
ENTRYPOINT_ADDRESS=
TEST_CHAIN_ID=
RPC_URL=
# Provider API keys
PIMLICO_API_KEY=
STACKUP_API_KEY=
ZERODEV_PROJECT_ID=
ZERODEV_API_KEY=
# RPC endpoints
PIMLICO_BUNDLER_RPC_HOST=
PIMLICO_PAYMASTER_RPC_HOST=
ZERODEV_BUNDLER_RPC_HOST=
ZERODEV_PAYMASTER_RPC_HOST=
# Multi-chain test configs
SEPOLIA_RPC_URL=
OPTIMISM_SEPOLIA_RPC_URL=- Formatter/Linter: Biome (configured in
biome.json) - Indentation: 4 spaces
- Line Width: 80 characters
- Semicolons: As needed
- Trailing Commas: None
- Pre-commit Hook: Auto-formats and lints code
- Unit tests: Located alongside source files
- E2E tests: In
packages/test/ - Version-specific tests:
v0.7/directory for EntryPoint v0.7
# Run all tests
bun test
# Run specific test file
bun test ecdsaKernelAccount.test.ts
# Run v0.7 tests
bun test v0.7/-
Feature Development:
- Create feature branch from
main - Implement changes with tests
- Run
bun run formatandbun run lint:fix - Create changeset:
bun run changeset
- Create feature branch from
-
Building:
- Run
bun run buildat root to build all packages - Individual packages build to
_cjs/,_esm/, and_types/
- Run
-
Testing:
- Ensure
.envis configured - Write tests in same directory as source
- Run tests before committing
- Ensure
-
Release Process:
- Uses changesets for version management
- Automated via GitHub Actions
- Publishes to npm registry
- Create directory in
plugins/ - Copy
tsconfig.build.jsonfrom existing plugin - Set up
package.jsonwith standard scripts - Export main functionality from
index.ts - Build outputs to
_cjs/,_esm/,_types/
// Standard plugin exports
export { toPluginValidator } from './toPluginValidator'
export { PLUGIN_CONSTANTS } from './constants'
export type { PluginTypes } from './types'- Supports EntryPoint v0.6 and v0.7
- Kernel versions: v1, v2 (0.2.x), v3 (0.3.x)
- Version-specific code in separate directories
- Extensive TypeScript types
- Viem integration for chain types
- Strict type checking enabled
Based on NOTES.md, the architecture separates concerns:
- BundlerClient: UserOperation submission
- PaymasterClient: Sponsorship and gas abstraction
- KernelAccountClient: High-level account operations
- SmartAccount: Account abstraction implementation
- Main branch:
main - Auto-formatting on pre-commit
- CI/CD via GitHub Actions
- Changesets for version management
- Create in
packages/core/actions/ - Export from appropriate index file
- Add client decorator if needed
- Include TypeScript types
- Update in plugin's
package.json - Update peer dependencies if needed
- Run
bun install --lockfile-only - Create changeset for version bump
- Use
console.logfor debugging - Check RPC endpoints in
.env - Verify contract deployments
- Use test utilities in
packages/test/utils.ts
- Documentation
- Examples Repository
- Discord Channel
- License: MIT