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 executionTevm.getAccount
- gets account information such as balances contract information nonces and state roots.Tevm.setAccount
- directly modifies the state of an accountTevm.contract
- Similar to eth call but with additional properties to control the VM executionTevm.script
- Runs the provided bytecode against the EVM state- 🚧
Tevm.traceContractCall
- 🚧
Tevm.traceScript
Tevm.dumpState
- Returns the state of the VMTevm.loadState
- Initializes the state of the VM
Eth methods
Tevm plans on implementing most of the ethereum JSON-RPC spec
- `Tevm.eth.chainId’
- `Tevm.eth.call’
- `Tevm.eth.getCode’
- `Tevm.eth.getStorageAt’
- `Tevm.eth.gasPrice’
- `Tevm.eth.getBalance’
- `Tevm.eth.estimateGas’
- 🚧 `Tevm.eth.sign’
- 🚧 `Tevm.eth.getLogs’
- 🚧 `Tevm.eth.accounts’
- 🚧 `Tevm.eth.coinbase’
- 🚧 `Tevm.eth.hashrate’
- 🚧 `Tevm.eth.newFilter’
- 🚧 `Tevm.eth.getFilterLogs’
- 🚧 `Tevm.eth.getBlockByHash’
- 🚧 `Tevm.eth.newBlockFilter’
- 🚧 `Tevm.eth.protocolVersion’
- 🚧 `Tevm.eth.sendTransaction’
- 🚧 `Tevm.eth.signTransaction’
- 🚧 `Tevm.eth.uninstallFilter’
- 🚧 `Tevm.eth.getBlockByNumber’
- 🚧 `Tevm.eth.getFilterChanges’
- 🚧 `Tevm.eth.sendRawTransaction’
- 🚧 `Tevm.eth.getTransactionCount’
- 🚧 `Tevm.eth.getTransactionByHash’
- 🚧 `Tevm.eth.getTransactionReceipt’
- 🚧 `Tevm.eth.newPendingTransactionFilter’
- 🚧 `Tevm.eth.getBlockTransactionCountByHash’
- 🚧 `Tevm.eth.getBlockTransactionCountByNumber’
- 🚧 `Tevm.eth.getTransactionByBlockHashAndIndex’
- 🚧 `Tevm.eth.getTransactionByBlockNumberAndIndex’
Debug methods
Anvil/Hardhat methods
Anvil/hardhat methods are provided for compatability
- 🚧 `Tevm.anvil.mine’
- 🚧 `Tevm.anvil.reset’
- 🚧 `Tevm.anvil.setCode’
- 🚧 `Tevm.anvil.setNonce’
- 🚧 `Tevm.anvil.dumpState’
- 🚧 `Tevm.anvil.loadState’
- 🚧 `Tevm.anvil.setBalance’
- 🚧 `Tevm.anvil.setChainId’
- 🚧 `Tevm.anvil.getAutomine’
- 🚧 `Tevm.anvil.setStorageAt’
- 🚧 `Tevm.anvil.dropTransaction’
- 🚧 `Tevm.anvil.impersonateAccount’
- 🚧 `Tevm.anvil.stopImpersonatingAccount’
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