getWalletFromWif method

Future<BasicWallet> getWalletFromWif(
  1. Wif wif
)

Gets a wallet from the supplied wif

Future

Implementation

Future<BasicWallet> getWalletFromWif(Wif wif) async {
  var networkPrivateKey = getPrivateKeyAndNetworkFromWif(wif);
  HexPrivateKey hexPrivateKey = networkPrivateKey.hexPrivateKey!;
  NetworkPrefix networkPrefix = networkPrivateKey.networkPrefix!;

  var hexPublicKey = await getPublicKeyFromPrivateKey(hexPrivateKey);
  var address = generateAddress(hexPublicKey, networkPrefix);
  return BasicWallet(hexPublicKey, wif, address);
}