MoneroAccount.fromSeed constructor

MoneroAccount.fromSeed(
  1. List<int> seedBytes, {
  2. MoneroCoins coinType = MoneroCoins.moneroMainnet,
})

Factory method to create a Monero instance from a seed.

Given a seedBytes and an optional coinType, this method constructs a Monero instance with the associated keys and configurations.

Implementation

factory MoneroAccount.fromSeed(List<int> seedBytes,
    {MoneroCoins coinType = MoneroCoins.moneroMainnet}) {
  final List<int> privSkeyBytes =
      seedBytes.length == Ed25519KeysConst.privKeyByteLen
          ? seedBytes
          : QuickCrypto.keccack256Hash(seedBytes);
  return MoneroAccount.fromPrivateSpendKey(
      Ed25519Utils.scalarReduce(privSkeyBytes),
      coinType: coinType);
}