AleoAccount.fromExtendedPrivateKey constructor

AleoAccount.fromExtendedPrivateKey(
  1. String extendedPrivateKey, {
  2. int accountIndex = 0,
})

AleoAccount from extended privateKey aka seed accountIndex 0 for default account, next account index will be will 1

Implementation

AleoAccount.fromExtendedPrivateKey(
  this.extendedPrivateKey, {
  int accountIndex = 0,
}) {
  String path = "m/44'/0'/$accountIndex'/0'";
  final keys = deriveAleoPath(path, extendedPrivateKey);
  privateKey = privateKeyFromSeed(seed: keys.key!);
  viewKey = privateKeyToViewKey(privateKey: privateKey);
  address = privateKeyToAddress(privateKey: privateKey);
  derivePath = path;
}