HDWallet.fromBase58 constructor

HDWallet.fromBase58(
  1. String xpub, {
  2. NetworkType? network,
})

Implementation

factory HDWallet.fromBase58(String xpub, {NetworkType? network}) {
  network = network ?? bitcoin;
  var wallet;
  var p2pkh;
  try {
    wallet = bip32.BIP32.fromBase58(xpub, bip32.NetworkType(
        bip32: bip32.Bip32Type(
            public: network.bip32.public, private: network.bip32.private),
        wif: network.wif));
  }catch(e){
  }
  try {
    p2pkh = P2PKH(
        data: PaymentData(pubkey: wallet.publicKey), network: network);
  }catch(e){
  }
  return HDWallet(bip32: wallet, p2pkh: p2pkh, network: network, seed: null);
}