encodeKey static method

String encodeKey(
  1. Secp256k1PrivateKey key, {
  2. List<int> netVer = const [],
  3. CryptoKeyEncoding pubKeyMode = CryptoKeyEncoding.base,
})

Implementation

static String encodeKey(
  Secp256k1PrivateKey key, {
  List<int> netVer = const [],
  CryptoKeyEncoding pubKeyMode = CryptoKeyEncoding.base,
}) {
  return key.takeSecretKey().useValue((k) {
    return Base58Encoder.encodeWithChecksum([
      ...netVer,
      ...k,
      if (pubKeyMode == CryptoKeyEncoding.base) WifConst.comprPubKeySuffix,
    ]);
  });
}