Skip to content

bchdomains/lns-metadata-service

 
 

Repository files navigation

lns-metadata-service

Contributors Forks Stargazers Issues License Travis

API

Request

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

Request (example)

https://metadata.bch.domains/smartbch/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/42219085255511335250589442208301538195142221433306354426240614732612795430543/

https://metadata.bch.domains/dogechain-testnet/0x07D127d14Bbd2af65fd86537913acAd35D6c0682/0x3e603807758134653f4c858cec61078722f6544783a94e8f5b1298df89d293ae

https://metadata.bch.domains/dogechain/0x0aF878360B48b5f51F4e919f3cC1EC08B78627ad/0x3e603807758134653f4c858cec61078722f6544783a94e8f5b1298df89d293ae

https://metadata.bch.domains/dogechain/0x0aF878360B48b5f51F4e919f3cC1EC08B78627ad/0x8f77c8c6fd421d301c5f91568d08c991f5a87c5f04cc3f0a4176f9e9b14c3854

// dc domain https://metadata.bch.domains/dogechain/0xe83c2021550b17169bd2d608c51ba6a2bea0f350/0xa1ed537a640b942ced4023e4bcce52645fcedf46b28b966a036b9fe422a83e89

// ethw domain http://metadata.powns.domains/ethpow/0x0a0bacad455e764d834adf4916b5432e2054686d/0x5fe5663cec65d84e0c01671a1d6e49dfb0b85acd80e73ce507f9b21977d4f099

// uniw domain http://localhost:8080/ethpow/0x24Bd03494EA9D0bE43c2bEfFf1C94960dc321003/0x0ffe095c00ad8f8f98acbd70a1c607907a4601c528688484cfd8921fce5d8400

Response (example)

{
  "name": "pat.eth",
  "description": "pat.bch, an LNS name.",
  "attributes": [
    {
      "trait_type": "Created Date",
      "display_type": "date",
      "value": 1580803395000
    },
    {
      "trait_type": "Registration Date",
      "display_type": "date",
      "value": 1580803395000
    },
    {
      "trait_type": "Expiration Date",
      "display_type": "date",
      "value": 1698131707000
    }
  ],
  "name_length": 4,
  "short_name": null,
  "length": 0,
  "url": "https://app.bch.domains/name/pat.bch",
  "version": 0,
  "background_image": "https://metadata.bch.domains/smartbch/avatar/pat.bch",
  "image_url": "https://metadata.bch.domains/mainnet/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/0x5d5727cb0fb76e4944eafb88ec9a3cf0b3c9025a4b2f947729137c5d7f84f68f/image"
}

More info and list of all endpoints: https://metadata.bch.domains/docs

How to setup

git clone https://github.com/bchdomains/lns-metadata-service.git
cd lns-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 -
ENV Project scope local local/prod
INAMEWRAPPER InterfaceId of NameWrapper Contract 0x1aa28a1e -
ADDRESS_ETH_REGISTRAR smartBCH address of ENSBaseRegistrar Contract 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85 -
ADDRESS_NAME_WRAPPER smartBCH address of NameWrapper Contract 0x4D83cea620E3864F912046b73bB3a6c04Da75990 -

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.7%
  • JavaScript 0.3%