export declare const NEXUS_MAX_MEMBER_BALANCE = 999999999; export declare const NEXUS_MAX_MANUAL_AMOUNT = 10000; export type NexusAmountInput = string | number; export type NexusLedgerTransactionType = "daily" | "source_reward" | "achievement_reward" | "manual_award" | "adjustment" | "redemption" | "refund" | "reversal" | "reset" | "privacy_burn" | "inventory_correction"; export interface NexusLedgerAccount { accountId: string; guildId: string; memberId: string | null; balance: string; lifetimeEarned: string; lifetimeSpent: string; rankingEnabled: boolean; revision: number; createdAt: Date; updatedAt: Date; } interface NexusLedgerIntentContext { guildId: string; memberId: string; operationKey: string; actorUserId?: string; sourceModuleId?: string; sourceEventId?: string; sourceDeliveryId?: string; privateReason?: string; } export type NexusLedgerPostIntent = (NexusLedgerIntentContext & { type: "manual_award"; amount: NexusAmountInput; }) | (NexusLedgerIntentContext & { type: "adjustment" | "inventory_correction"; amount: NexusAmountInput; }) | (NexusLedgerIntentContext & { type: "redemption" | "reset" | "privacy_burn"; amount: NexusAmountInput; }) | (NexusLedgerIntentContext & { type: "refund"; amount: NexusAmountInput; relatedTransactionId: string; }); export interface NexusLedgerPostResult { transactionId: string; replayed: boolean; account: NexusLedgerAccount; } export interface NexusLedgerReverseInput { guildId: string; originalTransactionId: string; operationKey: string; actorUserId: string; privateReason: string; } export interface NexusLedgerVerificationDiscrepancy { accountId: string; accountType: "member" | "issuer" | "sink"; memberId: string | null; storedBalance: string; journalBalance: string; storedLifetimeEarned: string; journalLifetimeEarned: string; storedLifetimeSpent: string; journalLifetimeSpent: string; } export interface NexusLedgerVerificationResult { checkedAccounts: number; repairedAccounts: number; discrepancies: readonly NexusLedgerVerificationDiscrepancy[]; truncated: boolean; } export type NexusLedgerErrorCode = "invalid_input" | "operation_conflict" | "insufficient_balance" | "balance_cap" | "transaction_not_found" | "already_reversed" | "invalid_related_transaction" | "privacy_erased" | "projection_invariant"; export declare class NexusLedgerError extends Error { readonly code: NexusLedgerErrorCode; constructor(code: NexusLedgerErrorCode, message: string); } export interface NexusLedgerService { getMemberAccount(input: { guildId: string; memberId: string; }): Promise; post(input: NexusLedgerPostIntent): Promise; reverse(input: NexusLedgerReverseInput): Promise<{ transactionId: string; replayed: boolean; account: NexusLedgerAccount; }>; verifyGuild(input: { guildId: string; limit?: number; repair?: boolean; }): Promise; } export {};