isClassicAddress static method

bool isClassicAddress(
  1. String? address
)

Checks whether the given address is a classic XRP address.

This method attempts to decode the provided address as a classic XRP address using XrpAddrDecoder. Returns true if the decoding succeeds, indicating that the address is a classic XRP address; otherwise, returns false.

address The address to be checked. returns true if the address is a classic XRP address; false otherwise.

Implementation

static bool isClassicAddress(String? address) {
  try {
    XrpAddrDecoder().decodeAddr(address!);
    return true;
  } catch (e) {
    return false;
  }
}