toPrivateBase58 method

String toPrivateBase58()

Implementation

String toPrivateBase58() {
  final version =  network.bip32.private ;
  Uint8List buffer =  Uint8List(78);
  ByteData bytes = buffer.buffer.asByteData();
  bytes.setUint32(0, version);
  bytes.setUint8(4, depth);
  bytes.setUint32(5, parentFingerprint);
  bytes.setUint32(9, index);
  buffer.setRange(13, 45, chainCode);
  bytes.setUint8(45, 0);
  buffer.setRange(46, 78, privateKey!);
  return bs58check.encode(buffer);
}