Whitechain: trace (2/2)
API reference for Whitechain. All methods ->
Part 2 of 2: 1 · 2
trace_replayTransaction
Replays a transaction and returns the traces produced by its execution along with the state changes.
Available for Premium and Enterprise users only.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):transactionHash(string): the hash of the transaction to be replayed.traceTypes(array of strings): the types of traces to be included in the response. Possible value:trace.
Returns
The method returns an object that can include the following fields:
-
trace(array): an array of trace objects, similar to those returned bytrace_transactionandtrace_filter:-
action(object)- For
call:callType(string): the type of call (e.g., "call", "delegatecall", "staticcall").from(string): the address that initiated the call.to(string): the address that was called.gas(string): the amount of gas provided for the call.input(string): the input data for the call.value(string): the amount of Wei sent with the call.
- For
create:from(string): the address that created the contract.gas(string): the amount of gas provided for the creation.init(string): the initialization code for the contract.value(string): the amount of Wei sent with the creation.
- For
reward:author(string): the address that received the reward.value(string): the amount of Wei rewarded.rewardType(string): the type of reward (e.g., "block", "uncle").
- For
suicide:address(string): the address of the contract that self-destructed.refundAddress(string): the address that received the remaining balance.balance(string): the remaining balance of the contract.
- For
-
blockHash(string): the hash of the block containing the transaction. -
blockNumber(string): The number of the block containing the transaction. -
result(object)- For call:
gasUsed(string): The amount of gas used by the call.output(string): The output data from the call.
- For
create:address(string): The address of the created contract.code(string): The runtime code of the created contract.gasUsed(string): The amount of gas used by the creation.
- For
reward: No additional fields. - For
suicide: No additional fields.
- For call:
-
subtraces(integer): The number of subtraces (nested traces) generated by this trace. -
traceAddress(array of integers): The address within the trace hierarchy. -
transactionHash(string): The hash of the transaction containing the trace. -
transactionPosition(integer): The index position of the transaction within the block. -
type(string): The type of trace (e.g., "call", "create", "reward", "suicide").
-
Request example
curl -X POST https://rpc.ankr.com/whitechain/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayTransaction",
"params": [
"0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
[
"trace"
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"stateDiff": null,
"trace": [
{
"type": "call",
"action": {
"from": "0xf19133ee5b2eb7e49e99aa7dc2edbc866a4e986b",
"callType": "call",
"gas": "0x11cb8",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"value": "0x0"
},
"result": {
"gasUsed": "0x9e73",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 1,
"traceAddress": []
},
{
"type": "call",
"action": {
"from": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"callType": "delegatecall",
"gas": "0xfcbe",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xaa8145fe0081964f754fa247a5719f3712f3addf",
"value": "0x0"
},
"result": {
"gasUsed": "0x8253",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [
0
]
}
],
"vmTrace": null
}
}
trace_replayBlockTransactions
Replays all the transactions in a given block and returns the traces produced by their execution along with the state changes.
Available for Premium and Enterprise users only.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):blockHash(string): the hash of the block whose transactions you want to replay.traceTypes(array of strings): the types of traces to be included in the response. Possible value:trace.
Returns
The method returns an object that can include the following fields:
-
trace(array): an array of trace objects, similar to those returned bytrace_transactionandtrace_filter:-
action(object)- For
call:callType(string): the type of call (e.g., "call", "delegatecall", "staticcall").from(string): the address that initiated the call.to(string): the address that was called.gas(string): the amount of gas provided for the call.input(string): the input data for the call.value(string): the amount of Wei sent with the call.
- For
create:from(string): the address that created the contract.gas(string): the amount of gas provided for the creation.init(string): the initialization code for the contract.value(string): the amount of Wei sent with the creation.
- For
reward:author(string): the address that received the reward.value(string): the amount of Wei rewarded.rewardType(string): the type of reward (e.g., "block", "uncle").
- For
suicide:address(string): the address of the contract that self-destructed.refundAddress(string): the address that received the remaining balance.balance(string): the remaining balance of the contract.
- For
-
blockHash(string): the hash of the block containing the transaction. -
blockNumber(string): The number of the block containing the transaction. -
result(object)- For call:
gasUsed(string): The amount of gas used by the call.output(string): The output data from the call.
- For
create:address(string): The address of the created contract.code(string): The runtime code of the created contract.gasUsed(string): The amount of gas used by the creation.
- For
reward: No additional fields. - For
suicide: No additional fields.
- For call:
-
subtraces(integer): The number of subtraces (nested traces) generated by this trace. -
traceAddress(array of integers): The address within the trace hierarchy. -
transactionHash(string): The hash of the transaction containing the trace. -
transactionPosition(integer): The index position of the transaction within the block. -
type(string): The type of trace (e.g., "call", "create", "reward", "suicide").
-
Request example
curl -X POST https://rpc.ankr.com/whitechain/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"0x30e0cfc",
[
"trace"
]
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"output": "0x",
"stateDiff": null,
"trace": [
{
"type": "call",
"action": {
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"callType": "call",
"gas": "0xee9bc",
"input": "0x3db6be2b00000558000c3c9d0000000000000002000000006ae333fb00000000019147760000000000000000000000000000000000000000000000000000000002ade4c20000000000000000000000000000000000000000000000000000000000258d54c657f934ffaf987240fc5c666f4e7835418b9690ce54832d59449481d0b65fc1000000000000000000000000681fcc4272c14f70203ea655b1eaf9a20557a4730000000000000000000000000190",
"to": "0x4200000000000000000000000000000000000015",
"value": "0x0"
},
"result": {
"gasUsed": "0x5c12",
"output": "0x"
},
"subtraces": 1,
"traceAddress": []
},
{
"type": "call",
"action": {
"from": "0x4200000000000000000000000000000000000015",
"callType": "delegatecall",
"gas": "0xe9b0f",
"input": "0x3db6be2b00000558000c3c9d0000000000000002000000006ae333fb00000000019147760000000000000000000000000000000000000000000000000000000002ade4c20000000000000000000000000000000000000000000000000000000000258d54c657f934ffaf987240fc5c666f4e7835418b9690ce54832d59449481d0b65fc1000000000000000000000000681fcc4272c14f70203ea655b1eaf9a20557a4730000000000000000000000000190",
"to": "0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015",
"value": "0x0"
},
"result": {
"gasUsed": "0x489b",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0
]
}
],
"vmTrace": null,
"transactionHash": "0xdf439d9b3be560f610442fff542cf580b1229f3ebf5527d70553c87b05b71516"
},
{
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"stateDiff": null,
"trace": [
{
"type": "call",
"action": {
"from": "0xf19133ee5b2eb7e49e99aa7dc2edbc866a4e986b",
"callType": "call",
"gas": "0x11cb8",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"value": "0x0"
},
"result": {
"gasUsed": "0x9e73",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 1,
"traceAddress": []
},
{
"type": "call",
"action": {
"from": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"callType": "delegatecall",
"gas": "0xfcbe",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xaa8145fe0081964f754fa247a5719f3712f3addf",
"value": "0x0"
},
"result": {
"gasUsed": "0x8253",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [
0
]
}
],
"vmTrace": null,
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3"
}
]
}