verification
use it
# add to stunt.yaml
services:
erc4337:
adapter: embedded:erc4337-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the ERC-4337 Bundler RPC API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of ERC-4337 Bundler RPC. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real ERC-4337 Bundler RPC 0.7 surface — the data is fake, the behavior is real.
backing stores
useropsreceipts
api surface (2)
generated from the adapter manifest — exactly what boots, nothing more
2 routes
POST/
POST/paymaster/sign
VM-verified behaviors (7)
- ✓supportedEntryPoints, chainId, and the JSON-RPC envelope
- ✓estimateUserOperationGas validates the full v0.7 field set
- ✓sendUserOperation answers a deterministic hash and defaults the entry point
- ✓the op walks mempool -> bundled -> included on the virtual clock
- ✓simulate_fail reverts on inclusion with the AA95 reason
- ✓the paymaster signs the op into paymasterAndData
- ✓missing or invalid userOps are 400s
Not implemented (5)
- No eth_chainId, eth_blockNumber, or eth_getBlockByNumber passthrough
- No ERC-7677 paymaster RPC (pm_* methods); only local /paymaster/sign
- No EntryPoint v0.6 support; v0.7 entrypoint only
- No debug_bundler_* ops: sendBundleNow, clearState, dropUserOperation
- No WebSocket transport or newHeads subscriptions
Differs from the real API (6)
- gas estimates are deterministic fixed values; real bundlers differ per implementation
- inclusion runs on a fixed clock: mempool 0-1s, bundled 1-3s, included at >=3s
- eth_sendUserOperation accepts {simulate_fail:true} as a third params element
- mock paymaster POST /paymaster/sign mints synthetic sponsorship signatures
- userOp keeps the v0.6 paymasterAndData field though the adapter is EntryPoint-v0.7-only
- Error envelopes use generic -32602 rather than AA-prefixed codes (-32500...)
want more of the ERC-4337 Bundler RPC surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.