Returns confirmed block slots in the inclusive range starting at startSlot
and ending at endSlot, if provided.
Source
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getBlocks",> "params": [> 377268280,> 377268285,> {> "commitment": "finalized"> }> ]> }> '
params
u64required
Start slot
u64 | objectoptional
Inclusive end slot. For backwards compatibility, this parameter position may also be used for a configuration object.
- If this parameter is a number, it is the inclusive end slot and must be no
more than 500,000 slots higher than
start slot. - If this parameter is an object, it has the same shape as
configand the request omitsend slot.
When this parameter is an object, it contains:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level used to select which slot the node reads from for this request. processed is not supported. |
minContextSlot | number | Minimum slot at which the request may be evaluated. |
objectoptional
Configuration object. This parameter is only used when end slot is provided
as a number.
result
Response
{"jsonrpc": "2.0","result": [5, 6, 7, 8, 9, 10],"id": 1}
array
An array of u64 integers listing confirmed blocks between start_slot and
either end_slot - if provided, or the highest slot available at the requested
commitment, inclusive. Max range allowed is 500,000 slots. If end_slot is
lower than start_slot, the result is an empty array.
Is this page helpful?