encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey, {
  2. int? tag,
  3. ChainType chainType = ChainType.mainnet,
  4. EllipticCurveTypes? pubKeyType,
})
override

Encodes the public key into a Ripple (XRP) X-Address.

Implementation

@override
String encodeKey(
  List<int> pubKey, {
  int? tag,
  ChainType chainType = ChainType.mainnet,
  EllipticCurveTypes? pubKeyType,
}) {
  /// Calculate the hash160 of the public key.
  final hash160 = XRPAddressUtils.keyToHash(pubKey, type: pubKeyType);

  return XRPAddressUtils.hashToXAddress(hash160, chainType, tag);
}