# @web3yak/web3domain

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

Latest version **1.0.13** (published 2023-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @web3yak/web3domain
pnpm add @web3yak/web3domain
yarn add @web3yak/web3domain
bun add @web3yak/web3domain
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2023-07-30 |
| First published | 2023-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Web3Yak |
| Maintainers | web3yak |
| Keywords | Web3 Domain, web3domain, ens domain, ethereum, blockchain, resolution, web3, domain, unstoppable |

## Links

- npm: https://www.npmjs.com/package/@web3yak/web3domain
- Repository: https://github.com/web3yak/web3domain
- Homepage: https://web3domain.org/
- Issues: https://github.com/web3yak/web3domain/issues
- npm.io page: https://npm.io/package/@web3yak/web3domain

## Dependencies (5)

- [web3](https://npm.io/package/web3.md) ^1.8.1
- [axios](https://npm.io/package/axios.md) ^1.2.2
- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [@truffle/hdwallet-provider](https://npm.io/package/@truffle/hdwallet-provider.md) ^2.1.4
- [@unstoppabledomains/resolution](https://npm.io/package/@unstoppabledomains/resolution.md) ^8.3.3

## Recent versions

- 1.0.13 (latest) — 2023-07-30
- 1.0.12 — 2023-07-17
- 1.0.11 — 2023-07-16
- 1.0.10 — 2023-05-29
- 1.0.9 — 2023-05-08
- 1.0.8 — 2023-05-07
- 1.0.7 — 2023-02-17
- 1.0.6 — 2023-02-16
- 1.0.5 — 2023-01-14
- 1.0.4 — 2023-01-14
- 1.0.3 — 2023-01-13
- 1.0.2 — 2023-01-13
- 1.0.1 — 2023-01-12

## 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.

---
_Source: https://npm.io/package/@web3yak/web3domain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
