import * as react_jsx_runtime from 'react/jsx-runtime';
import React from 'react';
import { QueryClient } from '@tanstack/react-query';
import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, DepositModalInitialScreen, ChainType, DepositConfirmationMode, WithdrawTransactionInfo, AllowedCountryResult } from '@unifold/ui-react';
export { AllowedCountryResult, BrowserWalletAmountQuickSelect, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ConfirmingView, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
import { DepositEvent } from '@unifold/core';
export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, LockedQuoteLimits, LockedQuotePreview, LockedQuotePreviewRequest, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionCreatedData, OnrampSessionCreatedEvent, OnrampSessionRequest, OnrampSessionResponse, PaymentIntent, PaymentIntentDepositAddress, PaymentIntentStatus, PaymentIntentType, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SendSolanaTransactionRequest, SendSolanaTransactionResponse, SourceToken, SourceTokenNetwork, SupportedChain, SupportedDepositTokensResponse, SupportedDestinationTokensResponse, SupportedSourceTokensQuery, SupportedSourceTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, createDepositAddress, createOnrampSession, generatePrefixedKSUID, getApiBaseUrl, getChainName, getDefaultOnrampToken, getDepositQuote, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, retrievePaymentIntent, sendSolanaTransaction, setApiConfig, useUserIp } from '@unifold/core';

interface UnifoldConnectProviderConfig {
    publishableKey: string;
    /**
     * Bring your own TanStack QueryClient. When provided, UnifoldProvider will
     * use this client instead of creating its own, and will not add a
     * QueryClientProvider wrapper (it assumes one already exists in the tree).
     *
     * This avoids shadowing the host app's QueryClient and lets Unifold hooks
     * share the same cache, devtools, and default options as the rest of the app.
     */
    queryClient?: QueryClient;
    config?: {
        modalTitle?: string;
        /** Custom title for the withdraw modal. @default `"Withdraw"` */
        withdrawModalTitle?: string;
        hideDepositTracker?: boolean;
        /** Show balance in deposit modal header. Defaults to true */
        showBalanceHeader?: boolean;
        /** Theme appearance: 'light', 'dark', or 'auto' (system preference). Defaults to 'dark' */
        appearance?: ThemeMode | 'auto';
        /** Transfer input variant: 'single_input' or 'double_input'. Defaults to 'double_input' */
        transferInputVariant?: 'single_input' | 'double_input';
        /** Enable browser wallet connection option. Defaults to false */
        enableConnectWallet?: boolean;
        /** Enable "Pay with Exchange" option. Overrides dashboard default. Defaults to dashboard value or true. */
        enablePayWithExchange?: boolean;
        /** Enable "Connect Exchange" option for direct Coinbase Connect integration. Defaults to false. */
        enableConnectExchange?: boolean;
        /** Enable "Pay with Cash App" option. Defaults to false. */
        enableCashApp?: boolean;
        /** Simple accent/primary color override (applies to both light and dark modes) */
        accentColor?: string;
        /** Full theme color customization per mode */
        theme?: ThemeConfig;
        /** Single font family for all text (host app must load the font) */
        fontFamily?: string;
        /** Granular font family configuration for different weights */
        fonts?: FontConfig;
        /** Component-specific token overrides */
        components?: ComponentConfig;
        /** Default `initialScreen` for `beginDeposit()` when the call omits it */
        defaultInitialScreen?: DepositModalInitialScreen;
        /** Main menu — Transfer Crypto row title. @default `"Transfer Crypto"` (from package i18n when omitted) */
        transferCryptoTitle?: string;
        /** Main menu — Deposit with Card row title. @default `"Deposit with Card"` */
        depositWithCardTitle?: string;
        /** Main menu — Pay with Exchange row title. @default `"Pay with Exchange"` */
        payWithExchangeTitle?: string;
        /** Main menu — Deposit Tracker row title. @default `"Deposit Tracker"` */
        depositTrackerTitle?: string;
        /** Main menu — Deposit Tracker row description. @default `"Track your deposit progress"` */
        depositTrackerSubTitle?: string;
        /** Deposit with Card onramp: hide You use / You buy / You receive. @default false */
        hideDepositFlowInfo?: boolean;
        /** Deposit with Card onramp: hide wallet address disclaimer. @default false */
        hideDisplayDescription?: boolean;
        /** Connect Wallet → Enter amount: `percentage` (10%, 25%, 50%, 75%, MAX) or `usd` ($25…). @default `percentage` */
        browserWalletAmountQuickSelect?: "usd" | "percentage";
    };
}
interface DepositResult {
    message: string;
    transaction?: unknown;
    executionId?: string;
}
interface DepositError {
    message: string;
    error?: unknown;
    code?: string;
}
interface DepositConfig {
    externalUserId: string;
    destinationChainType: ChainType;
    destinationChainId: string;
    destinationTokenAddress: string;
    destinationTokenSymbol: string;
    recipientAddress: string;
    /**
     * Pre-select source token/chain in the Transfer Crypto view.
     * All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
     * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
     */
    defaultSourceChainType?: ChainType;
    /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` and a symbol or token address. */
    defaultSourceChainId?: string;
    /** Source token contract address. Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
    defaultSourceTokenAddress?: string;
    /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
    defaultSourceSymbol?: string;
    /** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
    depositConfirmationMode?: DepositConfirmationMode;
    onSuccess?: (data: DepositResult) => void;
    onError?: (error: DepositError) => void;
    /** Called when the user dismisses the deposit dialog (X button, Escape key, or programmatic close) */
    onClose?: () => void;
    /** Called when deposit lifecycle events occur. Use {@link DepositEventType} to narrow the event type. See {@link DepositEvent} for the full union. */
    onEvent?: (event: DepositEvent) => void;
    /**
     * Which screen opens first: menu (`main`, default), `transfer`, `card`, or `tracker`.
     * `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
     * (deposit history is always reachable). If not `main`, the header back control is hidden (nothing to return to);
     * card quotes/onramp and tracker detail still show back for inner navigation.
     */
    initialScreen?: DepositModalInitialScreen;
}
interface CheckoutResult {
    paymentIntentId: string;
    status: string;
}
interface CheckoutError {
    message: string;
    error?: unknown;
    code?: string;
}
interface WithdrawResult {
    message: string;
    transaction?: unknown;
}
interface WithdrawError {
    message: string;
    error?: unknown;
    code?: string;
}
interface CheckoutConfig {
    /** The client_secret from a PaymentIntent created on your server */
    clientSecret: string;
    /**
     * Pre-select source token/chain in the Transfer Crypto view.
     * All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
     * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
     */
    defaultSourceChainType?: ChainType;
    /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
    defaultSourceChainId?: string;
    /** Source token contract address. Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
    defaultSourceTokenAddress?: string;
    /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
    defaultSourceSymbol?: string;
    /** Optional callbacks (fired immediately when events occur) */
    onSuccess?: (data: CheckoutResult) => void;
    onError?: (error: CheckoutError) => void;
    /** Called when the user dismisses the checkout dialog */
    onClose?: () => void;
}
interface WithdrawConfig {
    /** External user ID — required, same as deposit */
    externalUserId: string;
    /** Source token chain type (e.g. 'ethereum', 'solana'). Must be a supported stablecoin. */
    sourceChainType: ChainType;
    /** Source token chain ID (e.g. '8453', 'mainnet') */
    sourceChainId: string;
    /** Source token contract address */
    sourceTokenAddress: string;
    /** Source token symbol (e.g. 'USDC'). Optional but recommended for display. */
    sourceTokenSymbol?: string;
    /** Optional: pre-fill the recipient address the user is withdrawing to */
    recipientAddress?: string;
    /**
     * Pre-select the destination (receive) token/chain in the withdraw view.
     * All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
     * If omitted or no match is found in `/supported_destination_tokens`, the first available token and chain are used.
     */
    defaultDestinationChainType?: string;
    /** Destination chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultDestinationChainType` + symbol or token address. */
    defaultDestinationChainId?: string;
    /** Destination token contract address. Must be paired with `defaultDestinationChainType` + `defaultDestinationChainId`. */
    defaultDestinationTokenAddress?: string;
    /** Destination token symbol (e.g. `"USDC"`). Must be paired with `defaultDestinationChainType` + `defaultDestinationChainId`. */
    defaultDestinationSymbol?: string;
    /**
     * The user's wallet address (the sender). Used to:
     * 1. Fetch balance for quick-select chips (25%/50%/75%/MAX)
     * 2. Detect if a matching browser wallet is connected
     */
    senderAddress: string;
    /**
     * Callback invoked with transaction details when the user confirms withdrawal.
     * The host app is responsible for signing and submitting the transaction — the
     * SDK does not have access to the user's private key.
     */
    withdraw: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
    onSuccess?: (data: WithdrawResult) => void;
    onError?: (error: WithdrawError) => void;
    onClose?: () => void;
}

