{"id":21420206,"url":"https://github.com/ethjs/ethjs-ens","last_synced_at":"2025-07-14T06:32:02.806Z","repository":{"id":19154725,"uuid":"84246155","full_name":"ethjs/ethjs-ens","owner":"ethjs","description":"An Ethereum Name Service interface module built on EthJS","archived":false,"fork":false,"pushed_at":"2022-12-06T17:34:05.000Z","size":480,"stargazers_count":34,"open_issues_count":18,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T08:19:07.556Z","etag":null,"topics":["ens","ethereum","ethjs-ens"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-07T21:07:38.000Z","updated_at":"2024-08-25T19:22:22.000Z","dependencies_parsed_at":"2023-01-14T07:45:24.891Z","dependency_job_id":null,"html_url":"https://github.com/ethjs/ethjs-ens","commit_stats":null,"previous_names":["flyswatter/ethjs-ens"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethjs%2Fethjs-ens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethjs%2Fethjs-ens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethjs%2Fethjs-ens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethjs%2Fethjs-ens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethjs","download_url":"https://codeload.github.com/ethjs/ethjs-ens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225958011,"owners_count":17551331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ens","ethereum","ethjs-ens"],"created_at":"2024-11-22T20:13:24.641Z","updated_at":"2024-11-22T20:13:25.232Z","avatar_url":"https://github.com/ethjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EthJS ENS\n\n[![CircleCI](https://circleci.com/gh/ethjs/ethjs-ens.svg?style=svg)](https://circleci.com/gh/ethjs/ethjs-ens)\n[![Coverage Status](https://coveralls.io/repos/github/ethjs/ethjs-ens/badge.svg?branch=master)](https://coveralls.io/github/ethjs/ethjs-ens?branch=master)\n\nA convenience interface for using the Ethereum Name Service, based on the [EthJS contract abstraction](https://github.com/ethjs/ethjs-contract).\n\n[Live Demo](https://ethjs.github.io/ethjs-ens)\n\n## Installation\n\nInstall from npm:\n\n`npm install ethjs-ens --save`\n\n## Usage\n\n```javascript\nconst ENS = require('ethjs-ens')\nconst HttpProvider = require('ethjs-provider-http')\n\n// For MetaMask or Mist compatibility:\nif (typeof window === 'object' \u0026\u0026 typeof window.web3 !== 'undefined') {\n  setupEns(web3.currentProvider)\n} else {\n  const provider = new HttpProvider('https://ropsten.infura.io')\n  setupEns(provider)\n}\n\nfunction setupEns (provider) {\n\n  // Currently requires both provider and\n  // either a network or registryAddress param\n  const ens = new ENS({ provider, network: '3' })\n\n  ens.lookup('vitalik.eth')\n  .then((address) =\u003e {\n    const expected = '0x5f8f68a0d1cbc75f6ef764a44619277092c32df0'\n\n    if (address === expected) {\n      alert(\"That's how you do it!\")\n    }\n  })\n  .catch((reason) =\u003e {\n    // There was an issue!\n    // Maybe the name wasn't registered!\n    console.error(reason)\n  })\n}\n```\n\n## Available APIs\n\n### ens.lookup( name )\n\nTakes a valid [ENS](https://ens.readthedocs.io/en/latest/introduction.html) name, like `vitalik.eth`, or `some.specialname.eth`.\n\nReturns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to a hex-prefixed hexadecimal string for the resolved address.\n\nIf a matching name can not be found, will throw:\n\n```javascript\nnew Error('ENS name not found.')\n```\n\n### ens.reverse( address )\n\nTakes an ethereum address (hex-encoded), and attempts to look up a corresponding name on the registry's reverse-registrar.\n\nReturns a promise that resolves a string if a name exists, or throws if it does not.\n\n### ens.registry\n\nAn [ethjs contract](https://github.com/ethjs/ethjs-ens) instance initialized for the specified network's address.\n\nImplements the registry interface specified in [EIP 137](https://github.com/ethereum/EIPs/issues/137):\n\n```\nfunction owner(bytes32 node) constant returns (address);\nReturns the owner (registrar) of the specified node.\n\nfunction resolver(bytes32 node) constant returns (address);\nReturns the resolver for the specified node.\n\nfunction ttl(bytes32 node) constant returns (uint64);\n```\n\n## Current Supported Networks\n\nNetwork support is added by adding a registry for that network to the [network map](./lib/network-map.json).\n\n- Main net (id 1)\n- Ropsten (id 3)\n\n## Licence\n\nThis project is licensed under the MIT license, Copyright (c) 2016 Dan Finlay. For more information see LICENSE.md.\n\n```\nThe MIT License\n\nCopyright (c) 2017 Dan Finlay. danfinlay.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethjs%2Fethjs-ens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethjs%2Fethjs-ens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethjs%2Fethjs-ens/lists"}