import React from 'react';

/**
 * Blockchain types supported by the wallet connector
 */
declare enum ChainType {
    EVM = "evm",
    SOLANA = "solana",
    TON = "ton",
    TRON = "tron"
}
/**
 * Supported wallet types
 */
declare enum WalletType {
    METAMASK = "metamask",
    TRUST_WALLET = "trustwallet",
    BITGET = "bitget",
    BASE = "base",
    ATOMIC = "atomic",
    SAFEPAL = "safepal",
    WALLETCONNECT = "walletconnect",
    TONKEEPER = "tonkeeper",
    TONHUB = "tonhub",
    MYTONWALLET = "mytonwallet",
    SOLFLARE = "solflare",
    PHANTOM = "phantom",
    TRONLINK = "tronlink",
    KLEVER = "klever",
    RABBY = "rabby",
    EXODUS = "exodus"
}
/**
 * Connection status
 */
declare enum ConnectionStatus {
    DISCONNECTED = "disconnected",
    CONNECTING = "connecting",
    CONNECTED = "connected",
    ERROR = "error"
}
/**
 * Account information
 */
interface Account {
    address: string;
    publicKey?: string;
    chainType: ChainType;
    /** Whether the account has NFTs from required collections (TON only) */
    hasRequiredNFTs?: boolean;
}
/**
 * NFT Collection information
 */
interface NFTCollection {
    address: string;
    name?: string;
    description?: string;
}
/**
 * NFT ownership result
 */
interface NFTOwnershipResult {
    hasNFTs: boolean;
    collections: NFTCollection[];
    ownedNFTs: Array<{
        collection: string;
        nftAddress: string;
        name?: string;
        description?: string;
    }>;
}
/**
 * Connection result
 */
interface ConnectionResult {
    success: boolean;
    account?: Account;
    error?: Error;
}
/**
 * Wallet adapter interface
 */
interface WalletAdapter {
    readonly name: string;
    readonly type: WalletType;
    readonly chainType: ChainType;
    readonly icon?: string;
    readonly downloadUrl?: string;
    /**
     * Check if the wallet is available (installed)
     */
    isAvailable(): boolean;
    /**
     * Connect to the wallet
     */
    connect(): Promise<ConnectionResult>;
    /**
     * Disconnect from the wallet
     */
    disconnect(): Promise<void>;
    /**
     * Get the current account
     */
    getAccount(): Promise<Account | null>;
    /**
     * Sign a message
     */
    signMessage(message: string): Promise<string>;
    /**
     * Sign a transaction (if supported by the wallet/chain)
     */
    signTransaction?: (transaction: any) => Promise<any>;
    /**
     * Listen for account changes
     */
    onAccountChanged(callback: (account: Account | null) => void): void;
    /**
     * Listen for connection status changes
     */
    onStatusChanged(callback: (status: ConnectionStatus) => void): void;
}
/**
 * Interface for EIP-1193 providers (standard Ethereum provider)
 */
interface EthereumProvider {
    request(args: {
        method: string;
        params?: any[];
    }): Promise<any>;
    on(event: string, callback: (...args: any[]) => void): void;
    removeListener(event: string, callback: (...args: any[]) => void): void;
    isMetaMask?: boolean;
    isTrust?: boolean;
    isTrustWallet?: boolean;
    isBitKeep?: boolean;
    isCoinbaseWallet?: boolean;
    isAtomic?: boolean;
    isSafePal?: boolean;
    isRabby?: boolean;
    isExodus?: boolean;
    providers?: EthereumProvider[];
    disconnect?: () => Promise<void>;
}
/**
 * Storage type for persisting connection
 */
type StorageType$1 = 'localStorage' | 'cookie' | 'both';
/**
 * Multi-chain configuration
 */
