convertHdPublicKey function
Implementation
String convertHdPublicKey(String hdPubKey, KaspaNetwork toNetwork) {
final network = networkForKpub(hdPubKey);
if (network == toNetwork) {
return hdPubKey;
}
final networkType = networkTypeForNetwork(network);
final bip32 = BIP32.fromBase58(hdPubKey, networkType);
final toNetworkType = networkTypeForNetwork(toNetwork);
bip32.network = toNetworkType;
return bip32.toBase58();
}