Skip to content

Actions

Overview

Tevm has an actions based api similar to viem’s actions api and following similar patterns. This is a higher level of abstraction than the lower level JSON-RPC api

Tevm actions

Tevm methods are the main recomended way to interact with Tevm. 🚧 means the procedure is still under construction

  • Tevm.call - Similar to eth call but with additional properties to control the VM execution
  • Tevm.getAccount - gets account information such as balances contract information nonces and state roots.
  • Tevm.setAccount - directly modifies the state of an account
  • Tevm.contract - Similar to eth call but with additional properties to control the VM execution
  • Tevm.script - Runs the provided bytecode against the EVM state
  • 🚧 Tevm.traceContractCall
  • 🚧 Tevm.traceScript
  • Tevm.dumpState - Returns the state of the VM
  • Tevm.loadState - Initializes the state of the VM

Eth methods

Tevm plans on implementing most of the ethereum JSON-RPC spec

Debug methods

Anvil/Hardhat methods

Anvil/hardhat methods are provided for compatability

Tree shakeable actions

Like viem, Tevm provides tree shakable versions of the actions in the tevm/procedures package. But for Tevm it is recomended you use the higher level client apis. If bundle size is a concern a more effective way of reducing bundle size is using a remote http client and running the EVM on a backend server