@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 documentationSince
0.0.0Properties
[brand]
Defined in: src/primitives/CallTrace/CallTraceType.ts:13readonly[brand]:"CallTrace"
calls?
Defined in: src/primitives/CallTrace/CallTraceType.ts:42 Nested calls made by this callreadonlyoptionalcalls: readonlyCallTraceType[]
error?
Defined in: src/primitives/CallTrace/CallTraceType.ts:38 Error message if call failedreadonlyoptionalerror:string
from
Defined in: src/primitives/CallTrace/CallTraceType.ts:24 Caller addressreadonlyfrom:AddressType
gas
Defined in: src/primitives/CallTrace/CallTraceType.ts:30 Gas provided to this callreadonlygas:Type
gasUsed
Defined in: src/primitives/CallTrace/CallTraceType.ts:32 Gas actually used by this callreadonlygasUsed:Type
input
Defined in: src/primitives/CallTrace/CallTraceType.ts:34 Input data (calldata or init code)readonlyinput:Uint8Array
output
Defined in: src/primitives/CallTrace/CallTraceType.ts:36 Return data or deployed codereadonlyoutput:Uint8Array
revertReason?
Defined in: src/primitives/CallTrace/CallTraceType.ts:40 Decoded revert reason (from Error(string) or Panic(uint256))readonlyoptionalrevertReason:string
to?
Defined in: src/primitives/CallTrace/CallTraceType.ts:26 Callee address (undefined for CREATE/CREATE2 before completion)readonlyoptionalto:AddressType
type
Defined in: src/primitives/CallTrace/CallTraceType.ts:15 Call typereadonlytype:"CALL"|"STATICCALL"|"DELEGATECALL"|"CALLCODE"|"CREATE"|"CREATE2"|"SELFDESTRUCT"
value?
Defined in: src/primitives/CallTrace/CallTraceType.ts:28 Call value in weireadonlyoptionalvalue:Type
Functions
_flatten()
_flatten(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 ordertrace):CallTraceType[]
Parameters
trace
CallTraceType
Root call trace
Returns
CallTraceType[]
Flat array of all calls (including root)
Example
_from()
_from(Defined in: src/primitives/CallTrace/from.js:31 Creates a CallTrace from raw datadata):CallTraceType
Parameters
data
CallTrace datacalls?
readonlyCallTraceType[]
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(Defined in: src/primitives/CallTrace/getCalls.js:13 Gets nested calls from a CallTracetrace): readonlyCallTraceType[]
Parameters
trace
CallTraceType
CallTrace to extract calls from
Returns
readonlyCallTraceType[]
Nested calls (empty array if none)
Example
_hasError()
_hasError(Defined in: src/primitives/CallTrace/hasError.js:14 Checks if a CallTrace has an errortrace):boolean
Parameters
trace
CallTraceType
CallTrace to check
Returns
boolean
True if call failed
Example
flatten()
flatten(Defined in: src/primitives/CallTrace/index.ts:73 Flattens a call tree into a linear listtrace):CallTraceType[]
Parameters
trace
CallTraceType
Root call trace
Returns
CallTraceType[]
Flat array of all calls
Example
from()
from(Defined in: src/primitives/CallTrace/index.ts:26 Creates a CallTrace from raw datadata):CallTraceType
Parameters
data
Omit<CallTraceType, brand>
CallTrace data
Returns
CallTraceType
CallTrace instance
See
https://voltaire.tevm.sh/primitives/call-trace for CallTrace documentationSince
0.0.0Example
getCalls()
getCalls(Defined in: src/primitives/CallTrace/index.ts:43 Gets nested calls from a CallTracetrace): readonlyCallTraceType[]
Parameters
trace
CallTraceType
CallTrace to extract calls from
Returns
readonlyCallTraceType[]
Nested calls
Example
hasError()
hasError(Defined in: src/primitives/CallTrace/index.ts:58 Checks if a CallTrace has an errortrace):boolean
Parameters
trace
CallTraceType
CallTrace to check
Returns
boolean
True if call failed

