Bip32.fromPublicKey constructor

Bip32.fromPublicKey({
  1. required Uint8List publicKey,
  2. required Uint8List chainCode,
  3. Bip32EccCurve? ecc,
})

Implementation

factory Bip32.fromPublicKey({
  required Uint8List publicKey,
  required Uint8List chainCode,
  Bip32EccCurve? ecc,
}) {
  ecc ??= Bip32EccCurve();

  if (!ecc.isPoint(publicKey)) {
    throw ArgumentError('Point is not on the curve');
  }

  return Bip32(null, publicKey, chainCode, _bitcoinNetworkType);
}