Skip to main content
import { Slot } from 'voltaire-effect/primitives'
import { Effect } from 'effect'

const slot = yield* Slot.from(12345)

// Conversions
Slot.toNumber(slot)  // 12345
Slot.toBigInt(slot)  // 12345n
Slot.toEpoch(slot)   // epoch number (slot / 32)

// Compare
Slot.equals(a, b)

API

FunctionSignature
from(input) => Effect<SlotType, SlotError>
toNumber(slot) => number
toBigInt(slot) => bigint
toEpoch(slot) => bigint
equals(a, b) => boolean
SchemaAccepts number, bigint, string