OnChainAuditTrail
@iota/audit-trails API documentation
Class: OnChainAuditTrail
Read-only view of an on-chain audit trail.
Remarks
The trail is a shared, tamper-evident object that maintains an ordered sequence of records. Each record is assigned a unique, auto-incrementing sequence number that is never reused (the counter does not decrement on deletion). Access is governed by capability-based RBAC: every mutating call must present a Capability bound to a role whose permissions cover the operation.
Properties
createdAt
readonlycreatedAt:bigint
Returns the creation timestamp in milliseconds since the Unix epoch.
Returns
Creation timestamp in milliseconds.
creator
readonlycreator:string
Returns the address that created this trail.
Returns
Stringified IOTA address of the trail creator.
id
readonlyid:string
Returns the trail object ID.
Returns
Stringified object ID of this trail.
immutableMetadata
readonlyimmutableMetadata:ImmutableMetadata|undefined
Returns metadata fixed at creation time, when present.
Returns
The trail's ImmutableMetadata, or null when none was set.
lockingConfig
readonlylockingConfig:LockingConfig
Returns the active locking configuration that governs record deletion, trail deletion, and record writes.
Returns
Active LockingConfig for the trail.
records
readonlyrecords:LinkedTable
Returns the linked-table metadata for record storage.
Remarks
Returns table size and head/tail sequence numbers; record contents must be loaded via TrailRecords.
Returns
LinkedTable metadata for the record table.
roles
readonlyroles:RoleMap
Returns the trail's role definitions, the revoked-capability denylist, and the permissions required to administer roles and capabilities.
Returns
The trail's RoleMap.
sequenceNumber
readonlysequenceNumber:bigint
Returns the next sequence number that will be assigned to a new record.
Remarks
This is a monotonic counter that never decrements, even after records are deleted, so existing sequence numbers remain unique for the lifetime of the trail.
Returns
Sequence number that the next added record will receive.
tags
readonlytags:RecordTagEntry[]
Returns the canonical list of tags that may be attached to records in this trail, together with their combined usage counts.
Returns
Tag entries sorted alphabetically by tag name.
updatableMetadata
readonlyupdatableMetadata:string|undefined
Returns metadata that holders of Permission.UpdateMetadata can change after creation, when present.
Returns
Current value of updatableMetadata, or null when the field is unset.
version
readonlyversion:bigint
Returns the on-chain package version of the trail object.
Remarks
Use AuditTrailHandle.migrate after a package upgrade if this lags behind the package's expected version.
Returns
Stored package version of the trail object.
Methods
toJSON()
toJSON():
Object
- Return copy of self without private attributes.
Returns
Object
toString()
toString():
string
Return stringified version of self.
Returns
string