Optimism
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Optimism
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getTransactionByBlockHashAndIndex returns a single transaction from OP Mainnet by pinning it to a block hash and a zero-based position within that block. It is handy when you have already pulled a block and want the transaction at a known slot without a separate hash lookup. OP Mainnet is an OP Stack optimistic rollup (Bedrock) settling to Ethereum L1, with gas paid in ETH and a block roughly every two seconds, so positions within a block are stable once the block is referenced by hash. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
0x0 upward.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Optimism playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block hash or transaction index is malformed. |
"0x0" for the first transaction, not the integer 0.null rather than an error, so null-check before reading fields.المعاملات
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)