interface MultiChainConfig {
    [ChainType.EVM]: Array<{
        chainId: number;
        name: string;
        rpcUrl: string;
        blockExplorerUrl?: string;
        nativeCurrency?: {
            name: string;
            symbol: string;
            decimals: number;
        };
    }>;
    [ChainType.SOLANA]: Array<{
        chainId: string;
        name: string;
        rpcUrl: string;
        blockExplorerUrl?: string;
    }>;
    [ChainType.TON]: Array<{
        chainId: string;
        name: string;
        rpcUrl: string;
    }>;
    [ChainType.TRON]: Array<{
        chainId: string;
        name: string;
        rpcUrl: string;
        blockExplorerUrl?: string;
    }>;
}
/**
 * Debug configuration
 */
interface DebugConfig {
    level?: 'error' | 'warn' | 'info' | 'debug' | 'trace';
    enablePerformanceLogging?: boolean;
    enableStateLogging?: boolean;
    enableSDKLogging?: boolean;
    enableNetworkLogging?: boolean;
    logToConsole?: boolean;
    logToStorage?: boolean;
    maxLogEntries?: number;
}
/**
 * Wallet connector configuration
 */
interface WalletConnectorConfig {
    /**
     * Available wallet adapters
     */
    adapters: WalletAdapter[];
    /**
     * Auto-connect to previously connected wallet
     */
    autoConnect?: boolean;
    /**
     * Storage key for persisting connection
     */
    storageKey?: string;
    /**
     * Storage type: 'localStorage', 'cookie', or 'both' (default: 'both')
     */
    storageType?: StorageType$1;
    /**
     * Cookie expiration in days (default: 365)
     */
    cookieExpireDays?: number;
    /**
     * Cookie domain (optional)
     */
    cookieDomain?: string;
    /**
     * Cookie path (default: '/')
     */
    cookiePath?: string;
    /**
     * WalletConnect project ID (required for WalletConnect)
     */
    walletConnectProjectId?: string;
    /**
     * Default chain IDs for each chain type
     */
    defaultChains?: {
        [ChainType.EVM]?: number;
        [ChainType.SOLANA]?: string;
        [ChainType.TON]?: string;
        [ChainType.TRON]?: string;
    };
    /**
     * EVM options
     */
    evm?: {
        /**
         * If true, EVM adapters will not use injected providers and should rely on SDK/WalletConnect
         */
        disableInjected?: boolean;
    };
    /**
     * Multi-chain configuration
     */
    multiChainConfig?: MultiChainConfig;
    /**
     * Debug configuration
     */
    debugConfig?: DebugConfig;
    /**
     * Preload SDKs for better performance
     */
    preloadSDKs?: boolean;
    /**
     * SDK loader configuration
     */
    sdkLoaderConfig?: {
        enableCaching?: boolean;
        cacheTimeout?: number;
        retryAttempts?: number;
        retryDelay?: number;
        enablePreloading?: boolean;
        preloadDelay?: number;
    };
}
/**
 * Wallet connector state
 */
interface WalletConnectorState {
    status: ConnectionStatus;
    account: Account | null;
    wallet: WalletType | null;
    error: Error | null;
    /** Latest fetched TWC token balance as a string (e.g., "123.45") */
    twcBalance?: string | null;
    /** Latest fetched TWC USD value as a number (e.g., 12.34) */
    usdValue?: number | null;
    /** Number of NFTs owned by the connected account (TON only) */
    nftCount?: number;
    /** NFT data including owned NFTs details (TON only) */
    nftData?: NFTOwnershipResult | null;
    /** Current chain ID (EVM only) */
    chainId?: number | string | null;
}
/**
 * Event types
 */
declare enum WalletEvent {
    CONNECTED = "connected",
    DISCONNECTED = "disconnected",
    ACCOUNT_CHANGED = "accountChanged",
    STATUS_CHANGED = "statusChanged",
    BALANCE_UPDATED = "balanceUpdated",
    UI_ACTION = "uiAction",
    ERROR = "error"
}
type WalletUiAction = 'otherNetworkWallets';
interface WalletUiActionEvent {
    action: WalletUiAction;
}
/**
 * Event listener type
 */
type EventListener<T = any> = (data: T) => void;
/**
 * Event map
 */
