decodeAddr method

  1. @override
List<int> decodeAddr(
  1. String addr, {
  2. ChainType? chainType,
})
override

Validates and decodes the given Ripple (XRP) X-address.

Implementation

@override
List<int> decodeAddr(String addr, {ChainType? chainType}) {
  final decode = XRPAddressUtils.decodeXAddress(addr);
  if (chainType != null && decode.chainType != chainType) {
    throw AddressConverterException.addressValidationFailed(
      reason: "Mismatch chain type.",
    );
  }
  return decode.hash;
}