serialize static method
String
serialize(
- IPrivateKey privKey,
- String pathOrBip32Path,
- dynamic chainCodeOrBip32ChainCode,
- Slip32KeyNetVersions keyNetVer,
Serialize a private key with a given path, chain code, and network version.
This method serializes a private key privKey
into a SLIP-32 format along with
the specified path or Bip32 path pathOrBip32Path
, chain code, and private key
network version keyNetVer
. It returns the serialized private key as a Bech32-encoded string.
Implementation
static String serialize(
IPrivateKey privKey,
String pathOrBip32Path,
dynamic chainCodeOrBip32ChainCode,
Slip32KeyNetVersions keyNetVer,
) {
return Slip32KeySerializer.serialize(
List<int>.from([0x00, ...privKey.raw]),
pathOrBip32Path,
chainCodeOrBip32ChainCode,
keyNetVer.private,
);
}