interface EventMap {
    [WalletEvent.CONNECTED]: Account;
    [WalletEvent.DISCONNECTED]: void;
    [WalletEvent.ACCOUNT_CHANGED]: Account | null;
    [WalletEvent.STATUS_CHANGED]: ConnectionStatus;
    [WalletEvent.BALANCE_UPDATED]: {
        type: 'TWC' | 'NATIVE';
        balance: string;
        symbol: string;
        usdValue?: number;
        usdFormatted?: string;
        account: string;
    };
    [WalletEvent.UI_ACTION]: WalletUiActionEvent;
    [WalletEvent.ERROR]: Error;
}

/**
 * Main wallet connector class
 */
declare class WalletConnector {
    private adapters;
    private storage;
    private eventEmitter;
    private config;
    private state;
    private stateManager;
    private debugTools;
    private sdkLoader;
    private multiChainManager;
    private twcBalanceCache;
    private performanceMetrics;
    constructor(config: WalletConnectorConfig);
    /**
     * Get all available wallets
     */
    getAvailableWallets(): WalletAdapter[];
    /**
     * Get all registered wallets (including unavailable ones)
     */
    getAllWallets(): WalletAdapter[];
    /**
     * Get wallet adapter by type
     */
    getWallet(type: WalletType): WalletAdapter | undefined;
    /**
     * Connect to a wallet
     */
    connect(walletType: WalletType, isRestoring?: boolean): Promise<void>;
    /**
     * Disconnect from current wallet
     */
    disconnect(): Promise<void>;
    /**
     * Get current account
     */
    getAccount(): Promise<Account | null>;
    /**
     * Sign a message
     */
    signMessage(message: string): Promise<string>;
    /**
     * Sign a transaction
     */
    signTransaction(transaction: any): Promise<any>;
    /**
     * Get current state
     */
    getState(): WalletConnectorState;
    /**
     * Subscribe to events
     */
    on<K extends WalletEvent>(event: K, listener: (data: EventMap[K]) => void): () => void;
    /**
     * Unsubscribe from events
     */
    off<K extends WalletEvent>(event: K, listener: (data: EventMap[K]) => void): void;
    emitUiAction(data: EventMap[WalletEvent.UI_ACTION]): void;
    /**
     * Auto-connect to previously connected wallet
     */
    private autoConnect;
    /**
     * Update internal state
     */
    private updateState;
    /**
     * Preload SDKs for better performance
     */
    private preloadSDKs;
    /**
     * Switch chain for connected wallet
     */
    switchChain(chainId: number | string): Promise<boolean>;
    /**
     * Get current chain for connected wallet
     */
    getCurrentChain(): Promise<number | string | null>;
    /**
     * Get supported chains for wallet type
     */
    getSupportedChains(walletType?: WalletType): any[];
    /**
     * Get SDK performance metrics
     */
    getSDKPerformanceMetrics(): any;
    /**
     * Get debug information
     */
    getDebugInfo(): any;
    /**
     * Export debug information
     */
    exportDebugInfo(): string;
    /**
     * Clear debug logs
     */
    clearDebugLogs(): void;
    /**
     * Reset performance metrics
     */
    resetPerformanceMetrics(): void;
    /**
     * Update debug configuration
     */
    updateDebugConfig(config: any): void;
    /**
     * Get SDK loader status
     */
    getSDKLoaderStatus(): any;
    /**
     * Clear SDK cache
     */
    clearSDKCache(): void;
    /**
     * Get TWC token balance for EVM wallets
     * TWC is ONLY available on BSC (chainId 56)
     */
    private balanceFetchErrors;
    getTWCBalance(): Promise<{
        amount: string;
        symbol: string;
        usdValue?: number;
        usdFormatted?: string;
    }>;
    /**
     * Get balance fetch error history (for debugging)
     */
    getBalanceFetchErrors(): {
        endpoint: string;
        error: string;
        timestamp: number;
    }[];
    /**
     * Clear TWC balance cache
     */
    clearTWCCache(): void;
    /**
     * Clear balance cache
     */
    clearBalanceCache(): void;
    /**
     * Clear transactions cache
     */
    clearTransactionsCache(): void;
    /**
     * Get the current wallet's provider (for EVM wallets)
     */
    getProvider(): any;
    /**
     * Get native token balance (ETH, BNB, etc.) for EVM wallets
     */
    getNativeBalance(): Promise<{
        amount: string;
        symbol: string;
    }>;
    /**
     * Get TWC price in USD
     */
    getTWCPrice(): Promise<number>;
    /**
     * Get TWC value for a given amount
     */
    getTWCValue(twcAmount: string): Promise<number>;
    /**
     * Get formatted USD value
     */
    formatUSDValue(value: number): string;
    /**
     * Clean up resources
     */
    destroy(): void;
    /**
     * Check NFT ownership for TON wallets
     * Checks if the connected account owns NFTs from specified collections
     */
    checkNFTOwnership(collectionAddresses: string[]): Promise<NFTOwnershipResult>;
    /**
     * Normalize TON address by removing special characters and converting to lowercase
     */
    private normalizeTONAddress;
    /**
     * Compare two TON addresses for equality (handles different formats)
     */
    private tonAddressesMatch;
    /**
     * Query ALL NFTs owned by an address (not limited to specific collections)
     * Can optionally filter by collection addresses
     */
    private queryAllTONNFTs;
}

