isXAddress static method

bool isXAddress(
  1. String? address
)

Checks whether the given address is an X-Address.

This method attempts to decode the provided address as an X-Address using decodeXAddress. Returns true if the decoding succeeds, indicating that the address is an X-Address; otherwise, returns false.

address The address to be checked. returns true if the address is an X-Address; false otherwise.

Implementation

static bool isXAddress(String? address) {
  try {
    decodeXAddress(address!, null);
    return true;
  } catch (e) {
    return false;
  }
}