import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, MultiSourceWithdrawalConfig, SingleWithdrawalConfig, SourceTokenOption, WalletWithdrawalConfig, WithdrawalSourceOption } from '../providers/FunkitCheckoutContext'; /** * Type guard to check if withdrawal config uses wallet-based flow */ export declare function isWalletWithdrawalConfig(config: FunkitWithdrawalConfig): config is WalletWithdrawalConfig; /** * True when a wallet withdrawal would be a no-op self-transfer that Relay * rejects with a generic `QuoteError`: same chain, same token, and recipient == * the source wallet. Cross-chain or cross-token withdrawals to your own address * are valid and return false. Non-wallet configs and empty recipients are false. */ export declare function isNoOpSelfWithdrawal({ config, recipientAddress, selectedChainId, destinationTokenAddress, }: { config: FunkitWithdrawalConfig; recipientAddress: string; selectedChainId: number | undefined; destinationTokenAddress: string | undefined; }): boolean; /** A source-token option that can only move as-is — its receive target is the * option's own asset. */ export type DirectTransferOnlyOption = SourceTokenOption & { asset: NonNullable; }; /** * True when the selected source option supports direct transfer only: xStocks * have no Relay liquidity, so the only viable route is a same-token same-chain sweep. */ export declare function isDirectTransferOnlyOption(sourceTokenOption: SourceTokenOption | undefined): sourceTokenOption is DirectTransferOnlyOption; /** * Type guard to check if withdrawal config uses custom callback flow */ export declare function isCustomWithdrawalConfig(config: FunkitWithdrawalConfig): config is CustomWithdrawalConfig; /** * Type guard to check if withdrawal config wraps multiple methods the user * must pick between (e.g. "Fast" vs "Secure"). */ export declare function isMultiMethodWithdrawalConfig(config: FunkitWithdrawalConfig): config is MultiMethodWithdrawalConfig; /** * Type guard for a config whose source is picked from the amount screen's * dropdown, each source carrying its own chain, token and wallet. */ export declare function isMultiSourceWithdrawalConfig(config: FunkitWithdrawalConfig): config is MultiSourceWithdrawalConfig; /** * The source `sourceId` names, falling back to the default (then the first) * when it names none. Its config carries the container's header and * `disableConnectedWallet`, so it can drive the flow on its own. `undefined` * only for an empty container. */ export declare function resolveWithdrawalSource(config: MultiSourceWithdrawalConfig, sourceId?: string): { source: WithdrawalSourceOption; config: SingleWithdrawalConfig; } | undefined; /** * The single config a flow starts on before the user picks anything: the * first method, the default source, or the config itself. `undefined` for an * empty container. */ export declare function getDefaultWithdrawalConfig(config: FunkitWithdrawalConfig): SingleWithdrawalConfig | undefined; /** * The config a withdrawal item is seeded from. A multi-source config leaves out * its default source's balance callback: the item's callback is the fallback * for sources without their own, and the default source's reads another wallet. */ export declare function getWithdrawalItemSeedConfig(config: FunkitWithdrawalConfig): SingleWithdrawalConfig | undefined; /** * Converts a human-readable token amount to base units using string arithmetic * to avoid floating-point precision loss. * * The precision is preserved because the original user-input string is passed * directly — it is never coerced to a JS Number/float first. * * e.g. passing the already-truncated float string '8.967660226710157' would * still produce 8967660226710157000n (lossy). * But keeping the original full-precision string '8.967660226710157512' * produces 8967660226710157512n (exact). */ export declare function toWithdrawalAmountBaseUnit(amount: string, decimals: number): bigint;