Function getBadgeIdsForMetadataId

  • This return the badge IDs for a specific Metadata ID. Returns an empty array if not found.

    Type Parameters

    Parameters

    Returns UintRange<T>[]

    Remarks

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

    Example

    import { getBadgeIdsForMetadataId } from 'bitbadgesjs-sdk'
    const collection: BitBadgesCollection<bigint> = { ... }
    const metadataId = 123n
    const badgeIds = getBadgeIdsForMetadataId(metadataId, collection.getBadgeMetadataTimelineValue())

    Example

    This can also be used with the BitBadges collection interface

    import { BitBadgesCollection } from 'bitbadgesjs-sdk'
    const collection: BitBadgesCollection<bigint> = { ... }
    const metadataId = 123n
    const badgeIds = collection.getBadgeIdsForMetadataId(metadataId)