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.
Creates an instance of the signature class based on the provided signature type. This allows for the handling of different signature variants such as Ed25519, Secp256k1, and Keyless.
The publicKey object which determines the variant to be used.
Readonly
publicReference to the inner public key
Readonly
variantIndex of the underlying enum variant
Generates an authentication key from the current instance's byte representation. This function is essential for creating a unique identifier for authentication purposes.
The generated authentication key.
Serializes the current object using the provided serializer. This function helps in converting the object 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 signature in bytes (Uint8Array).
This function is a warning that it will soon return the underlying signature bytes directly. Use AnySignature.bcsToBytes() instead.
Uint8Array representation of the signature.
Verifies the provided signature against the given message. This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
The arguments for signature verification.
Represents the arguments required to verify a digital signature.
A boolean indicating whether the signature is valid for the given message.
Static
deserializeDeserializes an AnySignature from the provided deserializer. This function helps in reconstructing the AnySignature object from its serialized form, allowing for further processing or validation.
The deserializer instance used to read the serialized data.
Static
isDetermines if the provided publicKey is an instance of a valid PublicKey object.
The publicKey to be checked for validity.
True if the signature is a valid instance; otherwise, false.
Static
isDetermines if the provided public key is an instance of AnyPublicKey.
The public key to check.
Represents any public key supported by Aptos.
Since AIP-55 Aptos supports
Legacy
andUnified
authentication keys.Any unified authentication key is represented in the SDK as
AnyPublicKey
.