import { PickedEventListeners } from '@dynamic-labs/message-transport'; import { PhantomModuleMessages } from '@dynamic-labs/webview-messages'; import { Core } from '../../../client/core'; /** * Public Phantom module type - exposes event listeners for Phantom redirect events. * * When using Phantom wallet on mobile, signing operations open the Phantom app * via deep link. After the user approves, Phantom redirects back to your app. * On mobile web browsers, this redirect opens a new tab, which means the * original page context (including any Promise awaiting the signature) is lost. * * This module allows you to subscribe to events that fire when Phantom redirects * back, so you can handle the signature result even after context is lost. * * @example * ```typescript * client.wallets.phantom.on('signMessageResult', ({ signature, errorCode, errorMessage }) => { * if (errorCode) { * console.error('Sign failed:', errorMessage); * return; * } * console.log('Signature:', signature); * }); * ``` */ export type PhantomModule = PickedEventListeners; export declare const createPhantomModule: (core: Core) => PhantomModule;