Class AptosAccount

Class for creating and managing Aptos account

Hierarchy

  • AptosAccount

Constructors

  • Creates new account instance. Constructor allows passing in an address, to handle account key rotation, where auth_key != public_key

    Parameters

    • Optional privateKeyBytes: Uint8Array

      Private key from which account key pair will be generated. If not specified, new key pair is going to be created.

    • Optional address: MaybeHexString

      Account address (e.g. 0xe8012714cd17606cee7188a2a365eef3fe760be598750678c8c5954eb548a591). If not specified, a new one will be generated from public key

    Returns AptosAccount

Properties

accountAddress: HexString

Address associated with the given account

signingKey: SignKeyPair

A private key and public key, associated with the given account

Methods

  • This is the key by which Aptos account is referenced. It is the 32-byte of the SHA-3 256 cryptographic hash of the public key(s) concatenated with a signature scheme identifier byte

    Returns

    Address associated with the given account

    Returns HexString

  • This key is generated with Ed25519 scheme. Public key is used to check a signature of transaction, signed by given account

    Returns

    The public key for the associated account

    Returns HexString

  • Signs specified buffer with account's private key

    Returns

    A signature HexString

    Parameters

    • buffer: Uint8Array

      A buffer to sign

    Returns HexString

  • Derives account address, public key and private key

    Returns

    AptosAccountObject instance.

    Example

    An example of the returned AptosAccountObject object

    {
    address: "0xe8012714cd17606cee7188a2a365eef3fe760be598750678c8c5954eb548a591",
    publicKeyHex: "0xf56d8524faf79fbc0f48c13aeed3b0ce5dd376b4db93b8130a107c0a5e04ba04",
    privateKeyHex: `0x009c9f7c992a06cfafe916f125d8adb7a395fca243e264a8e56a4b3e6accf940
    d2b11e9ece3049ce60e3c7b4a1c58aebfa9298e29a30a58a67f1998646135204`
    }

    Returns AptosAccountObject

  • Takes source address and seeds and returns the resource account address

    Returns

    The resource account address

    Parameters

    • sourceAddress: MaybeHexString

      Address used to derive the resource account

    • seed: Uint8Array

      The seed bytes

    Returns HexString

  • Test derive path

    Parameters

    • path: string

    Returns boolean

Generated using TypeDoc