🚀 We’re excited to announce our $35m Series A led by Tiger Global: Press Release, Coindesk, Bloomberg, Business Insider & RefreshMiami!

Contents

eth_getTransactionByBlockHashAndIndex RPC method

Parameters:

  1. Hash - A blocks hash.
  2. Quantity - An integer of the transaction index position encoded as a hexadecimal.

Returns:

  1. Object - Transaction Response Object , or null if no transaction is found:

    hash - The hash of the transaction

    nonce - The number of transactions made by the sender prior to this one encoded as hexadecimal.

    blockHash - The hash of the block where this transaction was in. null if pending.

    blockNumber - The block number where this transaction was in. null if pending.

    transactionIndex - Integer of the transactions index position in the block. null if pending.

    from - Address of the sender.

    to - Address of the receiver. Null when its a contract creation transaction.

    value - The value transferred in Wei, encoded as a hexadecimal.

    gasPrice - The gas price provided by the sender in Wei, encoded as a hexadecimal.

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

    input - The data sent along with the transaction.

    v - The standardized V field of the signature.

    standardV - The standardized V field of the signature (0 or 1).

    r The R field of the signature.

    raw - The raw transaction data.

    publicKey - The public key of the signer.

    chainId - The chain id of the transaction, if any.

Code Examples:

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  const txInfo = await provider.send("eth_getTransactionByBlockHashAndIndex", [
    "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b",
    "0x2",
  ]);
  console.log(txInfo);
})();
Ready to try QuickNode? Start your 7-day free trial