/** * Append-only spend ledger for x402-cfo agent. * * Records every payment decision — approved, denied, or failed — * with full context. This is the audit trail. */ export type LedgerEntryStatus = 'paid' | 'denied' | 'failed'; export interface LedgerEntry { /** ISO timestamp */ timestamp: string; /** URL that was requested */ url: string; /** Amount in dollars (e.g. "0.25") */ amount: string; /** Currency (e.g. "USDC") */ currency: string; /** Network (e.g. "base") */ network: string; /** Payment status */ status: LedgerEntryStatus; /** Human-readable reason (e.g. "budget approved" or "exceeds_hourly_limit") */ reason: string; /** HTTP status code received (402, 200, etc.) */ httpStatus?: number; /** Challenge ID if applicable */ challengeId?: string; /** Transaction hash if payment was made */ txHash?: string; /** Anomaly detection result at decision time, if anomaly check ran */ anomalyResult?: { isAnomaly: boolean; zScore: number; baseline: number; multiplier: number; mode: 'enforce' | 'review' | 'off'; }; } export declare class Ledger { private entries; /** Record a ledger entry. */ record(entry: LedgerEntry): void; /** Get all entries. */ all(): readonly LedgerEntry[]; /** Get entries by status. */ byStatus(status: LedgerEntryStatus): LedgerEntry[]; /** Get entries for a specific URL. */ byUrl(url: string): LedgerEntry[]; /** Total number of entries. */ get size(): number; /** Export to JSON string. */ toJSON(): string; /** Export to CSV string. */ toCSV(): string; } //# sourceMappingURL=ledger.d.ts.map