- 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)
{
"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
git clone https://github.com/bchdomains/lns-metadata-service.git
cd lns-metadata-service
cp .env.org .env // Fill in Vars
yarn
yarn dev
yarn deploy
Regular unit test;
yarn test
Unit test + coverage;
yarn test:cov
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 | - |