Function getMetadataIdsForUri

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

    Type Parameters

    Parameters

    Returns T[]

    Remarks

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

    Example

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

    Example

    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)