AuditTrailClientReadOnly
@iota/audit-trails API documentation
Class: AuditTrailClientReadOnly
Read-only audit-trail client.
Remarks
This is the main entry point for package resolution and typed reads. Use AuditTrailClientReadOnly.trail to obtain an AuditTrailHandle bound to a single trail object.
Methods
chainId()
chainId():
string
Returns the chain ID of the network this client is connected to.
Returns
string
Hex-encoded chain identifier.
create()
staticcreate(iota_client):Promise<AuditTrailClientReadOnly>
Creates a read-only client by resolving package IDs from the connected network.
Parameters
iota_client
IotaClient
Returns
Promise<AuditTrailClientReadOnly>
A read-only audit-trail client bound to the resolved package IDs.
Remarks
This is the recommended constructor for official deployments tracked by the built-in package registry.
Throws
When package resolution fails for the connected network.
createWithPackageOverrides()
staticcreateWithPackageOverrides(iota_client,package_overrides):Promise<AuditTrailClientReadOnly>
Creates a read-only client with explicit package overrides.
Parameters
iota_client
IotaClient
package_overrides
Returns
Promise<AuditTrailClientReadOnly>
A read-only audit-trail client bound to the supplied package IDs.
Remarks
Prefer this when targeting a local deployment, preview environment, or any package pair that is not yet part of the package's built-in registry.
Throws
When the supplied package IDs are malformed or cannot be resolved.
createWithPkgId()
staticcreateWithPkgId(iota_client,package_id):Promise<AuditTrailClientReadOnly>
Creates a read-only client while overriding only the audit-trail package ID.
Parameters
iota_client
IotaClient
package_id
string
Returns
Promise<AuditTrailClientReadOnly>
A read-only audit-trail client bound to packageId.
Remarks
Compatibility helper for callers that need exactly one package override.
Throws
When packageId is malformed or cannot be resolved.
iotaClient()
iotaClient():
IotaClient
Returns the underlying IOTA client used to talk to the network.
Returns
IotaClient
The IOTA client passed to (or constructed during) creation of this client.
network()
network():
string
Returns the human-readable name of the network this client is connected to.
Returns
string
Network name (e.g. "mainnet", "testnet", "localnet").
packageHistory()
packageHistory():
string[]
Returns the resolved audit-trail package upgrade history.
Returns
string[]
Stringified object IDs of every published version, most recent first.
packageId()
packageId():
string
Returns the audit-trail package ID currently in use.
Returns
string
Stringified object ID of the resolved audit-trail package.
tfComponentsPackageId()
tfComponentsPackageId():
string
Returns the tf_components package ID currently in use.
Returns
string
Stringified object ID of the resolved tf_components package.
trail()
trail(
trail_id):AuditTrailHandle
Returns a trail-scoped handle for the given trail object ID.
Parameters
trail_id
string
Returns
Read-only AuditTrailHandle bound to trailId.
Remarks
Creating the handle is cheap. Reads only happen when methods are called on the returned handle.
Throws
When trailId is not a valid object ID.