Skip to main content
Version: 31.0.x

Class: Metadata

Defined in: src/api/entities/Asset/Base/Metadata/index.ts:37

Handles all Asset Metadata related functionality

Extends​

Methods​

get()​

get(): Promise<MetadataEntry[]>

Defined in: src/api/entities/Asset/Base/Metadata/index.ts:63

Retrieve all (global + local) the MetadataEntry for this Asset

Returns​

Promise<MetadataEntry[]>

Note​

this returns all available metadata entries for this Asset, with or without any value being associated with the metadata


getDetails()​

getDetails(): Promise<MetadataWithValue[]>

Defined in: src/api/entities/Asset/Base/Metadata/index.ts:177

Retrieve all (local + global) the MetadataEntry details whose value is set for this Asset

Returns​

Promise<MetadataWithValue[]>


getOne()​

getOne(args: object): Promise<MetadataEntry>

Defined in: src/api/entities/Asset/Base/Metadata/index.ts:109

Retrieve a single MetadataEntry by its ID and type

Parameters​

ParameterType

args

{ id: BigNumber; type: MetadataType; }

args.id

BigNumber

args.type

MetadataType

Returns​

Promise<MetadataEntry>

Throws​

if there is no MetadataEntry with the passed ID and specified type


register()​

register(args: RegisterMetadataParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<MetadataEntry, MetadataEntry>>

Defined in: src/api/entities/Asset/Base/Metadata/index.ts:56

Register a metadata for this Asset and optionally set its value. The metadata value can be set by passing value parameter and specifying other optional details about the value

Parameters​

ParameterType

args

RegisterMetadataParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<MetadataEntry, MetadataEntry>>

Note​

This registers a metadata of type Local

Note​

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