This return the badge IDs for a specific Metadata ID. 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 { getBadgeIdsForMetadataId } from 'bitbadgesjs-sdk'const collection: BitBadgesCollection<bigint> = { ... }const metadataId = 123nconst badgeIds = getBadgeIdsForMetadataId(metadataId, collection.getBadgeMetadataTimelineValue()) Copy
import { getBadgeIdsForMetadataId } from 'bitbadgesjs-sdk'const collection: BitBadgesCollection<bigint> = { ... }const metadataId = 123nconst badgeIds = getBadgeIdsForMetadataId(metadataId, collection.getBadgeMetadataTimelineValue())
This can also be used with the BitBadges collection interface
import { BitBadgesCollection } from 'bitbadgesjs-sdk'const collection: BitBadgesCollection<bigint> = { ... }const metadataId = 123nconst badgeIds = collection.getBadgeIdsForMetadataId(metadataId) Copy
import { BitBadgesCollection } from 'bitbadgesjs-sdk'const collection: BitBadgesCollection<bigint> = { ... }const metadataId = 123nconst badgeIds = collection.getBadgeIdsForMetadataId(metadataId)
This return the badge IDs for a specific Metadata ID. Returns an empty array if not found.