> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getTransactionByBlockHashAndIndex

Returns information about a transaction by block hash and transaction index position.

This method will use `40` [Compute Units](https://docs.validationcloud.io/nodeapi/about/billing.md).

***

## Reference: [Here](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyblockhashandindex)

## **Parameters**

1. `DATA`, 32 Bytes - hash of a block.
2. `QUANTITY` - integer of the transaction index position.

```javascript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
params: [
  "0x241a36521807e99d82624139dd3dd2ee0007c3126d9e15b82d08e2e76b6b7c8f",
  "0x1"
]
```

## Returns

`Object` - A transaction object, or `null` when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. `null` when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. `null` when its pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. `null` when its a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. `null` when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `QUANTITY` - ECDSA signature r
* `s`: `QUANTITY` - ECDSA signature s

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "type": "0x2",
    "chainId": "0xc4",
    "nonce": "0x3cf795",
    "gas": "0x2abf6",
    "maxFeePerGas": "0x25317c1",
    "maxPriorityFeePerGas": "0x7704c0",
    "to": "0xbff976f8874814e6f2ee98d559826812ff26597f",
    "value": "0x0",
    "accessList": [],
    "input": "0x64489bf50000000000000000000000000000000000000000000000000021c0331d5dc00000000000000000000000000019e315ec9cce550dcfe7e3972f148219...",
    "r": "0x4724181e3f1bc9f45cf6bf6eafe36f4ff266131c63e164fe4868b1841178defb",
    "s": "0x3693ea7f7a6bbda301108c0b41651d39123f25f0248d3fb1724199f16f1e3734",
    "yParity": "0x1",
    "v": "0x1",
    "hash": "0x6761ad2af540c24d7168489c98e77e8910eba2d07294ae25f24ceeeba11fb382",
    "blockHash": "0x241a36521807e99d82624139dd3dd2ee0007c3126d9e15b82d08e2e76b6b7c8f",
    "blockNumber": "0x4685f68",
    "transactionIndex": "0x1",
    "from": "0x7a8bcda73a1eca3f47944a7c9ee0133adce3d073",
    "gasPrice": "0x1a831c0"
  }
}
```

```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://mainnet.xlayer.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x241a36521807e99d82624139dd3dd2ee0007c3126d9e15b82d08e2e76b6b7c8f","0x1"],"id":1}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.