Bip32Base.fromPublicKey constructor

Bip32Base.fromPublicKey(
  1. List<int> pubKey, [
  2. Bip32KeyData? keyData,
  3. Bip32KeyNetVersions? keyNetVer
])

Creates a BIP-32 key from a public key.

The pubKey parameter represents the public key bytes, and the optional keyData and keyNetVer parameters specify key data and network versions.

Implementation

Bip32Base.fromPublicKey(List<int> pubKey,
    [Bip32KeyData? keyData, Bip32KeyNetVersions? keyNetVer]) {
  pubKey = pubKey.asImmutableBytes;
  keyNetVer ??= defaultKeyNetVersion;
  keyData ??= Bip32KeyData();
  _privKey =
      _initializePrivateKey(null, pubKey, keyData, keyNetVer, curveType);
  _pubKey = _initializePublicKey(null, pubKey, keyData, keyNetVer, curveType);
}