CCC Docs
    Preparing search index...

    Hierarchy

    Index

    Constructors

    • Creates an instance of WitnessArgs.

      Parameters

      • Optionallock: `0x${string}`

        The optional lock field of the witness.

      • OptionalinputType: `0x${string}`

        The optional input type field of the witness.

      • OptionaloutputType: `0x${string}`

        The optional output type field of the witness.

      Returns WitnessArgs

    Properties

    lock?: `0x${string}`

    The optional lock field of the witness.

    inputType?: `0x${string}`

    The optional input type field of the witness.

    outputType?: `0x${string}`

    The optional output type field of the witness.

    byteLength?: number

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

    Methods

    • Creates a WitnessArgs instance from a WitnessArgsLike object.

      Parameters

      • witnessArgs: WitnessArgsLike

        A WitnessArgsLike object or an instance of WitnessArgs.

      Returns WitnessArgs

      A WitnessArgs instance.

      const witnessArgs = WitnessArgs.from({
      lock: "0x...",
      inputType: "0x...",
      outputType: "0x..."
      });
    • Encode the entity into bytes

      Parameters

      Returns Bytes

      The encoded bytes

      Will throw an error if the entity is not serializable

    • Decode the entity from bytes

      Parameters

      Returns WitnessArgs

      The decoded entity

      Will throw an error if the entity is not serializable

    • Create an entity from bytes

      Parameters

      Returns WitnessArgs

      The created entity

      Will throw an error if the entity is not serializable

    • Convert the entity to bytes

      Returns Bytes

      The bytes representation of the entity

    • Check if the entity is equal to another entity

      Parameters

      Returns boolean

      True if the entities are equal, false otherwise

    • Calculate the hash of the entity

      Returns `0x${string}`

      The hash of the entity