Skip to main content

API reference

APIWhat it is
AnvilOptionsfluent, validated configuration of every anvil flag, in groups (.account, .evm, .fork, .mining, .logs, .network, .server, .state)
Flag rulesconflicts and dependencies between flags
AnvilContainerthe Testcontainers module: options + test client settings → a started node
StartedAnvilContainera running node: test client, cheats, account/transaction/time/state helpers
Test clientAnvilTestClient: every viem test, public and wallet action, bound to the node
anvil extrasAnvilActions: anvil RPC methods viem doesn't wrap, strict reset / revert
CheatsAnvilCheats: fluent, awaitable chains of state changes
TestClientOptionstransport, polling, retries, batching, default account, chain metadata
useAnvil()test lifecycle hooks with per-test isolation
Errorserror classes and AnvilTestClientError codes
Exportsfunctions, enums, constants and types

Code samples for every member are on the task pages; tables marked generated are produced from the library itself by pnpm docs:sync.