queryLedgerState_eraSummaries - Cardano

This method returns summaries of all known eras, giving the parameters needed to convert between slots, epochs, and wall-clock time across hard forks.

Parameters

  • None

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "queryLedgerState/eraSummaries",
    "id": "getblock.io"
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"jsonrpc": "2.0", "method": "queryLedgerState/eraSummaries", "id": "getblock.io"})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={"jsonrpc": "2.0", "method": "queryLedgerState/eraSummaries", "id": "getblock.io"}
)

print(response.json())

Response

json{
    "jsonrpc": "2.0",
    "method": "queryLedgerState/eraSummaries",
    "result": [
        {
            "start": {
                "time": {
                    "seconds": 0
                },
                "slot": 0,
                "epoch": 0
            },
            "end": {
                "time": {
                    "seconds": 89856000
                },
                "slot": 4492800,
                "epoch": 208
            },
            "parameters": {
                "epochLength": 21600,
                "slotLength": {
                    "milliseconds": 20000
                },
                "safeZone": 4320
            }
        }
    ],
    "id": "getblock.io"
}

Response Parameters

FieldTypeDescription
startobjectBound at which the era begins
endobjectBound at which the era ends
parametersobjectEpoch length, slot length, and safe zone for the era

Use Cases

  • Time Conversion: Convert any slot to time across all eras
  • Scheduling: Compute future epoch and slot boundaries
  • Wallet Backends: Translate slots to dates for transaction history
  • Analytics: Normalize timestamps across hard forks

Error Handling

Error CodeMessageDescription
-32602Invalid paramsA required field is missing or has the wrong type
-32000Query unavailableThe query is not available in the current ledger era
-32603Internal errorThe node failed to answer the query