Skip to main content

UpdateState

@iota/notarization API documentation


Class: UpdateState

Transaction that replaces the state of a notarization.

Remarks

On success the transaction increments stateVersionCount by one and refreshes lastStateChangeAt to the on-chain clock timestamp.

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.

Emits a NotarizationUpdated event on success.

Constructors

Constructor

new UpdateState(state, object_id): UpdateState

Constructs the transaction.

Parameters

state

State

The replacement State.

object_id

string

Returns

UpdateState

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.