Class: MetadataEntry
api/entities/MetadataEntry.MetadataEntry
Represents an Asset MetadataEntry in the Polymesh blockchain
Hierarchy
-
Entity
<UniqueIdentifiers
,HumanReadable
>↳
MetadataEntry
Properties
asset
• asset: BaseAsset
Asset for which this is the metadata
Defined in
api/entities/MetadataEntry/index.ts:50
id
• id: BigNumber
identifier number of the MetadataEntry
Defined in
api/entities/MetadataEntry/index.ts:60
type
• type: MetadataType
Type of metadata represented by this instance
Defined in
api/entities/MetadataEntry/index.ts:55
uuid
• uuid: string
Inherited from
Defined in
Methods
clear
▸ clear(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Removes the asset metadata value
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/MetadataEntry/index.ts:120
details
▸ details(): Promise
<MetadataDetails
>
Retrieve name and specs for this MetadataEntry
Returns
Promise
<MetadataDetails
>
Defined in
api/entities/MetadataEntry/index.ts:145
exists
▸ exists(): Promise
<boolean
>
Determine whether this MetadataEntry exists on chain
Returns
Promise
<boolean
>
Overrides
Defined in
api/entities/MetadataEntry/index.ts:221
isEqual
▸ isEqual(entity
): boolean
Determine whether this Entity is the same as another one
Parameters
Name | Type |
---|---|
entity | Entity <unknown , unknown > |
Returns
boolean
Inherited from
Defined in
isModifiable
▸ isModifiable(): Promise
<{ canModify
: boolean
; reason?
: PolymeshError
}>
Check if the MetadataEntry can be modified. A MetadataEntry is modifiable if it exists and is not locked
Returns
Promise
<{ canModify
: boolean
; reason?
: PolymeshError
}>
Defined in
api/entities/MetadataEntry/index.ts:254
remove
▸ remove(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Removes a local Asset Metadata key along with its value
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/MetadataEntry/index.ts:138
set
▸ set(args
, opts?
): Promise
<GenericPolymeshTransaction
<MetadataEntry
, MetadataEntry
>>
Assign new value for the MetadataEntry along with its details or optionally only set the details (expiry + lock status) of any Metadata value
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/MetadataEntry/index.ts:106
toHuman
▸ toHuman(): HumanReadable
Return the MetadataEntry's ID, Asset ticker and Metadata type
Returns
Overrides
Defined in
api/entities/MetadataEntry/index.ts:317
value
▸ value(): Promise
<null
| MetadataValue
>
Retrieve the value and details (expiry + lock status) for this MetadataEntry
Returns
Promise
<null
| MetadataValue
>
Note
- This returns
null
if no value is yet specified for this MetadataEntry
Defined in
api/entities/MetadataEntry/index.ts:192
generateUuid
▸ Static
generateUuid<Identifiers
>(identifiers
): string
Generate the Entity's UUID from its identifying properties
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type |
---|---|
identifiers | Identifiers |
Returns
string
Inherited from
Defined in
unserialize
▸ Static
unserialize<Identifiers
>(serialized
): Identifiers
Unserialize a UUID into its Unique Identifiers
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type | Description |
---|---|---|
serialized | string | UUID to unserialize |
Returns
Identifiers