ECPair.fromPrivateKey constructor

ECPair.fromPrivateKey(Uint8List privateKey, { Network network, bool compressed })

Creates a keypair from privateKey

Implementation

factory ECPair.fromPrivateKey(Uint8List privateKey, {Network network, bool compressed}) {
  if (privateKey.length != 32)
    throw ArgumentError(
      "Expected property privateKey of type Buffer(Length: 32)");
  if (!ecc.isPrivate(privateKey))
    throw ArgumentError("Private key not in range [1, n)");
  return ECPair(privateKey, null,
    network: network, compressed: compressed);
}