Skip to content

Verified TypeScript examples for the bitbadges SDK helpers, balances, uint ranges, transfers, address lists, metadata, approvals, and interpreters.

Working examples for the SDK helper classes and functions. Each snippet imports from bitbadges and uses the names exported by the current package.

Snippets that construct a BitBadgesAPI client read BITBADGES_API_KEY. Create a key at bitbadges.io/developer. See BitBadges API.

PageUse it for
Address Conversions0x and bb1 conversion, address validation
Uint RangesUintRange and UintRangeArray: merge, search, invert, remove, overlaps
BalancesBalanceArray: add, subtract, look up by token ID and time
Balance LookupsFetch a balance from the API, the chain, or the CLI; full array vs single amount
TransfersTransferWithIncrements for batch and sequential distribution
Address ListsAddressList: membership checks, inversion, reserved lists
Token MetadataTokenMetadataDetails: update, remove, and read metadata per token ID
ApprovalsFind unhandled (disapproved) approval combinations, append default user approvals
Interpret a CollectioninterpretCollection: a plain-language report of an on-chain collection
Interpret a TransactioninterpretTransaction: a plain-language report of an unsigned MsgUniversalUpdateCollection
Simulation Balance DiffssimulateAndReview, parseSimulationEvents, calculateNetChanges

Concepts behind these helpers live in the Token standard. The generated API is at the SDK reference.

Edit this page on GitHub