import { SafeEventEmitter } from "@web3auth/auth"; import { type LinkAccountParams, type LinkAccountResult, UnlinkAccountResult } from "./account-linking"; import { Analytics, type AuthTokenInfo, type ChainNamespaceType, ConnectedAccountsWithProviders, type Connection, type CONNECTOR_STATUS_TYPE, type CustomChainConfig, type IConnector, type IPlugin, type IProvider, type IWeb3Auth, type IWeb3AuthCoreOptions, IWeb3AuthState, LinkedAccountInfo, LoginModeType, type LoginParamMap, type ProjectConfig, type UserInfo, type WALLET_CONNECTOR_TYPE, type Web3AuthNoModalEvents } from "./base"; import { type AuthConnectorSwitchAccountResult, type AuthConnectorType } from "./connectors/auth-connector"; import { type AccountAbstractionProvider } from "./providers/account-abstraction-provider"; import { CommonJRPCProvider } from "./providers/base-provider"; type ConnectedWalletAccountRef = LinkedAccountInfo | Pick | null | undefined; export declare class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth { readonly coreOptions: IWeb3AuthCoreOptions; status: CONNECTOR_STATUS_TYPE; loginMode: LoginModeType; protected aaProvider: AccountAbstractionProvider | null; protected connectors: IConnector[]; protected commonJRPCProvider: CommonJRPCProvider | null; protected analytics: Analytics; protected plugins: Record; protected consentRequired: boolean; protected projectConfig: ProjectConfig | null; private storage; private connectionReconnected; /** Connected wallet state keyed by linked account id; the primary session uses a reserved key. */ private connectedWalletConnectorMap; private activeWalletConnectorKey; private state; constructor(options: IWeb3AuthCoreOptions, initialState?: Partial); get currentChain(): CustomChainConfig | undefined; get connected(): boolean; get connection(): Connection | null; get primaryConnectorName(): WALLET_CONNECTOR_TYPE | null; get cachedConnector(): string | null; get currentChainId(): string | null; /** * This is always the primary connector that is connected to the user. */ get primaryConnector(): IConnector | null; get accountAbstractionProvider(): AccountAbstractionProvider | null; get idToken(): string | null; get accessToken(): string | null; get refreshToken(): string | null; protected get activeAccount(): LinkedAccountInfo | null; /** * This is the current active connector. */ private get activeConnector(); set provider(_: IProvider | null); init(options?: { signal?: AbortSignal; }): Promise; getConnector(connectorName: WALLET_CONNECTOR_TYPE, chainNamespace?: ChainNamespaceType): IConnector | null; clearCache(): Promise; cleanup(): Promise; switchChain(params: { chainId: string; }): Promise; /** * Connect to a specific wallet connector * @param connectorName - Key of the wallet connector to use. */ connectTo(connectorName: T, loginParams?: LoginParamMap[T], loginMode?: LoginModeType): Promise; logout(options?: { cleanup: boolean; }): Promise; getUserInfo(): Promise>; getLinkedAccounts(): Promise; getConnectedAccountsWithProviders(): ConnectedAccountsWithProviders[]; enableMFA(loginParams?: T): Promise; manageMFA(loginParams?: T): Promise; getAuthTokenInfo(): Promise>; getPlugin(name: string): IPlugin | null; switchAccount(account: LinkedAccountInfo): Promise; linkAccount(params?: LinkAccountParams): Promise; unlinkAccount(address: string): Promise; setAnalyticsProperties(properties: Record): void; protected initChainsConfig(projectConfig: ProjectConfig): void; protected initAccountAbstractionConfig(projectConfig?: ProjectConfig): void; protected initUIConfig(projectConfig: ProjectConfig): void; protected initSessionTimeConfig(projectConfig: ProjectConfig): void; protected initCachedConnectorAndChainId(): Promise; protected initWalletServicesConfig(projectConfig: ProjectConfig): void; protected getInitializationTrackData(): {}; protected setupCommonJRPCProvider(): Promise; protected setupConnector(connector: IConnector): Promise; protected loadConnectors({ projectConfig, modalMode }: { projectConfig: ProjectConfig; modalMode?: boolean; }): Promise; protected initPlugins(): Promise; protected setConnectors(connectors: IConnector[]): void; protected subscribeToConnectorEvents(connector: IConnector): void; protected checkInitRequirements(): void; protected checkIfAutoConnect(connector: IConnector): boolean; /** * Gets the initial chain configuration for a connector * @throws WalletInitializationError If no chain is found for the connector's namespace */ protected getInitialChainIdForConnector(connector: IConnector): CustomChainConfig; protected completeConsentAcceptance(): Promise; protected resolveLinkAccountChainConfig(chainId?: string | null): CustomChainConfig; /** * Resolves the chain ID for a switch account operation. * If the account's chain namespace is the same as the current chain namespace, return the current chain ID. * If the account's chain namespace is different from the current chain namespace, return the chainId the account was linked in. * * @param account - The account to switch to. * @param activeChainId - The current active chain ID. * @returns The resolved chain ID. */ protected resolveSwitchAccountChainId(account: Pick, activeChainId: string): string; protected createLinkingWalletConnector(connectorName: WALLET_CONNECTOR_TYPE | string, chainId: string, config?: ProjectConfig): Promise>; protected createSwitchingWalletConnector(connectorName: WALLET_CONNECTOR_TYPE | string, chainId: string, config?: ProjectConfig): Promise>; protected getConnectedWalletConnector(account?: Pick | null): IConnector | null; protected getConnectedWalletConnectorState(account?: Pick | null): ConnectedAccountsWithProviders | null; protected setConnectedWalletConnectorState(connectedWallet: ConnectedAccountsWithProviders, account?: Pick | null): void; protected setConnectedWalletConnector(connector: IConnector, account?: Pick | null): void; protected deleteConnectedWalletConnector(account?: Pick | null): void; protected getConnectedWalletConnection(account?: Pick | null): Connection | null; protected hasUsableConnectedSwitchConnector(connector: IConnector | null): boolean; protected setActiveWalletConnectorKey(account?: Pick | null): void; protected getConnectedWalletConnectorKey(account?: Pick | null): string; protected getConnectedWalletConnectorStateByKey(accountKey: string): ConnectedAccountsWithProviders | null; protected isLinkedAccountInfo(account: ConnectedWalletAccountRef): account is LinkedAccountInfo; protected toConnectedWalletLinkedAccountInfo(account: Omit): Omit; protected getConnectedWalletLinkedAccountInfo(account?: ConnectedWalletAccountRef): Omit; protected syncConnectedWalletLinkedAccounts(linkedAccounts: LinkedAccountInfo[]): void; protected refreshConnectedWalletActiveStates(activeAccount: LinkedAccountInfo | null): void; protected getConnectedWalletConnectionByKey(accountKey: string): Connection | null; protected buildConnectionFromConnectedWalletConnectorState(connectedWallet: ConnectedAccountsWithProviders): Connection; protected buildImmediateConnectedWalletConnectorState(params: { connector: IConnector; ethereumProvider: IProvider | null; solanaWallet: Connection["solanaWallet"]; usePrimaryProxy: boolean; account?: ConnectedWalletAccountRef; }): ConnectedAccountsWithProviders; protected resolveConnectedWalletConnectorState(params: { connector: IConnector; ethereumProvider: IProvider | null; solanaWallet: Connection["solanaWallet"]; usePrimaryProxy: boolean; account?: ConnectedWalletAccountRef; }): Promise; protected linkAccountWithConnector(connectorName: WALLET_CONNECTOR_TYPE | string, chainId: string, connectorToLink: IConnector): Promise; protected getMainAuthConnector(): AuthConnectorType; /** * Processes the result of a switch account operation. * * - If the target account is a primary account, we will switch back to the primary account. * - If the target account is an external account and already connected (i.e. connector is available with connected state), we will just switch to it without re-connecting again. * - If the target account is an external account and not connected (i.e. connector is not available with connected state), we will create a new isolated connector and connect to it. * @param authConnector - The main auth connector to use. * @param switchResult - The result of the switch account operation. * @param options - The options for the switch account operation. * @returns A promise that resolves when the switch account operation is complete. */ protected processSwitchAccountResult(authConnector: AuthConnectorType, switchResult: AuthConnectorSwitchAccountResult, options?: { walletConnector?: IConnector; projectConfig?: ProjectConfig; }): Promise; private isActiveConnectorEventSource; private shouldIgnoreInactiveConnectorEvent; private findLinkedAccountByAddress; private findLinkedAccountByWalletAddress; private getConnectedWalletAddress; private cacheConnectedLinkedWalletConnector; private cacheWallet; private setCurrentChain; private connectToPlugins; private bindPrimaryEthereumSigningProxy; private getChainConfigForIsolatedConnector; private resolveInstalledDiscoveredWalletConnector; private resolveDiscoveredWalletConnector; /** * Create a new connector instance that is NOT registered in this.connectors and NOT * subscribed to the main SDK event loop. Its lifecycle events are therefore isolated * and will not mutate any global SDK state (connectedConnectorName, connection, idToken). */ private createIsolatedWalletConnector; private setState; private loadState; private getStorageMethod; } export {};