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

    Function getTokenIdsForMetadataId

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

      Type Parameters

      Parameters

      Returns UintRange<T>[]

      The token metadata array is the timeline values (TokenMetadataTimeline.tokenMetadata), not the cached fetched values from the API.

      import { getTokenIdsForMetadataId } from 'bitbadgesjs-sdk'
      const collection: BitBadgesCollection<bigint> = { ... }
      const metadataId = 123n
      const tokenIds = getTokenIdsForMetadataId(metadataId, collection.getTokenMetadataTimelineValue())

      This can also be used with the BitBadges collection interface

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