isValidETHAddress function

bool isValidETHAddress(
  1. String address
)

Implementation

bool isValidETHAddress(String address) {
  if (isValidCAIP10NFTAddress(address)) return true;
  if (address.contains('eip155:')) {
    final splittedAddress = address.split(':');
    if (splittedAddress.length == 3) {
      return isAddress(splittedAddress[2]);
    }
    if (splittedAddress.length == 2) {
      return isAddress(splittedAddress[1]);
    }
  }
  return isAddress(address);
}