Skip to main content

UpdateMetadata

@iota/notarization API documentation


Class: UpdateMetadata

Transaction that replaces the updatable metadata of a notarization.

Remarks​

Does not affect the state, the stateVersionCount, the lastStateChangeAt timestamp, or the immutable description.

Behavior depends on the Notarization Method:

  • Dynamic: always permitted — the underlying updateLock is fixed to TimeLockType.None.
  • Locked: always aborts on-chain, because the underlying updateLock is pinned to TimeLockType.UntilDestroyed.

Constructors​

Constructor​

new UpdateMetadata(metadata, object_id): UpdateMetadata

Constructs the transaction.

Parameters​

metadata​

The replacement metadata, or null to clear it.

undefined | null | string

object_id​

string

Returns​

UpdateMetadata

Throws​

When the ID is malformed.

Methods​

toJSON()​

toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object


toString()​

toString(): string

Return stringified version of self.

Returns​

string


applyWithEvents()​

applyWithEvents(wasm_effects, wasm_events, client): Promise<Empty>

Reads the on-chain effects and events of the submitted transaction.

Parameters​

wasm_effects​

TransactionEffects

wasm_events​

IotaEvent[]

client​

CoreClientReadOnly

A read-only client connected to the target network.

Returns​

Promise<Empty>

Remarks​

Invoked automatically by the TransactionBuilder machinery after the transaction has been submitted; calling it directly is normally not necessary.

Throws​

When the effects/events are inconsistent with this transaction.


buildProgrammableTransaction()​

buildProgrammableTransaction(client): Promise<Uint8Array<ArrayBufferLike>>

Builds the programmable transaction bytes.

Parameters​

client​

CoreClientReadOnly

A read-only client connected to the target network.

Returns​

Promise<Uint8Array<ArrayBufferLike>>

The BCS-serialized programmable transaction, ready to be signed and submitted.

Throws​

When the transaction cannot be built.