deriveExtendedPubKey function

String deriveExtendedPubKey({
  1. required Uint8List seed,
  2. required HDWalletPath walletPurpose,
  3. UTXONetworkType? type,
})

Implementation

String deriveExtendedPubKey({
  required Uint8List seed,
  required HDWalletPath walletPurpose,
  UTXONetworkType? type,
}) {
  ///
  /// Walletkit Compatibility
  ///
  if (type == LitecoinNetwork) {
    final depth1MasterNode = deriveMasterNodeFromSeed(
      seed: seed,
      networkType: type,
      walletPath: bitcoinBip44HDPath, // TODO: Check if still valid
    );

    final parentFingerprint = depth1MasterNode.parentFingerprint;

    final masterNode = deriveMasterNodeFromSeed(
      seed: seed,
      networkType: type,
      walletPath: walletPurpose,
    );
    return masterNode.neutered().toBase58wkCompatibility(parentFingerprint, 1);
  }

  final masterNode = deriveMasterNodeFromSeed(
    seed: seed,
    networkType: type,
    walletPath: walletPurpose,
  );
  return masterNode.neutered().toBase58();
}