/**
 * Wallet-side utilities for popup protocol
 *
 * Use these in your wallet's popup pages to handle requests from dApps.
 *
 * @example
 * ```typescript
 * import { parsePopupParams, sendResponse, sendErrorResponse, ErrorCodes } from '@1sat/connect'
 *
 * // In your popup page (e.g., /connect)
 * const { requestId, origin, method, params } = parsePopupParams(
 *   new URLSearchParams(window.location.search)
 * )
 *
 * // After user approves
 * sendResponse(requestId, { paymentAddress, ordinalAddress }, origin)
 *
 * // Or on error
 * sendErrorResponse(requestId, ErrorCodes.USER_REJECTED, 'User rejected', origin)
 * ```
 */
export interface PopupParams {
    /** Unique request identifier for matching response */
    requestId: string | null;
    /** Origin of the requesting dApp */
    origin: string | null;
    /** RPC method being called (connect, signTransaction, etc.) */
    method: string | null;
    /** App name for display purposes */
    appName: string | null;
    /** Parsed request parameters */
    params: unknown;
}
/**
 * Parse popup URL query parameters
 *
 * Call this in your popup page to extract the request data from the URL.
 */
export declare function parsePopupParams(searchParams: URLSearchParams): PopupParams;
/**
 * Send a success response to the opener window and close the popup
 */
export declare function sendResponse(requestId: string, result: unknown, origin: string): void;
/**
 * Send an error response to the opener window and close the popup
 */
export declare function sendErrorResponse(requestId: string, code: number, message: string, origin: string, data?: unknown): void;
/**
 * Reject a request with USER_REJECTED error code
 */
export declare function rejectRequest(requestId: string, origin: string, reason?: string): void;
/**
 * Send a wallet locked error response
 */
export declare function walletLockedError(requestId: string, origin: string): void;
/**
 * Send a wallet not connected error response
 */
export declare function walletNotConnectedError(requestId: string, origin: string): void;
/**
 * Close the popup without sending a response
 * The dApp will receive a POPUP_CLOSED error via the PopupManager
 */
export declare function closePopup(): void;
/**
 * Check if this page was opened as a popup by a dApp
 */
export declare function isPopupContext(): boolean;
/**
 * Get popup context with validated parameters
 * Throws if required parameters are missing
 */
export declare function getPopupContext(searchParams: URLSearchParams): {
    requestId: string;
    origin: string;
    method: string | null;
    appName: string | null;
    params: unknown;
};
//# sourceMappingURL=wallet.d.ts.map