Skip to content

This returns the URIs for a specific Metadata ID. Returns an empty array if not found.

getUrisForMetadataIds<T>(metadataIds, collectionUri, _tokenUris): string[]

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/metadata/metadataIds.ts:194

This returns the URIs for a specific Metadata ID. Returns an empty array if not found.

Type Parameters

T

T extends NumberType

Parameters

metadataIds

T[]

collectionUri

string

_tokenUris

TokenMetadata<T>[]

Returns

string[]

Remarks

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

Examples

ts
import { getUrisForMetadataId } from 'bitbadges'
const collection: BitBadgesCollection<bigint> = { ... }
const metadataId = 123n
const uris = getUrisForMetadataId(metadataId, collection.getTokenMetadataTimelineValue())

This can also be used with the BitBadges collection interface

ts
import { BitBadgesCollection } from 'bitbadges'
const collection: BitBadgesCollection<bigint> = { ... }
const metadataId = 123n
const uris = collection.getUrisForMetadataId(metadataId)

Edit this page on GitHub