import React, { type ReactNode } from 'react';
import type { Address } from 'viem';
import { type ApplyDynamicRoutingPath } from '../../domains/dynamicRouting';
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
import type { AssetHoldingsItem } from '../../utils/assets';
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
import type { DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
export * from './types';
interface FunkitCheckoutContextInterface {
    checkoutItem: FunkitActiveCheckoutItem | null;
    getCheckoutProgress(checkoutId: string): CheckoutProgress | undefined;
    setCheckoutProgress(checkoutId: string, progress: CheckoutProgress): void;
    initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
    updateModalTitleMeta(newMeta: string): void;
    updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
    updateTargetAssetAmount(newTargetAssetAmount: number, fiatAmount?: number, tokenAmountBaseUnits?: bigint): void;
    updateTargetAsset(asset: {
        targetAsset: Address;
        targetChain: string;
        targetAssetTicker: string;
        targetAssetMinAmount: number | undefined;
        iconSrc: string | undefined;
        generateActionsParams?: FunkitCheckoutConfig['generateActionsParams'];
    }): void;
    updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
    updateCustomRecipient: (recipient: Address) => void;
    confirmCheckout(quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient, preWithdrawalTxs?: WithdrawalTransaction[]): Promise<Address>;
    cancelCheckout(depositAddress: Address): Promise<boolean>;
    /**
     * Partial-update the active checkout item. Exposed for direct-execution
     * fast-paths that bypass `confirmCheckout` (e.g. Aave native supply) and
     * need to sync `checkoutItem.depositAddress` themselves. TODO(ENG-3966):
     * fold these call sites into a shared orchestration helper so this
     * doesn't need to be public.
     */
    updateActiveCheckout: (data: Partial<FunkitActiveCheckoutItem> | ((checkoutItem: FunkitActiveCheckoutItem) => Partial<FunkitActiveCheckoutItem>)) => void;
    /** @deprecated to be removed after quote migration is finished (historically named setCheckoutQuote) */
    setCheckout: (checkout: FunkitActiveCheckoutItem) => void;
    setCompletedTimestamp(timestampMs: number): void;
    withdrawalItem: FunkitActiveWithdrawalItem | null;
    initNewWithdrawal(initSettings: Partial<UseFunkitCheckoutPropsWithFullConfig>, config: UseFunkitCheckoutPropsWithFullConfig): string;
    updateWithdrawalSourceAssetAmount(newSourceAmount: string): void;
    resetForNewWithdrawal(): void;
    resetForNewDeposit(): void;
    applyDynamicRouting(path: ApplyDynamicRoutingPath): void;
    updateDynamicRoutingId(dynamicRoutingId: string): void;
    /**
     * Apply a selected {@link DynamicTargetAssetCandidate} to the active checkout
     * in one atomic update: target token fields, `dynamicRoutingId`, and (when the
     * candidate carries one) `customRecipient`. The single source of truth for
     * "select a destination candidate", shared by the SourceChange target-asset
     * dropdown and customer account pickers (e.g. Polymarket) so neither has to
     * re-sequence the individual setters.
     */
    applyDynamicTargetAssetCandidate(candidate: DynamicTargetAssetCandidate): void;
}
export type CheckoutProgressStep = 1 | 2;
export type CheckoutProgress = {
    step: CheckoutProgressStep;
};
export declare function FunkitCheckoutProvider({ children }: {
    children: ReactNode;
}): React.JSX.Element;
export declare function useCheckoutContext(): FunkitCheckoutContextInterface;
/**
 * External hook for user to kickstart a checkout in their app
 */
export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullConfig): {
    beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<{
        isActivated: boolean;
    }>;
    beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
};
export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
    beginCheckout: (config: FunkitCheckoutConfig) => Promise<{
        isActivated: boolean;
    }>;
    beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
};
