bitbadgesjs-sdk - v0.22.7
    Preparing search index...

    Function getMetadataIdsForUri

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

      Type Parameters

      Parameters

      Returns T[]

      The token metadata array is the timeline values (TokenMetadataTimeline.tokenMetadata), 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.getTokenMetadataTimelineValue())

      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)