This function returns the Metadata IDs for a specific token URI. Returns an empty array if not found.
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()) Copy
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) Copy
import { BitBadgesCollection } from 'bitbadgesjs-sdk'const collection: BitBadgesCollection<bigint> = { ... }const uri = 'https://bitbadges.io/collection/1/badge/1'const metadataIds = collection.getMetadataIdsForUri(uri)
This function returns the Metadata IDs for a specific token URI. Returns an empty array if not found.