ENSKit icon indicating copy to clipboard operation
ENSKit copied to clipboard

Feature Request: resolve name from address

Open elisealix22 opened this issue 2 years ago • 3 comments

Is it possible to resolve an ENS name from an ETH address? If not, that would be an amazing feature so I could use ENSKit to fetch both an ENS name and avatar from an address (happy to fetch serially).

@stdc105 let me know if I missed something!

elisealix22 avatar Jan 15 '23 07:01 elisealix22

Hi Elise,

Currently, ENSKit can turn ENS names into addresses. To make it possible to do the reverse, from addresses to ENS names, we're working on adding that feature. We'll let you know as soon as it's ready.

In the meantime, you can check out this API, it can handle both types of queries:

https://api.ensideas.com/ens/resolve/vitalik.eth https://api.ensideas.com/ens/resolve/0xd8da6bf26964af9d7eed9e03e53415d37aa96045

When we first started ENSKit, our main focus was on the content hash field for dWebsites, as there wasn't a public API for that yet.

Thanks!

livid avatar Jan 15 '23 19:01 livid

Thank you so much for the explanation @livid ! I'll take a look at the API 👀

elisealix22 avatar Jan 16 '23 01:01 elisealix22

Hi @elisealix22

We have added support for reverse resolver. You can use it like this:

let enskit = ENSKit()
if let name = try await enskit.name(addr: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045") {
    // 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 would resolve to vitalik.eth
}

livid avatar Feb 05 '23 16:02 livid