Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

@tevm/actions

Action handlers for the Tevm client, covering standard Ethereum JSON-RPC, Anvil-compatible test methods, debug/tracing, and Tevm-specific calls.

Full API: packages/actions/docs.

Installation

npm install @tevm/actions

API Reference

Error Classes

Core Types

Base Actions

Call Actions

Contract Actions

Deploy Actions

Validation Functions

JSON-RPC Procedures

Internal Utilities

Ethereum JSON-RPC Actions

Account & Network

State Reading

Block Operations

Anvil (Testing & Development) Actions

State Manipulation

Mining & Chain Control

Debug Actions

Usage Examples

import { createTevmNode } from 'tevm'
import { callHandler, contractHandler, deployHandler, ethCallHandler } from 'tevm/actions'
 
const client = createTevmNode()
 
const call = await callHandler(client)({
  to: '0x1234567890123456789012345678901234567890',
  data: '0x',
  value: 1000n,
})
 
const contract = await contractHandler(client)({
  to: '0x1234567890123456789012345678901234567890',
  abi: [...],
  functionName: 'transfer',
  args: ['0x0000000000000000000000000000000000000000', 1000n],
})
 
const deploy = await deployHandler(client)({
  bytecode: '0x...',
  abi: [...],
  args: ['constructor arg'],
})
 
const ethCall = await ethCallHandler(client)({
  to: '0x1234567890123456789012345678901234567890',
  data: '0x',
})

All actions accept throwOnFail: false to return errors in the result instead of throwing.

const invalidCall = await callHandler(client)({
  to: '0x123',
  data: '0x',
  throwOnFail: false,
})
 
if (invalidCall.errors) {
  console.error(invalidCall.errors)
}

See Also