import { DirectExecutionType } from '@funkit/api-base';
import type { RelayTxHash, RelayVmType } from '@funkit/fun-relay';
import type { CheckoutQuoteResponse } from '@funkit/utils';
import type { Address, Hex } from 'viem';
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext';
import { type WithdrawalClient, type WithdrawalTransaction } from '../wallets/Wallet';
interface DirectExecutionQuoteRequestParamsBase {
    actionParams: FunkitCheckoutActionParams[];
    bridgeOverride?: 'across' | 'relay';
    fromChainId: string;
    fromTokenAddress: Address;
    isExactIn?: boolean;
    toChainId: string;
    toTokenAddress: Address;
    recipientAddress: Address;
    senderAddress?: Address;
    /**
     * Explicit permit preference for the source-side authorization step.
     * Forwarded as `usePermit` on the v2 quote request body. When defined,
     * takes priority over the legacy auto-gasless-fallback (see frog's
     * getUsePermit for the full resolution order).
     */
    usePermit?: boolean;
}
interface RegularDEQuoteRequest extends DirectExecutionQuoteRequestParamsBase {
    toTokenAmount: number;
    toTokenDecimals: number;
    isExactIn?: false;
}
interface WithdrawalDEQuoteRequest extends DirectExecutionQuoteRequestParamsBase {
    fromTokenAmount: string;
    isExactIn: true;
    fromTokenDecimals: number;
}
type DirectExecutionQuoteRequestParams = RegularDEQuoteRequest | WithdrawalDEQuoteRequest;
interface DirectExecutionStartParams {
    checkoutItem: FunkitActiveCheckoutItem;
    stepMessageSetter: (m: string) => void;
    actionsParams: FunkitCheckoutActionParams[];
    latestQuote: FunkitCheckoutQuoteResult;
    onTransactionConfirmed: (txHash: RelayTxHash<RelayVmType>) => void;
    withdrawalClient?: WithdrawalClient;
    /**
     * Transactions returned by `WalletWithdrawalConfig.preWithdrawalAction`.
     * Prepended to the SDK's withdrawal txn and broadcast as a single
     * atomic batch via `withdrawalClient.sendTransactions`.
     */
    preWithdrawalTxs?: WithdrawalTransaction[];
}
export interface FunkitDirectExecutionInfo {
    isDirectExecution: boolean;
    directExecutionType: DirectExecutionType | null;
    getDirectExecutionQuote: (params: DirectExecutionQuoteRequestParams) => Promise<CheckoutQuoteResponse | null>;
    executeDirectExecution: (params: DirectExecutionStartParams) => Promise<Hex | null>;
}
interface UseCheckoutDirectExecutionReturn {
    getDirectExecutionInfo: (checkoutItem: FunkitActiveCheckoutItem | null) => FunkitDirectExecutionInfo;
    getWithdrawalDirectExecution: () => FunkitDirectExecutionInfo;
}
export declare function useCheckoutDirectExecution(): UseCheckoutDirectExecutionReturn;
export {};
