Tevm reference
Overview
Tevm reference docs are autogenerated from their TypeScript types and jsdoc annotations. This guide organizes the generated docs contextually.
All runtime packages are available both as standalone packages (@tevm/actions
) or conveniently in a barrel
package. tevm
.
All buildtime packages like the typescript or webpack plugin are similarly available both as a standalone @tevm/ts-plugin
and in a barrel
package @tevm/bundler
TevmClient api
All clients share the TevmClient
api which is how you interact with the EVM. The following reference docs contain it’s api.
- @tevm/client-types - Contains the TevmClient all
Clients
share. This is usually the best place to start. - @tevm/actions-types - Contains the actions api definitions
- @tevm/procedures-types - Contains the JSON-RPC definitions
Clients
In addition to the TevmClient
api above documentation about specific clients exists in following packages
- @tevm/memory-client - The main in memory EVM client
- @tevm/http-client - A client that executes via a remote MemoryClient over (http)[#Server]
There are also extension clients for viem and ethers
Contracts
A common way of using contract action
with tevm is Tevm Contracts
and Scripts
. They are defined in the @tevm/contracts
package
Scripting
Package for creating precompiles for scripting enables JavaScript precompiles to be added to the VM.
Server
- @tevm/server - Contains utilities to run Tevm as an JSON-RPC http server in Node, Bun, express, and Next.js.
Implementation
The following internal packages contain the majority of the implementation code. All the packages above so far are sufficient for exploring the api. But if you want to dive deeper into implementation source code the following packages can be useful.
- @tevm/actions - Contains decorators that decorate ethereumjs with the Tevm api.
- @tevm/procedures - Contains decorators that decorate ethereumjs with the Tevm JSON-rpc api.
@tevm/bundler
To configure your bundler setup navigate to your bundler’s plugins docs @tevm/*-plugin
- @tevm/bun-plugin
- @tevm/esbuild-plugin
- @tevm/rollup-plugin
- @tevm/rspack-plugin
- @tevm/vite-plugin
- @tevm/webpack-plugin
There is also config documentation below but you are most likely only interested in the CompilerConfig docs.
Bundlers bundle solidity via turning their imports into Contract
and Script
instances. We already listed this package but for convenience it is below:
Internal packages
There are more internal packages that aren’t listed in this documentation but still have documentation on github in their docs
folder.
Runtime packages
- @tevm/effect - Contains effect related utilities
- @tevm/state - Contains the custom EVM state implementation for tevm.
- @tevm/revm - Contains an experimental wasm build of revm. Future versions of Tevm may replace some components with revm.
- @tevm/schemas - Contains experimental
effect schemas
for ethereum types. - @tevm/viem-effect - Contains an experimental package that strongly types viem errors using effect
Buildtime packages
- @tevm/base-bundler - Contains the Javascript bundler implementation used internally by all other bundlers
- @tevm/compiler - Contains the Tevm solidity compiler implementation
- @tevm/solc - Contains a thin wrapper around
solc
that adds typescript types. - @tevm/ts-plugin - Contains the implementation of of typescript language service plugin. This enables your editor to understand solidity imports.
- @tevm/lsp - Contains an experimental rewrite of the LSP using
volar
. This will upgrade the LSP features and give TevmSvelte
andVue
support once ready. - @tevm/experimental-solc - Contains experimental package that fetches solc at runtime via an ESM import