Skip to main content

AddRecord

@iota/audit-trails API documentation


Class: AddRecord

Transaction wrapper for adding a record.

Remarks

While the trail's writeLock is active the call aborts. Tagged writes additionally require the tag to exist in the trail registry and the supplied capability's role to allow that tag. Records are assigned the trail's current monotonic sequence number, which is never reused even after deletions.

Requires the Permission.AddRecord permission.

Emits a RecordAdded event on success.

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

Applies transaction effects and events and decodes the matching event payload.

Parameters

wasm_effects

TransactionEffects

wasm_events

IotaEvent[]

client

CoreClientReadOnly

Read-only core client used during application.

Returns

Promise<RecordAdded>

Decoded RecordAdded event payload.

Throws

When the expected event is missing or transaction application fails.


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.