encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey, [
  2. Map<String, dynamic> kwargs = const {}
])
override

Encodes a Filecoin address for a public key using the secp256k1 address type.

This method takes a public key represented as a List

Parameters:

  • pubKey: The public key to encode as a List

Returns: A string representing the encoded Filecoin address.

Implementation

@override
String encodeKey(List<int> pubKey, [Map<String, dynamic> kwargs = const {}]) {
  final pubkey = AddrKeyValidator.validateAndGetSecp256k1Key(pubKey);
  final tobytes = pubkey.uncompressed;
  return _FilAddrUtils.encodeKeyBytes(tobytes, FillAddrTypes.secp256k1);
}