Evolution SDK

Time/SlotConfig.ts

SlotConfig overview


Table of contents


Time

SLOT_CONFIG_NETWORK

Network-specific slot configurations for all Cardano networks.

  • Mainnet: Production network starting at Shelley era
  • Preview: Preview testnet for protocol updates
  • Preprod: Pre-production testnet
  • Custom: Customizable for emulator/devnet (initialized with zeros)

Signature

export declare const SLOT_CONFIG_NETWORK: Record<"Mainnet" | "Preview" | "Preprod" | "Custom", SlotConfig>

Added in v2.0.0

SlotConfig (interface)

Slot configuration for a Cardano network. Defines the relationship between slots and Unix time.

Signature

export interface SlotConfig {
  /**
   * Unix timestamp (in milliseconds) of the network start (Shelley era).
   */
  readonly zeroTime: bigint

  /**
   * First slot number of the Shelley era.
   */
  readonly zeroSlot: bigint

  /**
   * Duration of each slot in milliseconds (typically 1000ms = 1 second).
   */
  readonly slotLength: number
}

Added in v2.0.0

getSlotConfig

Get slot configuration for a network.

Signature

export declare const getSlotConfig: (network: Network.Network) => SlotConfig

Added in v2.0.0