Returns traces matching given filter.
Supported on ETH, BSC, opBNB, and Polygon.
Parameters
Object
- The filter objectfromBlock
: Quantity or Tag - (optional) From this block.toBlock
: Quantity or Tag - (optional) To this block.fromAddress
: Array - (optional) Sent from these addresses.toAddress
: Array - (optional) Sent to these addresses.after
: Quantity - (optional) The offset trace numbercount
: Quantity - (optional) Integer number of traces to display in a batch.mode
: - (optional)union
orintersection
Returns
array
- The block traces, which have the following fields (please note that all return types are hexadecimal representations of their data type unless otherwise stated):action
- The ParityTrace object, which has the following fields:from
- The address of the sendercallType
- The type of method such as call, delegatecallgas
- The gas provided by the sender, encoded as hexadecimalinput
- The data sent along with the transactionto
- The address of the receivervalue
- The integer of the value sent with this transaction, encoded as hexadecimal
blockHash
- The hash of the block where this transaction was inblockNumber
- The block number where this transaction was inresult
- The ParityTraceResult object which has the following fields:gasUsed
- The amount of gas used by this specific transaction aloneoutput
- The value returned by the contract call, and it only contains the actual value sent by the RETURN method. If the RETURN method was not executed, the output is empty bytes
subtraces
- The traces of contract calls made by the transactiontraceAddress
- The list of addresses where the call executed, the address of the parents and the order of the current sub calltransactionHash
- The hash of the transactiontransactionPosition
- The transaction positiontype
- The value of the method such as call or create
API Endpoint
The format of a MegaNode API endpoint is https://{chain}-{network}.nodereal.io/v1/{API-key}
Here is an example:
https://eth-mainnet.nodereal.io/v1/4c0a1c23661a4e26bcbcwed461e34ea9
For other chains or networks, please refer to this guidance Find API key & endpoint.
Example
Request
curl https://eth-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_filter","params":[{"fromBlock":"0xc26f54","toBlock":"0xc26f54"}],"id":1,"jsonrpc":"2.0"}'
Result
{
"jsonrpc": "2.0",
"result":
[{"action": {
"callType": "call",
"from": "0x15dce17509846b420b1f5c158fe3d7518204abb6",
"gas": "0xed2a4",
"input": "0x00000000000000000000000000abc3136b63363200000000000000000000000000708a100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001f0000000016128acb08000000cb0c5d9d92f4f2f80cce7aa271a1e148c226e19d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ae720a71622e824f576b4a8c03031066548a3b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075cf0c1848f9db946ab000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e000000000c128acb0800000060594a405d53811d3bc4766596efd80fd545a2700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cb0c5d9d92f4f2f80cce7aa271a1e148c226e19d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e41dbb290f7bc000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000002a9059cbb000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060594a405d53811d3bc4766596efd80fd545a270000000000000000000000000000000000000000000000000e41dbb290f7bc0000000000005022c0d9f0000008ae720a71622e824f576b4a8c03031066548a3b100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4f726c005981e87000000000000000000000000000000000000abe945c436595ce765a8a261317b00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
"to": "0x000000000000abe945c436595ce765a8a261317b",
"value": "0x0"
},
"blockHash": "0xe0583a364c20fa67748ca92e276df63919c67e12fdc9bdbc17deae8cf730cf35",
"blockNumber": 12742484,
"result": {
"gasUsed": "0x4551d",
"output": "0x00000000000000000000000000000000000000000000000000d96b96f61c5e87"},
"subtraces": 12,
"traceAddress": [],
"transactionHash": "0x87951d0547018db2c4817282a53e2015d91934b42d1b8d8bba1bef7cb480f263",
"transactionPosition": 0,
"type": "call"},
...
}