Web3.js: ENS reverse lookup

Created on 15 Apr 2019  路  11Comments  路  Source: ChainSafe/web3.js

Description

Implement the ENS reverse lookup.

Docs: https://docs.ens.domains/contract-api-reference/reverseregistrar

2.x Feature Request Stale

Most helpful comment

I've created a code snippet to do a reverse lookup.

async function Reverse(address) {        
    var lookup=address.toLowerCase().substr(2) + '.addr.reverse'
    var ResolverContract=await web3.eth.ens.resolver(lookup);
    var nh=namehash.hash(lookup);
    var name=await ResolverContract.methods.name(nh).call()
    return name;
}    

All 11 comments

@nivida I think the ENS registry is also missing.
Docs: https://docs.ens.domains/contract-api-reference/ens

you can add in this issue or if you want I can create a new issue.

@nivida all methods are not present, which is listed in this docs.
Only registry is there.

Yep, there are some missing new methods. I was in contact with the ENS team and told them to check it. I'll do this together with the ENS reverse lookup because it isn't a big thing to add these methods.

The current registry: https://github.com/ethereum/web3.js/blob/1.0/packages/web3-eth-ens/src/contracts/Registry.js

@jefflau

Is the reverse on the roadmap? or can we create a PR ?

This would be great, I see its be flagged for the 2.x branch - I guess this means we wont make it into 1.x?

It would be really awesome if this was priorities to be fixed - the current way, from my understanding, to allow users to claim subdomains on ENS is to send them to the ENS manager site or write some custom code, would be great if this was part of native we3js

I've created a code snippet to do a reverse lookup.

async function Reverse(address) {        
    var lookup=address.toLowerCase().substr(2) + '.addr.reverse'
    var ResolverContract=await web3.eth.ens.resolver(lookup);
    var nh=namehash.hash(lookup);
    var name=await ResolverContract.methods.name(nh).call()
    return name;
}    

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

@x48-crypto check this comment

any update?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

connectdotz picture connectdotz  路  3Comments

SCBuergel picture SCBuergel  路  3Comments

dzarezenko picture dzarezenko  路  3Comments

TinyWJL picture TinyWJL  路  3Comments

xpepermint picture xpepermint  路  3Comments