Bip32.fromPrivateKey constructor

Bip32.fromPrivateKey(
  1. Uint8List privateKey,
  2. Uint8List chainCode, [
  3. NetworkType? nw
])

Implementation

factory Bip32.fromPrivateKey(Uint8List privateKey, Uint8List chainCode,
    [NetworkType? nw]) {
  NetworkType network = nw ?? bitcoin;
  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 Bip32(privateKey, null, chainCode, network);
}