getBlocksWithLimit
Returns up to limit confirmed block slots, starting at startSlot.
Request
{ "jsonrpc": "2.0", "id": 1, "method": "getBlocksWithLimit", "params": [ 5, 3, { "commitment": "finalized" } ]}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| startSlot | u64 | Yes | The first slot to return. Confirmed blocks at or after this slot are included. |
| limit | usize | Yes | Maximum number of blocks to return. Must not exceed 500000. Pass 0 to receive an empty array. |
| commitment | string | No | Commitment level: confirmed or finalized (default). processed is not accepted. |
| minContextSlot | number | No | Minimum slot at which the request may be evaluated. |
Commitment levels
| Value | Description |
|---|---|
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed but weaker than finalized. |
| finalized | Return data from the highest slot the cluster recognizes as finalized — it has reached maximum vote lockout and is recognized by at least two-thirds of active stake. Strongest guarantee. |
Response
{ "jsonrpc": "2.0", "result": [5, 6, 7], "id": 1}| Field | Type | Description |
|---|---|---|
| result | u64[] | Array of confirmed block slot numbers starting at startSlot, up to limit entries. Empty array when limit is 0 or no blocks exist in range. |
If no confirmed blocks exist between startSlot and the end of the available chain, the result is an empty array. Gaps in the sequence indicate skipped slots with no confirmed block.