import { type AmountInUnits, type AmountUnit } from '../../components/TokenSwapWidget/AmountUnitToggle/useAmountUnitToggle'; /** * A typed amount in source base units, or `undefined` when empty or unpriced. * - Token mode parses the typed digits, so nothing passes through a float. * - USD mode divides by the live price, so it's as exact as that price. */ export declare function parseConvertInputToBaseUnits({ inputValue, unit, tokenAmount, decimals, }: { inputValue: string; unit: AmountUnit; /** The unit toggle's token amount; only read in USD mode. */ tokenAmount: number | undefined; decimals: number; }): bigint | undefined; /** * A preset amount as plain field text in the current unit, rounded down so the * field never shows more than the user has. Display only: the exact amount is * kept apart. Empty in USD mode without a price, rather than a token amount under a `$`. */ export declare function formatConvertPresetInput({ baseUnits, decimals, unit, unitPriceUsd, }: { baseUnits: bigint; decimals: number; unit: AmountUnit; unitPriceUsd: number | undefined; }): string; /** * A percentage preset's exact amount, or `undefined` when there's nothing to fill. * - Max keeps the gas reserve, so it always fits. Like checkout, it falls back to * the full balance while the reserve loads, and is 0 when gas takes it all. * - The rest take a share of the full balance, so on a native token they can * exceed Max, which raises the usual insufficient-balance issue. * - A share that rounds to 0 (dust) fills nothing rather than a silent "0". */ export declare function getConvertPercentBaseUnits({ percent, balanceBaseUnits, maxBaseUnits, }: { percent: number; balanceBaseUnits: bigint; maxBaseUnits: bigint | null; }): bigint | undefined; export interface ConvertAmount extends AmountInUnits { /** The field text; the preset's rounded-down display while a preset is on. */ inputValue: string; unit: AmountUnit; /** What to quote: the preset's exact amount, or the typed one. */ baseUnits: bigint | undefined; } /** * The amount a draft describes at `unitPriceUsd`. While a preset is on, the * field and converted amounts derive from it, so a price change or unit flip * never leaves them stale. */ export declare function getConvertAmount({ inputValue, unit, presetBaseUnits, decimals, unitPriceUsd, }: { inputValue: string; unit: AmountUnit; presetBaseUnits: bigint | undefined; decimals: number; unitPriceUsd: number | undefined; }): ConvertAmount;