Code Monkey home page Code Monkey logo

dgns-metadata-service's Introduction

dgns-metadata-service

API

Request

  • network: Name of the chain to query for. (mainnet | goerli ...)
  • contactAddress: accepts contractAddress of the NFT which represented by the tokenId
  • NFT v1 - tokenId: accepts DGNS name or labelhash of DGNS name in both hex and int format
  • NFT v2 - tokenId: accepts DGNS name or namehash of DGNS name in both hex and int format
/{network}/{contractAddress}/{tokenId}

Request (example)

https://metadata.digiv3rse.xyz/mainnet/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/42219085255511335250589442208301538195142221433306354426240614732612795430543/

Response (example)

{
  "is_normalized": true,
  "name": "nick.digi",
  "description": "nick.digi, an DGNS name.",
  "attributes": [
    {
      "trait_type": "Created Date",
      "display_type": "date",
      "value": 1571924851000
    },
    {
      "trait_type": "Length",
      "display_type": "number",
      "value": 4
    },
    {
      "trait_type": "Segment Length",
      "display_type": "number",
      "value": 4
    },
    {
      "trait_type": "Character Set",
      "display_type": "string",
      "value": "letter"
    },
    {
      "trait_type": "Registration Date",
      "display_type": "date",
      "value": 1580803395000
    },
    {
      "trait_type": "Expiration Date",
      "display_type": "date",
      "value": 1699709554000
    }
  ],
  "name_length": 4,
  "segment_length": 4,
  "url": "https://app.dgns.domains/name/nick.digi",
  "version": 0,
  "background_image": "https://metadata.digiv3rse.xyz/mainnet/avatar/nick.digi",
  "image": "https://metadata.digiv3rse.xyz/mainnet/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/0x5d5727cb0fb76e4944eafb88ec9a3cf0b3c9025a4b2f947729137c5d7f84f68f/image",
  "image_url": "https://metadata.digiv3rse.xyz/mainnet/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/0x5d5727cb0fb76e4944eafb88ec9a3cf0b3c9025a4b2f947729137c5d7f84f68f/image"
}

More info and list of all endpoints: https://metadata.digiv3rse.xyz/docs

How to setup

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

How to deploy (Google App Engine)

Modify the app_template.yaml according to your needs. Then run;

yarn deploy

How to test

Regular unit test;

yarn test

Unit test + coverage;

yarn test:cov

Environment Variables

Name Description Default value Options
HOST Host (ip/domain) address of the running service localhost -
ENV Project scope local local/prod
REDIS_URL (Optional) Redis connection if you want to enable rate limiter - -
INAMEWRAPPER InterfaceId of NameWrapper Contract 0xe89c48dc -
ADDRESS_DIGI_REGISTRAR Ethereum address of DGNSBaseRegistrar Contract 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85 -
ADDRESS_NAME_WRAPPER Ethereum address of NameWrapper Contract 0x582224b8d4534F4749EFA4f22eF7241E0C56D4B8 -
WEB3_NODE_URL Ethereum Node Provider API - -
NODE_PROVIDER Ethereum Node Provider Cloudflare Cloudflare/Google/Infura/Local
NODE_PROVIDER_URL Ethereum Node Provider API Endpoint - -
VPC_ACCESS_CONNECTOR (Optional) Needed if you will setup Memorystore for GAE - -

dgns-metadata-service's People

Contributors

digiv3rse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.