Ethereum
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Ethereum
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_getTransactionByBlockHashAndIndex fetches a single transaction by where it sits, not by what it is. You name a block by its hash and a zero-based position within that block, and Ethereum mainnet (chain ID 1, fees denominated in ETH) returns the full transaction object at that slot. The order matters here: a validator fixes the transaction ordering when it seals the block, and that order is exactly what this index walks. It's the same transaction object you'd get from eth_getTransactionByHash, just addressed positionally. Querying by block hash rather than number means you're pinned to one specific block even across a reorg. Send the call to https://ethereum.therpc.io/YOUR_API_KEY.
0x0 until you hit null, when you already have the block hash but not the individual tx hashes.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Oui | The hash of the block containing the transaction. |
| 2 | transactionIndex | string (hex) | Oui | Zero-based position of the transaction within the block. |
| Type | Description |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the Ethereum playground.
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block hash or transaction index is malformed. |
"0x0", the eleventh is "0xa" — passing a bare 0 or a decimal 10 will misfire.null, not an error. Pair this with eth_getBlockTransactionCountByNumber, or just treat null as your stop condition when enumerating.Paramètres
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)