Skip to content

MitrichDot/ens-metadata-service

 
 

Repository files navigation

ens-metadata-service

Contributors Forks Stargazers Issues License Travis

API

Request

contactAddress: accepts contractAddress of the NFT which represented by the tokenId NFT v1 - tokenId: accepts labelhash of ENS name in both hex and int format NFT v2 - tokenId: accepts namehash of ENS name in both hex and int format

/{contractAddress}/{tokenId}

Examples

Response

{
  "name":"nftest1.eth",
  "description":"nftest1.eth, an ENS name.",
  "attributes":[
    {
      "trait_type":"Created Date",
      "display_type":"date",
      "value":1626897331000
    },
    {
      "trait_type":"Registration Date",
      "display_type":"date",
      "value":1626897331000
    },
    {
      "trait_type":"Expiration Date",
      "display_type":"date",
      "value":1658454283000
    }
  ],
  "name_length":11,
  "length":0,
  "url":"https://app.ens.domains/name/nftest1.eth",
  "version":1,
  "image_url":"data:image/svg+xml;base64,CiAgICA8c3ZnIHdpZHRoPSI..."
}

Attributes include

  • Created Date
  • Registration Date (only .eth secondary domain)
  • Expiration Date (only .eth secondary domain)

How to setup

git clone https://github.com/ensdomains/ens-metadata-service.git
cd ens-metadata-service
cp .env.org .env // Fill in Vars
yarn
yarn dev

How to deploy

yarn deploy

How to test

Regular unit test;

yarn test

Unit test + coverage;

yarn test:cov

Environment Variables

Name Description Default value Options
INFURA_API_KEY API Key provided by Infura. See here (Required) - -
HOST Host (ip/domain) address of the running service localhost -
NETWORK Ethereum network name, the service will run on rinkeby local/rinkeby/ropsten/goerli/mainnet
ENV Project scope local local/prod
INAMEWRAPPER InterfaceId of NameWrapper Contract 0x1aa28a1e -
ADDRESS_ETH_REGISTRAR Ethereum address of ENSBaseRegistrar Contract 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85 -
ADDRESS_NAME_WRAPPER Ethereum address of NameWrapper Contract 0x4D83cea620E3864F912046b73bB3a6c04Da75990 -

TODO

  • Configure for different networks (localhost/rinkeby/ropsten/goerli/mainnet)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.6%
  • JavaScript 1.5%
  • CSS 0.9%