Skip to main content

CreateTrail

@iota/audit-trails API documentation


Class: CreateTrail

Transaction wrapper for trail creation.

Remarks​

On execution the audit-trail package shares the new trail object, seeds the reserved Admin role with the permission set returned by PermissionSet.adminPermissions, transfers a fresh initial-admin capability to the admin address, and optionally stores the initial record at sequence number 0, validating its tag against the registry.

Emits an AuditTrailCreated event on success.

Constructors​

Constructor​

new CreateTrail(builder): CreateTrail

Creates a transaction wrapper from an AuditTrailBuilder.

Parameters​

builder​

AuditTrailBuilder

Fully configured AuditTrailBuilder.

Returns​

CreateTrail

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<OnChainAuditTrail>

Applies transaction effects and events and then fetches the created trail object.

Parameters​

wasm_effects​

TransactionEffects

wasm_events​

IotaEvent[]

client​

CoreClientReadOnly

Read-only core client used to fetch the new trail object.

Returns​

Promise<OnChainAuditTrail>

The on-chain OnChainAuditTrail created by the transaction.

Throws​

When the expected event is missing or the trail cannot be fetched.


buildProgrammableTransaction()​

buildProgrammableTransaction(client): Promise<Uint8Array<ArrayBufferLike>>

Builds the programmable transaction bytes for submission.

Parameters​

client​

CoreClientReadOnly

Read-only core client used to resolve packages and serialize the transaction.

Returns​

Promise<Uint8Array<ArrayBufferLike>>

BCS-encoded programmable transaction bytes ready for signing and submission.

Throws​

When transaction serialization fails.