decodeAddr method
Decodes a Ripple (XRP) blockchain address into its byte representation.
This method takes a Ripple address as a string and optional keyword arguments, including "net_ver" specifying the network version byte and "base58_alph" specifying the Base58 alphabet to use for decoding. It delegates the decoding process to the P2PKHAddrDecoder class, providing the necessary parameters. The resulting byte representation of the address is returned as a List<int>.
Parameters:
addr
: The Ripple address as a string to decode.kwargs
: Optional keyword arguments, including "net_ver" and "base58_alph" settings.
Returns: A List<int> representing the byte data of the decoded Ripple address.
Example usage:
final decoder = XrpAddrDecoder();
final rippleAddress = "r9HcFbTdsuGAAQ14xaNk7zPQGqPt6fPqGT";
final decodedBytes = decoder.decodeAddr(rippleAddress);
Implementation
@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
/// Delegate the decoding process to P2PKHAddrDecoder with specific parameters.
return P2PKHAddrDecoder().decodeAddr(addr, {
"net_ver": CoinsConf.ripple.params.p2pkhNetVer!,
"base58_alph": Base58Alphabets.ripple,
});
}