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 = EthAddrEncoder().encodeKey(pubKey).substring(2);
  return Base58Encoder.encodeWithChecksum([
    ...BytesUtils.fromHexString(
      AddrKeyValidator.getConfigArg(
        CoinsConf.tron.params.addrPrefix,
        "addrPrefix",
      ),
    ),
    ...BytesUtils.fromHexString(ethAddr),
  ]);
}