trace_block

trace_block RPC Method

Parameters:

blockNumber - string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum and Gnosis

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 sender

callType - The type of method such as call, delegatecall

gas - The gas provided by the sender, encoded as hexadecimal

input - The data sent along with the transaction

to - The address of the receiver

value - The integer of the value sent with this transaction, encoded as hexadecimal

blockHash - The hash of the block where this transaction was in

blockNumber - The block number where this transaction was in

result - The ParityTraceResult object which has the following fields:

gasUsed - The amount of gas used by this specific transaction alone

output - 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 transaction

traceAddress - The list of addresses where the call executed, the address of the parents and the order of the current sub call

transactionHash - The hash of the transaction

transactionPosition - The transaction position

type - The value of the method such as call or create

Code Examples:

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "method": "trace_block",
  "params": [
    "0xccb93d"
  ],
  "id": 1,
  "jsonrpc": "2.0"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.ebs.ezat.io/core/api/v1.0/rpc/bsc/mainnet?x-api-key-id=API-KEY-ID&x-api-key=API-KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Last updated