Skip to main content

trace_call

POST

Simulates a specified transaction call and returns the result. This method does not actually send a transaction to the blockchain and provides detailed execution information including gas consumption, execution results, and logs. This is useful when you want to preview how a specific function call will be executed.
param[0]
callObjectobjectrequired
Call object for transaction simulation. May include the following fields.
  • from: Enter the transaction's from address as a string.
  • to: Enter the transaction's to address as a string.
  • gas: Enter the gas required to process the transaction as a hex-format string. For smart contract calls, no gas is consumed, so you can enter 0x0.
  • gasPrice: Enter the desired cost per gas as a hex-format string.
  • value: The value of the transaction.
  • data: The method signature hash of the transaction to execute. Can be referenced from the ABI.
fromstring
Enter the transaction's from address as a string.
tostring
Enter the transaction's to address as a string.
gasstring
Enter the gas required to process the transaction as a hex-format string. For smart contract calls, no gas is consumed, so you can enter 0x0.
gasPricestring
Enter the desired cost per gas as a hex-format string.
valuestring
The value of the transaction.
datastring
The method signature hash of the transaction to execute. Can be referenced from the ABI.
param[1]
traceTypearrayrequired
Trace type specifies the data types used when querying detailed execution information for a specific transaction or block on the Ethereum blockchain. This array can contain the following three string values:
  • vmTrace: Traces the virtual machine's step-by-step execution in detail. This includes memory state, stack state, and the result of each execution instruction.
  • trace: Provides step-by-step logs of transaction execution. These logs include call flow and details of internal transactions that occurred.
  • stateDiff: Shows the difference in account state before and after transaction execution. This includes changed storage keys and values, account balance changes, and contract code changes.
This information helps developers better understand the transaction processing flow and debug. Each type provides detailed information on a specific aspect of the blockchain to clearly understand the impact of a transaction.
Responses
Information about the traced action
fromstring
Caller address
callTypestring
Call type (call, delegatecall, staticcall, etc.)
gasstring
Gas limit set for the call (hex)
inputstring
Call input data (hex)
tostring
Callee address
valuestring
Amount of ETH transferred (hex, in wei)
blockHashstring
Hash of the block containing the transaction
blockNumberinteger
Block number containing the transaction
Call result
gasUsedstring
Actual gas used (hex)
outputstring
Call return data (hex)
subtracesinteger
Number of sub-traces
traceAddressarray
Index array representing the trace path
transactionHashstring
Hash of the traced transaction
transactionPositioninteger
Position of the transaction within the block
typestring
Trace type (call, create, reward, etc.)
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://ethereum-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "trace_call",
"params": [
{
"from": "0xc90d3Ac75D1D36dF0b0a229E73D8409FB7F3c4ab",
"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"value": "0x186a0",
"data": "0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
[
"trace"
]
]
}'