# sui_getCheckpoint

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

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

Retrieves a checkpoint by its digest or sequence number.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/sui-get-checkpoint

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | Checkpoint identifier — can be a digest or a sequence number (both strings). |

## Result

**result** (object): The checkpoint data for the specified ID.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_getCheckpoint",
  "params": [
    "1000"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": "0",
    "sequenceNumber": "1000",
    "digest": "BE4JixC94sDtCgHJZruyk7QffZnWDFvM2oFjC8XtChET",
    "networkTotalTransactions": "1001",
    "previousDigest": "41nPNZWHvvajmBQjX3GbppsgGZDEB6DhN4UxPkjSYRRj",
    "epochRollingGasCostSummary": {
      "computationCost": "0",
      "storageCost": "0",
      "storageRebate": "0",
      "nonRefundableStorageFee": "0"
    },
    "timestampMs": "1681393657483",
    "transactions": [
      "9NnjyPG8V2TPCSbNE391KDyge42AwV3vUD7aNtQQ9eqS"
    ],
    "checkpointCommitments": [],
    "validatorSignature": "r8/5+Rm7niIlndcnvjSJ/vZLPrH3xY/ePGYTvrVbTascoQSpS+wsGlC+bQBpzIwA"
  },
  "id": 1
}
```

## Code Examples

### cURL

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

### JavaScript

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

fetch('https://sui-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://sui-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sui_getCheckpoint",
    "params": ["1000"]
}
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://sui-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"sui_getCheckpoint\",\n  \"params\": [\n    \"1000\"\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://sui-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"sui_getCheckpoint\",\n  \"params\": [\n    \"1000\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://sui-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\": \"sui_getCheckpoint\",\n  \"params\": [\n    \"1000\"\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: sui_getCheckpoint
summary: Return a checkpoint
description: |
  Retrieves a checkpoint by its digest or sequence number.
params:
  - name: id
    required: true
    description: Checkpoint identifier — can be a digest or a sequence number (both strings).
    schema:
      type: string
result:
  name: result
  description: The checkpoint data for the specified ID.
  schema:
    type: object
    required:
      - epoch
      - sequenceNumber
      - digest
      - networkTotalTransactions
      - previousDigest
      - epochRollingGasCostSummary
      - timestampMs
      - transactions
      - checkpointCommitments
      - validatorSignature
    properties:
      epoch:
        type: string
      sequenceNumber:
        type: string
      digest:
        type: string
      networkTotalTransactions:
        type: string
      previousDigest:
        type: string
      epochRollingGasCostSummary:
        type: object
        properties:
          computationCost:
            type: string
          storageCost:
            type: string
          storageRebate:
            type: string
          nonRefundableStorageFee:
            type: string
      timestampMs:
        type: string
      transactions:
        type: array
        items:
          type: string
      checkpointCommitments:
        type: array
        items:
          type: string
      validatorSignature:
        type: string
examples:
  - name: Valid response for checkpoint
    params:
      - name: id
        value: '1000'
    result:
      name: result
      value:
        epoch: '0'
        sequenceNumber: '1000'
        digest: BE4JixC94sDtCgHJZruyk7QffZnWDFvM2oFjC8XtChET
        networkTotalTransactions: '1001'
        previousDigest: 41nPNZWHvvajmBQjX3GbppsgGZDEB6DhN4UxPkjSYRRj
        epochRollingGasCostSummary:
          computationCost: '0'
          storageCost: '0'
          storageRebate: '0'
          nonRefundableStorageFee: '0'
        timestampMs: '1681393657483'
        transactions:
          - 9NnjyPG8V2TPCSbNE391KDyge42AwV3vUD7aNtQQ9eqS
        checkpointCommitments: []
        validatorSignature: r8/5+Rm7niIlndcnvjSJ/vZLPrH3xY/ePGYTvrVbTascoQSpS+wsGlC+bQBpzIwA
```
