项目作者: x5engine

项目描述 :
ENS Resolver that works in both ways (ENS name <--> Ethereum Address)
高级语言: JavaScript
项目地址: git://github.com/x5engine/ens-resolver.git
创建时间: 2019-07-31T19:21:45Z
项目社区:https://github.com/x5engine/ens-resolver

开源协议:MIT License

下载


Two ways ENS Resolver

Installation

npm i -S ens-resolver

Resolver your ENS name or Ethereum Address

Give it a try!
DEMO

Happy hacking =)

Usage

  1. import React from "react";
  2. import ReactDOM from "react-dom";
  3. import EnsResolver from "ens-resolver";
  4. // First one from ENS name to ETH address
  5. // Second on from ETH address to ENS name
  6. function App() {
  7. return (
  8. <div className="App">
  9. <h1>Two ways ENS Resolver</h1>
  10. <EnsResolver lookup="0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359" ></EnsResolver>
  11. {/*expected result: ethereumfoundation.eth */}
  12. <EnsResolver lookup="ethereumfoundation.eth" ></EnsResolver>
  13. {/*expected result: 0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359 */}
  14. </div>
  15. );
  16. }

Technologies

  • ES6/ESNext - Write ES6 code and Babel will transpile it to ES5 for backwards compatibility
  • Test - Mocha with Istanbul coverage
  • Lint - Preconfigured ESlint with Airbnb config
  • CI - TravisCI configuration setup
  • Minify - Built code will be minified for performance

Commands

  • npm run clean - Remove lib/ directory
  • npm test - Run tests with linting and coverage results.
  • npm test:watch - You can even re-run tests on file changes!
  • npm test:prod - Run tests with minified code.
  • npm run test:examples - Test written examples on pure JS for better understanding module usage.
  • npm run lint - Run ESlint with airbnb-config
  • npm run build - Babel will transpile ES6 => ES5 and minify the code.
  • npm run prepublish - Hook for npm. Do all the checks before publishing your module.

License

MIT © X5 Engine