Serializes a Serializable
value to its BCS representation.
This function is the TypeScript SDK equivalent of bcs::to_bytes
in Move.
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.
A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
Signature for a K-of-N multi-sig transaction. This constructor initializes a multi-signature transaction with the provided signatures and bitmap.
An object containing the parameters for the multi-signature transaction.
Readonly
publicList of any public keys
Readonly
signaturesThe minimum number of valid signatures required, for the number of public keys specified
Generates an authentication key based on the current instance's byte representation. This key can be used for secure authentication processes within the system.
The generated authentication key.
Create a bitmap that holds the mapping from the original public keys to the signatures passed in
array of the index mapping to the matching public keys
Uint8array bit map
Serializes the object by writing its signatures and bitmap to the provided serializer. This allows the object to be converted into a format suitable for transmission or storage.
The serializer instance used to perform the serialization.
Get the public key as a hex string with a 0x prefix.
The public key in hex format.
Get the raw public key bytes
Verifies the provided signature against the given message. This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.
Note: This function will fail if a keyless signature is used. Use verifySignatureAsync
instead.
The arguments for verifying the signature.
The message that was signed.
The signature to verify.
Verifies the provided signature against the given message. This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.
The arguments for verifying the signature.
The Aptos configuration to use
The message that was signed.
Optional
options?: { throwErrorWithReason?: boolean }The signature to verify.
Static
deserializeDeserializes a MultiKeySignature from the provided deserializer. This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.
The deserializer instance used to read the serialized data.
Get the index of the provided public key.
This function retrieves the index of a specified public key within the MultiKey. If the public key does not exist, it throws an error.
The public key to find the index for.
The corresponding index of the public key, if it exists.
Represents a multi-key authentication scheme for accounts, allowing multiple public keys to be associated with a single account. This class enforces a minimum number of valid signatures required to authorize actions, ensuring enhanced security for multi-agent accounts.
The public keys of each individual agent can be any type of public key supported by Aptos. Since AIP-55, Aptos supports
Legacy
andUnified
authentication keys.