Account

abstract class Account

This file defines the Account abstract class and its companion object, which provides methods for creating and importing accounts using different signature schemes.

The [Account] class has the following abstract properties:

  • [publicKey]: The public key of the account.

  • [address]: The account address.

  • [scheme]: The signature scheme used by the account.

The companion object provides the following methods:

  • create(scheme: SignatureScheme = SignatureScheme.ED25519): Creates a new account using the specified signature scheme. Defaults to ED25519.

  • import(privateKey: ByteArray, scheme: SignatureScheme = SignatureScheme.ED25519): Imports an account using the provided private key and signature scheme. Defaults to ED25519.

  • import(phrase: String, scheme: SignatureScheme = SignatureScheme.ED25519): Imports an account using the provided mnemonic phrase and signature scheme. Defaults to ED25519.

  • import(phrases: List<String>, scheme: SignatureScheme = SignatureScheme.ED25519): Imports an account using the provided list of mnemonic phrases and signature scheme. Defaults to ED25519.

The [create] and [import] methods throw a [SignatureSchemeNotSupportedException] if the specified signature scheme is not supported.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val address: AccountAddress
Link copied to clipboard
abstract val publicKey: PublicKey
Link copied to clipboard
abstract val scheme: SignatureScheme

Functions

Link copied to clipboard
abstract fun sign(message: ByteArray): ByteArray