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
readonlyid:string
The notarization's object ID, as a hexadecimal string.
immutableMetadata
readonlyimmutableMetadata: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
readonlylastStateChangeAt:bigint
The timestamp of the most recent state change, in milliseconds since the Unix epoch.
method
readonlymethod:NotarizationMethod
The NotarizationMethod the notarization was created with.
owner
readonlyowner:string
The current owner's IOTA address.
state
readonlystate: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
readonlystateVersionCount:bigint
The number of state versions the notarization has gone through.
0 means the state has not been updated since creation.
updatableMetadata
readonlyupdatableMetadata: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
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.