Skip to main content
Version: 31.0.x

Class: MetadataEntry

Defined in: src/api/entities/MetadataEntry/index.ts:45

Represents an Asset MetadataEntry in the Polymesh blockchain

Extends​

Properties​

asset​

asset: BaseAsset

Defined in: src/api/entities/MetadataEntry/index.ts:49

Asset for which this is the metadata


id​

id: BigNumber

Defined in: src/api/entities/MetadataEntry/index.ts:59

identifier number of the MetadataEntry


type​

type: MetadataType

Defined in: src/api/entities/MetadataEntry/index.ts:54

Type of metadata represented by this instance


uuid​

uuid: string

Defined in: src/api/entities/Entity.ts:46

Inherited from​

Entity.uuid

Methods​

clear()​

clear(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/MetadataEntry/index.ts:111

Removes the asset metadata value

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Throws​

  • if the Metadata doesn't exists
    • if the Metadata value is locked

Note​

this method is of type NoArgsProcedureMethod, which means you can call clear.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


details()​

details(): Promise<MetadataDetails>

Defined in: src/api/entities/MetadataEntry/index.ts:129

Retrieve name and specs for this MetadataEntry

Returns​

Promise<MetadataDetails>


exists()​

exists(): Promise<boolean>

Defined in: src/api/entities/MetadataEntry/index.ts:205

Determine whether this MetadataEntry exists on chain

Returns​

Promise<boolean>

Overrides​

Entity.exists


isEqual()​

isEqual(entity: Entity<unknown, unknown>): boolean

Defined in: src/api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters​

ParameterType

entity

Entity<unknown, unknown>

Returns​

boolean

Inherited from​

Entity.isEqual


isModifiable()​

isModifiable(): Promise<{ canModify: boolean; reason?: PolymeshError; }>

Defined in: src/api/entities/MetadataEntry/index.ts:238

Check if the MetadataEntry can be modified. A MetadataEntry is modifiable if it exists and is not locked

Returns​

Promise<{ canModify: boolean; reason?: PolymeshError; }>


remove()​

remove(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/MetadataEntry/index.ts:124

Removes a local Asset Metadata key along with its value

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

A global Metadata key cannot be deleted

Throws​

  • if the Metadata type is global
    • if the Metadata doesn't exists
    • if the Metadata value is locked
    • if the Metadata is a mandatory key for any NFT Collection

Note​

this method is of type NoArgsProcedureMethod, which means you can call remove.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


set()​

set(args: SetMetadataParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<MetadataEntry, MetadataEntry>>

Defined in: src/api/entities/MetadataEntry/index.ts:102

Assign new value for the MetadataEntry along with its details or optionally only set the details (expiry + lock status) of any Metadata value

Parameters​

ParameterType

args

SetMetadataParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<MetadataEntry, MetadataEntry>>

Note​

  • Value or the details can only be set if the MetadataEntry is not locked

Note​

this method is of type ProcedureMethod, which means you can call set.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


toHuman()​

toHuman(): HumanReadable

Defined in: src/api/entities/MetadataEntry/index.ts:301

Return the MetadataEntry's ID, Asset ticker and Metadata type

Returns​

HumanReadable

Overrides​

Entity.toHuman


value()​

value(): Promise<MetadataValue | null>

Defined in: src/api/entities/MetadataEntry/index.ts:176

Retrieve the value and details (expiry + lock status) for this MetadataEntry

Returns​

Promise<MetadataValue | null>

Note​

  • This returns null if no value is yet specified for this MetadataEntry

generateUuid()​

static generateUuid<Identifiers>(identifiers: Identifiers): string

Defined in: src/api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

identifiers

Identifiers

‐

Returns​

string

Inherited from​

Entity.generateUuid


unserialize()​

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns​

Identifiers

Inherited from​

Entity.unserialize