accountFromPrivateKey function

LegacyAccount accountFromPrivateKey(
  1. String privHex
)

private key (hex) → account

Implementation

LegacyAccount accountFromPrivateKey(String privHex) {
  final pub = compressedPublicKey(bytesToBigInt(hexToBytes(privHex)));
  return LegacyAccount(privHex, bytesToHex(pub), publicKeyToAddress(pub));
}