0.0.11 • Published 2 years ago
music-nft-inspect v0.0.11
⏯️ music-nft-inspect 🎧
this package allows you to easily verify music nfts.
This library works alongside the metadata checker and allows for DAOs and individuals to compare nft metadata to the top music metadata standards including Catalog, Sound, Decent & more. Arbitrary music NFTs across a wide variety of contract implementations are supported.
Main components:
Quickstart
- Install package:
yarn add music-nft-inspect
- Index contract address:
import { index } from "music-nft-inspect";
const chainId = 1;
const metadata = index(contractAddress, chainId);
console.log("metadataJson", metadata);
- Evaluate:
import { evaluate, index } from "music-nft-inspect";
const metadata = index(contractAddress);
const results = evaluate(metadata);
console.log("missing array", results[0].missing);
console.log("matching array", results[0].matching);
console.log("score", results[0].score);
Contributing
If you're from Sound, Catalog, Ooh La La, Spin Amp, Future Tape, Zora, etc, this section is for you.
There are a few module types you can contribute to.
- Evaluators - input JSON and return
{matching, missing, score, ...}
. - Indexers - read contract methods using
ethers
Adding a new Evaluator
src/schemas/
src/evaluators/
- shared
evaluate()
export inindex.ts
Schemas
- standard metadata JSON for music nfts
- examples found in
src/schemas
Evaluators
- evaluators are the method to validate metadata schemas.
evaluate
method - returns{missing, matching, score}
given ametadata
JSON object.
- examples found in
src/evaluators
Adding a new Indexer
src/abi/
src/indexers/
- shared
index()
export inindex.ts
ABI
- standard contract ABI for music nfts
- examples found in
src/abi
Indexers
- indexers are the method to read contract data and return metadata JSON.
index
method - returns{metadataJson}
given acontractAddress
.
- examples found in
src/indexers