Represents a multi-signature transaction using Ed25519 signatures. This class allows for the creation and management of a K-of-N multi-signature scheme, where a specified number of signatures are required to authorize a transaction.

It includes functionality to validate the number of signatures against a bitmap, which indicates which public keys have signed the transaction.

Hierarchy (view full)

Constructors

Methods

  • Serializes a Serializable value to its BCS representation. This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.

    Returns Uint8Array

    the BCS representation of the Serializable instance as a byte buffer.

  • Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.

    Returns Hex

    A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.

  • Helper method to create a bitmap out of the specified bit positions

    Parameters

    • args: {
          bits: number[];
      }
      • bits: number[]

        The bitmap positions that should be set. A position starts at index 0. Valid position should range between 0 and 31.

    Returns Uint8Array

    bitmap that is 32bit long

    Here's an example of valid bits

    [0, 2, 31]
    

    [0, 2, 31] means the 1st, 3rd and 32nd bits should be set in the bitmap. The result bitmap should be 0b1010000000000000000000000000001

Properties

bitmap: Uint8Array

32-bit Bitmap representing who signed the transaction

This is represented where each public key can be masked to determine whether the message was signed by that key.

signatures: AnySignature[]

The list of underlying Ed25519 signatures

BITMAP_LEN: number = 4

Number of bytes in the bitmap representing who signed the transaction (32-bits)

MAX_SIGNATURES_SUPPORTED: number = ...

Maximum number of Ed25519 signatures supported