Ethereum
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Ethereum
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
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.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | نعم | The hash of the block containing the transaction. |
| 2 | transactionIndex | string (hex) | نعم | Zero-based position of the transaction within the block. |
| النوع | الوصف |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the Ethereum playground.
| الكود | الرسالة | السبب |
|---|---|---|
-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.المعاملات
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)