Solana
Solana
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
getBlocksWithLimit returns up to limit confirmed slots starting at a given startSlot on Solana, the Proof-of-Stake chain whose native token is SOL. It is the count-bounded sibling of getBlocks: instead of a startSlot/endSlot window, you ask for the next N confirmed slots from a known point. That makes it ideal for fixed-size paging through Solana's fast ~400 ms slots without computing an end boundary in advance. The result is an array of u64 slot numbers, each one a slot that actually produced a block. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST.
| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | startSlot | integer | نعم | First slot to start from. |
| 2 | limit | integer | نعم | Maximum number of slots to return. |
| 3 | config | object | لا | Options: commitment. |
| النوع | الوصف |
|---|---|
| array | Array of u64 confirmed slot numbers, up to limit. |
| الكود | الرسالة | السبب |
|---|---|---|
-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. |
limit entries when slots in that span were skipped — never assume the result length equals limit.startSlot. Do not key the next page off limit, since skipped slots make the returned count unreliable as a stride.