import { X as XSWDConnectorOptions } from '../xswd-pay-Dul7umAR.js'; export { a as XSWDAppData, b as XSWDConnector, c as XSWDConnectorEvents, d as XSWDPayAppData, e as XSWDPayClient, f as XSWDPayEvents } from '../xswd-pay-Dul7umAR.js'; import { f as InvoiceStatus, I as Invoice } from '../types-Bsy2LUTI.js'; import { W as WalletConnector, b as WalletCapability, e as WalletConnectorPolicy, c as WalletConnectorContext, f as SpendConfirmationRequest, a as WalletConnectorState, I as IntegratedAddressResult, g as WalletConnectorType } from '../types-D-riGgKJ.js'; export { S as ScInvokeRequest, h as SpendConfirmationTransfer, i as SpendOperationKind, j as TransferRequest, T as TransferResult, d as WalletTransferFilter } from '../types-D-riGgKJ.js'; type WalletErrorCode = "WALLET_NOT_CONNECTED" | "METHOD_NOT_SUPPORTED" | "PERMISSION_DENIED" | "OFFLINE_MODE" | "INVALID_PAYLOAD" | "INSUFFICIENT_FUNDS" | "RPC_FAILURE" | "TRANSPORT_FAILURE" | "SECURITY_POLICY_BLOCKED"; declare class WalletConnectorError extends Error { readonly code: WalletErrorCode; readonly meta?: Record; constructor(code: WalletErrorCode, message: string, meta?: Record); } type RawWalletError = { code?: number | string; message?: string; }; declare function isWalletConnectorError(error: unknown): error is WalletConnectorError; declare function normalizeWalletConnectorError(error: unknown, fallbackCode?: WalletErrorCode, meta?: Record): WalletConnectorError; declare function mapRawWalletErrorCode(raw: RawWalletError, message?: string, fallbackCode?: WalletErrorCode): WalletErrorCode; declare const defaultWalletConnectorPolicy: WalletConnectorPolicy; declare function mergeWalletConnectorPolicy(policy?: Partial): WalletConnectorPolicy; declare function assertConnectorCapability(connector: WalletConnector, capability: WalletCapability): void; declare function assertSpendOperationsAllowed(policy: WalletConnectorPolicy, operation: "transfer" | "scInvoke", connectorType: string): void; declare function confirmSpendOperation(ctx: WalletConnectorContext, request: SpendConfirmationRequest): Promise; type WasmWebwalletBridge = { getAddress?: () => string | Promise; getBalance?: (scid?: string) => { balance?: number | string | bigint; unlocked_balance?: number | string | bigint; unlockedBalance?: number | string | bigint; } | Promise<{ balance?: number | string | bigint; unlocked_balance?: number | string | bigint; unlockedBalance?: number | string | bigint; }>; makeIntegratedAddress?: (args: { address?: string; payloadRpc?: unknown[]; }) => { integratedAddress: string; payloadRpc?: unknown[]; } | Promise<{ integratedAddress: string; payloadRpc?: unknown[]; }>; splitIntegratedAddress?: (integratedAddress: string) => { address: string; payloadRpc?: unknown[]; } | Promise<{ address: string; payloadRpc?: unknown[]; }>; signData?: (data: string | Uint8Array) => string | Promise; checkSignature?: (signature: string) => { signer: string; message: string; } | Promise<{ signer: string; message: string; }>; }; type WasmMethodKey = keyof WasmWebwalletBridge; type WasmBridgeSource = "explicit" | "DERO_JS_WEBWALLET" | "DERO_JS_WALLET" | "DERO_JS" | "DERO_JS_GLOBALS"; type WasmBridgeProbe = { bridge: WasmWebwalletBridge; source: WasmBridgeSource; availableMethods: WasmMethodKey[]; }; declare function resolveWasmWebwalletBridge(explicitBridge?: WasmWebwalletBridge): WasmWebwalletBridge | null; declare function probeWasmWebwalletBridge(explicitBridge?: WasmWebwalletBridge): WasmBridgeProbe | null; type WasmWebwalletConnectorOptions = { bridge?: WasmWebwalletBridge; }; declare class WasmWebwalletConnector implements WalletConnector { readonly type = "wasm-webwallet"; readonly version = "0-experimental"; private bridge; private bridgeSource; private connected; private address; private context; constructor(options?: WasmWebwalletConnectorOptions); static isAvailable(bridge?: WasmWebwalletBridge): boolean; getState(): WalletConnectorState; supports(capability: WalletCapability): boolean; connect(ctx: WalletConnectorContext): Promise; disconnect(): Promise; getAddress(): Promise; getBalance(scid?: string): Promise<{ unlockedAtomic: bigint; totalAtomic: bigint; }>; makeIntegratedAddress(args: { address?: string; payloadRpc?: unknown[]; }): Promise; splitIntegratedAddress(integratedAddress: string): Promise<{ address: string; payloadRpc?: unknown[]; }>; signData(data: string | Uint8Array): Promise; checkSignature(signature: string): Promise<{ signer: string; message: string; }>; private requireBridge; } type ConnectorFactoryOptions = { preferred?: WalletConnectorType[]; policy?: Partial; xswd?: XSWDConnectorOptions; wasm?: WasmWebwalletConnectorOptions; custom?: WalletConnector; }; declare function createWalletConnector(opts?: ConnectorFactoryOptions): Promise; declare function isWasmWebwalletAvailable(bridge?: WasmWebwalletBridge): boolean; /** * Client-side payment session for tracking invoice status. * * Used on the customer's payment page to poll the DeroPay server * for real-time invoice status updates (amount received, confirmations, * completion). */ /** Payment session events */ type PaymentSessionEvents = { /** Invoice status changed */ statusChanged: (status: InvoiceStatus, invoice: Invoice) => void; /** Payment was detected */ paymentDetected: (invoice: Invoice) => void; /** Invoice is fully paid and confirmed */ completed: (invoice: Invoice) => void; /** Invoice expired */ expired: (invoice: Invoice) => void; /** Error occurred */ error: (error: Error) => void; }; /** * Client-side payment session that polls the server for invoice status. * * Usage: * ```ts * const session = new PaymentSession({ * invoiceId: "abc-123", * statusEndpoint: "/api/pay/status", * }); * * session.on("completed", (invoice) => { * // Redirect to success page * window.location.href = "/order/success"; * }); * * session.start(); * ``` */ declare class PaymentSession { private invoiceId; private statusEndpoint; private pollIntervalMs; private timer; private isRunning; private lastStatus; private listeners; constructor(options: { /** Invoice ID to track */ invoiceId: string; /** Server endpoint that returns invoice status */ statusEndpoint?: string; /** Polling interval in ms (default: 3000) */ pollIntervalMs?: number; }); /** Register an event listener */ on(event: K, callback: PaymentSessionEvents[K]): () => void; private emit; /** Start polling for status updates */ start(): void; /** Stop polling */ stop(): void; /** Get the last known status */ getLastStatus(): InvoiceStatus | null; private poll; } export { type ConnectorFactoryOptions, IntegratedAddressResult, PaymentSession, type PaymentSessionEvents, type RawWalletError, SpendConfirmationRequest, WalletCapability, WalletConnector, WalletConnectorContext, WalletConnectorError, WalletConnectorPolicy, WalletConnectorState, WalletConnectorType, type WalletErrorCode, type WasmWebwalletBridge, WasmWebwalletConnector, type WasmWebwalletConnectorOptions, XSWDConnectorOptions, assertConnectorCapability, assertSpendOperationsAllowed, confirmSpendOperation, createWalletConnector, defaultWalletConnectorPolicy, isWalletConnectorError, isWasmWebwalletAvailable, mapRawWalletErrorCode, mergeWalletConnectorPolicy, normalizeWalletConnectorError, probeWasmWebwalletBridge, resolveWasmWebwalletBridge };