Skip to content

Simple metadata API for the Soliditree Protocol, written in Node.js

Notifications You must be signed in to change notification settings

th3nolo/metadata-api-nodejs

 
 

Repository files navigation

Sample Metadata API for Non-Fungible Tokens (NFTs)

Use this repo to make an API for serving metadata about your tokens (ERC-721 or ERC-1155) to marketplaces like OpenSea and other third parties.

Metadata for each token can include an image, animation, attributes, scalar properties, boost properties, and more!

Deploy

Requirements

You need node.js (v16.16.* or later) and npm installed. If you want to do a Heroku deployment, download and install the Heroku CLI and run heroku login locally.

  1. Click the Deploy to Heroku button above to instantly get it up and running somewhere. You can pick the URL! For this example, let's say that it's your-metadata-api.herokuapp.com.
  2. Run heroku git:clone -a your-metadata-api, and cd into your new directory.
  3. Run npm install.
  4. Save the Heroku URL you picked into src/constants.js as the HOST variable (e.g. https://your-metadata-api.herokuapp.com). This is the root URL for the tokens on your contract.
  5. Deploy to Heroku by committing your changes and using git push heroku master.
  6. Visit your token's metadata at https://your-metadata-api.herokuapp.com/api/token/1 (for token 1).

Metadata

  1. To evolve your NFT over Time use the fuction levelOfToken, and set the Days you want for any given Level.
  2. To set the metadata of any given level use the database, and change it with your NFT metadata.

Env Example

MORALISV3_API_KEY = <apiKeyV3>
MORALISV2_API_KEY = <apiKeyV2>
ADDRESSNFT = The NFT address
ADDRESSPROTOCOL = The Protocol Address
ADDRESSTOKEN = The underlying asset to fund the poool
SERVER_URL = https://<url>.usemoralis.com:2053/server
APP_ID = 
MASTER_KEY = 

Smart Contracts: https://github.com/th3nolo/SolidiTreeSmartContracts

About

Simple metadata API for the Soliditree Protocol, written in Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.9%
  • Procfile 0.1%