Skip to main content

starknet_traceTransaction RPC Method

Returns the execution trace of the transaction designated by the input hash.

Updated on
Mar 18, 2024

Parameters

transaction_hash
string
REQUIRED

The hash of the requested transaction

Returns

result
object

The transaction's trace, which can be one of the following objects

INVOKE_TXN_TRACE
object

The execution trace of an invoke transaction, which contains the following fields

validate_invocation
object

(Optional) The trace of the validate call, omitted when SKIP_VALIDATE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

execute_invocation
object

The trace of the execute call. If the transaction reverted, this is an object with a single 'revert_reason' field instead

revert_reason
string

The revert reason, returned in place of the invocation fields when the execution reverted

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

fee_transfer_invocation
object

(Optional) The trace of the fee transfer, omitted when SKIP_FEE_CHARGE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

execution_resources
object

The resources consumed by the transaction, including from L1 handler and validation

l1_gas
integer

The L1 gas consumed by the transaction

l1_data_gas
integer

The L1 data gas consumed by the transaction

l2_gas
integer

The L2 gas consumed by the transaction

state_diff
object

The state diff produced by the transaction, which contains the following fields

declared_classes
array

The declared class hash and compiled class hash

class_hash
string

The hash of the declared class

compiled_class_hash
string

The Cairo assembly hash corresponding to the declared class

deployed_contracts
array

The contracts deployed as part of the state update

address
string

The address of the contract

class_hash
string

The hash of the contract code

deprecated_declared_classes
array

The hashes of the declared deprecated (Cairo 0) classes

nonces
array

The updated nonce per contract address

contract_address
string

The address of the contract

nonce
string

The nonce for the given address at the end of the block

replaced_classes
array

The list of contracts whose class was replaced

class_hash
string

The new class hash

contract_address
string

The address of the contract whose class was replaced

storage_diffs
array

The storage updates per contract address

address
string

The address of the contract whose storage was updated

storage_entries
array

The changed storage entries, each with a 'key' and a 'value'

type
string

The type of the traced transaction. It can take only one value - 'INVOKE'

DECLARE_TXN_TRACE
object

The execution trace of a declare transaction, which contains the following fields

validate_invocation
object

(Optional) The trace of the validate call, omitted when SKIP_VALIDATE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

fee_transfer_invocation
object

(Optional) The trace of the fee transfer, omitted when SKIP_FEE_CHARGE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

execution_resources
object

The resources consumed by the transaction, including from L1 handler and validation

l1_gas
integer

The L1 gas consumed by the transaction

l1_data_gas
integer

The L1 data gas consumed by the transaction

l2_gas
integer

The L2 gas consumed by the transaction

state_diff
object

The state diff produced by the transaction, which contains the following fields

declared_classes
array

The declared class hash and compiled class hash

class_hash
string

The hash of the declared class

compiled_class_hash
string

The Cairo assembly hash corresponding to the declared class

deployed_contracts
array

The contracts deployed as part of the state update

address
string

The address of the contract

class_hash
string

The hash of the contract code

deprecated_declared_classes
array

The hashes of the declared deprecated (Cairo 0) classes

nonces
array

The updated nonce per contract address

contract_address
string

The address of the contract

nonce
string

The nonce for the given address at the end of the block

replaced_classes
array

The list of contracts whose class was replaced

class_hash
string

The new class hash

contract_address
string

The address of the contract whose class was replaced

storage_diffs
array

The storage updates per contract address

address
string

The address of the contract whose storage was updated

storage_entries
array

The changed storage entries, each with a 'key' and a 'value'

type
string

The type of the traced transaction. It can take only one value - 'DECLARE'

DEPLOY_ACCOUNT_TXN_TRACE
object

The execution trace of a deploy account transaction, which contains the following fields

validate_invocation
object

(Optional) The trace of the validate call, omitted when SKIP_VALIDATE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

constructor_invocation
object

The trace of the constructor call

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

fee_transfer_invocation
object

