classicToXAddress static method
Converts a classic XRP address to an X-Address.
This method decodes the classic XRP address to obtain the address hash and then calls hashToXAddress with the provided X-Address prefix and optional tag to generate the resulting X-Address.
addr
The classic XRP address to be converted to an X-Address.
xAddrPrefix
The prefix for the X-Address, specific to mainnet or testnet.
tag
An optional tag associated with the X-Address. Must be lower than 2^32 for Ripple X-Addresses.
returns The converted X-Address as a Base58Check encoded string.
Implementation
static String classicToXAddress(String addr, List<int> xAddrPrefix,
{int? tag}) {
final addrHash = XrpAddrDecoder().decodeAddr(addr);
return hashToXAddress(addrHash, xAddrPrefix, tag);
}