@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
23 lines (22 loc) • 1.01 kB
TypeScript
import type { IsStablecoinFn } from '../../hooks/useIsStablecoin';
import { type QuoteBuilder } from './types';
export interface ResolveQuoteBuilderParams {
hasPostAction: boolean | undefined;
isExactInEnabled: boolean;
isStablecoin: IsStablecoinFn;
providerSupportsExactInWithActions?: boolean;
}
/**
* Determines the quote mode and returns the corresponding builder.
*
* Resolution order:
* 1. No checkout config (hasPostAction is undefined) → EXACT_OUT (safe default)
* 2. Feature gate off → EXACT_OUT (Stage 1 default)
* 3. No action params → EXACT_IN
* 4. Action params + provider supports → EXACT_IN
* 5. Action params + no support → EXACT_OUT
*
* Note: ONE_TO_ONE (subsidized routes) is not yet auto-detected.
* It will be enabled in a future phase when subsidy detection is implemented.
*/
export declare function resolveQuoteBuilder({ hasPostAction, isExactInEnabled, isStablecoin, providerSupportsExactInWithActions, }: ResolveQuoteBuilderParams): QuoteBuilder;