ECPair.fromPrivateKey constructor

ECPair.fromPrivateKey(
  1. Uint8List privateKey, {
  2. NetworkType? network,
  3. bool? compressed,
})

Implementation

factory ECPair.fromPrivateKey(Uint8List privateKey, {NetworkType? 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);
}