Skip to content

JSON-RPC

JSON-RPC Requests

All clients implement a tevm.request() method for handling JSON-RPC requests.

const {result, errors, id, method, jsonrpc} = await client.request({
method: 'eth_blockNumber',
params: [],
id: 1,
jsonrpc: '2.0',
})

Below are all procedures implemented or planned to be implemented. 🚧 means the procedure is still under construction

Tevm methods

Tevm methods are feature-rich methods that provide a high level of control over the VM.

  • 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_script - Runs the provided bytecode against the EVM state
  • tevm_dumpState - Returns the state of the VM
  • tevm_loadState - Initializes the state of the VM
  • 🚧 tevm_traceContractCall
  • 🚧 tevm_traceScript

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