/**
 * Base adapter class with common functionality
 */
declare abstract class BaseWalletAdapter implements WalletAdapter {
    abstract readonly name: string;
    abstract readonly type: WalletType;
    abstract readonly chainType: ChainType;
    readonly icon?: string;
    readonly downloadUrl?: string;
    protected status: ConnectionStatus;
    protected accountChangedCallbacks: Set<(account: Account | null) => void>;
    protected statusChangedCallbacks: Set<(status: ConnectionStatus) => void>;
    abstract isAvailable(): boolean;
    abstract connect(): Promise<ConnectionResult>;
    abstract disconnect(): Promise<void>;
    abstract getAccount(): Promise<Account | null>;
    abstract signMessage(message: string): Promise<string>;
    onAccountChanged(callback: (account: Account | null) => void): () => void;
    onStatusChanged(callback: (status: ConnectionStatus) => void): () => void;
    protected notifyAccountChanged(account: Account | null): void;
    protected notifyStatusChanged(status: ConnectionStatus): void;
}

/**
 * Base adapter for EVM-compatible wallets
 */
declare abstract class EVMBaseAdapter extends BaseWalletAdapter {
    readonly chainType = ChainType.EVM;
    protected provider: EthereumProvider | null;
    protected currentAccount: string | null;
    protected static disableInjected: boolean;
    protected static walletConnectProjectId: string | undefined;
    protected static enableWalletConnectFallback: boolean;
    protected abstract getProvider(): EthereumProvider | null;
    isAvailable(): boolean;
    connect(): Promise<ConnectionResult>;
    getAccount(): Promise<Account | null>;
    signMessage(message: string): Promise<string>;
    /**
     * Format number with commas for better readability
     */
    private formatNumberWithCommas;
    /**
     * Check if a contract exists at the given address
     */
    contractExists(contractAddress: string): Promise<boolean>;
    /**
     * Get ERC-20 token balance
     */
    getTokenBalance(tokenAddress: string, decimals?: number, skipExistenceCheck?: boolean): Promise<string>;
    /**
     * Get native token balance (ETH, BNB, etc.)
     */
    getNativeBalance(): Promise<string>;
    protected setupListeners(): void;
    private connectionCheckInterval?;
    private eventHandlers;
    protected startConnectionCheck(): void;
    disconnect(): Promise<void>;
}

/**
 * MetaMask wallet adapter
 */
