Optimism
Optimism
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_blockNumber returns the height of the most recently accepted L2 block on OP Mainnet, the OP Stack optimistic rollup that settles to Ethereum and pays gas in ETH. Because OP Mainnet produces a block roughly every 2 seconds, this single integer is the fastest way to know how far the sequencer has advanced. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa); the response is the latest L2 block number as a hex string.
eth_getLogs ranges across historical Optimism blocks.Diese Methode erwartet keine Parameter. Übergib ein leeres Array [].
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Try it live in the Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-32603 | Internal error | Node is not reachable or has not yet produced any block. |
"0x7a1b3c" — run it through parseInt(value, 16) or BigInt(value) before doing any arithmetic.