Skip to main content

OnChainNotarization

@iota/notarization API documentation


Class: OnChainNotarization

The on-chain representation of a notarization.

Remarks​

Stores user-defined data together with immutable provenance, optional updatable metadata, and lock metadata that governs whether the object can be updated, transferred, or destroyed. The selected NotarizationMethod determines which mutations are allowed after creation.

Returned by NotarizationClientReadOnly.getNotarizationById and by the executed transaction. Exposes the notarization's identity, current state, immutable and updatable metadata, the NotarizationMethod, and the current owner.

Properties​

id​

readonly id: string

The notarization's object ID, as a hexadecimal string.


immutableMetadata​

readonly immutableMetadata: ImmutableMetadata

The fixed-at-creation ImmutableMetadata.

Remarks​

Provides immutable information, assertions, and guarantees for third parties: it is created automatically at notarization creation and cannot be changed afterwards.


lastStateChangeAt​

readonly lastStateChangeAt: bigint

The timestamp of the most recent state change, in milliseconds since the Unix epoch.


method​

readonly method: NotarizationMethod

The NotarizationMethod the notarization was created with.


owner​

readonly owner: string

The current owner's IOTA address.


state​

readonly state: State

The current State of the notarization.

Remarks​

The state of a notarization contains the notarized data and metadata associated with the current version of the state.

Mutability depends on the Notarization Method:

  • Dynamic: the state can be replaced after creation via NotarizationClient.updateState.
  • Locked: the state is fixed at creation and cannot be replaced.

stateVersionCount​

readonly stateVersionCount: bigint

The number of state versions the notarization has gone through. 0 means the state has not been updated since creation.


updatableMetadata​

readonly updatableMetadata: undefined | string

The current updatable metadata, if any.

Remarks​

Provides context or additional information for third parties.

Mutability depends on the Notarization Method:

  • Dynamic: the updatable metadata can be replaced after creation via NotarizationClient.updateMetadata.
  • Locked: the value is fixed at creation and cannot be replaced.

updatableMetadata is independent of OnChainNotarization.state: replacing it does not increment the stateVersionCount and does not update the lastStateChangeAt timestamp.

Methods​

toJSON()​

toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object


toString()​

toString(): string

Return stringified version of self.

Returns​

string


iotaResourceLocatorBuilder()​

iotaResourceLocatorBuilder(network): NotarizationResourceBuilder

Creates an IOTA Resource Locator (IRL) builder rooted at this notarization.

Parameters​

network​

string

The IOTA network identifier (e.g. "mainnet").

Returns​

NotarizationResourceBuilder

A NotarizationResourceBuilder for this notarization.

Remarks​

The returned builder produces IRLs of the form iota:<network alias or genesis digest>/<notarization ID>/state/data and similar paths for related fields.

Throws​

When network is not a valid IOTA network identifier.