resolveENS method

Future<String?> resolveENS({
  1. required String name,
  2. required String contractAddress,
})

Implementation

Future<String?> resolveENS({
  required String name,
  required String contractAddress,
}) async {
  name = name.toLowerCase();
  final contract = EnsRegistryContract(
    rpc: this,
    contractAddress: contractAddress,
  );

  final resolverAddress = await contract.resolver(name: name);

  if (resolverAddress == null) {
    return null;
  }

  final resolver = EnsResolverContract(
    contractAddress: resolverAddress,
    rpc: this,
  );

  final addr = await resolver.addr(name: name);

  return addr;
}