Class BadgeMetadataDetails<T>

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

badgeIds: UintRangeArray<T>

The badge IDs that correspond to the metadata

customData: string

Custom data

fetchedUri?: string

The URI that the metadata was fetched from with placeholders replaced.

metadata?: Metadata<T>

The metadata fetched by the URI

toUploadToIpfs?: boolean

Flag to denote if the metadata is new and should be updated. Used internally.

uri: string

The URI that the metadata was fetched from. This is the original on-chain URI, so may still have placeholders (i.e. {id} or {address})

Methods

  • Compares this object's fields to another object's fields for equality. Equality is determined by comparing the JSON representations of the objects.

    If normalizeNumberTypes is true, then all number types will be compared as strings (i.e. "1n" === "1" === 1). Else, they will be compared as their native types (i.e. 1n !== 1 !== "1").

    Type Parameters

    Parameters

    • other: undefined | null | CustomType<U>
    • OptionalnormalizeNumberTypes: boolean

    Returns boolean

  • For each badgeId in badgeIds, populates the metadata array with the given key, value JSON property pair.

    If you want to update the entire metadata (not just a specific key value pair), use updateBadgeMetadata instead.

    This is typically used when customizing or creating a badge.

    Type Parameters

    Parameters

    Returns BadgeMetadataDetails<T>[]

    Use this function to set the "name" property of all badges to "test" via setMetadataPropertyForAll(metadataArr, badgeIds, uri, "name", "test")