xAddressToClassic static method

String xAddressToClassic(
  1. String xAddrress,
  2. List<int> xAddrPrefix
)

Converts an X-Address to a classic XRP address.

This method decodes the X-Address to obtain the address bytes and then encodes them into a classic XRP address using the Base58Check encoding with the prefix specified in CoinsConf.ripple.params.p2pkhNetVer.

xAddrress The X-Address to be converted to a classic XRP address. xAddrPrefix The prefix for the X-Address, specific to mainnet or testnet. returns The converted classic XRP address as a Base58Check encoded string.

Implementation

static String xAddressToClassic(String xAddrress, List<int> xAddrPrefix) {
  final decode =
      XrpXAddrDecoder().decodeAddr(xAddrress, {"prefix": xAddrPrefix});

  return Base58Encoder.checkEncode(
      List<int>.from([...CoinsConf.ripple.params.p2pkhNetVer!, ...decode]),
      Base58Alphabets.ripple);
}