random static method

Generate a new random Ed25519HDKeyPair

Implementation

static Future<Ed25519HDKeyPair> random() {
  int random(int _) => _random.nextInt(256);

  // Create the seed
  final List<int> seedBytes = List<int>.generate(32, random);

  // Finally, create a new wallet
  return Ed25519HDKeyPair.fromSeedWithHdPath(
    seed: seedBytes,
    hdPath: "m/44'/501'/0'/0'",
  );
}