# ledger_getSequencerCommitmentsOnSlotByNumber

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://citrea-mainnet.g.alchemy.com/v2/{apiKey}

Returns sequencer commitment(s) found in the specified DA slot height.

Reference: https://www.alchemy.com/docs/chains/citrea/citrea-api-endpoints/ledger-get-sequencer-commitments-on-slot-by-number

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| height | integer | Yes | L1 DA slot height. |

## Result

**Sequencer commitments** (null or object[]): Array of commitments found at the DA slot height (or null if none).

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "ledger_getSequencerCommitmentsOnSlotByNumber",
  "params": [
    88001
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "merkleRoot": "0xd6dc3eb1a59be7bc1ece68318f82a60919f0f98d8c648337d588ce243a17f473",
      "index": "0xba5",
      "l2EndBlockNumber": "0xb7a20b"
    },
    {
      "merkleRoot": "0xf85a8f3f872fe8079fe778a2f6a8ebd92cf3d1a7c6324af025c8bffbb46d1811",
      "index": "0xba6",
      "l2EndBlockNumber": "0xb7a5f3"
    }
  ],
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://citrea-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "ledger_getSequencerCommitmentsOnSlotByNumber",
  "params": [
    88001
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'ledger_getSequencerCommitmentsOnSlotByNumber',
    params: [88001]
  })
};

fetch('https://citrea-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://citrea-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "ledger_getSequencerCommitmentsOnSlotByNumber",
    "params": [88001]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://citrea-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getSequencerCommitmentsOnSlotByNumber\",\n  \"params\": [\n    88001\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://citrea-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getSequencerCommitmentsOnSlotByNumber\",\n  \"params\": [\n    88001\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://citrea-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"ledger_getSequencerCommitmentsOnSlotByNumber\",\n  \"params\": [\n    88001\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: ledger_getSequencerCommitmentsOnSlotByNumber
description: Returns sequencer commitment(s) found in the specified DA slot height.
params:
  - name: height
    required: true
    description: L1 DA slot height.
    schema:
      title: DASlotHeight
      type: integer
result:
  name: Sequencer commitments
  description: Array of commitments found at the DA slot height (or null if none).
  schema:
    oneOf:
      - type: 'null'
      - type: array
        items:
          type: object
          required:
            - merkleRoot
            - index
            - l2EndBlockNumber
          additionalProperties: false
          properties:
            merkleRoot:
              title: 32 byte hex value
              type: string
              pattern: ^0x[0-9a-f]{64}$
              description: Merkle root of sequencer commitment.
            index:
              title: hex encoded unsigned integer
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              description: Global commitment index (hex quantity).
            l2EndBlockNumber:
              title: hex encoded unsigned integer
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              description: Last L2 block included in this commitment (hex quantity).
examples:
  - name: ledger_getSequencerCommitmentsOnSlotByNumber — commitments exist
    params:
      - name: height
        value: 88001
    result:
      name: Sequencer commitments
      value:
        - merkleRoot: '0xd6dc3eb1a59be7bc1ece68318f82a60919f0f98d8c648337d588ce243a17f473'
          index: '0xba5'
          l2EndBlockNumber: '0xb7a20b'
        - merkleRoot: '0xf85a8f3f872fe8079fe778a2f6a8ebd92cf3d1a7c6324af025c8bffbb46d1811'
          index: '0xba6'
          l2EndBlockNumber: '0xb7a5f3'
  - name: ledger_getSequencerCommitmentsOnSlotByNumber — no commitments
    params:
      - name: height
        value: 88001
    result:
      name: Sequencer commitments
      value: null
```
