import type { ExchangeRates, SwappedFormOfPayment, ThirdPartyPaymentConfigs } from '@funkit/api-base'; import type { FunLogger } from '../utils/funLogger'; import type { SyntheticFormOfPayment } from './syntheticFop'; export declare const FOPS_STALE_TIME: number; /** Statsig `swappeddefaultinputamount` value. */ export interface SwappedDefaultInputAmountConfig { /** USD amount converted into the user's currency when no override matches. */ fallbackUsd: number; /** Amounts in the keyed currency, sent as-is. */ currencyOverrides: Record; } /** * Amount prefilled into the Swapped on-ramp, in `fiatCurrencyCode`. Overrides * win; otherwise the USD fallback is converted (1:1 while rates are unknown) * and rounded up to a whole unit. Swapped raises anything under its minimum. */ export declare function getSwappedDefaultInputAmount(defaultInputAmountConfig: SwappedDefaultInputAmountConfig, fiatCurrencyCode: string, exchangeRates: ExchangeRates | undefined): number; export interface SwappedThirdPartyPaymentConfigsParams { /** Integrator-supplied email prefilled into the Swapped widget, if any. */ prefillFiatEmail: string | undefined; /** Theme query params the API bakes into the returned `embeddedFlowUrl`. */ themeConfig: Record; /** Call-site prefix for the decision log, e.g. `'useFops'`. */ logTag: string; logger: FunLogger; } /** * Build the Swapped `thirdPartyPaymentConfigs` for a /fops request, shared by * the on- and off-ramp fops queries on both web and React Native. * * `prefillFiatEmail` is normalized + validated here, but the backend is the * authoritative validator: invalid emails are dropped (never block checkout) * and the email value is never logged (PII). */ export declare function buildSwappedThirdPartyPaymentConfigs({ prefillFiatEmail, themeConfig, logTag, logger, }: SwappedThirdPartyPaymentConfigsParams): ThirdPartyPaymentConfigs; /** * Sorts fops by a priority order list (array of fopType strings, index = priority). * Fops not in the list are sorted by max checkout limit descending. */ export declare function sortFops(fops: T[], priorityOrder: readonly string[]): T[]; /** * Rounds to: * - >= $1M: nearest $100,000 (one decimal of "M" once compact-formatted, e.g. $1.4M) * - >= $1000: nearest $1000 * - >= $100: down to nearest $100 * - >= $10: down to nearest $10 * - < $10: down to nearest $1 (floored to whole number) */ export declare function roundFopsLimit(value: number): number; /** * Deposit FOP limit: the payment method's own ceiling, rounded + compact-formatted * (e.g. "$5k", "$1.5M"). Approximating a cap is fine — see roundFopsLimit. */ export declare function getFopsLimit(fop: SwappedFormOfPayment, exchangeRates: ExchangeRates | undefined, defaultMaxLimit?: string): string; /** * Withdrawal disclaimer limit. A limit only matters when the user's balance can * exceed it; below that the method is effectively unlimited for this user, so * return undefined (no limit shown). The backend clamps each method's max to the * cap we send (eurMaxCap, EUR = balance), so max < cap ⇒ the method's real * limit (shown deposit-rounded); max at/above the cap ⇒ balance-bound ⇒ hidden. */ export declare function getWithdrawalFopsDisclaimerLimit(fop: SwappedFormOfPayment, exchangeRates: ExchangeRates | undefined, eurMaxCap: number | undefined): string | undefined; /** * Withdrawal FOP limit: the user's withdrawable balance, not a payment-method cap. * Shown as the exact figure floored to whole dollars (never display more than is * withdrawable) with separators and no suffix — rounding would understate the * user's real money. */ export declare function getWithdrawalFopsLimit(fop: SwappedFormOfPayment, exchangeRates: ExchangeRates | undefined, defaultMaxLimit?: string): string; //# sourceMappingURL=swapped.d.ts.map