getCAIPAddress function

Future<String> getCAIPAddress({
  1. required String address,
})

Implementation

Future<String> getCAIPAddress({required String address}) async {
  if (isValidCAIP10NFTAddress(address)) {
    return await getUserDID(address: address);
  }
  if (validateCAIP(address)) {
    return address;
  } else {
    if (isValidETHAddress(address)) {
      return getFallbackETHCAIPAddress(address: address);
    } else {
      throw Exception('invalid address');
    }
  }
}