random static method

Future<Account> random({
  1. String? name,
  2. AccountType accountType = AccountType.single,
})

Create a new, random generated account.

Implementation

static Future<Account> random({
  String? name,
  AccountType accountType = AccountType.single,
}) async {
  final keyPair = await Ed25519().newKeyPair();
  final publicKey = await keyPair.extractPublicKey();
  final account = Account._create(
    publicKey: publicKey,
    keyPair: keyPair,
    name: name,
    accountType: accountType,
  );

  return account;
}