import { AUTH_CONNECTION_TYPE, type AuthUserInfo, HttpClient } from "@web3auth/auth"; import type { EventEmitter } from "events"; import { ControllerEvents } from "./enums"; import { THEME } from "./Preferences/IPreferencesController"; /** * State change callbacks */ export type Listener = (state: T) => void; /** * Base controller configuration */ export interface BaseConfig { /** * Determines if this controller is enabled */ disabled?: boolean; } export type AuthHttpClientGetter = () => HttpClient; /** * Base state representation */ export interface BaseState { /** * Unique name for this controller */ name?: string; } export type BaseControllerEvents = { store: (state: S) => void; }; export interface IController { defaultConfig: C; defaultState: S; name: string; get state(): S; get config(): C; update(state: Partial, overwrite?: boolean): void; configure(config: Partial, overwrite?: boolean, fullUpdate?: boolean): void; } export type generic = () => T; export interface IWindow { closed: boolean; open(): IWindow | Promise; close(): void; } export interface IStreamWindow extends IWindow, EventEmitter { } export interface WindowBlockAlertParams { windowId: string; finalUrl: string; } export type UserInfo = AuthUserInfo; export interface PaymentParams { /** * Address to send the funds to */ selectedAddress?: string; /** * Default fiat currency for the user to make the payment in */ selectedCurrency?: string; /** * Amount to buy in the selectedCurrency */ fiatValue?: number; /** * Cryptocurrency to buy */ selectedCryptoCurrency?: string; /** * Amount Cryptocurrency to buy */ cryptoAmount?: number; } export declare const PAYMENT_PROVIDER: { readonly MOONPAY: "moonpay"; readonly WYRE: "wyre"; readonly RAMPNETWORK: "rampnetwork"; readonly XANPOOL: "xanpool"; readonly MERCURYO: "mercuryo"; readonly TRANSAK: "transak"; }; export type PAYMENT_PROVIDER_TYPE = (typeof PAYMENT_PROVIDER)[keyof typeof PAYMENT_PROVIDER]; export type InPageWalletProviderState = { accounts: string[]; chainId: string; isUnlocked: boolean; }; export type CommunicationWalletProviderState = { isLoggedIn: boolean; currentAuthConnection: AUTH_CONNECTION_TYPE; }; export interface PopupWhitelabelData { theme: THEME; } export type WsAPIControllerEvents = { [ControllerEvents.UserUnauthorized]: () => void; };