import * as _web3modal_ui from '@web3modal/ui'; import * as _wagmi_core from '@wagmi/core'; import { GetAccountResult, Chain as Chain$1, SwitchNetworkResult, watchAccount } from '@wagmi/core'; import * as _web3modal_core from '@web3modal/core'; import { ConfigCtrlState, Listing, ThemeCtrlState } from '@web3modal/core'; import * as _web3modal_core_dist__types_src_controllers_ModalCtrl from '@web3modal/core/dist/_types/src/controllers/ModalCtrl'; import * as _web3modal_core_dist__types_src_types_controllerTypes from '@web3modal/core/dist/_types/src/types/controllerTypes'; import * as viem__types_actions_wallet_signTransaction from 'viem/_types/actions/wallet/signTransaction'; import * as viem__types_actions_wallet_sendRawTransaction from 'viem/_types/actions/wallet/sendRawTransaction'; import * as viem from 'viem'; import * as _wagmi_core_dist_index_e744bbc2 from '@wagmi/core/dist/index-e744bbc2'; import { EthereumClient } from '@web3modal/ethereum'; import EthereumProvider from '@walletconnect/ethereum-provider'; import { IProvider } from '@walletconnect/universal-provider'; import * as zustand_vanilla from 'zustand/vanilla'; import { A as AuthcClientOptions, a as AuthcClient, R as RedirectLoginOptions, l as LogoutOptions } from './AuthcClient-e13f668e.js'; import { Chain } from '@wagmi/chains'; interface AuthcWalletOptions$1 extends AuthcWalletOptions { } interface AuthcOptions extends AuthcClientOptions { /** * unlock wallet on demand * @default false */ unlockOnDemand?: boolean; walletOptions: AuthcWalletOptions$1; events?: { afterLogout?: () => void; }; } declare class Authc extends AuthcClient { wallet: AuthcWalletLogin; private loginPromise; private opts; store: zustand_vanilla.StoreApi<{ status: 'login' | 'loginFailed' | 'createWallet' | 'reconstruct' | 'viewAccount' | 'reconstructFailed' | ''; loading: boolean; }>; get events(): { afterLogout: () => void; }; constructor(_options: AuthcOptions); onConnectWalletByPostMessage(): void; private closeWatchHandler; walletHandler(): void; loginWithWallet(options?: RedirectLoginOptions): Promise; connectWallet(): Promise<_wagmi_core.GetAccountResult>; toUnlockWallet(): void; logout(options?: LogoutOptions): Promise; } interface EventMessage { modal: { state: boolean; }; cancelLogin: void; lifecycle: { name: 'login' | 'loginFailed' | 'createWallet' | 'reconstruct' | 'viewAccount' | 'reconstructFailed'; }; loginFailed: { err?: Error; errorMessage: string; }; initialized: void; connectWalletByWalletName: { name: string; walletAddress: string; }; 401: void; wcUri: { code: string; }; logout: void; $all: any; signingMessage: { sid: string; message: string; name: string; }; } type EventMessageCallback = ((type: keyof EventMessage, data: any, event: MessageEvent) => void); interface ListenerCallback { (data: EventMessage[T]): any; } declare const sendMessage: (iframe: HTMLIFrameElement, data: { [key: string]: any; type: string; }) => void; declare class CustomPostMessage { private iframe; type?: string; initialized: boolean; constructor(iframe: () => HTMLIFrameElement | null, type?: string); initializedCallbackQueue: (() => void)[]; protected init(): void; postMessage(data: Parameters[1]): void; receiveMessage: (callback?: EventMessageCallback) => () => boolean; addMessageListener: (type: T, callback: ListenerCallback) => void; viewWallet(): void; push(path: string): void; replace(path: string, params?: Record): void; checkWalletAddress(address: string): void; placement(): void; logout(): void; setLocale(locale: string): void; } interface AuthcWalletOptions extends ConfigCtrlState { customWallets?: ConfigCtrlState['mobileWallets']; chains?: Chain[]; /** * @default authc.wallet.wagmi */ storageKey?: string; /** * Using same wagmi client in multiple instances * @default false */ wagmiClientCache?: boolean; /** * Authc instance */ authc?: Authc; /** * @internal * @default false * Unlock wallet on demand */ unlockOnDemand?: boolean; /** * @default en */ locale?: () => string; } declare class CustomWalletLogin extends CustomPostMessage { private walletOption; private closeWatch; walletLoginPromise: Promise; __resolve: (value: any) => void; __reject: (err: any) => void; CUSTOM_WALLET_KEY: string; authc: Authc; constructor(walletOption: AuthcWalletOptions); get isCustomWallet(): boolean; get walletName(): string; get customIframe(): HTMLIFrameElement; removeIframe(): Promise; private onLoadLoginIframeError; toggleIframeVisible: (state: boolean) => void; getWalletConnectUri(): Promise; createLoginPromise(): Promise; reconnectWalletCustom(): Promise; connectWalletCustom(name?: string): Promise; getCustomWallet: (name: string) => _web3modal_core.MobileWallet; watchCustomLogin(): Promise; watchCustomWallet(): void; watchAccount(callback: (account: GetAccountResult & { /** * is custom wallet login? */ isCustomWallet: boolean; errMessage: string; }) => void, ...args: any[]): () => void; cancelLogin(): Promise; disconnect(): void | Promise; getWalletClient(_chainId?: number): Promise<_wagmi_core_dist_index_e744bbc2.P | { account: viem.Account; batch?: { multicall?: boolean | { batchSize?: number; wait?: number; }; }; cacheTime: number; chain: Chain$1; key: string; name: string; pollingInterval: number; request: viem.EIP1193RequestFn; transport: viem.TransportConfig & Record; type: string; uid: string; addChain: (args: viem.AddChainParameters) => Promise; deployContract: (args: viem.DeployContractParameters) => Promise<`0x${string}`>; getAddresses: () => Promise; getChainId: () => Promise; getPermissions: () => Promise; prepareTransactionRequest: (args: viem.PrepareTransactionRequestParameters) => Promise; requestAddresses: () => Promise; requestPermissions: (args: { [x: string]: Record; eth_accounts: Record; }) => Promise; sendRawTransaction: (args: viem__types_actions_wallet_sendRawTransaction.SendRawTransactionParameters) => Promise<`0x${string}`>; sendTransaction: (args: viem.SendTransactionParameters) => Promise<`0x${string}`>; signMessage: (args: viem.SignMessageParameters) => Promise<`0x${string}`>; signTransaction: (args: viem__types_actions_wallet_signTransaction.SignTransactionParameters) => Promise<`0x${string}`>; signTypedData: (args: viem.SignTypedDataParameters) => Promise<`0x${string}`>; switchChain: (args: viem.SwitchChainParameters) => Promise; watchAsset: (args: viem.WatchAssetParams) => Promise; writeContract: (args: viem.WriteContractParameters) => Promise<`0x${string}`>; extend: (fn: (client: viem.Client>) => client) => viem.Client>; }>; getSignerProvider(): Promise; getSignClient(): Promise; switchNetwork(params: { chainId: number; }): Promise; protected logoutWithIframe(url: string): Promise; get modal(): { state: _web3modal_core_dist__types_src_types_controllerTypes.ModalCtrlState; subscribe(callback: (newState: _web3modal_core_dist__types_src_types_controllerTypes.ModalCtrlState) => void): () => void; open(options?: _web3modal_core_dist__types_src_controllers_ModalCtrl.OpenOptions): Promise; close(): void; }; get config(): { state: _web3modal_core.ConfigCtrlState; subscribe(callback: (newState: _web3modal_core.ConfigCtrlState) => void): () => void; setConfig(config: _web3modal_core.ConfigCtrlState): void; }; get client(): () => EthereumClient; get explorer(): { state: _web3modal_core_dist__types_src_types_controllerTypes.ExplorerCtrlState; getRecomendedWallets(): Promise<_web3modal_core.Listing[]>; getWallets(params: _web3modal_core_dist__types_src_types_controllerTypes.ListingParams): Promise<(_web3modal_core.ListingResponse & { page: number; }) | { listings: _web3modal_core.Listing[]; total: number; }>; getInjectedWallets(): Promise<_web3modal_core.Listing[]>; getWalletImageUrl(imageId: string): string; getAssetImageUrl(imageId: string): string; resetSearch(): void; }; get options(): { state: _web3modal_core_dist__types_src_types_controllerTypes.OptionsCtrlState; subscribe(callback: (newState: _web3modal_core_dist__types_src_types_controllerTypes.OptionsCtrlState) => void): () => void; setChains(chains?: Chain$1[]): void; getSelectedChain(): _web3modal_core_dist__types_src_types_controllerTypes.Chain; setSelectedChain(selectedChain: _web3modal_core_dist__types_src_types_controllerTypes.Chain): void; setIsCustomDesktop(isCustomDesktop: boolean): void; setIsCustomMobile(isCustomMobile: boolean): void; setIsDataLoaded(isDataLoaded: boolean): void; setIsUiLoaded(isUiLoaded: boolean): void; setIsPreferInjected(isPreferInjected: boolean): void; }; } declare class AuthcWalletLogin extends CustomWalletLogin { connectorNames: { metamask: string; coinbase: string; }; constructor(config: AuthcWalletOptions); private onMobilePlatform; private onAndroidPlatform; private onConnectPlatformDesktop; private onConnectConnector; getWalletInfo(walletName: string): Promise; connectWalletByWalletName(walletName: string): Promise>; onConnectWalletByPostMessage(postMessage?: Window['postMessage']): void; onWalletConnect(theme?: ThemeCtrlState): Promise; importUi(): Promise<{ default: typeof _web3modal_ui; W3mAccountButton: typeof _web3modal_ui.W3mAccountButton; W3mConnectButton: typeof _web3modal_ui.W3mConnectButton; W3mCoreButton: typeof _web3modal_ui.W3mCoreButton; W3mModal: typeof _web3modal_ui.W3mModal; W3mNetworkSwitch: typeof _web3modal_ui.W3mNetworkSwitch; W3mQrCode: typeof _web3modal_ui.W3mQrCode; }>; } type AccountType = Parameters[0]>[0]; export { AuthcWalletLogin as A, AccountType as a, AuthcWalletOptions as b, AuthcOptions as c, Authc as d };