Collection Interpreter

The interpretCollection function generates a thorough, human-readable explanation of any collection β€” permissions, approvals, claims, invariants, metadata, and risks. It works with the full BitBadgesCollection object including metadata and claims.

Usage

import { interpretCollection } from 'bitbadgesjs-sdk';
import { BitBadgesApi } from 'bitbadgesjs-sdk';

// After fetching a collection
const collection = await BitBadgesApi.getCollections({
  collectionsToFetch: [{ collectionId: '1' }]
});
const explanation = interpretCollection(collection.collections[0]);
console.log(explanation);

What's Included in the Output

  • Collection overview β€” name, type, token range, standards

  • How tokens are created/obtained β€” every mint approval explained

  • Transferability rules β€” every transfer approval explained

  • Default balances and auto-approve settings

  • What the manager can and cannot change β€” every permission's state

  • On-chain invariants and guarantees

  • Claims β€” plugin types, flow, rewards (no secrets)

  • IBC/cross-chain details

Privacy

The function automatically strips sensitive claim parameters (seedCode, preimages, private params) from the output. Safe to display to any user.

Also Available Via

  • MCP: The explain_collection tool uses this under the hood

  • Frontend: Displayed on collection overview pages

Last updated