import Web3 from "web3";
useEffect(() => {
const web3 = new Web3(window.ethereum);
web3.eth.ens.getAddress("ethereum.eth").then(function (address) {
console.log(address);
});
}, []);
here using this code i am getting address from ether name
is there any way i can get name from address
web3.eth.ens.getOwner("0xc74E8eFaFE54481bD109f97422AeBca607499f57").then(function (address) {
console.log(address);
});
I am trying above piece of code but it is not working
if i input 0xc74E8eFaFE54481bD109f97422AeBca607499f57 i should get ethereum.eth
please take a look how can i get this