For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getTransactionByBlockNumberAndIndex - Ethereum

eth_getTransactionByBlockNumberAndIndex on Ethereum: returns a transaction by block number and its index in the block. Parameters, response and request example for the RPC Fast endpoint.

Returns a transaction by block number and its index in the block.

Parameters

  1. block (string) — Block number as hex, or a tag: latest, earliest, pending, safe, finalized

  2. index (quantity) — Transaction index

Returns

The transaction, as a transaction object: hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gas, fee fields, input, type and the signature v, r, s; null if there is none.

Example

Request

curl https://eth-mainnet.rpcfast.com/?api_key=<API_KEY> \
  -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByBlockNumberAndIndex","params":["0x192a337","0x0"]}'

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "type": "0x2",
    "chainId": "0x1",
    "nonce": "0x0",
    "gas": "0x8d872",
    "maxFeePerGas": "0x8a56425",
    "maxPriorityFeePerGas": "0x7",
    "to": "0x6c7909a8bb9aaea333fed7b282e49b6812f0926d",
    "value": "0x1",
    "accessList": [
      {
        "address": "0x4e68ccd3e89f51c3074ca5072bbac773960dfa36",
        "storageKeys": [
          "0x0000000000000000000000000000000000000000000000000000000000000000",
          "0x0000000000000000000000000000000000000000000000000000000000000002",
          "0x0000000000000000000000000000000000000000000000000000000000000003",
          "… 2 more"
        ]
      },
      {
        "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "storageKeys": [
          "0x217fdff7afc5cd5a4e8ef4146b5a8c30926ffa20f0ff879ffdc9ed3476cd86ee",
          "0x80ee9218012820894f27e40ac8696c01fa1481de67954e45941477a3ff9af92d"
        ]
      },
      {
        "address": "0xd4ce9489d9d5e3e8e755e93c22d1a296bf04d748",
        "storageKeys": [
          "0x0000000000000000000000000000000000000000000000000000000000000006",
          "0x0000000000000000000000000000000000000000000000000000000000000007",
          "0x0000000000000000000000000000000000000000000000000000000000000008",
          "… 3 more"
        ]
      },
      "… 2 more"
    ],
    "input": "0x05d00000550069007d04400100550069025d1001860026d2000001640091012800007d077d0001a500550403690001f5170f000000350209022a0303001b59…",
    "r": "0x1469620482e1333174bc9955155811e35432d0bcf4c78b919629ef77b3af7838",
    "s": "0x13e625eb2e2749daa145b169bdfb1d7c9edb0b89762154a55d0300586e066b1e",
    "yParity": "0x0",
    "v": "0x0",
    "hash": "0x20f6cbee4067a1b977016915b689e742f665158de4b631341a6877dac372ca14",
    "blockHash": "0xcb340ea929c555563cdb3c6db683fc96c6d015d0119c691c40f980b8b61c3eff",
    "blockNumber": "0x192a337",
    "transactionIndex": "0x0",
    "from": "0x3a293b5bbacd9dc69f9cdd756266e26671eaf51c",
    "gasPrice": "0x5c39820",
    "blockTimestamp": "0x6af38ef3"
  }
}

See Compute Units for the price of this method on Ethereum.

Last updated