Skip to content

Latest Epoch

GET /v1/epochs/latest

Get the current network tip and epoch information from Ogmios. This endpoint provides real-time blockchain tip data, useful for calculating transaction TTL (time-to-live) values.

Example Request:

bash
curl -X GET "https://api.fireblocks.partners.iagon.com/v1/epochs/latest" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

Content-Type: application/json;charset=utf-8

json
{
  "success": true,
  "data": {
    "tip": {
      "slot": 141234567,
      "epoch": 536,
      "epoch_slot": 234567
    },
    "network": {
      "era": "conway",
      "name": "mainnet",
      "sync_progress": 1
    },
    "params": {
      "epoch_length": 432000,
      "slot_length": 1
    }
  }
}

Content-Type: application/json;charset=utf-8

json
{
  "success": false,
  "error": "Failed to fetch network tip"
}

Response Fields:

Tip Object

FieldTypeDescription
slotintegerAbsolute slot number (use this for TTL calculation)
epochintegerCurrent epoch number
epoch_slotintegerSlot number within the current epoch (0 to epoch_length-1)

Network Object

FieldTypeDescription
erastringCurrent Cardano era (e.g., "conway", "babbage")
namestringNetwork name (e.g., "mainnet", "preprod", "preview")
sync_progressnumberNode synchronization progress (0-1, where 1 = fully synced)

Params Object

FieldTypeDescription
epoch_lengthintegerNumber of slots per epoch (432000 for mainnet)
slot_lengthintegerDuration of each slot in seconds (1 for mainnet post-Shelley)

Usage Example: Calculating Transaction TTL

Use the tip information to calculate a safe TTL for transactions:

javascript
const response = await fetch('/v1/epochs/latest', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const { data } = await response.json();

// Set TTL to 2 hours (7200 slots) from current tip
const ttl = data.tip.slot + 7200;

// Use this TTL when building your transaction
console.log(`Transaction TTL: ${ttl}`);