Docs/API/writeRecord

writeRecord

functionAudit & helpers

Append an immutable record to the Curb audit topic on HCS.

signature
writeRecord(client, cfg, partial): Promise<CurbRecord>

Used internally by the policies/hooks. Errors are caught and logged so a transient HCS hiccup never breaks enforcement.

Parameters

NameTypeDescription
clientreqClientHedera client (the one running the agent).
cfgreqCurbConfigProvides the audit topic id + agent id.
partialreqOmit<CurbRecord,'v'|'agent'|'ts'>The record fields (type, amount, reason, …).

Returns

Promise<CurbRecord>

The assembled record — returned even if the HCS write failed (the error is logged, not thrown).

VERIFIABLE SPEND-CONTROL   ·   ENFORCED ON-CHAIN   ·   AGENTS CAN PAY — NOW THEY CAN’T OVERSPEND   ·   CURB × HEDERA   ·   VERIFIABLE SPEND-CONTROL   ·   ENFORCED ON-CHAIN   ·   AGENTS CAN PAY — NOW THEY CAN’T OVERSPEND   ·   CURB × HEDERA   ·