CCC Docs
    Preparing search index...

    Class MultisigCkbWitness

    A class representing multisig information, holding information ingredients and containing utilities.

    Hierarchy

    Index

    Constructors

    • Parameters

      • publicKeyHashes: {
            publicKeyHashes: `0x${string}`[];
            threshold: number;
            mustMatch: number;
            signatures: `0x${string}`[];
        }

        The public key hashes.

      Returns MultisigCkbWitness

    Properties

    byteLength?: number

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

    Encode the entity into bytes

    Type Declaration

    Will throw an error if the entity is not serializable

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

    Decode the entity from bytes

    Type Declaration

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

        • _: BytesLike

          The bytes to decode

        • Optional_config: { isExtraFieldIgnored?: boolean }

          The configuration for decoding, including whether to ignore extra fields

        Returns MultisigCkbWitness

        The decoded entity

    Will throw an error if the entity is not serializable

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

    Create an entity from bytes

    Type Declaration

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

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

          The configuration for decoding, including whether to ignore extra fields

        Returns MultisigCkbWitness

        The created entity

    Will throw an error if the entity is not serializable

    publicKeyHashes: `0x${string}`[]
    threshold: number
    mustMatch: number
    signatures: `0x${string}`[]

    Accessors

    Methods

    • 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

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

      Returns `0x${string}`

      The entity full-byte untrimmed hexadecimal representation

    • Generate valid public key hashes and their signatures from the witness. This method filters out invalid signatures, duplicate signatures, and signatures not in the multisig script.

      Parameters

      Returns Generator<
          {
              pubkeyHash: `0x${string}`;
              signature: `0x${string}`;
              isRequired: boolean;
          },
      >

      A generator of public key hashes, signatures, and whether the signature is required.

    • Calculate the number of matched signatures in the witness.

      Parameters

      Returns { required: number; flexible: number }

      The number of required and flexible signatures.