deriveMasterNodeFromSeed function

BipNode deriveMasterNodeFromSeed({
  1. required Uint8List seed,
  2. required HDWalletPath walletPath,
  3. UTXONetworkType? networkType,
})

Implementation

BipNode deriveMasterNodeFromSeed({
  required Uint8List seed,
  required HDWalletPath walletPath,
  UTXONetworkType? networkType,
}) {
  final bipNetworkType =
      networkType?.networkBIP.getForWalletType(walletPath.purpose);

  final parentNode = BipNode.fromSeed(seed, bipNetworkType);
  final derivationPath = switch (walletPath.basePath) {
    "m/44'/2'" => walletPath.account0Path,
    _ => walletPath.purpose.string,
  };
  final node =
      parentNode.derivePath(derivationPath); // TODO: Use base Path with Account

  return node;
}