declare class MetamaskAdapter extends EVMBaseAdapter {
    readonly name = "MetaMask";
    readonly type = WalletType.METAMASK;
    readonly icon = "https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg";
    readonly downloadUrl = "https://metamask.io/download/";
    private sdkInstance;
    private sdkProvider;
    private performanceMetrics;
    private debugMode;
    isAvailable(): boolean;
    /**
     * Debug logging utility
     */
    private debugLog;
    /**
     * Performance timing utility
     */
    private startTimer;
    /**
     * Get performance metrics
     */
    getPerformanceMetrics(): {
        sdkLoadTime: number;
        connectionTime: number;
        errorCount: number;
        lastError: Error | null;
    };
    /**
     * Reset performance metrics
     */
    resetPerformanceMetrics(): void;
    protected getProvider(): EthereumProvider | null;
    private getInjectedProvider;
    private discoverEip6963MetaMaskProviderSync;
    connect(): Promise<ConnectionResult>;
    /**
     * Ensure and return the MetaMask SDK EIP-1193 provider
     */
    getSdkProvider(): Promise<EthereumProvider | null>;
    private initSdkProviderAndCheck;
    /**
     * Disconnect from MetaMask
     * Also disconnects from MetaMask SDK if it was used
     */
    disconnect(): Promise<void>;
}

/**
 * Trust Wallet adapter
 */
