fetch-nft-metadata

1.0.0 • Public • Published

NodeJS Fetch Ethereum NFT Metadata

This package fetches an NFT Metadata from a contract using ERC721 or ERC1155 (Most NFTs)

It also proxies ipfs urls to https

Installation

Install fetch-nft-metadata with npm

  npm install fetch-nft-metadata

Usage/Examples

A full example is availible in ./example.js

(async () => {
  var FetchNFTMetadata = require("fetch-nft-metadata")(
    "ETH-RPC-URL" // YOUR ETHEREUM RPC URL HERE default is "https://cloudflare-eth.com/v1/mainnet"
  );

  var result = await FetchNFTMetadata.fetch(
    "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", // YOUR TOKEN CONTRACT ADDRESS HERE
    476 // YOUR TOKEN ID HERE
  );
  console.log(result); // result is the metadata object, ipfs is proxied to https://ipfs.io/ipfs/
})();

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Authors

License

MIT

Package Sidebar

Install

npm i fetch-nft-metadata

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

17.3 kB

Total Files

7

Last publish

Collaborators

  • rtiscool