API Overview — evmstate
Skip to content

API Overview

@polareth/evmstate provides three main APIs for analyzing Ethereum state changes:

traceState

Main function for tracing state changes from a transaction.

import type { TraceStateOptions, TraceStateResult } from "@polareth/evmstate";
 
// @ts-expect-error - Function implementation is missing
function traceState(options: TraceStateOptions): Promise<TraceStateResult>;

Use traceState when you need to analyze a single transaction and don't need to reuse configuration.

API reference →

Tracer

Class for creating reusable tracing instances with shared configuration.

import type { TraceStateBaseOptions, TraceStateTxParams } from "@polareth/evmstate";
 
class Tracer {
  // @ts-expect-error - Constructor implementation is missing
  constructor(options: TraceStateBaseOptions);
  // @ts-expect-error - Function implementation is missing
  traceState(txOptions: TraceStateTxParams): Promise<TraceStateResult>;
}

Use Tracer when you need to perform multiple traces with the same configuration.

API reference →

watchState

Function for monitoring state changes for a specific address.

import type { WatchStateOptions, DeepReadonly, SolcStorageLayout } from "@polareth/evmstate";
 
// @ts-expect-error - Function implementation is missing
function watchState<TStorageLayout extends DeepReadonly<SolcStorageLayout> | undefined = undefined>(
  options: WatchStateOptions<TStorageLayout>
): Promise<() => void>;

Use watchState to continuously monitor an address for state changes across multiple blocks.

API reference →