Function getMetadataIdsForUri

This function returns the Metadata IDs for a specific badge URI. Returns an empty array if not found.

The badge metadata array is the timeline values (BadgeMetadataTimeline.badgeMetadata), not the cached fetched values from the API.

import { getMetadataIdsForUri } from 'bitbadgesjs-sdk'
const collection: BitBadgesCollection<bigint> = { ... }
const uri = 'https://bitbadges.io/collection/1/badge/1'
const metadataIds = getMetadataIdsForUri(uri, collection.getBadgeMetadataTimelineValue())

This can also be used with the BitBadges collection interface

import { BitBadgesCollection } from 'bitbadgesjs-sdk'
const collection: BitBadgesCollection<bigint> = { ... }
const uri = 'https://bitbadges.io/collection/1/badge/1'
const metadataIds = collection.getMetadataIdsForUri(uri)