Bip32Base.fromPrivateKey constructor
Bip32Base.fromPrivateKey(
- List<
int> privKey, [ - Bip32KeyData? keyData,
- Bip32KeyNetVersions? keyNetVer
Creates a BIP-32 key from a private key.
The privKey
parameter represents the private key bytes, and the optional
keyData
and keyNetVer
parameters specify key data and network versions.
Implementation
Bip32Base.fromPrivateKey(List<int> privKey,
[Bip32KeyData? keyData, Bip32KeyNetVersions? keyNetVer]) {
privKey = privKey.asImmutableBytes;
keyNetVer ??= defaultKeyNetVersion;
keyData ??= Bip32KeyData();
_privKey =
_initializePrivateKey(privKey, null, keyData, keyNetVer, curveType);
_pubKey =
_initializePublicKey(privKey, null, keyData, keyNetVer, curveType);
}