@zoralabs/nft-metadata
Javascript library for parsing nft metadata.
This parses data following a variety of standards and contracts. All contracts on https://zora.co/ are parsed using this library.
Usage:
Add package:
yarn add @zoralabs/nft-metadata
Use in project:
import {Agent} from '@zoralabs/nft-metadata';
const parser = new Agent({
network: 'homestead',
networkUrl: RPC_URL,
ipfsGatewayUrl: IPFS_URL,
timeout: 60 * 1000,
})
parser.fetchMetadata('0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6', '23').then((data) => {
console.log(data);
})
Supported data encoding methods:
- http server uri w/ json standard metadata
- ipfs server uri w/ json standard metadata
- on-chain data-uri for metadata
- on-chain data-uri for metadata and content
- handling for zNFT's seperate metadata and content uris
- normalization for multiple kinds of data in properties
Special-case contracts that are handled:
- Using FND, SuperRare, and ZORA custom IPFS gateways
- Wrapped Punks (fetch image and metadata tags from official on-chain published data)
- Hashmaps (use a different token address)
- Autoglyphs (generate metadata tags from scheme and reference official website for svg renderings)
- Decentraland metadata parsing