@aptos-labs/ts-sdk - v7.4.0
    Preparing search index...

    Class AnyPublicKey

    Represents any public key supported by Aptos.

    Since AIP-55 Aptos supports Legacy and Unified authentication keys.

    Any unified authentication key is represented in the SDK as AnyPublicKey.

    Hierarchy (View Summary)

    Index
    • 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.

    publicKey: PublicKey

    Reference to the inner public key

    Index of the underlying enum variant

    • 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.

      Parameters

      • args: { message: HexInput; signature: AnySignature }

        The arguments for signature verification.

        • message: HexInput

          The message that was signed.

        • signature: AnySignature

          The signature to verify, which must be an instance of AnySignature.

      Returns boolean

      A boolean indicating whether the signature is valid for the given message.

    • 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.

      Parameters

      • args: {
            aptosConfig: AptosConfig;
            message: HexInput;
            options?: { throwErrorWithReason?: boolean };
            signature: Signature;
        }

        The arguments for signature verification.

        • aptosConfig: AptosConfig

          The configuration object for connecting to the Aptos network

        • message: HexInput

          The message that was signed.

        • Optionaloptions?: { throwErrorWithReason?: boolean }
        • signature: Signature

          The signature to verify, which must be an instance of AnySignature.

      Returns Promise<boolean>

      A boolean indicating whether the signature is valid for the given message.