eth_getTransactionByBlockNumberAndIndex | Aurora

Aurora API method that retrieves information about a specific transaction based on the block number and the transaction index within the block. This information can track transactions, debug issues, analyze data, and build decentralized applications on the Cronos blockchain.


Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.


  • quantity or tag β€” the integer of a block encoded as hexadecimal or the string with:

    • latest β€” the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.

    • safeβ€”the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or severe propagation latency.

    • finalizedβ€”the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, requiring burning at least 1/3 of the staked amount.

    • earliest β€” the earliest available or genesis block.

    • pendingβ€”the pending state and transactions block. This is the current state of transactions that have been broadcast to the network but have not yet been included in a block.


      See the default block parameter and How The Merge Impacts Ethereum’s Application Layer.

  • quantity β€” the integer identifying the transaction index position within the block, encoded as hexadecimal.


  • object β€” the transaction response object, or null if no transaction is found:
    • blockHash β€” the block hash. Identifies the block in which the transaction was included. This field is null for transactions that have not yet been included in a block.
    • blockNumber β€” the number of the block in which the transaction was included. This field is null for transactions that have not yet been included in a block.
    • from β€” the address of the sender who initiated the transaction.
    • gas β€” the units of gas included in the transaction by the sender.
    • gasPrice β€” the price of gas in Wei included in the transaction by the sender.
    • maxFeePerGas β€” the maximum amount the transaction's sender is willing to pay per unit of gas for the transaction to be executed.
    • maxPriorityFeePerGas β€” the maximum priority fee the transaction sender is willing to pay per gas unit.
    • hash β€” the hash that uniquely identifies the transaction.
    • input β€” the optional input data sent with the transaction, usually used to interact with smart contracts.
    • nonce β€” a counter identifying the transaction's number sent by the sender's wallet. It essentially identifies how many transactions an account has made. Used to ensure each transaction is executed only once.
    • to β€” the recipient's address of the transaction if it was a transaction to an address. For contract creation transactions, this field is null.
    • transactionIndex β€” the index of the transaction within the block. It is null for transactions that have not yet been included in a block.
    • value β€” the value of the native token transferred along with the transaction in Wei.
    • type β€” the type of the transaction. 0 indicates a regular transfer; 2 indicates a contract creation or smart contract function call.
    • accessList β€” a list of authorized addresses and storage keys the transaction plans to interact with.
    • v β€” the recovery parameter in the Ethereum Signature Algorithm (ECDSA).
    • r β€” the first component of the signature in the Ethereum Signature Algorithm (ECDSA).
    • s β€” the second component of the signature in the Ethereum Signature Algorithm (ECDSA).

eth_getTransactionByBlockNumberAndIndex code examples

const { Web3 } = require("web3");
const web3 = new Web3(NODE_URL);

async function getTransaction() {
  const transaction = await web3.eth.getTransactionFromBlock("118839860", 0);

const ethers = require('ethers');
const provider = new ethers.JsonRpcProvider(NODE_URL);

const getTransaction = async (blocNumber, index) => {
    const transaction = await provider.send("eth_getTransactionByBlockNumberAndIndex", [blocNumber, index]);
  getTransaction("latest", "0x1");
from web3 import Web3  

web3 = Web3(Web3.HTTPProvider(node_url)) 
print(web3.eth.get_transaction_by_block(118839860, 0)) # Hex encoded parameters starting with "0x" are accepted as well.

Use case

The eth_getTransactionByBlockNumberAndIndex can be used to retrieve transaction details from a block; for example, an analytics tool systematically scans each block for transactions by sequentially incrementing the block number and cycling through the transactions within each block using the transaction index. For each transaction, it retrieves detailed information such as the value transferred, the gas price, the sender and receiver addresses, and the input data, which can contain calls to smart contracts.

Try the eth_getTransactionByBlockNumberAndIndex RPC method yourself

Click Try It! to start a request and see the response here!