declare function UnifoldProvider({ children, publishableKey, queryClient, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
declare function useUnifold(): {
    publishableKey: string;
    beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
    closeDeposit: () => void;
    beginCheckout: (config: CheckoutConfig) => Promise<CheckoutResult>;
    closeCheckout: () => void;
    beginWithdraw: (config: WithdrawConfig) => Promise<WithdrawResult>;
    closeWithdraw: () => void;
};
/**
 * Convenience wrapper for useAllowedCountry that automatically passes publishableKey from context
 *
 * This wrapper makes it easy for developers to check geo-restrictions without manually
 * passing the publishableKey.
 *
 * @returns AllowedCountryResult with isAllowed status and location info
 *
 * @example
 * ```tsx
 * import { useAllowedCountry } from '@unifold/connect-react';
 *
 * function MyComponent() {
 *   const { isAllowed, isLoading, error } = useAllowedCountry();
 *
 *   if (isLoading) return <Loading />;
 *   if (!isAllowed) return <GeoBlocked />;
 *
 *   return <YourContent />;
 * }
 * ```
 */
declare function useAllowedCountry(): AllowedCountryResult;

export { type CheckoutConfig, type CheckoutError, type CheckoutResult, type DepositConfig, type DepositError, type DepositResult, type UnifoldConnectProviderConfig, UnifoldProvider, type WithdrawConfig, type WithdrawError, type WithdrawResult, useAllowedCountry, useUnifold };
