npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@web3yak/web3domain

v1.0.13

Published

Looking up cryptocurrency & website address from Web3 Domain Name (ENS, Unstoppable domain, FVM & YAK)

Downloads

13

Readme

Web3 Domain Name Tool

A library for interacting with blockchain domain names. It can be used to retrieve wallet addresses and IPFS hashes for decentralized websites.

Resolution supports different decentralized domains across multiple chains.

Supports all major Web3 Domain provider.

Ethereum Name Service (ENS)

Unstoppable Domains

Web3Domain - W3D

Installing Web3Domain Tool

To install the library use npm.

npm i @web3yak/web3domain

Using Web3Domain Tool

Create a new project.

`mkdir W3D && cd $_
yarn init -y
npm i @web3yak/web3domain`

Look up a domain for cryptocurrency address

Create a new file in your project, address.js.

var w3d = require("@web3yak/web3domain");

const settings = {
  matic_rpc_url: "https://polygon-mainnet.g.alchemy.com/v2/..........",  //Get your own RPC free URL
  eth_rpc_url: "https://eth-mainnet.g.alchemy.com/v2/................", //Get your own RPC free URL
  fvm_rpc_url: "https://api.node.glif.io/rpc/v1"
};

let resolve = new w3d.Web3Domain(settings);

//Retrieves from the Web3Domain
resolve.getAddress("jack.demo","ETH").then(x => {
  console.log("Wallet address of jack.demo is : " + x);
}).catch(console.error);

//Retrieves from the ENS domain
resolve.getAddress("brad.eth","ETH").then(x => {
  console.log("Wallet address of brad.eth is : " + x);
}).catch(console.error);

//Retrieves from the UnstoppableDomain
resolve.getAddress("brad.crypto","ETH").then(x => {
  console.log("Wallet address of brad.crypto is : " + x);
}).catch(console.error);

Execute the script

PS D:\W3D> node address.js
Wallet address of brad.crypto is : 0x8aaD44321A86b170879d7A244c1e8d360c99DdA8
Wallet address of jack.demo is : 0x8D714B10B719c65B878F2Ed1436A964E11fA3271
Wallet address of brad.eth is : 0x0C82A14EDCF37266889e531e58cA516c10C78f18

Look up a cryptocurrency address for Web3 Domain Name

Create a new file in your project, domain.js

var w3d = require("@web3yak/web3domain");

    const settings = {
      matic_rpc_url: "https://polygon-mainnet.g.alchemy.com/v2/..........",  //Get your own RPC free URL
      eth_rpc_url: "https://eth-mainnet.g.alchemy.com/v2/................", //Get your own RPC free URL
      fvm_rpc_url: "https://api.node.glif.io/rpc/v1"
    };
    let resolve = new w3d.Web3Domain(settings);

    //Retrieves from the Web3Domain
resolve.getDomain("0x8D714B10B719c65B878F2Ed1436A964E11fA3271","W3D").then(x => {
    console.log("EVM address to Web3Domain Name : " + x);
  }).catch(console.error);
  
  //Retrieves from the ENS domain
  resolve.getDomain("0x0C82A14EDCF37266889e531e58cA516c10C78f18","ENS").then(x => {
    console.log("EVM Address to ENS Domain : " + x);
  }).catch(console.error);

Execute the script

PS D:\W3D> node domain.js
EVM address to Web3Domain Name : jack.demo
EVM Address to ENS Domain : brad.eth

Find the IPFS hash for a decentralized website from Web3 Domain Name

Create a new file in your project, hash.js.

var w3d = require("@web3yak/web3domain");
    const settings = {
      matic_rpc_url: "https://polygon-mainnet.g.alchemy.com/v2/..........",  //Get your own RPC free URL
      eth_rpc_url: "https://eth-mainnet.g.alchemy.com/v2/................", //Get your own RPC free URL
      fvm_rpc_url: "https://api.node.glif.io/rpc/v1"
    };
    let resolve = new w3d.Web3Domain(settings);

//Retrieve website address from Web3Domain
  resolve.getWeb("jack.demo").then(x => {
    console.log("jack.demo website url is: " + x);
  }).catch(console.error);

    //Retrieve website address from UnstoppableDomain
    resolve.getWeb("brad.crypto").then(x => {
        console.log("brad.crypto website url is: " + x);
      }).catch(console.error);

Execute the script

PS D:\W3D> node hash.js
brad.crypto website url is: https://gateway.ipfs.io/ipfs/QmTiqc12wo2pBsGa9XsbpavkhrjFiyuSWsKyffvZqVGtut
jack.demo website url is: https://gateway.ipfs.io/ipfs/bafkreif6fr5oapdrsrv7ccdonuaqa5ysijubsoqzy323ocrr4gobbegg4i

Help us improve

We are always looking for ways to improve how developers use and integrate our products into their applications.