import type { FunLogger } from './funLogger'; /** * The amount a withdrawal quote should price: the typed amount less a flat, * venue-charged fee, clamped at 0. * * - The deduction lands on the quote input rather than the typed amount, so the * account is debited what the user typed and the remainder is what moves. * - `dnum` fixed-point, not float: `10.1 - 3` is `7.100000000000001` in binary * floating point, and a quote key would refetch on that noise alone. */ export declare function deductFlatFee(inputAmount: string, feeTokenAmount: number): string; /** * A share of a balance, for the percentage shortcuts on an amount field. * * - Always rounds down: at 100% a rounded-up share would exceed the balance, * and below it the extra digit is dust the transfer can't carry anyway. * - `decimals` is the token's precision. Until it's known, two digits past * whatever the balance carries is what dividing by 100 needs. */ export declare function percentOfAmount(balance: string, percent: number, decimals?: number): string; /** Cents: what a USD figure is written to when it's the converted side. */ export declare const USD_DECIMALS = 2; /** * The token amount a USD figure buys, for a field typed in dollars. * * - Rounds down: a rounded-up amount can exceed the balance being spent from. * - A price of `0` is "unknown", so it yields `'0'` rather than dividing by it. */ export declare function usdToTokenAmount(usd: string, usdPrice: number, decimals?: number): string; /** * What a token amount is worth, in cents. Rounds down rather than up to a cent * nobody has; `0` is "unknown", not free. */ export declare function tokenAmountToUsd(amount: string, usdPrice: number): string; /** * Resolve the integrator's `withdrawalSourceTokenBalance` callback to a numeric * string. Generic over the callback params so each platform keeps its own shape * (web asks by `sourceAsset`, React Native by `sourceToken`). * * - `undefined` means no callback was supplied — distinct from a callback * returning `0` ("nothing withdrawable"). * - A throw or an unusable value yields `'0'`, never `undefined`: a broken * callback must not read as "unknown" and let the form fall through to some * other balance source. */ export declare function resolveWithdrawalSourceTokenBalance(fn: ((params: TParams) => string | number) | undefined, params: TParams, logger: FunLogger): string | undefined; //# sourceMappingURL=withdrawal.d.ts.map