import { type CheckoutHistoryItem, type DirectExecution } from '@funkit/api-base'; /** * Pure, platform-agnostic logic backing the checkout-notifications feature: * merging multi-step direct-execution chains, classifying deposits vs * withdrawals vs token transfers, applying the recency/variant filters, and * deriving which records changed relative to an initial snapshot. * * No React / DOM dependencies. Extracted out of `hooks/queries/useRecentDeposits` * (the polling hook) and `modals/.../CheckoutNotifications.tsx` (the view) so the * same derivation runs on both platforms. */ /** * Default cutoff for notification recency: direct executions / checkouts older * than this window are not surfaced as notifications. */ export declare const DEFAULT_NOTIF_CUTOFF: number; export type NotificationVariant = 'deposit' | 'withdrawal' | 'token_transfer' | 'bitcoin_lightning'; export interface MergedMultiStepDirectExecution extends DirectExecution { /** * In a multi-step DE chain, represents the latest **present** DE of the chain. * * Always `undefined` for single-step DEs. */ latestStep?: DirectExecution; } export declare function mergeMultiStepDirectExecutions(directExecutions: DirectExecution[]): MergedMultiStepDirectExecution[]; export declare function isTokenTransferDirectExecution(de: DirectExecution): boolean; export declare function isWithdrawalDirectExecution(de: DirectExecution): boolean; export declare function isBitcoinLightningDirectExecution(de: DirectExecution): boolean; /** * Pure transform: filters, merges multi-step chains, and sorts direct executions. * Testable without React. */ export declare function processRecentDepositsForNotifications(directExecutions: DirectExecution[] | undefined, { createdAfterMs, cutOffTimeMs, variant, }?: { createdAfterMs?: number; cutOffTimeMs?: number; variant?: NotificationVariant; }): MergedMultiStepDirectExecution[] | undefined; /** * @returns checkouts that are either not present in the initial checkouts or the data changed somehow */ export declare const getUpdatedCheckouts: (checkouts: CheckoutHistoryItem[], initialCheckouts?: CheckoutHistoryItem[]) => CheckoutHistoryItem[]; /** * @returns direct executions that are either not present in the initial set or whose data changed */ export declare const getUpdatedDirectExecutions: (directExecutions: MergedMultiStepDirectExecution[], initialDirectExecutions?: DirectExecution[]) => MergedMultiStepDirectExecution[]; //# sourceMappingURL=checkoutNotifications.d.ts.map