Class Metadata<T>

Type Parameters

Hierarchy (View Summary, Expand)

Implements

Constructors

Properties

_isUpdating?: boolean

Whether the metadata is currently being updated.

additionalInfo?: {
    description: string;
    image: string;
    name: string;
    url?: string;
}[]

Header links for this item displayed right under the title

attributes?: { name: string; type: string; value: string | number | boolean }[]

The attributes for this item

bannerImage?: string

The banner image for this item.

category?: string

The category for this item (e.g. "Education", "Attendance").

description: string

The description of this item. Supports markdown.

externalUrl?: string

The external URL for this item.

fetchedAt?: T

The time the metadata was fetched.

fetchedAtBlock?: T

The block the metadata was fetched at.

image: string

The image for this item.

name: string

The name of this item.

offChainTransferabilityInfo?: { assignMethod: string; host: string }

The off-chain transferability info for this item (used for badges - off-chain, disregard for others)

socials?: { [key: string]: string }

The socials for this item

tags?: string[]

The tags for this item

video?: string

The video for this item. If a standard video is used, this should be a link to the video. We will use image as the poster image. If a youtube video is used, we embed it as an iframe.

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

  • Returns a new Metadata object with default placeholder values. By default, it returns as type, but you can convert it with .convert method.

    import { Numberify } from 'bitbadgesjs-sdk'
    const metadata = Metadata.DefaultPlaceholderMetadata().convert(Numberify)

    Returns Metadata<bigint>

  • Returns a new Metadata object with default placeholder values. By default, it returns as type, but you can convert it with .convert method.

    import { Numberify } from 'bitbadgesjs-sdk'
    const metadata = Metadata.ErrorMetadata().convert(Numberify)

    Returns Metadata<bigint>

MMNEPVFCICPMFPCPTTAAATR