import EthereumProvider from '@walletconnect/ethereum-provider'; import { ProviderAccounts } from 'node_modules/@walletconnect/ethereum-provider/dist/types/types'; import { DeepLinkVariant, GetAddressOpts, WalletDeepLinks } from '@dynamic-labs/wallet-connector-core'; import { GenericNetwork } from '@dynamic-labs/types'; type ProviderInitOpts = { storePrefix?: string; }; export declare class WalletConnectProvider { static isInitializing: boolean; static isInitialized: boolean; static projectId: string; static enabledNetworks: GenericNetwork[]; static preferredChains: `eip155:${number}`[]; static evmNetworkRpcMap: Record; static appName: string; static appLogoUrl: string; /** * Native redirect URL scheme (e.g., 'yourapp://') * Used for WalletConnect mobile linking to redirect back to the app after signature */ static redirectNative: string | undefined; /** * Universal redirect URL (e.g., 'https://yourapp.com/...') * Optional universal link for WalletConnect mobile linking */ static redirectUniversal: string | undefined; private static providerInitPromise; private static provider; /** * The connection URI for the current connection. */ private static connectionUri; private static eventListenersSetup; private static accountChangedHandler; private static chainChangedHandler; private static disconnectHandler; private constructor(); /** * Initializes the provider. This method should only be called once. * Does not start a connection. */ static init: ({ storePrefix, }?: ProviderInitOpts) => Promise; /** * Connects to a wallet. This method should be called whenever a new wallet connection is needed. * If the wallet is already connected when the page is refreshed, this method does not need to be called. */ static connect: ({ deepLinks, deepLinkPreference, connectionOpts, walletName, chainId, }: { deepLinks?: WalletDeepLinks; deepLinkPreference: DeepLinkVariant; connectionOpts?: GetAddressOpts; walletName?: string; chainId?: number; }) => Promise; /** * Disconnects from a wallet. This method should be called whenever we need to disconnect from a wallet. * It will kill the connection, but not the provider. * * Also aborts any in-flight pairing attempt and cleans up unsettled pairings * on the relay so that abandoned QR-code attempts (user closed the modal, * navigated away, etc.) do not leave orphaned pairings/proposals consuming * relay capacity. */ static disconnect: () => Promise; /** * Waits for the provider to be initialized and returns the EthereumProvider instance. * We should use this wherever possible (async methods), to ensure the provider is initialized. */ static awaitAndGetProvider: () => Promise; /** * Returns the EthereumProvider instance. * Used when we need to access the provider synchronously. */ static getProvider: () => EthereumProvider | undefined; static getConnectionUri: () => string | undefined; private static handleChainChangedEvent; private static handleAccountChangedEvent; /** * Sets up event listeners for the provider. */ static setupEventListeners: ({ onChainChanged, onAccountChanged, onDisconnect, }: { onChainChanged?: (chainId: number) => void; onAccountChanged?: (account: string) => void; onDisconnect?: () => void; }) => void; /** * Tears down event listeners for the provider. */ static teardownEventListeners: () => void; private static getMappedChainsByPreferredOrder; } export {};