Request
curl https://eth.l0vdinfra.com/YOUR_KEY \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByBlockHashAndIndex","params":["0xc7a2fd354a9a1512636dad41b44e618905f5e8d2500f08c515c3bbbdf5261f6a","0x0"]}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xc7a2fd354a9a1512636dad41b44e618905f5e8d2500f08c515c3bbbdf5261f6a",
"blockNumber": "0x1208a5f",
"blockTimestamp": "0x65922b33",
"from": "0x958da591e94cc7678931915018f0af1a0c81b88f",
"gas": "0x5208",
"gasPrice": "0x104c533c00",
"hash": "0xbb62ecfc053ce6aa2f12dd09261e27e7c06b46dd015c67e28d5f7200bd6251ac",
"input": "0x",
"nonce": "0x1",
"to": "0x0016c0d0343e8f2c3a7b6a51606b84b1545ec606",
"transactionIndex": "0x0",
"value": "0x33d16ab2475000",
"type": "0x0",
"chainId": "0x1",
"v": "0x25",
"r": "0x96a1dd0c9729d6340a778a1d5c405f02e25fb2c6eae9f90c2ef30fc7127e50a3",
"s": "0x3dd747997bd8aa478bbdf2e242ae481995b061be95bf515b0656a73ce3f50b1f"
}
}
Params and your endpoint
Parameters
blockHashstringrequired- 32-byte block hash.
indexstringrequired- Transaction index, hex.
Returns
object Transaction object, or null.
hashstring- Transaction hash.
blockNumberstring- Block number, hex; null while pending.
blockHashstring- Block hash; null while pending.
transactionIndexstring- Position in the block, hex.
fromstring- Sender address.
tostring- Recipient; null for contract creation.
valuestring- Value transferred, hex wei.
inputstring- Call data.
gasstring- Gas limit provided by the sender, hex.
noncestring- Sender nonce, hex.
typestring- Transaction type: "0x0" legacy, "0x2" EIP-1559, "0x3" blob.
When to use it
Read the transaction at a given position of a block identified by hash.
How to read the result
Transaction object, or null.
Tips
- Reorg-safe variant of eth_getTransactionByBlockNumberAndIndex.
Related methods