Ethereum
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Ethereum
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Sí | The hash of the block containing the transaction. |
| 2 | transactionIndex | string (hex) | Sí | Zero-based position of the transaction within the block. |
| Tipo | Descripción |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the Ethereum playground.
| Código | Mensaje | Causa |
|---|---|---|
-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.Parámetros
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)