import type { BillingBalance } from "@opengeni/contracts"; import { type Database } from "./database.js"; type CreditLedgerEntryInput = { accountId: string; workspaceId?: string | null; type: string; amountMicros: number; eligibleModelIds?: string[] | undefined; sourceType?: string | null; sourceId?: string | null; idempotencyKey: string; metadata?: Record; occurredAt?: Date; }; export declare function applyCreditLedgerEntry(db: Database, input: CreditLedgerEntryInput): Promise; /** * {@link applyCreditLedgerEntry} that also reports whether this call inserted * the row. `inserted` is false when the idempotency key already existed, so a * caller can count a purchase exactly once even when two deliveries race. */ export declare function applyCreditLedgerEntryOnce(db: Database, input: CreditLedgerEntryInput): Promise<{ balance: BillingBalance; inserted: boolean; }>; export {};