declare class TrustWalletAdapter extends EVMBaseAdapter {
    readonly name = "Trust Wallet";
    readonly type = WalletType.TRUST_WALLET;
    readonly icon = "https://trustwallet.com/assets/images/media/assets/TWT.png";
    readonly downloadUrl = "https://trustwallet.com/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * Bitget Wallet adapter (formerly BitKeep)
 */
declare class BitgetAdapter extends EVMBaseAdapter {
    readonly name = "Bitget Wallet";
    readonly type = WalletType.BITGET;
    readonly icon = "https://img.bitgetimg.com/image/third/1723701065784.png";
    readonly downloadUrl = "https://web3.bitget.com/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * Base Wallet adapter (formerly Coinbase Wallet)
 */
declare class BaseAdapter extends EVMBaseAdapter {
    readonly name = "Base Wallet";
    readonly type = WalletType.BASE;
    readonly icon = "https://www.coinbase.com/img/favicon/favicon-32x32.png";
    readonly downloadUrl = "https://www.coinbase.com/wallet";
    private _coinbaseProvider;
    protected getProvider(): EthereumProvider | null;
    connect(): Promise<ConnectionResult>;
}

/**
 * Atomic Wallet adapter
 */
declare class AtomicAdapter extends EVMBaseAdapter {
    readonly name = "Atomic Wallet";
    readonly type = WalletType.ATOMIC;
    readonly downloadUrl = "https://atomicwallet.io/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * SafePal Wallet adapter
 */
declare class SafePalAdapter extends EVMBaseAdapter {
    readonly name = "SafePal";
    readonly type = WalletType.SAFEPAL;
    readonly downloadUrl = "https://www.safepal.com/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * Rabby Wallet adapter
 */
declare class RabbyAdapter extends EVMBaseAdapter {
    readonly name = "Rabby";
    readonly type = WalletType.RABBY;
    readonly downloadUrl = "https://rabby.io/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * Exodus Wallet adapter
 */
declare class ExodusAdapter extends EVMBaseAdapter {
    readonly name = "Exodus";
    readonly type = WalletType.EXODUS;
    readonly downloadUrl = "https://www.exodus.com/";
    protected getProvider(): EthereumProvider | null;
}

/**
 * WalletConnect adapter for EVM chains (using Reown AppKit)
 */
declare class WalletConnectAdapter extends EVMBaseAdapter {
    readonly name = "WalletConnect";
    readonly type = WalletType.WALLETCONNECT;
    readonly icon = "https://walletconnect.com/walletconnect-logo.svg";
    readonly downloadUrl = "https://reown.com/";
    private appKit;
    private projectId;
    private debugMode;
    private config;
    private isValidProjectId;
    constructor(projectIdOrConfig: string | {
        projectId: string;
    } & Partial<typeof WalletConnectAdapter.prototype.config>, config?: Partial<typeof WalletConnectAdapter.prototype.config>);
    private initializeAppKit;
    isAvailable(): boolean;
    private handleConnection;
    private handleDisconnect;
    connect(): Promise<ConnectionResult>;
    disconnect(): Promise<void>;
    getAccount(): Promise<Account | null>;
    getChainId(): Promise<number | null>;
    protected getProvider(): EthereumProvider | null;
    private debugLog;
    updateConfig(newConfig: Partial<typeof WalletConnectAdapter.prototype.config>): void;
}

/**
 * Base adapter for TON wallets
 */
declare abstract class TONBaseAdapter extends BaseWalletAdapter {
    readonly chainType = ChainType.TON;
    protected connector: any;
    protected currentAccount: string | null;
    protected manifestUrl: string;
    protected performanceMetrics: {
        sdkLoadTime: number;
        connectionTime: number;
        errorCount: number;
        lastError: Error | null;
    };
    protected balanceCache: {
        balance: string;
        timestamp: number;
        address: string;
    } | null;
    protected readonly BALANCE_CACHE_TTL = 30000;
    protected debugMode: boolean;
    protected config: {
        manifestUrl: string;
        buttonRootId: string;
        walletsListConfiguration?: any;
        uiPreferences?: any;
        language?: string;
        actionsConfiguration?: any;
    };
    constructor(manifestUrl?: string, config?: Partial<typeof TONBaseAdapter.prototype.config>);
    /**
     * Debug logging utility
     */
    protected debugLog(message: string, data?: any): void;
    /**
     * Performance timing utility
     */
    protected startTimer(label: string): () => void;
    /**
     * Get performance metrics
     */
    getPerformanceMetrics(): {
        sdkLoadTime: number;
        connectionTime: number;
        errorCount: number;
        lastError: Error | null;
    };
    /**
     * Reset performance metrics
     */
    resetPerformanceMetrics(): void;
    /**
     * Update configuration
     */
    updateConfig(newConfig: Partial<typeof TONBaseAdapter.prototype.config>): void;
    /**
     * Check if TonConnect UI is actually available by attempting to load it
     */
    checkTonConnectAvailability(): Promise<boolean>;
    /**
     * Initialize TonConnectUI instance (called once)
     */
    protected initializeTonConnect(): Promise<void>;
    /**
     * Enhanced availability check that actually tries to load the SDK
     */
    isAvailableAsync(): Promise<boolean>;
    /**
     * Validate manifest URL
     */
    protected validateManifest(manifestUrl: string): Promise<boolean>;
    protected getDefaultManifestUrl(): string;
    isAvailable(): boolean;
    /**
     * @deprecated No longer used - TonConnect UI is loaded dynamically
     */
    private checkForTonWalletExtensions;
    connect(): Promise<ConnectionResult>;
    disconnect(): Promise<void>;
    /**
     * Clear all TON-related storage (localStorage and cookies)
     */
    private clearAllTONStorage;
    getAccount(): Promise<Account | null>;
    /**
     * Get TON balance with caching
     */
    getNativeBalance(): Promise<string>;
    /**
     * Clear balance cache
     */
    clearBalanceCache(): void;
    signMessage(message: string): Promise<string>;
    protected setupListeners(): void;
}

/**
 * Tonkeeper wallet adapter
 */
declare class TonkeeperAdapter extends TONBaseAdapter {
    readonly name = "Tonkeeper";
    readonly type = WalletType.TONKEEPER;
    readonly icon = "https://tonkeeper.com/assets/tonconnect-icon.png";
    readonly downloadUrl = "https://tonkeeper.com/";
    constructor(manifestUrl?: string);
}

/**
 * Ton Hub wallet adapter
 */
declare class TonHubAdapter extends TONBaseAdapter {
    readonly name = "Ton Hub";
    readonly type = WalletType.TONHUB;
    readonly downloadUrl = "https://tonhub.com/";
    constructor(manifestUrl?: string);
}

/**
 * MyTonWallet adapter
 */
declare class MyTonWalletAdapter extends TONBaseAdapter {
    readonly name = "MyTonWallet";
    readonly type = WalletType.MYTONWALLET;
    readonly downloadUrl = "https://mytonwallet.io/";
    constructor(manifestUrl?: string);
}

/**
 * Solana wallet interface
 */
interface SolanaWallet {
    publicKey?: {
        toBase58(): string;
    };
    isConnected: boolean;
    connect(): Promise<{
        publicKey: {
            toBase58(): string;
        };
    }>;
    disconnect(): Promise<void>;
    signMessage(message: Uint8Array): Promise<{
        signature: Uint8Array;
    }>;
    signTransaction?(transaction: any): Promise<any>;
    on(event: string, callback: (...args: any[]) => void): void;
    off(event: string, callback: (...args: any[]) => void): void;
}
/**
 * Base adapter for Solana wallets
 */
declare abstract class SolanaBaseAdapter extends BaseWalletAdapter {
    readonly chainType = ChainType.SOLANA;
    protected wallet: SolanaWallet | null;
    protected currentAccount: string | null;
    protected abstract getWallet(): SolanaWallet | null;
    isAvailable(): boolean;
    connect(): Promise<ConnectionResult>;
    getAccount(): Promise<Account | null>;
    signMessage(message: string): Promise<string>;
    signTransaction(transaction: any): Promise<any>;
    protected setupListeners(): void;
    private connectionCheckInterval?;
    protected startConnectionCheck(): void;
    disconnect(): Promise<void>;
}

/**
 * Solflare wallet adapter
 */
declare class SolflareAdapter extends SolanaBaseAdapter {
    readonly name = "Solflare";
    readonly type = WalletType.SOLFLARE;
    readonly icon = "https://solflare.com/favicon.ico";
    readonly downloadUrl = "https://solflare.com/";
    protected getWallet(): SolanaWallet | null;
}

/**
 * Phantom wallet adapter
 */
declare class PhantomAdapter extends SolanaBaseAdapter {
    readonly name = "Phantom";
    readonly type = WalletType.PHANTOM;
    readonly icon = "https://phantom.app/img/phantom-logo.svg";
    readonly downloadUrl = "https://phantom.app/";
    protected getWallet(): SolanaWallet | null;
}

/**
 * Tron wallet interface
 */
interface TronWallet {
    ready?: boolean;
    request(args: {
        method: string;
        params?: any;
    }): Promise<any>;
    on?(event: string, callback: (...args: any[]) => void): void;
    removeListener?(event: string, callback: (...args: any[]) => void): void;
}
/**
 * Base adapter for Tron wallets
 */
declare abstract class TronBaseAdapter extends BaseWalletAdapter {
    readonly chainType = ChainType.TRON;
    protected wallet: TronWallet | null;
    protected tronWeb: any;
    protected currentAccount: string | null;
    protected abstract getWallet(): TronWallet | null;
    connect(): Promise<ConnectionResult>;
    getAccount(): Promise<Account | null>;
    signMessage(message: string): Promise<string>;
    signTransaction(transaction: any): Promise<any>;
    protected setupListeners(): void;
    private connectionCheckInterval?;
    protected startConnectionCheck(): void;
    disconnect(): Promise<void>;
}

/**
 * TronLink wallet adapter
 */
declare class TronLinkAdapter extends TronBaseAdapter {
    readonly name = "TronLink";
    readonly type = WalletType.TRONLINK;
    readonly downloadUrl = "https://www.tronlink.org/";
    isAvailable(): boolean;
    protected getWallet(): TronWallet | null;
}

/**
 * Klever wallet adapter
 */
declare class KleverAdapter extends TronBaseAdapter {
    readonly name = "Klever";
    readonly type = WalletType.KLEVER;
    readonly downloadUrl = "https://klever.io/";
    isAvailable(): boolean;
    protected getWallet(): TronWallet | null;
}

/**
 * Storage types
 */
type StorageType = 'localStorage' | 'cookie' | 'both';
/**
 * Storage options
 */
interface WalletStorageOptions {
    key?: string;
    type?: StorageType;
    cookieExpireDays?: number;
    cookieDomain?: string;
    cookiePath?: string;
}
/**
 * Storage utility for persisting wallet connection state
 * Supports both localStorage and cookies
 */
declare class WalletStorage {
    private key;
    private type;
    private cookieExpireDays;
    private cookieDomain?;
    private cookiePath;
    constructor(options?: WalletStorageOptions);
    /**
     * Save connected wallet type
     */
    saveWallet(walletType: string): void;
    /**
     * Save full wallet state
     */
    saveState(state: any): void;
    /**
     * Get saved wallet type
     */
    getWallet(): string | null;
    /**
     * Get saved wallet state
     */
    getState(): any | null;
    /**
     * Clear saved wallet
     */
    clearWallet(): void;
    /**
     * Clear all wallet-related storage
     * This is more aggressive and clears all possible wallet-related data
     */
    clearAllWalletStorage(): void;
    /**
     * Save to localStorage
     */
    private saveToLocalStorage;
    /**
     * Get from localStorage
     */
    private getFromLocalStorage;
    /**
     * Clear from localStorage
     */
    private clearFromLocalStorage;
    /**
     * Save to cookie
     */
    private saveToCookie;
    /**
     * Get from cookie
     */
    private getFromCookie;
    /**
     * Clear from cookie
     */
    private clearFromCookie;
}

/**
 * Simple event emitter for wallet events
 */
declare class EventEmitter {
    private listeners;
    /**
     * Subscribe to an event
     */
    on<K extends WalletEvent>(event: K, listener: EventListener<EventMap[K]>): () => void;
    /**
     * Unsubscribe from an event
     */
    off<K extends WalletEvent>(event: K, listener: EventListener<EventMap[K]>): void;
    /**
     * Emit an event
     */
    emit<K extends WalletEvent>(event: K, data: EventMap[K]): void;
    /**
     * Remove all listeners
     */
    removeAllListeners(): void;
}

interface UseTiwiflixConnectionResult {
    account: Account | null;
    wallet: WalletType | null;
    status: ConnectionStatus;
    error: Error | null;
    connect: (wallet: WalletType) => Promise<void>;
    disconnect: () => Promise<void>;
    checkNFTOwnership: (collectionAddresses: string[]) => Promise<NFTOwnershipResult>;
    twcBalance?: string | null;
    usdValue?: number | null;
    nftCount?: number;
    nftData?: NFTOwnershipResult | null;
}
interface UseTiwiflixConnectionOptions {
    onConnect?: (account: Account) => void;
    onDisconnect?: () => void;
    onError?: (error: Error) => void;
    onStatusChange?: (status: ConnectionStatus) => void;
    onAccountChange?: (account: Account | null) => void;
}
declare function useTiwiflixConnection(connector: WalletConnector, options?: UseTiwiflixConnectionOptions): UseTiwiflixConnectionResult;

/**
 * Tiwiflix Wallet Connect Button Component
 * A ready-to-use React component for wallet connection
 */

interface ConnectButtonProps {
    connector: WalletConnector;
    onConnect?: (account: Account) => void;
    onDisconnect?: () => void;
    onError?: (error: Error) => void;
    onUiAction?: (event: WalletUiActionEvent) => void;
    className?: string;
    style?: React.CSSProperties;
    showBalance?: boolean;
    modalPosition?: "top" | "bottom" | "center";
    theme?: "light" | "dark" | "auto";
    buttonText?: string;
    getExplorerUrl?: (account: Account) => string;
}
declare const ConnectButton: React.FC<ConnectButtonProps>;

export { AtomicAdapter, BaseAdapter, BaseWalletAdapter, BitgetAdapter, ChainType, ConnectButton, ConnectionStatus, EVMBaseAdapter, EventEmitter, ExodusAdapter, KleverAdapter, MetamaskAdapter, MyTonWalletAdapter, PhantomAdapter, RabbyAdapter, SafePalAdapter, SolanaBaseAdapter, SolflareAdapter, TONBaseAdapter, TonHubAdapter, TonkeeperAdapter, TronBaseAdapter, TronLinkAdapter, TrustWalletAdapter, WalletConnectAdapter, WalletConnector, WalletEvent, WalletStorage, WalletType, useTiwiflixConnection };
export type { Account, ConnectButtonProps, ConnectionResult, DebugConfig, EthereumProvider, EventListener, EventMap, MultiChainConfig, NFTCollection, NFTOwnershipResult, StorageType, WalletAdapter, WalletConnectorConfig, WalletConnectorState, WalletStorageOptions, WalletUiAction, WalletUiActionEvent };
