Coder Social home page Coder Social logo

metadata-api-nodejs's Introduction

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

Getting Started

Requirements

You need node.js (8.11.* 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).

Minting Tokens

Here's a tutorial on setting up a mintable NFT contract. Alternatively, you can have your buyers mint the tokens for you (and pay the gas to do that) at purchase-time, using the OpenSea Crowdsale Tutorial.

Now that you a contract and a token URI for each of your tokens, there's a nice mint.js script that you can run locally to mint them on a testnet like Rinkeby and on mainnet Ethereum.

If you want more control over the minting process, call _setTokenURI on your NFT's contract using the URL pattern above, either directly if you exposed that method for the contract owner, or by minting new tokens using mintWithTokenURI.

Selling Tokens

If you're signed into MetaMask as the owner of your contract, you can click the "SELL" button on any asset to sell it immediately on OpenSea, using Dutch (declining price), English (to the highest bidder), and fixed-price auctions.

Selling in Bulk

You can also use the OpenSea.js SDK to create sell orders. You can create sell orders in bulk if you followed the Crowdsale Tutorial above.

Troubleshooting

If you have questions, contact the OpenSea team on Discord. We're very responsive!

metadata-api-nodejs's People

Contributors

alexanderatallah 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.