encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey
)
override

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

Throws AddressConverterException on invalid input.

Implementation

@override
String encodeKey(List<int> pubKey) {
  final String ethAddr = StringUtils.strip0x(
    EthAddrEncoder().encodeKey(pubKey),
  );

  return Bech32Encoder.encode(
    AddrKeyValidator.getConfigArg(
      CoinsConf.harmonyOne.params.addrHrp,
      "addrHrp",
    ),
    BytesUtils.fromHexString(ethAddr),
  );
}