Base
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Base
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getBlockByNumber returns block data for the block at a given height or a named tag such as latest or finalized. Base is Coinbase's OP Stack rollup that uses ETH for gas and seals a new block about every 2 seconds, so this is the workhorse for walking the L2 chain by height. Send a block number or tag to https://base.therpc.io/YOUR_API_KEY (chain ID 8453) plus a boolean for full transactions versus hashes, and the node returns the same block object shape as eth_getBlockByHash, or null if the block does not exist yet.
latest block for a real-time monitoring dashboard tracking the L2 tip.finalized block to anchor queries that must be reorg-safe — finality on Base traces back to Ethereum L1.includeTransactions=false) before fetching their receipts in bulk via eth_getBlockReceipts.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockTag | string | نعم | The block to retrieve. |
| 2 | includeTransactions | boolean | نعم | When true, transactions[] contains full transaction objects. When false, only hashes. |
| النوع | الوصف |
|---|---|
| object | null | Same block object as eth_getBlockByHash. Returns null if the block does not exist. |
Try it live in the Base playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block number is malformed or block tag is unrecognised. |
includeTransactions, not the string "true" — JSON-RPC requires the boolean type.eth_getBlockReceipts call over N individual eth_getTransactionReceipt requests.includeTransactions=true, a heavily loaded Base block full of swaps can reach 1–2 MB; plan for that payload or request hashes only.المعاملات
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
true = full tx objects, false = tx hashes only