Interface SingleKeySigner

An interface which defines if an Account utilizes SingleKey signing.

Such an account will use the AnyPublicKey enum to represent its public key when deriving the auth key.

interface SingleKeySigner {
    accountAddress: AccountAddress;
    publicKey: AccountPublicKey;
    signingScheme: SigningScheme;
    getAnyPublicKey(): AnyPublicKey;
    sign(message: HexInput): Signature;
    signTransaction(transaction: AnyRawTransaction): Signature;
    signTransactionWithAuthenticator(
        transaction: AnyRawTransaction,
    ): AccountAuthenticator;
    signWithAuthenticator(message: HexInput): AccountAuthenticator;
    verifySignature(args: VerifySignatureArgs): boolean;
    verifySignatureAsync(
        args: {
            aptosConfig: AptosConfig;
            message: HexInput;
            signature: Signature;
        },
    ): Promise<boolean>;
}

Hierarchy (View Summary, Expand)

Implemented by

Implementation - Account (On-Chain Model)

accountAddress: AccountAddress

Account address associated with the account

publicKey: AccountPublicKey

Public key associated with the account

signingScheme: SigningScheme

Signing scheme used to sign transactions

  • Verify the given message and signature with the public key. This function helps ensure the integrity and authenticity of a message by validating its signature.

    Parameters

    Returns boolean

    A boolean indicating whether the signature is valid.

  • Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.

    Parameters

    • args: { aptosConfig: AptosConfig; message: HexInput; signature: Signature }

      The arguments for verifying the signature.

      • aptosConfig: AptosConfig

        The configuration object for connecting to the Aptos network

      • message: HexInput

        Raw message data in HexInput format.

      • signature: Signature

        Signed message signature.

    Returns Promise<boolean>

    A boolean indicating whether the signature is valid.

Methods

MMNEPVFCICPMFPCPTTAAATR