Class AccountAbstract

Abstract class representing a generic Aptos account.

This class serves as a single entry point for account generation, allowing accounts to be created either through Account.generate() or Account.fromDerivationPath. Although it is defined as an abstract class, it should be treated as an interface and enforced using the implements keyword.

Note: Generating an account instance does not create the account on-chain.

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.

  • Generates a new account based on the specified signing scheme and legacy option. This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.

    Parameters

    • Optionalargs: GenerateEd25519AccountArgs

      The arguments for generating the account.

      Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.

      • Optionallegacy?: true
      • Optionalscheme?: Ed25519

    Returns Ed25519Account

  • Generates a new account based on the specified signing scheme and legacy option. This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.

    Parameters

    • args: GenerateEd25519SingleKeyAccountArgs

      The arguments for generating the account.

      Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey. The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.

      • legacy: false
      • Optionalscheme?: Ed25519

    Returns SingleKeyAccount

  • Generates a new account based on the specified signing scheme and legacy option. This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.

    Parameters

    • args: GenerateSingleKeyAccountArgs

      The arguments for generating the account.

      Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey. The legacy argument is optional and defaults to false, and cannot be set to true.

    Returns SingleKeyAccount

  • Generates a new account based on the specified signing scheme and legacy option. This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.

    Parameters

    • args: GenerateAccountArgs

      The arguments for generating the account.

      Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.

    Returns Account

Constructors

MMNEPVFCICPMFPCPTTAAATR