Represents the signature of a K-of-N Ed25519 multi-sig transaction.

Hierarchy (view full)

Constructors

  • Signature for a K-of-N multi-sig transaction.

    Parameters

    • args: {
          bitmap: Uint8Array | number[];
          signatures: Ed25519Signature[];
      }
      • bitmap: Uint8Array | number[]

        4 bytes, at most 32 signatures are supported. If Nth bit value is 1, the Nth signature should be provided in signatures. Bits are read from left to right. Alternatively, you can specify an array of bitmap positions. Valid position should range between 0 and 31.

      • signatures: Ed25519Signature[]

        A list of signatures

    Returns MultiEd25519Signature

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: Ed25519Signature[]

The list of underlying Ed25519 signatures

BITMAP_LEN: number

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

MAX_SIGNATURES_SUPPORTED: number

Maximum number of Ed25519 signatures supported

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

  • Helper function to get a value's BCS-serialized bytes as a Hex instance.

    Returns Hex

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

  • Parameters

    Returns void

  • Get the signature as a hex string with a 0x prefix e.g. 0x123456...

    Returns string

  • Converts a MultiSignature into Uint8Array (bytes) with bytes = s1_bytes | ... | sn_bytes | bitmap

    Returns 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