Documentation index

getSlot

Returns the slot that has reached the given or default commitment level. This is one of the simplest and most frequently used methods for tracking the network's progress, implementing slot-based polling, and synchronizing off-chain systems with the current chain state. It is lightweight and suitable for high-frequency monitoring.

Parameters

#TypeRequiredDescription
1objectNoConfiguration object

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

Returns a single value:

FieldTypeDescription
resultu64The current slot

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getSlot",
  "params": [
    { "commitment": "processed" }
  ]
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getSlot",
    params: [
      { commitment: "processed" }
    ]
  }),
});
const { result } = await response.json();
console.log("Current slot:", result);

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getSlot",
    "params": [
        {"commitment": "processed"}
    ]
})
result = response.json()["result"]
print(f"Current slot: {result}")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getSlot",
            "params": [
                {"commitment": "processed"}
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": 166974442,
  "id": 1
}