CCC Docs
    Preparing search index...

    Hierarchy

    Index

    Constructors

    Properties

    relative: "absolute" | "relative"
    metric: "epoch" | "timestamp" | "blockNumber"
    value: bigint
    byteLength?: number

    The bytes length of the entity, if it is fixed, otherwise undefined

    encode: (_: SinceLike) => Bytes

    Encode the entity into bytes

    Type Declaration

    Will throw an error if the entity is not serializable

    decode: (_: BytesLike, _config?: { isExtraFieldIgnored?: boolean }) => Since

    Decode the entity from bytes

    Type Declaration

      • (_: BytesLike, _config?: { isExtraFieldIgnored?: boolean }): Since
      • Parameters

        • _: BytesLike

          The bytes to decode

        • Optional_config: { isExtraFieldIgnored?: boolean }

          The configuration for decoding, including whether to ignore extra fields

        Returns Since

        The decoded entity

    Will throw an error if the entity is not serializable

    fromBytes: (
        _bytes: BytesLike,
        _config?: { isExtraFieldIgnored?: boolean },
    ) => Since

    Create an entity from bytes

    Type Declaration

      • (_bytes: BytesLike, _config?: { isExtraFieldIgnored?: boolean }): Since
      • Parameters

        • _bytes: BytesLike
        • Optional_config: { isExtraFieldIgnored?: boolean }

          The configuration for decoding, including whether to ignore extra fields

        Returns Since

        The created entity

    Will throw an error if the entity is not serializable

    Methods

    • Clone a Since.

      Returns Since

      A cloned Since instance.

      const since1 = since0.clone();
      
    • Creates a Since instance from a SinceLike object.

      Parameters

      • since: SinceLike

        A SinceLike object or an instance of Since.

      Returns Since

      A Since instance.

      const since = Since.from("0x1234567812345678");
      
    • Converts the Since instance to num.

      Returns bigint

      A num

      const num = since.toNum();
      
    • Creates a Since instance from a num-like value.

      Parameters

      • numLike: NumLike

        The num-like value to convert.

      Returns Since

      A Since instance.

      const since = Since.fromNum("0x0");
      
    • Convert the entity to bytes

      Returns Bytes

      The bytes representation of the entity

    • Check if the entity is equal to another entity

      Parameters

      • other: SinceLike

        The other entity to compare with

      Returns boolean

      True if the entities are equal, false otherwise

    • Calculate the hash of the entity

      Returns `0x${string}`

      The hash of the entity

    • Convert the entity to a full-byte untrimmed Hex representation

      Returns `0x${string}`

      The entity full-byte untrimmed hexadecimal representation