CCC Docs
    Preparing search index...

    Type Alias EpochLike

    EpochLike:
        | [NumLike, NumLike, NumLike]
        | { integer: NumLike; numerator: NumLike; denominator: NumLike }
        | Num
        | Hex

    EpochLike

    Union type that represents any allowed input shapes that can be converted into an Epoch instance.

    Accepted shapes:

    • Tuple: [integer, numerator, denominator] where each element is NumLike
    • Object: { integer, numerator, denominator } where each field is NumLike
    • Packed numeric form: Num (bigint) or Hex (RPC-style packed hex)

    Notes:

    • When constructing an Epoch from a Num or Hex the packed numeric representation encodes integer (24 bits), numerator (16 bits) and denominator (16 bits).
    • Use Epoch.from() to convert any EpochLike into an Epoch instance.
    // From tuple
    Epoch.from([1n, 0n, 1n]);