Skip to main content

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

readonly createdAt: bigint

Returns the creation timestamp in milliseconds since the Unix epoch.

Returns

Creation timestamp in milliseconds.


creator

readonly creator: string

Returns the address that created this trail.

Returns

Stringified IOTA address of the trail creator.


id

readonly id: string

Returns the trail object ID.

Returns

Stringified object ID of this trail.


immutableMetadata

readonly immutableMetadata: ImmutableMetadata | undefined

Returns metadata fixed at creation time, when present.

Returns

The trail's ImmutableMetadata, or null when none was set.


lockingConfig

readonly lockingConfig: LockingConfig

Returns the active locking configuration that governs record deletion, trail deletion, and record writes.

Returns

Active LockingConfig for the trail.


records

readonly records: 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

readonly roles: 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

readonly sequenceNumber: 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

readonly tags: 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

readonly updatableMetadata: 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

readonly version: 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