encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey, {
  2. List<int>? netVersion,
})
override

Encodes a public key or address bytes into a blockchain address.

Throws AddressConverterException on invalid input.

Implementation

@override
String encodeKey(List<int> pubKey, {List<int>? netVersion}) {
  netVersion = AddrKeyValidator.getAddrArg<List<int>>(
    netVersion,
    "netVersion",
  );

  return Base58Encoder.encodeWithChecksum([
    ...netVersion,
    ...validateAndHashKey(pubKey),
  ]);
}