Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/security / / AuditDb

Interface: AuditDb

Defined in: packages/security/src/audit/audit-db.ts:84

Minimal audit-database surface consumed by the chain operations. Concrete bindings can expose more, but the contract is intentionally small so the verifier remains binding-agnostic.

The methods are deliberately synchronous on the read path — the single-file SQLite default is already in-process, and asynchrony would add no I/O parallelism but would force every audit consumer to plumb promise-state through hot loops.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
bindingreadonlyAuditDbBindingIdStable identifier of the binding that produced this handle.packages/security/src/audit/audit-db.ts:86
closereadonly() => Promise<void>Close the underlying handle.packages/security/src/audit/audit-db.ts:110
countreadonly() => Promise<number>Total number of stored entries.packages/security/src/audit/audit-db.ts:99
deleteUpToreadonly(threshold) => Promise&lt;number&gt;Delete entries with seq <= threshold. Used by pruneAudit.packages/security/src/audit/audit-db.ts:101
insertreadonly(entry) => Promise&lt;StoredAuditEntry&gt;Append a new audit entry. The binding is responsible for atomicity.packages/security/src/audit/audit-db.ts:90
iteratereadonly(bounds?) => AsyncIterable&lt;StoredAuditEntry&gt;Iterate stored entries in seq order. The optional bounds are inclusive.packages/security/src/audit/audit-db.ts:94
latestreadonly() => Promise&lt; | StoredAuditEntry | undefined&gt;Read the most-recent entry, used by appendAudit to compute prev_hash.packages/security/src/audit/audit-db.ts:92
pathreadonlystringPath on disk.packages/security/src/audit/audit-db.ts:88
replaceEntryreadonly(entry) => Promise&lt;void&gt;Replace a stored entry. The replacement preserves the seq primary key and overwrites prevHash and hash. Used by pruneAudit to root the surviving chain at the genesis prev-hash and recompute the rolling chain hashes.packages/security/src/audit/audit-db.ts:108