0.2.16 • Published 2 years ago

@musedao/nft-fetch-metadata v0.2.16

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

NFT Fetch Metadata

We forked Zora's metadata fetcher architechture + adding all the features and customizations we needed to be able to index all NFTs from any contract and fit our NFT indexer.

Feel free to use it and contribute.

https://www.npmjs.com/package/@musedao/nft-fetch-metadata

npm install @musedao/nft-fetch-metadata

Example

require("dotenv").config();

const Fetcher = require("@musedao/nft-fetch-metadata");

let rpc = `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY}`;
  
const infuraIPFS = "https://ipfs.infura.io:5001/api/v0/cat?arg="; //optional to pass ipfs node that works good, otherwise use a public one.


let options = [, , infuraIPFS, , rpc];

const fetch = new Fetcher(...options);

const tokenUri = await fetch.fetchTokenURI(
   "0xe4605d46fd0b3f8329d936a8b258d69276cba264",
    "54"
);

console.log(tokenUri);

const nft = await fetch.fetchMetadata(
    "0xa3518c1008698082057f3c0d49a67683265df6e5", //loot
    "51",
    {
      method: "post",
      auth: process.env.INFURA_IPFS,
      // responseType: "arraybuffer",
      // responseEncoding: "binary",
    }
);

console.log(nft);

The package has many more useful functions, examples are wip.

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago