import { type MinTransferConfig } from './checkoutTransfer'; import { PaymentMethod } from './paymentMethods'; /** USD ceiling for a Bitcoin/Cash App Lightning checkout. */ export declare const MAX_BTC_LIGHTNING_AMOUNT_USD = 10000; /** Extra USD headroom added to a card (Meld) minimum deposit. */ export declare const MELD_MIN_LIMIT_BUFFER = 5; /** * The active deposit target. `getMinDepositUSD` is the customer-configured * minimum for the destination token/chain; keeping it a passed-in closure * (rather than a customer branch) keeps this module customer-agnostic. All * fields are optional because RN resolves them lazily from host config. */ export interface MinDepositTarget { targetChain?: string; targetAsset?: string; dynamicRoutingId?: string; getMinDepositUSD?: (ctx: { tokenChainId?: string; tokenAddress?: string; dynamicRoutingId?: string; }) => number; } /** * The customer-configured minimum deposit (USD) for a target, or 0 if none. * A non-finite closure return (NaN from a not-yet-loaded price) collapses to 0 * so it can't poison the downstream limit math. */ export declare function getConfiguredMinDepositUsd(target: MinDepositTarget | undefined): number; /** * Minimum token-transfer value (USD) for a chain: the Statsig per-chain floor * plus the target's already-resolved minimum-deposit add-on, rounded up to a * whole dollar. Callers resolve the add-on via {@link getConfiguredMinDepositUsd} * (or their own typed closure) so this stays free of the customer config type. */ export declare function getMinTransferValueUsd(chainId: number | undefined, limits: MinTransferConfig, minDepositAddOnUsd?: number): number; /** * Minimum token-transfer value converted to EUR — the fiat (Swapped) buy floor * the backend expects. The USD floor from {@link getMinTransferValueUsd} at the * live EUR rate, rounded up. Shared by web and RN so the two can't drift; falls * back to a 1:1 rate while rates load (see {@link convertUsdAmount}). */ export declare function getMinTransferValueEur(chainId: number | undefined, limits: MinTransferConfig, minDepositAddOnUsd: number, exchangeRates: Record | undefined): number; /** * Convert a USD amount to `currency` using the fiat exchange rates (no Meld * markup — bips 0). Falls back to a 1:1 rate while rates are loading. Set * `round` to ceil the result (used for display/limit floors). */ export declare function convertUsdAmount(usd: number, currency: string, exchangeRates: Record | undefined, options?: { round?: boolean; }): number; /** * Card (Meld) minimum deposit in `currency`: the configured USD minimum * converted to the target currency, plus a buffer on card payments only. */ export declare function getMeldMinDepositInCurrency({ minDepositUsd, paymentMethod, currency, exchangeRates, }: { minDepositUsd: number; paymentMethod?: PaymentMethod; currency: string; exchangeRates: Record | undefined; }): number; export interface WithdrawalAmountValidation { isWithdrawAmountTooLow: boolean; isWithdrawAmountTooHigh: boolean; isWithdrawAmountAboveBalance: boolean; isWithdrawAmountValid: boolean; /** Min shown to the user: token-unit for per-token flows, USD otherwise. */ minWithdrawalDisplayValue: number; } export declare function validateWithdrawalAmount({ withdrawalInputAmount, sourceTokenUsdPrice, sourceTokenDecimals, sourceTokenBalance, perTokenMin, perTokenMax, usdMin, usdMax, }: { /** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */ withdrawalInputAmount: string; sourceTokenUsdPrice: number; /** * Fraction digits the source carries. Only matters where the price isn't 1 — * at parity the USD floor converts exactly and there is nothing to drop. */ sourceTokenDecimals?: number; sourceTokenBalance: string; perTokenMin: number | undefined; /** Optional: rails whose source has a resolvable price use `usdMax`. */ perTokenMax?: number; usdMin: number; usdMax: number | undefined; }): WithdrawalAmountValidation; export interface CheckoutAmountLimitsUsd { minUsd: number | undefined; maxUsd: number; } /** * Min/max USD bounds for the checkout amount input, by payment method: * - Lightning carries the token-transfer floor and a fixed ceiling. * - Brokerage takes the larger of the brokerage and configured minimums. * - Everything else uses the configured minimum and the global max. */ export declare function getCheckoutAmountLimitsUsd({ paymentMethod, minDepositUsd, minTransferValueUsd, brokerageMinUsd, maxDepositUsd, }: { paymentMethod: PaymentMethod; minDepositUsd: number | undefined; minTransferValueUsd: number; brokerageMinUsd: number | undefined; maxDepositUsd: number; }): CheckoutAmountLimitsUsd; //# sourceMappingURL=amountLimits.d.ts.map