Solana
Solana
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
getBlocks returns the list of slots that actually produced a confirmed block between a startSlot and an endSlot on Solana, the high-throughput Proof-of-Stake chain whose native token is SOL. Because Solana advances at roughly 400 ms per slot and not every slot yields a block, this method is how indexers find the real, non-empty slots to fetch rather than guessing slot numbers. The result is a plain array of u64 slot numbers; any slot in the range that is missing from the array was skipped. If you omit endSlot, it defaults to the latest slot. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST, then feed each returned slot into getBlock.
getBlock on a slot that has no data.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | startSlot | integer | نعم | First slot of the range. |
| 2 | endSlot | integer | لا | Last slot of the range (defaults to the latest). |
| 3 | config | object | لا | Options: commitment. |
| النوع | الوصف |
|---|---|
| array | Array of u64 confirmed slot numbers in the range. |
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32004 | Block not available for slot | The slot is not in this node's ledger (purged, skipped, or behind first available block). Use an archival endpoint for deep history. |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
startSlot and endSlot is capped (around 500,000 slots). For wider history, chunk the request into successive ranges instead of asking for the whole span at once.