import { WalletClient } from 'viem';
import { A as AdaptedWallet } from './wallet-DfvPIcuW.cjs';

type QuoteParams = {
    srcToken: string;
    destToken: string;
    amount: string | number;
    srcChainId: number;
    destChainId: number;
    senderAddress?: string;
    recipient?: string;
    slippage?: number;
    options?: {
        topupGas?: boolean;
        topupGasAmount?: number;
        tipAmount?: number;
    };
};
interface QuoteResponse {
    routes: Route[];
    inputAmount: InputAmount;
    outputAmount: InputAmount;
    calldatas: Calldatas;
    pricePerInputToken: string;
    bridgeId?: string;
    topupGas?: TopupGas;
}
interface Calldatas {
    chainId: number;
    from: string;
    value: string;
    data: string;
    to: string;
}
interface InputAmount {
    address: string;
    decimals: number;
    name: string;
    symbol: string;
    value: string;
    chainId: number;
    receiver?: string;
}
interface Route {
    path: string[];
    amountIn: InputAmount;
    amountOut: InputAmount;
}
interface TopupGas {
    chainId: number;
    token: string;
    amount: string;
    name: string;
    symbol: string;
    decimals: number;
}

type Stage = 'processing' | 'submitting' | 'initiated' | 'success' | 'error';
type PlaceOrderResult = {
    status: boolean;
    srcTxHash: string;
    srcChainId: number;
    destChainId: number;
    destTxHash: string;
} | {
    status: boolean;
    message: string;
    stage: string;
} | undefined;

interface TokenSearchParams {
    /** Optional: search phrase (symbol, token name, or address) */
    q?: string;
    /** Optional: Chain ID filter (e.g. 8453 = Base, 42161 = Arbitrum, 7565164 = Solana, 101 = Sui) */
    networkId?: number;
    /** Optional: page number for pagination (default = 1) */
    page?: number;
    /** Optional: number of results per page (default = 20) */
    limit?: number;
    /** Optional: Abort signal to cancel requests (useful in UI search inputs) */
    signal?: AbortSignal;
}
/** Normalized token shape returned by the API */
interface TokenInfo {
    address: string;
    symbol: string;
    name: string;
    chainId: number;
    decimals: number;
    image?: string;
    isVerified?: boolean;
    priceUSD?: string;
}
/** Paginated API response */
interface TokenSearchResponse {
    count: number;
    page: number;
    limit: number;
    results: TokenInfo[];
}

interface BalanceRequestParams {
    /** Object containing wallet addresses for supported chains. */
    addresses: {
        /** EVM-compatible wallet address (optional). */
        evm?: string;
        /** Solana wallet address (optional). */
        svm?: string;
    };
    /** Optional pagination cursor for EVM balances. */
    cursorEvm?: string;
    /** Optional pagination cursor for Solana balances. */
    cursorSvm?: string;
}
interface TokenBalance {
    /** Token name (e.g. Ethereum, Solana, USD Coin) */
    name: string;
    /** Token symbol (e.g. ETH, SOL, USDC) */
    symbol: string;
    /** Chain ID (matches ChainID enum from @shogun-sdk/one-shot) */
    chainId: number;
    /** Token contract address or Solana mint address */
    address: string;
    /** Raw balance in smallest units (wei, lamports, etc.) */
    balance: string;
    /** Human-readable formatted balance (e.g. "0.1234") */
    balanceFormatted?: string;
    /** USD value of this balance */
    balanceUsd: number;
    /** Token decimals */
    decimals: number;
    /** Token logo or thumbnail image URL */
    image?: string;
    /** Whether this represents the native coin of the chain */
    isNative: boolean;
    /** (Optional) Wallet address that owns this token */
    walletAddress?: string;
    /** (Optional) True if token is verified in the registry */
    isVerified?: boolean;
    /** (Optional) Current price in USD */
    priceUSD?: number;
}
interface BalanceResponse {
    /** List of balances across networks. */
    results: TokenBalance[];
    /** Optional pagination cursors */
    nextCursorEvm?: string;
    nextCursorSvm?: string;
}

declare function getTokensData(addresses: string[]): Promise<TokenInfo[]>;

/**
 * Configuration options for initializing the OneShot SDK.
 */
type OneShotSDKConfig = {
    /** Shogun or Dextra API key required for authenticated requests. */
    apiKey: string;
    jitoApiKey?: string;
    /**
     * Optional affiliate-fee configuration.
     *
     * `feePercentage`
     *   - Percentage of the input amount to send as an affiliate fee.
     *   - Applied only when the value is greater than zero.
     *
     * `receiverWallet`
     *   - EVM and Solana wallet addresses that will receive the affiliate fee.
     *
     * **Example**
     * ```
     * affiliateFee = 3
     * User swaps 100 USDT → USDC
     *
     * 3% (3 USDT) is sent to `receiverWallet`
     * 97% (97 USDT) is used for the actual swap and delivered to `destinationAddress`
     * ```
     */
    fees?: {
        feePercentage: number;
        receiverWallet: {
            EVM: string;
            SVM: string;
        };
    };
};
/**
 * OneShotSDK — Unified SDK for token discovery, quoting, and transaction execution.
 *
 * Features:
 * - Retrieve real-time swap quotes across EVM and Solana.
 * - Execute swaps using an adapted wallet or standard WalletClient.
 * - Search verified tokens with pagination and query support.
 * - Fetch balances across EVM and SVM chains.
 *
 * Designed to integrate easily with React hooks and Vue composables.
 */
