ensdomains / ensjs-v2

Javascript bindings for the Ethereum Name Service
208 stars 122 forks source link

Name empty, but ens owner #83

Open thedarkknight197 opened 2 years ago

thedarkknight197 commented 2 years ago

Hello i can't resolve from my address, my ens domain. I am using React. This is my code:

import ENS from '@ensdomains/ensjs'

async getENS(address){
        var Web3 = require('web3');
        var provider= new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/key");
        var ens = new ENS({provider,  ensAddress: '0x314159265dd8dbb310642f98f50c066173c1259b' });

        console.log(await ens.getName(address));
}

The result is: {name: null}

What's the problem?

Uysim commented 2 years ago

I am facing the same problem Maybe because of this line getNameWithResolver. I don't why we need parseInt(resolverAddr, 16) === 0 condition

Uysim commented 2 years ago

@thedarkknight197 I solved it by set primary ens.