import { ProviderRequest, WalletNetwork } from '@moonpay/login-common'; /** * Class that encapsulates the calls to the secure-wallet, handling post message mechanics. */ declare class SecureWalletSender { target: Window; targetOrigin: string; onPromptChangeCallback?: (promptState: 'loading' | 'ready' | 'approved' | 'rejected') => void; messageHandlers: ((event: MessageEvent) => void)[]; network: WalletNetwork; id?: string; /** * Constructor to create a new SecureWalletSender instance. * * @param {Window} target - The secure wallet iframe window. * @param {string} targetOrigin - The target origin for postMessage. * @param {WalletNetwork} network - The network to interact with (e.g., 'mainnet', 'testnet', etc.). * @param {(promptState: 'loading' | 'ready' | 'approved' | 'rejected') => void} onPromptChangeCallback - Optional callback function to handle prompt state changes. * @param {string} id - A session ID used to track the request. */ constructor(target: Window, targetOrigin: string, network: WalletNetwork, onPromptChangeCallback?: (promptState: 'loading' | 'ready' | 'approved' | 'rejected') => void, id?: string); /** * Send a provider request to the target window (secure wallet iframe). * * @param {ProviderRequest} request - The request object. * @param {WalletNetwork} network - The network to interact with. * @returns {Promise} Returns a Promise that resolves with the response result or rejects with an error. */ sendToTarget(request: ProviderRequest, network: WalletNetwork): Promise; /** * Send a provider request to the secure wallet iframe. * * @param {ProviderRequest} request - The request object. * @returns {Promise} Returns a Promise that resolves with the response result or rejects with an error. */ send(request: ProviderRequest): Promise; /** * Unregisters all message event handlers from the window object. */ unregisterHandlers(): void; } export { SecureWalletSender };