[英]web3 get name from address
import Web3 from "web3";
useEffect(() => {
const web3 = new Web3(window.ethereum);
web3.eth.ens.getAddress("ethereum.eth").then(function (address) {
console.log(address);
});
}, []);
在這里使用此代碼我從以太名稱獲取address
有什么方法可以從地址獲取名稱
web3.eth.ens.getOwner("0xc74E8eFaFE54481bD109f97422AeBca607499f57").then(function (address) {
console.log(address);
});
我正在嘗試上面的一段代碼,但是如果我輸入0xc74E8eFaFE54481bD109f97422AeBca607499f57
我應該得到ethereum.eth
請看看我怎么能得到這個
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.