Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/CallTrace

primitives/CallTrace

Type Aliases

CallTraceType

CallTraceType = object
Defined in: src/primitives/CallTrace/CallTraceType.ts:12 Call tree structure from callTracer Represents a single call (or create) and its nested subcalls

See

https://voltaire.tevm.sh/primitives/call-trace for CallTrace documentation

Since

0.0.0

Properties

[brand]
readonly [brand]: "CallTrace"
Defined in: src/primitives/CallTrace/CallTraceType.ts:13
calls?
readonly optional calls: readonly CallTraceType[]
Defined in: src/primitives/CallTrace/CallTraceType.ts:42 Nested calls made by this call
error?
readonly optional error: string
Defined in: src/primitives/CallTrace/CallTraceType.ts:38 Error message if call failed
from
readonly from: AddressType
Defined in: src/primitives/CallTrace/CallTraceType.ts:24 Caller address
gas
readonly gas: Type
Defined in: src/primitives/CallTrace/CallTraceType.ts:30 Gas provided to this call
gasUsed
readonly gasUsed: Type
Defined in: src/primitives/CallTrace/CallTraceType.ts:32 Gas actually used by this call
input
readonly input: Uint8Array
Defined in: src/primitives/CallTrace/CallTraceType.ts:34 Input data (calldata or init code)
output
readonly output: Uint8Array
Defined in: src/primitives/CallTrace/CallTraceType.ts:36 Return data or deployed code
revertReason?
readonly optional revertReason: string
Defined in: src/primitives/CallTrace/CallTraceType.ts:40 Decoded revert reason (from Error(string) or Panic(uint256))
to?
readonly optional to: AddressType
Defined in: src/primitives/CallTrace/CallTraceType.ts:26 Callee address (undefined for CREATE/CREATE2 before completion)
type
readonly type: "CALL" | "STATICCALL" | "DELEGATECALL" | "CALLCODE" | "CREATE" | "CREATE2" | "SELFDESTRUCT"
Defined in: src/primitives/CallTrace/CallTraceType.ts:15 Call type
value?
readonly optional value: Type
Defined in: src/primitives/CallTrace/CallTraceType.ts:28 Call value in wei

Functions

_flatten()

_flatten(trace): CallTraceType[]
Defined in: src/primitives/CallTrace/flatten.js:14 Flattens a call tree into a linear list of all calls Useful for analyzing all calls in execution order

Parameters

trace
CallTraceType Root call trace

Returns

CallTraceType[] Flat array of all calls (including root)

Example


_from()

_from(data): CallTraceType
Defined in: src/primitives/CallTrace/from.js:31 Creates a CallTrace from raw data

Parameters

data
CallTrace data
calls?
readonly CallTraceType[] Nested calls
error?
string Error message
from
AddressType Caller address
gas
Type Gas provided
gasUsed
Type Gas used
input
Uint8Array<ArrayBufferLike> Input data
output
Uint8Array<ArrayBufferLike> Output data
revertReason?
string Decoded revert reason
to?
AddressType Callee address
type
"CALL" | "STATICCALL" | "DELEGATECALL" | "CALLCODE" | "CREATE" | "CREATE2" | "SELFDESTRUCT" Call type
value?
Type Call value

Returns

CallTraceType CallTrace instance

Example


_getCalls()

_getCalls(trace): readonly CallTraceType[]
Defined in: src/primitives/CallTrace/getCalls.js:13 Gets nested calls from a CallTrace

Parameters

trace
CallTraceType CallTrace to extract calls from

Returns

readonly CallTraceType[] Nested calls (empty array if none)

Example


_hasError()

_hasError(trace): boolean
Defined in: src/primitives/CallTrace/hasError.js:14 Checks if a CallTrace has an error

Parameters

trace
CallTraceType CallTrace to check

Returns

boolean True if call failed

Example


flatten()

flatten(trace): CallTraceType[]
Defined in: src/primitives/CallTrace/index.ts:73 Flattens a call tree into a linear list

Parameters

trace
CallTraceType Root call trace

Returns

CallTraceType[] Flat array of all calls

Example


from()

from(data): CallTraceType
Defined in: src/primitives/CallTrace/index.ts:26 Creates a CallTrace from raw data

Parameters

data
Omit<CallTraceType, brand> CallTrace data

Returns

CallTraceType CallTrace instance

See

https://voltaire.tevm.sh/primitives/call-trace for CallTrace documentation

Since

0.0.0

Example


getCalls()

getCalls(trace): readonly CallTraceType[]
Defined in: src/primitives/CallTrace/index.ts:43 Gets nested calls from a CallTrace

Parameters

trace
CallTraceType CallTrace to extract calls from

Returns

readonly CallTraceType[] Nested calls

Example


hasError()

hasError(trace): boolean
Defined in: src/primitives/CallTrace/index.ts:58 Checks if a CallTrace has an error

Parameters

trace
CallTraceType CallTrace to check

Returns

boolean True if call failed

Example