79 lines
1.3 KiB
Plaintext
79 lines
1.3 KiB
Plaintext
import {
|
|
DocBlock,
|
|
DocSideBySide,
|
|
CodeParams,
|
|
Parameter,
|
|
Field,
|
|
Values,
|
|
CodeSnippets,
|
|
} from "../../../components/CodeDocBlock";
|
|
|
|
<DocBlock>
|
|
|
|
## getConfirmedBlocksWithLimit
|
|
|
|
:::warning DEPRECATED
|
|
This method is expected to be removed in solana-core v2.0
|
|
**Please use [getBlocksWithLimit](#getblockswithlimit) instead**
|
|
:::
|
|
|
|
Returns a list of confirmed blocks starting at the given slot
|
|
|
|
<DocSideBySide>
|
|
|
|
<CodeParams>
|
|
|
|
### Parameters:
|
|
|
|
<Parameter type={"u64"} required={true}>
|
|
start_slot, as u64 integer
|
|
</Parameter>
|
|
|
|
<Parameter type={"u64"} required={true}>
|
|
limit, as u64 integer
|
|
</Parameter>
|
|
|
|
<Parameter type={"object"} optional={true}>
|
|
|
|
Configuration object containing the following fields:
|
|
|
|
<Field
|
|
name="commitment"
|
|
type="string"
|
|
optional={true}
|
|
href="/api/http#configuring-state-commitment"
|
|
></Field>
|
|
|
|
</Parameter>
|
|
|
|
### Result:
|
|
|
|
The result field will be an array of u64 integers listing confirmed blocks
|
|
starting at `start_slot` for up to `limit` blocks, inclusive.
|
|
|
|
</CodeParams>
|
|
|
|
<CodeSnippets>
|
|
|
|
### Code sample:
|
|
|
|
```bash
|
|
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
|
|
{
|
|
"jsonrpc": "2.0", "id": 1,
|
|
"method": "getConfirmedBlocksWithLimit",
|
|
"params": [5, 3]
|
|
}
|
|
'
|
|
```
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{ "jsonrpc": "2.0", "result": [5, 6, 7], "id": 1 }
|
|
```
|
|
|
|
</CodeSnippets>
|
|
</DocSideBySide>
|
|
</DocBlock>
|