/** * Real-time spend analytics for x402-cfo agent. * * Computes burn rate, projected spend, and top endpoints from * the ledger data. Designed to be queried frequently by agent * orchestration layers that need to make cost-aware decisions. */ import type { Ledger } from './ledger.js'; export interface SpendSummary { /** Total amount spent (paid only), dollars */ totalSpent: string; /** Number of paid transactions */ totalTransactions: number; /** Number of denied transactions */ totalDenied: number; /** Number of failed transactions */ totalFailed: number; /** Current burn rate in dollars per minute (rolling 15-min average) */ burnRatePerMinute: string; /** Projected daily spend based on current burn rate, dollars */ projectedDaily: string; /** Top endpoints by total spend */ topEndpoints: { url: string; spent: string; count: number; }[]; /** Spend breakdown by currency */ byCurrency: Record; /** Total denied request value (policy + budget + anomaly denials), in dollars. * This is the sum of quoted amounts from ALL denied transactions. * NOT deduplicated: if the same request is retried and denied 3 times, all 3 are counted. * Use as "denied transaction value", not "money saved". */ protectedSpend: string; /** Number of payments blocked by anomaly detection */ anomalyBlocks: number; /** Number of payments flagged by anomaly detection (review mode) */ anomalyFlags: number; /** Number of payments denied by policy rules */ policyDenials: number; } export declare class Analytics { private ledger; constructor(ledger: Ledger); /** Generate a full spend summary from current ledger data. */ summary(): SpendSummary; } //# sourceMappingURL=analytics.d.ts.map