Whitechain: trace (1/2)
API reference for Whitechain. All methods ->
Part 1 of 2: 1 · 2
trace_block
Retrieves a detailed trace of all the transactions in a specific block.
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):blockNumber(string): the number of the block you want to trace, given as a hexadecimal string.
Returns
The method returns an array of trace objects, each of which contains detailed information about a particular operation. These trace objects include the following fields:
action(object): describes the action that was performed. The structure of this object varies based on the type of action.-
For
callactions: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
createactions: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
rewardactions: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
suicideactions: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.
-
blockHash(string): the hash of the block containing the transaction. -
blockNumber(string): the number of the block containing the transaction. -
result(object): describes the result of the action.-
For
callactions:gasUsed(string): the amount of gas used by the call.output(string): the output data from the call.
-
For
createactions: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
rewardactions: no additional fields. -
For
suicideactions: no additional fields.
-
-
subtraces(integer): the number of subtraces (nested traces) generated by this trace. -
traceAddress(array of integers): the address within the trace hierarchy, indicating the position of the trace in the call stack. -
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_block",
"params": [
"0x30e0cfc"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"callType": "call",
"gas": "0xee9bc",
"input": "0x3db6be2b00000558000c3c9d0000000000000002000000006ae333fb00000000019147760000000000000000000000000000000000000000000000000000000002ade4c20000000000000000000000000000000000000000000000000000000000258d54c657f934ffaf987240fc5c666f4e7835418b9690ce54832d59449481d0b65fc1000000000000000000000000681fcc4272c14f70203ea655b1eaf9a20557a4730000000000000000000000000190",
"to": "0x4200000000000000000000000000000000000015",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x5c12",
"output": "0x"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0xdf439d9b3be560f610442fff542cf580b1229f3ebf5527d70553c87b05b71516",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0x4200000000000000000000000000000000000015",
"callType": "delegatecall",
"gas": "0xe9b0f",
"input": "0x3db6be2b00000558000c3c9d0000000000000002000000006ae333fb00000000019147760000000000000000000000000000000000000000000000000000000002ade4c20000000000000000000000000000000000000000000000000000000000258d54c657f934ffaf987240fc5c666f4e7835418b9690ce54832d59449481d0b65fc1000000000000000000000000681fcc4272c14f70203ea655b1eaf9a20557a4730000000000000000000000000190",
"to": "0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x489b",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0
],
"transactionHash": "0xdf439d9b3be560f610442fff542cf580b1229f3ebf5527d70553c87b05b71516",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xf19133ee5b2eb7e49e99aa7dc2edbc866a4e986b",
"callType": "call",
"gas": "0x11cb8",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x9e73",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
"transactionPosition": 1,
"type": "call"
},
{
"action": {
"from": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"callType": "delegatecall",
"gas": "0xfcbe",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xaa8145fe0081964f754fa247a5719f3712f3addf",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x8253",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [
0
],
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
"transactionPosition": 1,
"type": "call"
}
]
}
trace_transaction
Retrieves the traces created during the execution of a given transaction.
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; required): the hash of the transaction for which you want to retrieve the traces.
Returns
-
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_transaction",
"params": [
"0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xf19133ee5b2eb7e49e99aa7dc2edbc866a4e986b",
"callType": "call",
"gas": "0x11cb8",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x9e73",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
"transactionPosition": 1,
"type": "call"
},
{
"action": {
"from": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"callType": "delegatecall",
"gas": "0xfcbe",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xaa8145fe0081964f754fa247a5719f3712f3addf",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x8253",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [
0
],
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
"transactionPosition": 1,
"type": "call"
}
]
}
trace_filter
Retrieve traces that match filter criteria.
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):fromBlock(string, optional): the starting block number, given as a hexadecimal string. Example: "0x1" for the first block.toBlock(string, optional): the ending block number, given as a hexadecimal string. Example: "latest" for the most recent block.fromAddress(array of strings, optional): an array of addresses that initiated the transactions. Example: ["0xAddress1", "0xAddress2"].toAddress(array of strings, optional): an array of addresses that received the transactions. Example: ["0xAddress1", "0xAddress2"].after(integer, optional): the offset for pagination. Example: 0.count(integer, optional): the number of results to return. Example: 100.topics(array of arrays of strings, optional): an array of log topics to filter by. Each inner array represents a set of possible values for that topic. Example: [["0xTopic1", "0xTopic2"], ["0xTopic3"]].
Returns
-
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
-
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_filter",
"params": [
{
"fromBlock": "0x30e0cfc",
"toBlock": "0x30e0cfc",
"toAddress": [
"0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7"
]
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xf19133ee5b2eb7e49e99aa7dc2edbc866a4e986b",
"callType": "call",
"gas": "0x11cb8",
"input": "0xa9059cbb0000000000000000000000003ab2b5abbcb979cf1cf246b19312b570365f6f450000000000000000000000000000000000000000000000000000000016e30010",
"to": "0xf97b9bf62916f1eb42dd906a7254603e7b9fc4a7",
"value": "0x0"
},
"blockHash": "0xeffd7548db31c493d9582fe3c2d7688dbc1bea3db701bc433c2c1977f5a9cc4e",
"blockNumber": 51252476,
"result": {
"gasUsed": "0x9e73",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x14de2916159642d9ba049f72118d50ba7dc15907ffadb839674916dcc0589cd3",
"transactionPosition": 1,
"type": "call"
}
]
}