Reverse Resolve Address to ENS does NOT work

So here is the code, simple enough, but it does not resolve for addresses like 0x94DBCE8a42E2F578ad80266863bc9C7d2e04ea6A which corresponds to Askar.eth

def resolveAddress(address):
    # get the holders per page

    url = "https://deep-index.moralis.io/api/v2/resolve/" + address + "/reverse"
    headers = {
        "Content-Type": "application/json",
        "X-API-Key": "key",
    }
    # get the response, if we fail once, end the search
    try:
        response = requests.request("GET", url, headers=headers)
        data = response.json()
        print(data)
    except Exception as err:
        print(err)
        print("error in getting ens domain, do not count")
        time.sleep(2)
        return "Error"


if __name__ == "__main__":


    address = "0x94DBCE8a42E2F578ad80266863bc9C7d2e04ea6A"
    resolveAddress(address)

we will have to investigate, it could be a problem on our side

I think the problem stems out of the reach of Moralis. For reverse resolution of ENS domains, each ens domains has to be properly set to actually be reversed resolved. That being said, I would hope Moralis finds a different way to reverse resolve ENS instead of just using the ENS api

So your domain was not set up properly? Fundamentally I don’t see how they can get around that if it requires a configuration on ENS’s side.

Otherwise did you try resolving with another library e.g. web3py?

Web3 has the same exact problem. But the API route provided by Moralis will thus be rendered useless. There would be a need to exact/create a database of their own that would make sense. However, etherjs seems to do the job according to some google searches, but for us users using the Moralis api in python, we are basically rendered useless. I’d suggest Moralis find a new work around especially since some people are paying for premium options.

Thanks for all your work!

I am not able to look up that address you mentioned with ethers.js either with lookupAddress.

This looks like a problem with your domain and not a resolver (ethers.js, web3.py or Moralis API).

it looks like etherscan doesn’t associate that domain to that address automatically either:
https://etherscan.io/address/0x94DBCE8a42E2F578ad80266863bc9C7d2e04ea6A

1 Like

Sorry, I had the wrong address inside: it should resolve to 0xDF93B5ec8Eb9407F03fF14a2E2B3eE4196fcD8b0
However, it won’t. The reason being is how ENS api reverse resolves. I’m assuming that is what Moralis uses because that is what web3 uses. Point being is that, Moralis should use a different method of reverse resolving ENS domains

0xDF93B5ec8Eb9407F03fF14a2E2B3eE4196fcD8b0

What should this resolve to? Have you tried the base ensjs to try this? If that doesn’t work I’m not sure what else would work outside of querying the contracts.

sorry for the delay, but askar.eth

Thanks. So that address/domain don’t seem to resolve either way with the libraries. You can try querying the ENS contract directly, I believe this is what Etherscan does.

You can suggest on https://roadmap.moralis.io.