encodeKey method

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

Encodes a public key as a Tron address.

Implementation

@override
String encodeKey(List<int> pubKey) {
  final String ethAddr = EthAddrEncoder().encodeKey(pubKey).substring(2);
  return Base58Encoder.checkEncode([
    ...BytesUtils.fromHexString(
      AddrKeyValidator.getConfigArg(
        CoinsConf.tron.params.addrPrefix,
        "addrPrefix",
      ),
    ),
    ...BytesUtils.fromHexString(ethAddr),
  ]);
}