(Optional) The trace of the fee transfer, omitted when SKIP_FEE_CHARGE is set

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

execution_resources
object

The resources consumed by the transaction, including from L1 handler and validation

l1_gas
integer

The L1 gas consumed by the transaction

l1_data_gas
integer

The L1 data gas consumed by the transaction

l2_gas
integer

The L2 gas consumed by the transaction

state_diff
object

The state diff produced by the transaction, which contains the following fields

declared_classes
array

The declared class hash and compiled class hash

class_hash
string

The hash of the declared class

compiled_class_hash
string

The Cairo assembly hash corresponding to the declared class

deployed_contracts
array

The contracts deployed as part of the state update

address
string

The address of the contract

class_hash
string

The hash of the contract code

deprecated_declared_classes
array

The hashes of the declared deprecated (Cairo 0) classes

nonces
array

The updated nonce per contract address

contract_address
string

The address of the contract

nonce
string

The nonce for the given address at the end of the block

replaced_classes
array

The list of contracts whose class was replaced

class_hash
string

The new class hash

contract_address
string

The address of the contract whose class was replaced

storage_diffs
array

The storage updates per contract address

address
string

The address of the contract whose storage was updated

storage_entries
array

The changed storage entries, each with a 'key' and a 'value'

type
string

The type of the traced transaction. It can take only one value - 'DEPLOY_ACCOUNT'

L1_HANDLER_TXN_TRACE
object

The execution trace of an L1 handler transaction, which contains the following fields

function_invocation
object

The trace of the L1 handler call. If the transaction reverted, this is an object with a single 'revert_reason' field instead

call_type
string

The type of call. Possible values include - 'LIBRARY_CALL', 'CALL', 'DELEGATE'

calldata
array

The arguments passed to the function

caller_address
string

The address of the invoking contract. 0 for the root invocation

calls
array

The calls made by this invocation, each with the same fields as this object

class_hash
string

The hash of the class being called

contract_address
string

The address of the contract

entry_point_selector
string

The entry point selector

entry_point_type
string

The type of entry point. Possible values include - 'EXTERNAL', 'L1_HANDLER', 'CONSTRUCTOR'

events
array

The events emitted in this invocation

order
integer

The order of the event within the transaction

keys
array

The keys associated with the event

data
array

The data associated with the event

execution_resources
object

The computational resources consumed by the call

l1_gas
integer

The L1 gas consumed by the call

l2_gas
integer

The L2 gas consumed by the call

is_reverted
boolean

Whether the invocation reverted

messages
array

The messages sent by this invocation to L1

order
integer

The order of the message within the transaction

payload
array

The payload of the message

to_address
string

The target L1 address the message is sent to

result
array

The value returned from the function invocation

execution_resources
object

The resources consumed by the transaction, including from L1 handler and validation

l1_gas
integer

The L1 gas consumed by the transaction

l1_data_gas
integer

The L1 data gas consumed by the transaction

l2_gas
integer

The L2 gas consumed by the transaction

state_diff
object

The state diff produced by the transaction, which contains the following fields

declared_classes
array

The declared class hash and compiled class hash

class_hash
string

The hash of the declared class

compiled_class_hash
string

The Cairo assembly hash corresponding to the declared class

deployed_contracts
array

The contracts deployed as part of the state update

address
string

The address of the contract

class_hash
string

The hash of the contract code

deprecated_declared_classes
array

The hashes of the declared deprecated (Cairo 0) classes

nonces
array

The updated nonce per contract address

contract_address
string

The address of the contract

nonce
string

The nonce for the given address at the end of the block

replaced_classes
array

The list of contracts whose class was replaced

class_hash
string

The new class hash

contract_address
string

The address of the contract whose class was replaced

storage_diffs
array

The storage updates per contract address

address
string

The address of the contract whose storage was updated

storage_entries
array

The changed storage entries, each with a 'key' and a 'value'

type
string

The type of the traced transaction. It can take only one value - 'L1_HANDLER'

Request
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free