CCC Docs
    Preparing search index...

    Class WitnessArgs

    Hierarchy

    • Impl<
          {
              lock?: BytesLike
              | null;
              inputType?: BytesLike | null;
              outputType?: BytesLike | null;
          } & {},
          WitnessArgs,
          any,
          this,
      >
      • WitnessArgs
    Index
    • Creates an instance of WitnessArgs.

      Parameters

      • lock: DecodedRecord<
            {
                lock: Codec<
                    BytesLike
                    | null
                    | undefined,
                    `0x${string}` | undefined,
                    unknown,
                >;
                inputType: Codec<
                    BytesLike
                    | null
                    | undefined,
                    `0x${string}` | undefined,
                    unknown,
                >;
                outputType: Codec<
                    BytesLike
                    | null
                    | undefined,
                    `0x${string}` | undefined,
                    unknown,
                >;
            },
        >

        The optional lock field of the witness.

      Returns WitnessArgs

    lock?: `0x${string}`
    inputType?: `0x${string}`
    outputType?: `0x${string}`
    byteLength?: number

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

    encode: (
        _: {
            lock?: BytesLike | null;
            inputType?: BytesLike | null;
            outputType?: BytesLike | null;
        } & {},
    ) => Bytes

    Encode the entity into bytes

    Type Declaration

      • (
            _: {
                lock?: BytesLike | null;
                inputType?: BytesLike | null;
                outputType?: BytesLike | null;
            } & {},
        ): Bytes
      • Parameters

        • _: {
              lock?: BytesLike | null;
              inputType?: BytesLike | null;
              outputType?: BytesLike | null;
          } & {}

          The entity to encode

        Returns Bytes

        The encoded bytes

    Will throw an error if the entity is not serializable

    decode: (_: BytesLike, _context?: any) => WitnessArgs

    Decode the entity from bytes

    Type Declaration

    Will throw an error if the entity is not serializable

    fromBytes: (_bytes: BytesLike, _context?: any) => WitnessArgs

    Create an entity from bytes

    Type Declaration

    Will throw an error if the entity is not serializable

    from: (
        _: {
            lock?: BytesLike | null;
            inputType?: BytesLike | null;
            outputType?: BytesLike | null;
        } & {},
    ) => WitnessArgs

    Create an entity from a serializable object

    Type Declaration

      • (
            _: {
                lock?: BytesLike | null;
                inputType?: BytesLike | null;
                outputType?: BytesLike | null;
            } & {},
        ): WitnessArgs
      • Parameters

        • _: {
              lock?: BytesLike | null;
              inputType?: BytesLike | null;
              outputType?: BytesLike | null;
          } & {}

          The serializable object to create the entity from

        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

      • other: {
            lock?: BytesLike | null;
            inputType?: BytesLike | null;
            outputType?: BytesLike | null;
        } & {}

        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