Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

await ens.reverse(address).name() promise never resolves #48

Open
oznekenzo opened this issue Dec 11, 2019 · 1 comment
Open

await ens.reverse(address).name() promise never resolves #48

oznekenzo opened this issue Dec 11, 2019 · 1 comment

Comments

@oznekenzo
Copy link

I believe I've instantiated correctly:

import ENS from 'ethereum-ens';
import Web3 from 'web3';

const provider = new Web3.providers.HttpProvider();
const ens = new ENS(provider);

let name = await ens.reverse(address).name();
if (address !== await ens.resolver(name).addr()) {
  name = null;
}

The ens.reverse(address).name() promise never resolves and just hangs. The method directly after doesn't run.

There is a network request being made to infura: https://ipfs.infura.io:5001/api/v0/add?pin=true,
returning hash, name, and size values - but not sure if its this method that's making that exact request

Thanks for any help

@oznekenzo
Copy link
Author

I don't mean to bad-mouth but for others running into the same situation I found the solution elsewhere using:

import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(web3.currentProvider);
const name = await provider.lookupAddress(address);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant