@tevm/actions
Version:
A typesafe library for writing forge scripts in typescript
1,319 lines (1,264 loc) • 202 kB
TypeScript
import * as _tevm_utils from '@tevm/utils';
import { Abi as Abi$1, Address as Address$1, Hex as Hex$1, ContractFunctionName, EncodeFunctionDataParameters, DecodeFunctionResultReturnType, ContractConstructorArgs, EncodeDeployDataParameters, BlockTag as BlockTag$1 } from '@tevm/utils';
import { JsonRpcRequest, JsonRpcResponse } from '@tevm/jsonrpc';
import * as _tevm_node from '@tevm/node';
import { TevmNode, Filter } from '@tevm/node';
import { InvalidParamsError, InvalidSkipBalanceError, InvalidGasRefundError, InvalidBlockError, InvalidGasPriceError, InvalidOriginError, InvalidCallerError, InvalidDepthError, InvalidBlobVersionedHashesError, InvalidAddToMempoolError, InvalidAddToBlockchainError, UnknownBlockError, AuthCallUnsetError, BLS12381FpNotInFieldError, BLS12381InputEmptyError, BLS12381InvalidInputLengthError, BLS12381PointNotOnCurveError, CodeStoreOutOfGasError, CodeSizeExceedsMaximumError, CreateCollisionError, InvalidCommitmentError, EvmRevertError, InitcodeSizeViolationError, InsufficientBalanceError, InternalEvmError, InvalidBeginSubError, InvalidBytecodeResultError, InvalidEofFormatError, InvalidInputLengthError, InvalidJumpError, InvalidJumpSubError, InvalidKzgInputsError, InvalidOpcodeError, InvalidProofError, InvalidReturnSubError, OutOfGasError, OutOfRangeError, RefundExhaustedError, StackOverflowError, StackUnderflowError, StaticStateChangeError, StopError, ValueOverflowError, InvalidAddressError, InvalidGasLimitError, InvalidSaltError, InvalidDataError, InvalidBytecodeError, InternalError, ExecutionError, RevertError, ForkError, InvalidRequestError, InvalidAbiError, InvalidArgsError, InvalidFunctionNameError, AccountNotFoundError, InvalidBalanceError, InvalidNonceError, InvalidDeployedBytecodeError, InvalidStorageRootError } from '@tevm/errors';
import * as zod from 'zod';
import { z } from 'zod';
import { Address as Address$2 } from '@tevm/address';
import * as _tevm_evm from '@tevm/evm';
import { InterpreterStep, EvmResult, PrecompileInput, ExecResult } from '@tevm/evm';
import * as _tevm_vm from '@tevm/vm';
import * as _tevm_block from '@tevm/block';
import { Block as Block$1 } from '@tevm/block';
import * as viem from 'viem';
import { SerializableTevmState, ParameterizedTevmState, TevmState, StateRoots } from '@tevm/state';
import { ChainOptions } from '@tevm/blockchain';
import { ConsensusAlgorithm, ConsensusType } from '@tevm/common';
import { TxPool } from '@tevm/txpool';
import { TxReceipt } from '@tevm/receipt-manager';
/**
* A valid [Ethereum JSON ABI](https://docs.soliditylang.org/en/latest/abi-spec.html#json)
*/
type Abi = Abi$1;
/**
* A hex string
* @example
* const hex: Hex = '0x1234ff'
*/
type Hex = `0x${string}`;
/**
* The state of an account as captured by `debug_` traces
*/
type AccountState = {
readonly balance: Hex;
readonly nonce: number;
readonly code: Hex;
readonly storage: Record<Hex, Hex>;
};
/**
* An ethereum address represented as a hex string
* @see https://abitype.dev/config#addresstype for configuration options to change type to being a string if preferred
*/
type Address = Address$1;
/**
* Header information of an ethereum block
*/
type Block = {
/**
* The block number (height) in the blockchain.
*/
readonly number: bigint;
/**
* The address of the miner or validator who mined or validated the block.
*/
readonly coinbase: Address;
/**
* The timestamp at which the block was mined or validated.
*/
readonly timestamp: bigint;
/**
* The difficulty level of the block (relevant in PoW chains).
*/
readonly difficulty: bigint;
/**
* The gas limit for the block, i.e., the maximum amount of gas that can be used by the transactions in the block.
*/
readonly gasLimit: bigint;
/**
* (Optional) The base fee per gas in the block, introduced in EIP-1559 for dynamic transaction fee calculation.
*/
readonly baseFeePerGas?: bigint;
/**
* The gas price for the block; may be undefined in blocks after EIP-1559.
*/
readonly blobGasPrice?: bigint;
};
/**
* The fields of this optional object customize the block as part of which the call is simulated. The object contains the following fields:
* This option cannot be used when `createTransaction` is set to `true`
* Setting the block number to past block will not run in the context of that blocks state. To do that fork that block number first.
*/
type BlockOverrideSet = {
/**
* Fake block number
*/
number?: bigint;
/**
* Fake difficulty. Note post-merge difficulty should be 0.
* not included as an option atm
*/
/**
* Fake block timestamp
*/
time?: bigint;
/**
* Block gas capacity
*/
gasLimit?: bigint;
/**
* Block fee recipient
*/
coinbase?: Address$1;
/**
* Fake PrevRandao value
* Not included as an option atm
*/
/**
* Block base fee (see EIP-1559)
*/
baseFee?: bigint;
/**
* Block blob base fee (see EIP-4844)
*/
blobBaseFee?: bigint;
};
type BlockTag = 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
type BlockParam = BlockTag | Hex$1 | bigint;
/**
* A transaction request object
*/
type TransactionParams = {
readonly from: Address;
readonly to?: Address;
readonly gas?: Hex;
readonly gasPrice?: Hex;
readonly value?: Hex;
readonly input: Hex;
readonly nonce?: Hex;
};
/**
* The type returned by block related
* json rpc procedures
*/
type BlockResult<TIncludeTransactions extends boolean = false> = {
/**
* The block number (height) in the blockchain.
*/
readonly number: Hex;
/**
* The hex stringhash of the block.
*/
readonly hash: Hex;
/**
* The hex stringhash of the parent block.
*/
readonly parentHash: Hex;
readonly nonce: Hex;
/**
* The hex stringhash of the uncles of the block.
*/
readonly sha3Uncles: Hex;
readonly logsBloom: Hex;
readonly transactionsRoot: Hex;
readonly stateRoot: Hex;
readonly miner: Hex;
readonly difficulty: Hex;
readonly totalDifficulty: Hex;
readonly extraData: Hex;
readonly size: Hex;
readonly gasLimit: Hex;
readonly gasUsed: Hex;
readonly timestamp: Hex;
readonly transactions: TIncludeTransactions extends true ? Array<TransactionParams> : Hex[];
readonly uncles: Hex[];
};
/**
* Event emitted when a new contract is created
*/
interface NewContractEvent {
/** Address of the newly created contract */
address: Address$2;
/** Deployed contract bytecode */
code: Uint8Array;
}
/**
* Message object representing a call to the EVM
* This corresponds to the EVM's internal Message object
*/
interface Message {
/** Target address (undefined for contract creation) */
to?: Address$2;
/** Value sent with the call (in wei) */
value: bigint;
/** Address of the account that initiated this call */
caller: Address$2;
/** Gas limit for this call */
gasLimit: bigint;
/** Input data to the call */
data: Uint8Array;
/** Contract code for the call - can be bytecode or a precompile function */
code?: Uint8Array | any;
/** Call depth */
depth: number;
/** Whether the call is static (view) */
isStatic: boolean;
/** Whether this is precompiled contract code */
isCompiled: boolean;
/** Whether this is a DELEGATECALL */
delegatecall: boolean;
/** Salt for CREATE2 calls */
salt?: Uint8Array;
/** Origin address for AUTH calls */
authcallOrigin?: Address$2;
/** Gas refund counter */
gasRefund?: bigint;
}
/**
* Event handlers for EVM execution during a call
* @example
* ```typescript
* import { createMemoryClient } from 'tevm'
* import { tevmCall } from 'tevm/actions'
*
* const client = createMemoryClient()
*
* const result = await tevmCall(client, {
* to: '0x1234...',
* data: '0xabcdef...',
* onStep: (step, next) => {
* console.log(`Executing ${step.opcode.name} at PC=${step.pc}`)
* next?.()
* }
* })
* ```
*/
type CallEvents = {
/**
* Handler called on each EVM step (instruction execution)
* @param data Step information including opcode, stack, and memory state
* @param next Function to continue execution - must be called to proceed
*/
onStep?: (data: InterpreterStep, next?: () => void) => void;
/**
* Handler called when a new contract is created
* @param data Contract creation information
* @param next Function to continue execution - must be called to proceed
*/
onNewContract?: (data: NewContractEvent, next?: () => void) => void;
/**
* Handler called before a message (call) is processed
* @param data Message information
* @param next Function to continue execution - must be called to proceed
*/
onBeforeMessage?: (data: Message, next?: () => void) => void;
/**
* Handler called after a message (call) is processed
* @param data Result information
* @param next Function to continue execution - must be called to proceed
*/
onAfterMessage?: (data: EvmResult, next?: () => void) => void;
};
type TraceType = 'CALL' | 'DELEGATECALL' | 'STATICCALL' | 'CREATE' | 'CREATE2' | 'SELFDESTRUCT';
type TraceCall = {
type: TraceType;
from: Address;
to: Address;
value?: bigint;
gas?: bigint;
gasUsed?: bigint;
input: Hex;
output: Hex;
error?: string;
revertReason?: string;
calls?: TraceCall[];
};
/** Result from `debug_*` with `callTracer` */
type CallTraceResult = {
type: TraceType;
from: Address;
to: Address;
value: bigint;
gas: bigint;
gasUsed: bigint;
input: Hex;
output: Hex;
calls?: TraceCall[];
};
type EmptyParams = readonly [] | {} | undefined | never;
/**
* FilterLog type for eth JSON-RPC procedures
*/
type FilterLog = {
readonly address: Hex;
readonly blockHash: Hex;
readonly blockNumber: bigint;
readonly data: Hex;
readonly logIndex: bigint;
readonly removed: boolean;
readonly topics: readonly Hex[];
readonly transactionHash: Hex;
readonly transactionIndex: bigint;
};
/**
* An event filter options object
*/
type FilterParams = {
readonly fromBlock?: BlockParam;
readonly toBlock?: BlockParam;
readonly address?: Address;
readonly topics?: ReadonlyArray<Hex> | ReadonlyArray<ReadonlyArray<Hex>>;
};
/**
* Result from `debug_*` with `4byteTracer`
* Returns a mapping of selector-calldata_size keys to their call counts as well as an additional mapping of contract address to selector keys to an array of calldata they were called with.
*
* Nodes usually only return the first mapping, but Tevm returns both for better debugging.
*
* The entries in the first mapping are in the format "0x{selector}-{calldata_size}" -> count where:
* - selector: 4-byte function selector (e.g., "0x27dc297e")
* - calldata_size: size of call data excluding the 4-byte selector
* - count: number of times the selector-calldata_size combination was called
*
* The entries in the second mapping are in the format "0x{contract_address}" -> "0x{selector}" -> [calldata1, calldata2, ...] where:
* - contract_address: 20-byte contract address (e.g., "0x1234567890123456789012345678901234567890")
* - selector: 4-byte function selector (e.g., "0x27dc297e")
* - calldata: hex-encoded calldata that was called with the selector
*
* @example
* ```json
* {
* "0x27dc297e-32": 1,
* "0x38cc4831-0": 2,
* "0x524f3889-64": 1,
* "0x1234567890123456789012345678901234567890": {
* "0x27dc297e": ["0x0000000000000000000000000000000000000000000000000000000000000001"],
* "0x38cc4831": ["0x", "0x"],
* "0x524f3889": ["0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"]
* }
* }
* ```
*/
type FourbyteTraceResult = {
readonly [K: string]: typeof K extends `${Hex}-${number}` ? number : typeof K extends Hex ? {
readonly [S: Hex]: readonly Hex[];
} : never;
};
/**
* Generic log information
*/
type Log = {
readonly address: Address;
readonly topics: Hex[];
readonly data: Hex;
};
/**
* Represents a configuration for a forked or proxied network
*/
type NetworkConfig = {
/**
* The URL to the RPC endpoint
*/
url: string;
/**
* the block tag to fork from
*/
blockTag: BlockParam;
};
/** Result from `debug_*` with `prestateTracer` */
type PrestateTraceResult<TDiffMode extends boolean = boolean> = TDiffMode extends true ? {
readonly pre: Record<Hex, AccountState>;
readonly post: Record<Hex, Partial<AccountState>>;
} : Record<Hex, AccountState>;
/**
* The state override set is an optional address-to-state mapping, where each entry specifies some state to be ephemerally overridden prior to executing the call. Each address maps to an object containing:
* This option cannot be used when `createTransaction` is set to `true`
*
* The goal of the state override set is manyfold:
* It can be used by DApps to reduce the amount of contract code needed to be deployed on chain. Code that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node on-demand.
* It can be used for smart contract analysis by extending the code deployed on chain with custom methods and invoking them. This avoids having to download and reconstruct the entire state in a sandbox to run custom code against.
* It can be used to debug smart contracts in an already deployed large suite of contracts by selectively overriding some code or state and seeing how execution changes. Specialized tooling will probably be necessary.
* @example
* ```ts
* {
* "0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3": {
* "balance": "0xde0b6b3a7640000"
* },
* "0xebe8efa441b9302a0d7eaecc277c09d20d684540": {
* "code": "0x...",
* "state": {
* "0x...": "0x..."
* }
* }
* }
* ```
*/
type StateOverrideSet = {
[address: Address]: {
/**
* Fake balance to set for the account before executing the call.
*/
balance?: bigint;
/**
* Fake nonce to set for the account before executing the call.
*/
nonce?: bigint;
/**
* Fake code to set for the account before executing the call.
*/
code?: Hex$1;
/**
* Fake key-value mapping to override all slots in the account storage before executing the calls
*/
state?: Record<Hex$1, Hex$1>;
/**
* Fake key-value mapping to override individual slots in the account storage before executing the calls
*/
stateDiff?: Record<Hex$1, Hex$1>;
};
};
type StructLog = {
readonly depth: number;
readonly gas: bigint;
readonly gasCost: bigint;
readonly op: string;
readonly pc: number;
readonly stack: Array<Hex>;
readonly error?: {
error: string;
errorType: string;
};
};
/** Result from `debug_*` with no tracer */
type TraceResult = {
failed: boolean;
gas: bigint;
returnValue: Hex;
structLogs: Array<StructLog>;
};
/**
* Transaction receipt result type for eth JSON-RPC procedures
*/
type TransactionReceiptResult = {
readonly blockHash: Hex;
readonly blockNumber: bigint;
readonly contractAddress: Hex | null;
readonly cumulativeGasUsed: bigint;
readonly effectiveGasPrice: bigint;
readonly from: Hex;
readonly gasUsed: bigint;
readonly logs: readonly FilterLog[];
readonly logsBloom: Hex;
readonly status?: Hex;
readonly root?: Hex;
readonly to: Hex | null;
readonly transactionHash: Hex;
readonly transactionIndex: bigint;
readonly blobGasUsed?: bigint;
readonly blobGasPrice?: bigint;
};
/**
* The type returned by transaction related
* json rpc procedures
*/
type TransactionResult = {
readonly blockHash: Hex;
readonly blockNumber: Hex;
readonly from: Hex;
readonly gas: Hex;
readonly gasPrice: Hex;
readonly hash: Hex;
readonly input: Hex;
readonly nonce: Hex;
readonly to: Hex;
readonly transactionIndex: Hex;
readonly value: Hex;
readonly v: Hex;
readonly r: Hex;
readonly s: Hex;
readonly chainId?: Hex;
readonly maxFeePerGas?: Hex;
readonly maxPriorityFeePerGas?: Hex;
readonly type?: Hex;
readonly accessList?: ReadonlyArray<{
readonly address: Hex;
readonly storageKeys: ReadonlyArray<Hex>;
}>;
readonly maxFeePerBlobGas?: Hex;
readonly blobVersionedHashes?: ReadonlyArray<Hex>;
readonly isImpersonated?: boolean;
};
/***
* TODO I didn't update any of these jsdocs
*/
/**
* Params fro `anvil_impersonateAccount` handler
*/
type AnvilImpersonateAccountParams = {
/**
* The address to impersonate
*/
readonly address: Address;
};
/**
* Params for `anvil_stopImpersonatingAccount` handler
*/
type AnvilStopImpersonatingAccountParams = {
/**
* The address to stop impersonating
*/
readonly address: Address;
};
/**
* Params for `anvil_autoImpersonateAccount` handler
* Not included atm because tevm_call supports it and i was getting methodNotFound errors trying it in anvil
*/
/**
* Params for `anvil_getAutomine` handler
*/
type AnvilGetAutomineParams = {} | undefined | never;
/**
* Params for `anvil_mine` handler
*/
type AnvilMineParams = {
/**
* Number of blocks to mine. Defaults to 1
*/
readonly blockCount?: number;
/**
* mineing interval
*/
readonly interval?: number;
};
/**
* Params for `anvil_reset` handler
*/
type AnvilResetParams = {};
/**
* Params for `anvil_dropTransaction` handler
*/
type AnvilDropTransactionParams = {
/**
* The transaction hash
*/
readonly transactionHash: Hex;
};
/**
* Params for `anvil_setBalance` handler
*/
type AnvilSetBalanceParams = {
/**
* The address to set the balance for
*/
readonly address: Address;
/**
* The balance to set
*/
readonly balance: Hex | BigInt;
};
/**
* Params for `anvil_setCode` handler
*/
type AnvilSetCodeParams = {
/**
* The address to set the code for
*/
readonly address: Address;
/**
* The code to set
*/
readonly code: Hex;
};
/**
* Params for `anvil_setNonce` handler
*/
type AnvilSetNonceParams = {
/**
* The address to set the nonce for
*/
readonly address: Address;
/**
* The nonce to set
*/
readonly nonce: BigInt;
};
/**
* Params for `anvil_setStorageAt` handler
*/
type AnvilSetStorageAtParams = {
/**
* The address to set the storage for
*/
readonly address: Address;
/**
* The position in storage to set
*/
readonly position: Hex | BigInt;
/**
* The value to set
*/
readonly value: Hex | BigInt;
};
/**
* Params for `anvil_setChainId` handler
*/
type AnvilSetChainIdParams = {
/**
* The chain id to set
*/
readonly chainId: number;
};
/**
* Params for `anvil_dumpState` handler
*/
type AnvilDumpStateParams = {} | undefined | never;
/**
* Params for `anvil_loadState` handler
*/
type AnvilLoadStateParams = {
/**
* The state to load
*/
readonly state: Record<Hex, Hex>;
};
type AnvilDealParams = {
/** The address of the ERC20 token to deal */
erc20?: Address;
/** The owner of the dealt tokens */
account: Address;
/** The amount of tokens to deal */
amount: bigint;
};
type AnvilImpersonateAccountResult = null;
type AnvilStopImpersonatingAccountResult = null;
type AnvilGetAutomineResult = boolean;
type AnvilMineResult = null;
type AnvilResetResult = null;
type AnvilDropTransactionResult = null;
type AnvilSetBalanceResult = null;
type AnvilSetCodeResult = null;
type AnvilSetNonceResult = null;
type AnvilSetStorageAtResult = null;
type AnvilSetChainIdResult = null;
type AnvilDumpStateResult = Hex;
type AnvilLoadStateResult = null;
type AnvilDealResult = {
errors?: Error[];
};
type AnvilImpersonateAccountHandler = (params: AnvilImpersonateAccountParams) => Promise<AnvilImpersonateAccountResult>;
type AnvilStopImpersonatingAccountHandler = (params: AnvilStopImpersonatingAccountParams) => Promise<AnvilStopImpersonatingAccountResult>;
type AnvilGetAutomineHandler = (params: AnvilGetAutomineParams) => Promise<AnvilGetAutomineResult>;
type AnvilMineHandler = (params: AnvilMineParams) => Promise<AnvilMineResult>;
type AnvilResetHandler = (params: AnvilResetParams) => Promise<AnvilResetResult>;
type AnvilDropTransactionHandler = (params: AnvilDropTransactionParams) => Promise<AnvilDropTransactionResult>;
type AnvilSetBalanceHandler = (params: AnvilSetBalanceParams) => Promise<AnvilSetBalanceResult>;
type AnvilSetCodeHandler = (params: AnvilSetCodeParams) => Promise<AnvilSetCodeResult>;
type AnvilSetNonceHandler = (params: AnvilSetNonceParams) => Promise<AnvilSetNonceResult>;
type AnvilSetStorageAtHandler = (params: AnvilSetStorageAtParams) => Promise<AnvilSetStorageAtResult>;
type AnvilSetChainIdHandler = (params: AnvilSetChainIdParams) => Promise<AnvilSetChainIdResult>;
type AnvilDumpStateHandler = (params: AnvilDumpStateParams) => Promise<AnvilDumpStateResult>;
type AnvilLoadStateHandler = (params: AnvilLoadStateParams) => Promise<AnvilLoadStateResult>;
type AnvilDealHandler = (params: AnvilDealParams) => Promise<AnvilDealResult>;
type JsonSerializable = bigint | string | number | boolean | null | JsonSerializableArray | JsonSerializableObject | JsonSerializableSet | (Error & {
code: number | string;
});
type JsonSerializableArray = ReadonlyArray<JsonSerializable>;
type JsonSerializableObject = {
[key: string]: JsonSerializable;
};
type JsonSerializableSet<T extends bigint | string | number | boolean = bigint | string | number | boolean> = Set<T>;
type BigIntToHex<T> = T extends bigint ? Hex$1 : T;
type SetToHex<T> = T extends Set<any> ? Hex$1 : T;
type SerializeToJson<T> = T extends Error & {
code: infer TCode;
} ? {
code: TCode;
message: T['message'];
} : T extends JsonSerializableSet<infer S> ? ReadonlyArray<S> : T extends JsonSerializableObject ? {
[P in keyof T]: SerializeToJson<T[P]>;
} : T extends JsonSerializableArray ? SerializeToJson<T[number]>[] : BigIntToHex<SetToHex<T>>;
/**
* JSON-RPC request for `anvil_impersonateAccount` method
*/
type AnvilImpersonateAccountJsonRpcRequest = JsonRpcRequest<'anvil_impersonateAccount', readonly [Address$1]>;
/**
* JSON-RPC request for `anvil_stopImpersonatingAccount` method
*/
type AnvilStopImpersonatingAccountJsonRpcRequest = JsonRpcRequest<'anvil_stopImpersonatingAccount', readonly [Address$1]>;
/**
* JSON-RPC request for `anvil_autoImpersonateAccount` method
* Not included atm because tevm_call supports it and i was getting methodNotFound errors trying it in anvil
*/
/**
* JSON-RPC request for `anvil_getAutomine` method
*/
type AnvilGetAutomineJsonRpcRequest = JsonRpcRequest<'anvil_getAutomine', [
SerializeToJson<AnvilGetAutomineParams>
]>;
/**
* JSON-RPC request for `anvil_setCoinbase` method
* Not included atm because tevm_call supports it and i was getting methodNotFound errors trying it in anvil
*/
type AnvilSetCoinbaseJsonRpcRequest = JsonRpcRequest<'anvil_setCoinbase', readonly [Address$1]>;
/**
* JSON-RPC request for `anvil_mine` method
*/
type AnvilMineJsonRpcRequest = JsonRpcRequest<'anvil_mine', readonly [blockCount: Hex$1, interval: Hex$1]>;
/**
* JSON-RPC request for `anvil_reset` method
*/
type AnvilResetJsonRpcRequest = JsonRpcRequest<'anvil_reset', readonly []>;
/**
* JSON-RPC request for `anvil_dropTransaction` method
*/
type AnvilDropTransactionJsonRpcRequest = JsonRpcRequest<'anvil_dropTransaction', [
SerializeToJson<AnvilDropTransactionParams>
]>;
/**
* JSON-RPC request for `anvil_setBalance` method
*/
type AnvilSetBalanceJsonRpcRequest = JsonRpcRequest<'anvil_setBalance', readonly [address: Address$1, balance: Hex$1]>;
/**
* JSON-RPC request for `anvil_setCode` method
*/
type AnvilSetCodeJsonRpcRequest = JsonRpcRequest<'anvil_setCode', readonly [account: Address$1, deployedBytecode: Hex$1]>;
/**
* JSON-RPC request for `anvil_setNonce` method
*/
type AnvilSetNonceJsonRpcRequest = JsonRpcRequest<'anvil_setNonce', readonly [address: Address$1, nonce: Hex$1]>;
/**
* JSON-RPC request for `anvil_setStorageAt` method
*/
type AnvilSetStorageAtJsonRpcRequest = JsonRpcRequest<'anvil_setStorageAt', [
address: Address$1,
slot: Hex$1,
value: Hex$1
]>;
/**
* JSON-RPC request for `anvil_setChainId` method
*/
type AnvilSetChainIdJsonRpcRequest = JsonRpcRequest<'anvil_setChainId', readonly [Hex$1]>;
/**
* JSON-RPC request for `anvil_dumpState` method
*/
type AnvilDumpStateJsonRpcRequest = JsonRpcRequest<'anvil_dumpState', readonly [SerializeToJson<AnvilDumpStateParams>]>;
/**
* JSON-RPC request for `anvil_loadState` method
*/
type AnvilLoadStateJsonRpcRequest = JsonRpcRequest<'anvil_loadState', readonly [SerializeToJson<AnvilLoadStateParams>]>;
/**
* JSON-RPC request for `anvil_deal` method
*/
type AnvilDealJsonRpcRequest = JsonRpcRequest<'anvil_deal', [SerializeToJson<AnvilDealParams>]>;
type AnvilJsonRpcRequest = AnvilImpersonateAccountJsonRpcRequest | AnvilStopImpersonatingAccountJsonRpcRequest | AnvilGetAutomineJsonRpcRequest | AnvilMineJsonRpcRequest | AnvilResetJsonRpcRequest | AnvilDropTransactionJsonRpcRequest | AnvilSetBalanceJsonRpcRequest | AnvilSetCodeJsonRpcRequest | AnvilSetNonceJsonRpcRequest | AnvilSetStorageAtJsonRpcRequest | AnvilSetChainIdJsonRpcRequest | AnvilDumpStateJsonRpcRequest | AnvilLoadStateJsonRpcRequest | AnvilSetCoinbaseJsonRpcRequest | AnvilDealJsonRpcRequest;
type AnvilError = string;
/**
* JSON-RPC response for `anvil_impersonateAccount` procedure
*/
type AnvilImpersonateAccountJsonRpcResponse = JsonRpcResponse<'anvil_impersonateAccount', SerializeToJson<AnvilImpersonateAccountResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_stopImpersonatingAccount` procedure
*/
type AnvilStopImpersonatingAccountJsonRpcResponse = JsonRpcResponse<'anvil_stopImpersonatingAccount', SerializeToJson<AnvilStopImpersonatingAccountResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setCoinbase` procedure
*/
type AnvilSetCoinbaseJsonRpcResponse = JsonRpcResponse<'anvil_setCoinbase', Address$1, AnvilError>;
/**
* JSON-RPC response for `anvil_autoImpersonateAccount` procedure
* Not included atm because tevm_call supports it and i was getting methodNotFound errors trying it in anvil
*/
/**
* JSON-RPC response for `anvil_getAutomine` procedure
*/
type AnvilGetAutomineJsonRpcResponse = JsonRpcResponse<'anvil_getAutomine', SerializeToJson<AnvilGetAutomineResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_mine` procedure
*/
type AnvilMineJsonRpcResponse = JsonRpcResponse<'anvil_mine', SerializeToJson<AnvilMineResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_reset` procedure
*/
type AnvilResetJsonRpcResponse = JsonRpcResponse<'anvil_reset', SerializeToJson<AnvilResetResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_dropTransaction` procedure
*/
type AnvilDropTransactionJsonRpcResponse = JsonRpcResponse<'anvil_dropTransaction', SerializeToJson<AnvilDropTransactionResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setBalance` procedure
*/
type AnvilSetBalanceJsonRpcResponse = JsonRpcResponse<'anvil_setBalance', SerializeToJson<AnvilSetBalanceResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setCode` procedure
*/
type AnvilSetCodeJsonRpcResponse = JsonRpcResponse<'anvil_setCode', SerializeToJson<AnvilSetCodeResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setNonce` procedure
*/
type AnvilSetNonceJsonRpcResponse = JsonRpcResponse<'anvil_setNonce', SerializeToJson<AnvilSetNonceResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setStorageAt` procedure
*/
type AnvilSetStorageAtJsonRpcResponse = JsonRpcResponse<'anvil_setStorageAt', SerializeToJson<AnvilSetStorageAtResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_setChainId` procedure
*/
type AnvilSetChainIdJsonRpcResponse = JsonRpcResponse<'anvil_setChainId', SerializeToJson<AnvilSetChainIdResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_dumpState` procedure
*/
type AnvilDumpStateJsonRpcResponse = JsonRpcResponse<'anvil_dumpState', SerializeToJson<AnvilDumpStateResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_loadState` procedure
*/
type AnvilLoadStateJsonRpcResponse = JsonRpcResponse<'anvil_loadState', SerializeToJson<AnvilLoadStateResult>, AnvilError>;
/**
* JSON-RPC response for `anvil_deal` procedure
*/
type AnvilDealJsonRpcResponse = JsonRpcResponse<'anvil_deal', SerializeToJson<AnvilDealResult>, AnvilError>;
type AnvilSetCoinbaseProcedure = (request: AnvilSetCoinbaseJsonRpcRequest) => Promise<AnvilSetCoinbaseJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_impersonateAccount`
*/
type AnvilImpersonateAccountProcedure = (request: AnvilImpersonateAccountJsonRpcRequest) => Promise<AnvilImpersonateAccountJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_stopImpersonatingAccount`
*/
type AnvilStopImpersonatingAccountProcedure = (request: AnvilStopImpersonatingAccountJsonRpcRequest) => Promise<AnvilStopImpersonatingAccountJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_autoImpersonateAccount`
* Not included atm because tevm_call supports it and i was getting methodNotFound errors trying it in anvil
*/
/**
* JSON-RPC procedure for `anvil_getAutomine`
*/
type AnvilGetAutomineProcedure = (request: AnvilGetAutomineJsonRpcRequest) => Promise<AnvilGetAutomineJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_mine`
*/
type AnvilMineProcedure = (request: AnvilMineJsonRpcRequest) => Promise<AnvilMineJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_reset`
*/
type AnvilResetProcedure = (request: AnvilResetJsonRpcRequest) => Promise<AnvilResetJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_dropTransaction`
*/
type AnvilDropTransactionProcedure = (request: AnvilDropTransactionJsonRpcRequest) => Promise<AnvilDropTransactionJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_setBalance`
*/
type AnvilSetBalanceProcedure = (request: AnvilSetBalanceJsonRpcRequest) => Promise<AnvilSetBalanceJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_setCode`
*/
type AnvilSetCodeProcedure = (request: AnvilSetCodeJsonRpcRequest) => Promise<AnvilSetCodeJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_setNonce`
*/
type AnvilSetNonceProcedure = (request: AnvilSetNonceJsonRpcRequest) => Promise<AnvilSetNonceJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_setStorageAt`
*/
type AnvilSetStorageAtProcedure = (request: AnvilSetStorageAtJsonRpcRequest) => Promise<AnvilSetStorageAtJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_setChainId`
*/
type AnvilSetChainIdProcedure = (request: AnvilSetChainIdJsonRpcRequest) => Promise<AnvilSetChainIdJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_dumpState`
*/
type AnvilDumpStateProcedure = (request: AnvilDumpStateJsonRpcRequest) => Promise<AnvilDumpStateJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_loadState`
*/
type AnvilLoadStateProcedure = (request: AnvilLoadStateJsonRpcRequest) => Promise<AnvilLoadStateJsonRpcResponse>;
/**
* JSON-RPC procedure for `anvil_deal`
*/
type AnvilDealProcedure = (request: AnvilDealJsonRpcRequest) => Promise<AnvilDealJsonRpcResponse>;
type AnvilProcedure = AnvilSetCoinbaseProcedure | AnvilImpersonateAccountProcedure | AnvilStopImpersonatingAccountProcedure | AnvilGetAutomineProcedure | AnvilMineProcedure | AnvilResetProcedure | AnvilDropTransactionProcedure | AnvilSetBalanceProcedure | AnvilSetCodeProcedure | AnvilSetNonceProcedure | AnvilSetStorageAtProcedure | AnvilSetChainIdProcedure | AnvilDumpStateProcedure | AnvilLoadStateProcedure | AnvilDealProcedure;
declare function dealHandler(node: _tevm_node.TevmNode): AnvilDealHandler;
declare function anvilDealJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilDealProcedure;
declare function anvilDropTransactionJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilDropTransactionProcedure;
declare function anvilDumpStateJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilDumpStateProcedure;
declare function anvilGetAutomineJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilGetAutomineProcedure;
declare function anvilImpersonateAccountJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilImpersonateAccountProcedure;
declare function anvilLoadStateJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilLoadStateProcedure;
declare function anvilResetJsonRpcProcedure(node: _tevm_node.TevmNode): AnvilResetProcedure;
declare function anvilSetBalanceJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetBalanceProcedure;
declare function anvilSetChainIdJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetChainIdProcedure;
declare function anvilSetCodeJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetCodeProcedure;
declare function anvilSetCoinbaseJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetCoinbaseProcedure;
declare function anvilSetNonceJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetNonceProcedure;
declare function anvilSetStorageAtJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilSetStorageAtProcedure;
declare function anvilStopImpersonatingAccountJsonRpcProcedure(client: _tevm_node.TevmNode): AnvilStopImpersonatingAccountProcedure;
/**
* The base parameters shared across all actions
*/
type BaseParams<TThrowOnFail extends boolean = boolean> = {
/**
* Whether to throw on errors or return errors as value on the 'errors' property
* Defaults to `true`
*/
readonly throwOnFail?: TThrowOnFail;
};
/**
* Properties shared across call-like params.
* This type is used as the base for various call-like parameter types:
* - [CallParams](https://tevm.sh/reference/tevm/actions/type-aliases/callparams-1/)
* - [ContractParams](https://tevm.sh/reference/tevm/actions/type-aliases/contractparams-1/)
* - [DeployParams](https://tevm.sh/reference/tevm/actions/type-aliases/deployparams-1/)
* - [ScriptParams](https://tevm.sh/reference/tevm/actions/type-aliases/scriptparams-1/)
*
* @extends BaseParams
* @example
* ```typescript
* import { BaseCallParams } from 'tevm'
*
* const params: BaseCallParams = {
* createTrace: true,
* createAccessList: true,
* createTransaction: 'on-success',
* blockTag: 'latest',
* skipBalance: true,
* gas: 1000000n,
* gasPrice: 1n,
* maxFeePerGas: 1n,
* maxPriorityFeePerGas: 1n,
* gasRefund: 0n,
* from: '0x123...',
* origin: '0x123...',
* caller: '0x123...',
* value: 0n,
* depth: 0,
* to: '0x123...',
* }
* ```
*/
type BaseCallParams<TThrowOnFail extends boolean = boolean> = BaseParams<TThrowOnFail> & {
/**
* Whether to return a complete trace with the call.
* Defaults to `false`.
* @example
* ```ts
* import { createMemoryClient } from 'tevm'
*
* const client = createMemoryClient()
*
* const { trace } = await client.call({ address: '0x1234', data: '0x1234', createTrace: true })
*
* trace.structLogs.forEach(console.log)
* ```
*/
readonly createTrace?: boolean;
/**
* Whether to return an access list mapping of addresses to storage keys.
* Defaults to `false`.
* @example
* ```ts
* import { createMemoryClient } from 'tevm'
*
* const client = createMemoryClient()
*
* const { accessList } = await client.tevmCall({ to: '0x1234...', data: '0x1234', createAccessList: true })
* console.log(accessList) // { "0x...": Set(["0x..."]) }
* ```
*/
readonly createAccessList?: boolean;
/**
* @deprecated Use `addToMempool` or `addToBlockchain` instead.
* Whether or not to update the state or run the call in a dry-run. Defaults to `never`.
* - `on-success`: Only update the state if the call is successful.
* - `always`: Always include the transaction even if it reverts.
* - `never`: Never include the transaction.
* - `true`: Alias for `on-success`.
* - `false`: Alias for `never`.
*
* @example
* ```typescript
* // Deprecated approach
* const { txHash } = await client.call({ address: '0x1234', data: '0x1234', createTransaction: 'on-success' })
* await client.mine()
* const receipt = await client.getTransactionReceipt({ hash: txHash })
*
* // New approach
* const { txHash } = await client.call({ address: '0x1234', data: '0x1234', addToMempool: true })
* await client.mine()
* const receipt = await client.getTransactionReceipt({ hash: txHash })
*
* // Or automatically mine the transaction
* const { txHash } = await client.call({ address: '0x1234', data: '0x1234', addToBlockchain: true })
* const receipt = await client.getTransactionReceipt({ hash: txHash })
* ```
*/
readonly createTransaction?: 'on-success' | 'always' | 'never' | boolean;
/**
* Whether to add the transaction to the mempool. Defaults to `false`.
* - `on-success`: Only add the transaction to the mempool if the call is successful.
* - `always`: Always add the transaction to the mempool even if it reverts.
* - `never`: Never add the transaction to the mempool.
* - `true`: Alias for `on-success`.
* - `false`: Alias for `never`.
*
* This does NOT automatically mine the transaction. To include the transaction in a block,
* you must call `client.mine()` afterward or use `addToBlockchain: true`.
*
* @example
* ```typescript
* const { txHash } = await client.call({ address: '0x1234', data: '0x1234', addToMempool: true })
* await client.mine()
* const receipt = await client.getTransactionReceipt({ hash: txHash })
* ```
*/
readonly addToMempool?: 'on-success' | 'always' | 'never' | boolean;
/**
* Whether to add the transaction to the blockchain (mine it immediately). Defaults to `false`.
* - `on-success`: Only add the transaction to the blockchain if the call is successful.
* - `always`: Always add the transaction to the blockchain even if it reverts.
* - `never`: Never add the transaction to the blockchain.
* - `true`: Alias for `on-success`.
* - `false`: Alias for `never`.
*
* This automatically adds the transaction to the mempool AND mines it.
* It only mines the current transaction, not any other transactions in the mempool.
*
* @example
* ```typescript
* const { txHash } = await client.call({ address: '0x1234', data: '0x1234', addToBlockchain: true })
* const receipt = await client.getTransactionReceipt({ hash: txHash })
* ```
*/
readonly addToBlockchain?: 'on-success' | 'always' | 'never' | boolean;
/**
* The block number or block tag to execute the call at. Defaults to `latest`.
* - `bigint`: The block number to execute the call at.
* - `Hex`: The block hash to execute the call at.
* - `BlockTag`: The named block tag to execute the call at.
*
* Notable block tags:
* - 'latest': The canonical head.
* - 'pending': A block that is optimistically built with transactions in the txpool that have not yet been mined.
* - 'forked': If forking, the 'forked' block will be the block the chain was forked at.
*/
readonly blockTag?: BlockParam;
/**
* Whether to skip the balance check. Defaults to `false`, except for scripts where it is set to `true`.
*/
readonly skipBalance?: boolean;
/**
* The gas limit for the call.
* Defaults to the block gas limit as specified by the common configuration or the fork URL.
*/
readonly gas?: bigint;
/**
* The gas price for the call.
* Note: This option is currently ignored when creating transactions because only EIP-1559 transactions are supported. This will be fixed in a future release.
*/
readonly gasPrice?: bigint;
/**
* The maximum fee per gas for EIP-1559 transactions.
*/
readonly maxFeePerGas?: bigint;
/**
* The maximum priority fee per gas for EIP-1559 transactions.
*/
readonly maxPriorityFeePerGas?: bigint;
/**
* The refund counter. Defaults to `0`.
*/
readonly gasRefund?: bigint;
/**
* The from address for the call. Defaults to the zero address for reads and the first account for writes.
* It is also possible to set the `origin` and `caller` addresses separately using those options. Otherwise, both are set to the `from` address.
*/
readonly from?: Address;
/**
* The nonce for the transaction. If provided, this nonce will be used instead of automatically calculating the next available nonce.
* This is useful when you want to replace a pending transaction or ensure a specific nonce is used.
*/
readonly nonce?: bigint;
/**
* The address where the call originated from. Defaults to the zero address.
* If the `from` address is set, it defaults to the `from` address; otherwise, it defaults to the zero address.
*/
readonly origin?: Address;
/**
* The address that ran this code (`msg.sender`). Defaults to the zero address.
* If the `from` address is set, it defaults to the `from` address; otherwise, it defaults to the zero address.
*/
readonly caller?: Address;
/**
* The value in ether that is being sent to the `to` address. Defaults to `0`.
*/
readonly value?: bigint;
/**
* The depth of the EVM call. Useful for simulating an internal call. Defaults to `0`.
*/
readonly depth?: number;
/**
* Addresses to selfdestruct. Defaults to an empty set.
*/
readonly selfdestruct?: Set<Address>;
/**
* The address of the account executing this code (`address(this)`). Defaults to the zero address.
* This is not set for create transactions but is required for most transactions.
*/
readonly to?: Address;
/**
* Versioned hashes for each blob in a blob transaction for EIP-4844 transactions.
*/
readonly blobVersionedHashes?: Hex[];
/**
* The state override set is an optional address-to-state mapping where each entry specifies some state to be ephemerally overridden prior to executing the call. Each address maps to an object containing:
* This option cannot be used when `createTransaction` is set to `true`.
*
* @example
* ```ts
* const stateOverride = {
* "0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3": {
* balance: "0xde0b6b3a7640000"
* },
* "0xebe8efa441b9302a0d7eaecc277c09d20d684540": {
* code: "0x...",
* state: {
* "0x...": "0x..."
* }
* }
* }
* const res = await client.call({ address: '0x1234', data: '0x1234', stateOverrideSet: stateOverride })
* ```
*/
readonly stateOverrideSet?: StateOverrideSet;
/**
* The fields of this optional object customize the block as part of which the call is simulated.
* The object contains fields such as block number, hash, parent hash, nonce, etc.
* This option cannot be used when `createTransaction` is set to `true`.
* Setting the block number to a past block will not run in the context of that block's state. To do that, fork that block number first.
*
* @example
* ```ts
* const blockOverride = {
* number: "0x1b4",
* hash: "0x...",
* parentHash: "0x...",
* nonce: "0x0000000000000042",
* }
* const res = await client.call({ address: '0x1234', data: '0x1234', blockOverrideSet: blockOverride })
* ```
*/
readonly blockOverrideSet?: BlockOverrideSet;
};
declare function validateBaseCallParams(action: BaseCallParams): ValidateBaseCallParamsError[];
type ValidateBaseCallParamsError = InvalidParamsError | InvalidSkipBalanceError | InvalidGasRefundError | InvalidBlockError | InvalidGasPriceError | InvalidOriginError | InvalidCallerError | InvalidDepthError | InvalidBlobVersionedHashesError | InvalidAddToMempoolError | InvalidAddToBlockchainError;
declare const zBaseCallParams: z.ZodObject<{
throwOnFail: z.ZodOptional<z.ZodBoolean>;
createTrace: z.ZodOptional<z.ZodBoolean>;
createAccessList: z.ZodOptional<z.ZodBoolean>;
createTransaction: z.ZodUnion<readonly [z.ZodOptional<z.ZodBoolean>, z.ZodLiteral<"on-success">, z.ZodLiteral<"always">, z.ZodLiteral<"never">]>;
addToMempool: z.ZodUnion<readonly [z.ZodOptional<z.ZodBoolean>, z.ZodLiteral<"on-success">, z.ZodLiteral<"always">, z.ZodLiteral<"never">]>;
addToBlockchain: z.ZodUnion<readonly [z.ZodOptional<z.ZodBoolean>, z.ZodLiteral<"on-success">, z.ZodLiteral<"always">, z.ZodLiteral<"never">]>;
skipBalance: z.ZodOptional<z.ZodBoolean>;
gasRefund: z.ZodOptional<z.ZodBigInt>;
blockTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"latest">, z.ZodLiteral<"earliest">, z.ZodLiteral<"pending">, z.ZodLiteral<"safe">, z.ZodLiteral<"finalized">, z.ZodBigInt, z.ZodPipe<z.ZodNumber, z.ZodTransform<bigint, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>]>>;
gasPrice: z.ZodOptional<z.ZodBigInt>;
origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
caller: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
gas: z.ZodOptional<z.ZodBigInt>;
value: z.ZodOptional<z.ZodBigInt>;
depth: z.ZodOptional<z.ZodNumber>;
selfdestruct: z.ZodOptional<z.ZodSet<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
to: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
blobVersionedHashes: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
stateOverrideSet: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodObject<{
balance: z.ZodOptional<z.ZodBigInt>;
nonce: z.ZodOptional<z.ZodBigInt>;
code: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
state: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
stateDiff: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
}, z.core.$strict>>>;
blockOverrideSet: z.ZodOptional<z.ZodObject<{
number: z.ZodOptional<z.ZodBigInt>;
time: z.ZodOptional<z.ZodBigInt>;
gasLimit: z.ZodOptional<z.ZodBigInt>;
coinbase: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
baseFee: z.ZodOptional<z.ZodBigInt>;
blobBaseFee: z.ZodOptional<z.ZodBigInt>;
}, z.core.$strict>>;
maxFeePerGas: z.ZodOptional<z.ZodBigInt>;
maxPriorityFeePerGas: z.ZodOptional<z.ZodBigInt>;
onStep: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
onNewContract: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
onBeforeMessage: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
onAfterMessage: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
}, z.core.$strip>;
/**
* TEVM parameters to execute a call on the VM.
* `Call` is the lowest level method to interact with the VM, and other methods such as `contract` and `script` use `call` under the hood.
*
* @example
* ```typescript
* import { createClient } from 'viem'
* import { createTevmTransport, tevmCall } from 'tevm'
* import { optimism } from 'tevm/common'
*
* const client = createClient({
* transport: createTevmTransport({}),
* chain: optimism,
* })
*
* const callParams = {
* data: '0x...',
* bytecode: '0x...',
* gasLimit: 420n,
* }
*
* await tevmCall(client, callParams)
* ```
*
* @see [BaseCallParams](https://tevm.sh/reference/tevm/actions/type-aliases/basecallparams-1/)
* @see [tevmCall](https://tevm.sh/reference/tevm/memory-client/functions/tevmCall/)
*/
type CallParams<TThrowOnFail extends boolean = boolean> = BaseCallParams<TThrowOnFail> & {
/**
* An optional CREATE2 salt.
*
* @example
* ```typescript
* import { createClient } from 'viem'
* import { createTevmTransport, tevmCall } from 'tevm'
* import { optimism } from 'tevm/common'
*
* const client = createClient({
* transport: createTevmTransport({}),
* chain: optimism,
* })
*
* const callParams = {
* data: '0x...',
* bytecode: '0x...',
* gasLimit: 420n,
* salt: '0x1234...',
* }
*
* await tevmCall(client, callParams)
* ```
*
* @see [CREATE2](https://eips.ethereum.org/EIPS/eip-1014)
*/
readonly salt?: Hex;
/**
* The input data for the call.
*/
readonly data?: Hex;
/**
* The encoded code to deploy with for a deployless call. Code is encoded with constructor arguments, unlike `deployedBytecode`.
*
* @example
* ```typescript
* import { createClient } from 'viem'
* import { createTevmTransport, tevmCall, encodeDeployData } from 'tevm'
* import { optimism } from 'tevm/common'
*
* const client = createClient({
* transport: createTevmTransport({}),
* chain: optimism,
* })
*
* const callParams = {
* createTransaction: true,
* data: encodeDeployData({
* bytecode: '0x...',
* data: '0x...',
* abi: [{.