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_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_block",
"params": [
"0x67df72"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"callType": "call",
"gas": "0xee9b0",
"input": "0x3db6be2b000186a0000f4240000000000000000b000000006a98e0040000000000b15d50000000000000000000000000000000000000000000000000000000003c55d3760000000000000000000000000000000000000000000000000000000003294abfb0fa2b3a5ed9dc43c0da32f96707e5bd1d208fdb1898eb66169d05b2677edff00000000000000000000000007d451299ab21bfa7132c690b91d749756ec1dbb70000000000000000000000000190",
"to": "0x4200000000000000000000000000000000000015",
"value": "0x0"
},
"blockHash": "0x11d4c576a6d9333a29b9b9bb598f9ac025c901721c040026dea80dbe3213ce37",
"blockNumber": 6807410,
"result": {
"gasUsed": "0x5c12",
"output": "0x"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0xf975a5ee428e66b94c06203690764a2e42380160fd8ebaea40e9dd473b0a60a0",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0x4200000000000000000000000000000000000015",
"callType": "delegatecall",
"gas": "0xe9b03",
"input": "0x3db6be2b000186a0000f4240000000000000000b000000006a98e0040000000000b15d50000000000000000000000000000000000000000000000000000000003c55d3760000000000000000000000000000000000000000000000000000000003294abfb0fa2b3a5ed9dc43c0da32f96707e5bd1d208fdb1898eb66169d05b2677edff00000000000000000000000007d451299ab21bfa7132c690b91d749756ec1dbb70000000000000000000000000190",
"to": "0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015",
"value": "0x0"
},
"blockHash": "0x11d4c576a6d9333a29b9b9bb598f9ac025c901721c040026dea80dbe3213ce37",
"blockNumber": 6807410,
"result": {
"gasUsed": "0x489b",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0
],
"transactionHash": "0xf975a5ee428e66b94c06203690764a2e42380160fd8ebaea40e9dd473b0a60a0",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xbd8258d5bb8e0484ad49b440477d958b25007cdd",
"callType": "call",
"gas": "0x8b4d",
"input": "0xa9059cbb000000000000000000000000ba2a19782476abeffc2d20c3f2472c0b2ce5edcb0000000000000000000000000000000000000000000000056bc75e2d63100000",
"to": "0xdccc102f943a108b12ec7221ee95940864d08d3c",
"value": "0x0"
},
"blockHash": "0x11d4c576a6d9333a29b9b9bb598f9ac025c901721c040026dea80dbe3213ce37",
"blockNumber": 6807410,
"result": {
"gasUsed": "0x756a",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x640aea514f282b11450ae552807e19670ba1654300a164195d9bf2ebacfd7707",
"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_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_transaction",
"params": [
"0x640aea514f282b11450ae552807e19670ba1654300a164195d9bf2ebacfd7707"
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xbd8258d5bb8e0484ad49b440477d958b25007cdd",
"callType": "call",
"gas": "0x8b4d",
"input": "0xa9059cbb000000000000000000000000ba2a19782476abeffc2d20c3f2472c0b2ce5edcb0000000000000000000000000000000000000000000000056bc75e2d63100000",
"to": "0xdccc102f943a108b12ec7221ee95940864d08d3c",
"value": "0x0"
},
"blockHash": "0x11d4c576a6d9333a29b9b9bb598f9ac025c901721c040026dea80dbe3213ce37",
"blockNumber": 6807410,
"result": {
"gasUsed": "0x756a",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x640aea514f282b11450ae552807e19670ba1654300a164195d9bf2ebacfd7707",
"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_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x67df72",
"toBlock": "0x67df72",
"toAddress": [
"0xdccc102f943a108b12ec7221ee95940864d08d3c"
]
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xbd8258d5bb8e0484ad49b440477d958b25007cdd",
"callType": "call",
"gas": "0x8b4d",
"input": "0xa9059cbb000000000000000000000000ba2a19782476abeffc2d20c3f2472c0b2ce5edcb0000000000000000000000000000000000000000000000056bc75e2d63100000",
"to": "0xdccc102f943a108b12ec7221ee95940864d08d3c",
"value": "0x0"
},
"blockHash": "0x11d4c576a6d9333a29b9b9bb598f9ac025c901721c040026dea80dbe3213ce37",
"blockNumber": 6807410,
"result": {
"gasUsed": "0x756a",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x640aea514f282b11450ae552807e19670ba1654300a164195d9bf2ebacfd7707",
"transactionPosition": 1,
"type": "call"
}
]
}