declare class OneShotSDK {
    private readonly apiKey;
    private readonly baseUrl;
    private readonly jitoApiKey;
    private readonly fees;
    constructor(config: OneShotSDKConfig);
    /**
      * Retrieves a swap quote for the given input and output tokens.
      *
      * This is a high-level wrapper around the low-level {@link getQuote} utility.
      * It automatically injects the SDK's configured `baseUrl` and `apiKey`,
      * and returns a normalized {@link QuoteResponse} object containing output amount,
      * route, price per input token, and other metadata.
      *
      * ---
      * ### Example
      * ```ts
      * const quote = await sdk.getQuote({
      *   srcToken: USDC_ADDRESS,
      *   destToken: WETH_ADDRESS,
      *   amount: "1000000", // 1 USDC (6 decimals)
      *   srcChainId: 1,
      *   destChainId: 8453,
      *   options: {
      *     topupGas: true,
      *     topupGasAmount: 3.5, // optional, defaults to $2.00 (6 decimals)
      *   },
      * });
      *
      * console.log("Output Amount:", quote.outputAmount.value);
      * console.log("Price per input token:", quote.pricePerInputToken);
      * ```
      * ---
      *
      * @param params - Quote configuration object.
      * @param params.srcToken - Address of the source token.
      * @param params.destToken - Address of the destination token.
      * @param params.amount - Input amount as a string or number.
      * @param params.srcChainId - Source chain ID.
      * @param params.destChainId - Destination chain ID.
      * @param params.senderAddress - (Optional) Wallet address initiating the swap.
      * @param params.recipient - (Optional) Recipient address of the destination tokens.
      * @param params.slippage - (Optional) Slippage tolerance (e.g., `0.5` for 0.5%).
      * @param params.options - (Optional) Extra configuration options.
      * @param params.options.topupGas - Whether to include a gas top-up on the destination chain.
      * @param params.options.topupGasAmount - Top-up gas amount in USD, defaults to `$2.00`.
      * @param params.options.tipAmount - Jito tip amount in SOL.
      *   Accepts numbers or strings (e.g. `0`, `"0.0005"`).
      *   Parsed into lamports (9 decimals).
      *   Set to `0` for no tip, or leave undefined to use the default network tip.
      *
      * @returns A {@link QuoteResponse} object containing the output quote details.
      */
    getQuote(params: QuoteParams): Promise<QuoteResponse>;
    /**
     * Retrieves a list of verified tokens based on search query or chain filter.
     *
     * @param params - Search parameters (query, chain ID, pagination options).
     * @returns Paginated `TokenSearchResponse` containing token metadata.
     */
    getTokenList(params: TokenSearchParams): Promise<TokenSearchResponse>;
    /**
     * Fetches token balances for the specified user wallet(s).
     *
     * Supports both EVM and SVM (Solana) wallet addresses.
     *
     * @param params - Wallet address and optional chain filters.
     * @param options - Optional abort signal for cancellation.
     * @returns A unified balance response with per-chain token details.
     */
    getBalances(params: BalanceRequestParams, options?: {
        signal?: AbortSignal;
    }): Promise<BalanceResponse>;
    /**
     * Executes a prepared quote using the provided wallet instance.
     *
     * Handles:
     * - Token approval (if required).
     * - Transaction signing and broadcasting.
     * - Confirmation polling and stage-based callbacks.
     *
     * @param quote - The swap quote to execute.
     * @param wallet - Adapted wallet (EVM/Solana) or standard `WalletClient`.
     * @param onStatus - Optional callback to receive execution stage updates.
     * @returns A finalized execution result (transaction hash, status, etc.).
     */
    executeTransaction({ quote, wallet, onStatus, options }: {
        quote: QuoteResponse;
        wallet: AdaptedWallet | WalletClient;
        onStatus?: (stage: Stage, message?: string) => void;
        options?: {
            maxAttempts?: number;
            retryDelayMs?: number;
        };
    }): Promise<PlaceOrderResult>;
    getTokensData: typeof getTokensData;
}

interface SupportedChain {
    id: ChainId;
    name: string;
    isEVM: boolean;
    wrapped: string;
    symbol: string;
    decimals: number;
    tokenAddress: string;
}
declare function isEvmChain(chainId: number): boolean;
declare enum ChainId {
    ETHEREUM = 1,
    OPTIMISM = 10,
    AVALANCHE = 43114,
    BSC = 56,
    POLYGON = 137,
    BASE = 8453,
    SONIC = 146,
    SOLANA = 7565164,
    BERACHAIN = 80094,
    HYPER_EVM = 999,
    ARBITRUM = 42161,
    MONAD = 143
}
declare const SupportedChains: SupportedChain[];

export { type BalanceResponse as B, ChainId as C, type OneShotSDKConfig as O, type PlaceOrderResult as P, type QuoteResponse as Q, SupportedChains as S, type TokenInfo as T, type SupportedChain as a, type TokenBalance as b, type BalanceRequestParams as c, type QuoteParams as d, OneShotSDK as e, type Stage as f, isEvmChain as i };
