import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; import { W as WalletStatus, I as Invoice, f as InvoiceStatus } from '../types-Bsy2LUTI.cjs'; import { g as WalletConnectorType, b as WalletCapability, W as WalletConnector, e as WalletConnectorPolicy, f as SpendConfirmationRequest } from '../types-D-riGgKJ.cjs'; /** Context value for DeroPay */ type DeroPayContextValue = { /** Current wallet connection status */ walletStatus: WalletStatus; /** Connected wallet address */ walletAddress: string | null; /** Active wallet connector type */ walletConnectorType: WalletConnectorType | null; /** Capabilities advertised by the active connector */ walletCapabilities: WalletCapability[]; /** Current invoice being paid */ currentInvoice: Invoice | null; /** Current invoice status */ invoiceStatus: InvoiceStatus | null; /** Whether a payment operation is in progress */ isLoading: boolean; /** Last error */ error: string | null; /** Connect to the DERO wallet */ connectWallet: () => Promise; /** Disconnect the wallet */ disconnectWallet: () => void; /** Start paying an invoice (fetches invoice and begins monitoring) */ startPayment: (invoiceId: string) => Promise; /** Pay an invoice directly from the connected wallet connector */ payWithWallet: () => Promise; /** Stop the current payment session */ stopPayment: () => void; }; /** Props for the DeroPayProvider */ type DeroPayProviderProps = { children: ReactNode; /** XSWD WebSocket URL (default: ws://localhost:44326/xswd) */ xswdUrl?: string; /** Override connector selection. Defaults to XSWD only. */ preferredWalletConnectors?: WalletConnectorType[]; /** Supply a fully custom connector implementation. */ walletConnector?: WalletConnector; /** Wallet connector policy gates. WASM remains disabled unless explicitly allowed. */ walletPolicy?: Partial; /** Optional confirmation hook for non-native wallet spend confirmations. */ confirmSpendOperation?: (request: SpendConfirmationRequest) => boolean | Promise; /** Application name shown in wallet connection dialog */ appName?: string; /** Application description */ appDescription?: string; /** Server endpoint for invoice status polling */ statusEndpoint?: string; /** Polling interval in ms (default: 3000) */ pollIntervalMs?: number; /** Callback when payment completes */ onPaymentComplete?: (invoice: Invoice) => void; /** Callback when invoice expires */ onPaymentExpired?: (invoice: Invoice) => void; /** Callback on error */ onError?: (error: string) => void; }; /** * Provider component that manages DeroPay payment state. * * ```tsx * * * * ``` */ declare function DeroPayProvider({ children, xswdUrl, preferredWalletConnectors, walletConnector, walletPolicy, confirmSpendOperation, appName, appDescription, statusEndpoint, pollIntervalMs, onPaymentComplete, onPaymentExpired, onError, }: DeroPayProviderProps): react_jsx_runtime.JSX.Element; /** * Hook to access the DeroPay context. * Must be used within a ``. */ declare function useDeroPayContext(): DeroPayContextValue; /** * Drop-in "Pay with DERO" button component. * * Handles wallet connection and payment initiation. */ /** Props for the PayWithDero button */ type PayWithDeroProps = { /** Invoice ID to pay */ invoiceId: string; /** Custom button text */ label?: string; /** Loading text */ loadingLabel?: string; /** Additional CSS class names */ className?: string; /** Custom styles */ style?: React.CSSProperties; /** Callback when payment transaction is submitted */ onPaymentSubmitted?: (txid: string) => void; /** Render prop for fully custom UI */ children?: (props: { pay: () => Promise; isLoading: boolean; isPaid: boolean; walletConnected: boolean; walletConnectorType: string | null; canTransfer: boolean; error: string | null; }) => React.ReactNode; }; /** * A drop-in button for paying with DERO. * * Must be used within a ``. * * Basic usage: * ```tsx * * ``` * * Custom UI via render prop: * ```tsx * * {({ pay, isLoading, isPaid }) => * isPaid ? Paid! : * } * * ``` */ declare function PayWithDero({ invoiceId, label, loadingLabel, className, style, onPaymentSubmitted, children, }: PayWithDeroProps): react_jsx_runtime.JSX.Element; /** * Invoice display component with address, QR code, countdown timer, * and real-time payment status. */ /** Props for the InvoiceView component */ type InvoiceViewProps = { /** Invoice ID to display */ invoiceId: string; /** Whether to show the QR code (default: true) */ showQr?: boolean; /** Whether to show the countdown timer (default: true) */ showTimer?: boolean; /** Whether to show the payment address (default: true) */ showAddress?: boolean; /** QR code size in pixels (default: 200) */ qrSize?: number; /** Additional CSS class names for the container */ className?: string; /** Custom styles for the container */ style?: React.CSSProperties; /** Callback when invoice is completed */ onCompleted?: () => void; /** Callback when invoice expires */ onExpired?: () => void; }; /** * A full invoice display component for payment pages. * * Shows: * - Invoice name and amount * - QR code with the integrated address * - Copyable payment address * - Countdown timer * - Real-time payment status * * Must be used within a ``. * * ```tsx * router.push("/success")} * /> * ``` */ declare function InvoiceView({ invoiceId, showQr, showTimer, showAddress, qrSize, className, style, onCompleted, onExpired, }: InvoiceViewProps): react_jsx_runtime.JSX.Element | null; /** * Minimal payment status indicator component. * * A smaller alternative to InvoiceView — just shows the current * status with a colored indicator dot. */ /** Props for the PaymentStatus component */ type PaymentStatusProps = { /** Invoice ID to monitor */ invoiceId: string; /** Whether to show the amount (default: true) */ showAmount?: boolean; /** Additional CSS class names */ className?: string; /** Custom styles */ style?: React.CSSProperties; }; /** * A compact payment status indicator. * * Must be used within a ``. * * ```tsx * * ``` */ declare function PaymentStatus({ invoiceId, showAmount, className, style, }: PaymentStatusProps): react_jsx_runtime.JSX.Element; /** * Escrow-backed invoice display component. * * Shows the full escrow lifecycle with buyer/seller/arbitrator actions: * - Deposit funds into escrow * - Confirm delivery (releases to seller) * - Raise a dispute * - View escrow status and on-chain state * * Requires the buyer to have a DERO wallet connected via XSWD. */ /** Props for the EscrowInvoiceView component */ type EscrowInvoiceViewProps = { /** Invoice ID to display */ invoiceId: string; /** User's role in this escrow */ role?: "buyer" | "seller" | "arbitrator" | "viewer"; /** Server endpoint for invoice status polling */ statusEndpoint?: string; /** Server endpoint for escrow actions (POST) */ escrowActionEndpoint?: string; /** Server endpoint for the Gate-2 buyer claim (POST, default: /api/pay/escrow/claim) */ claimEndpoint?: string; /** Polling interval in ms (default: 5000) */ pollIntervalMs?: number; /** Additional CSS class names */ className?: string; /** Custom styles */ style?: React.CSSProperties; /** Callback when escrow is released to seller */ onReleased?: () => void; /** Callback when escrow is refunded to buyer */ onRefunded?: () => void; /** Callback when dispute is raised */ onDisputed?: () => void; /** Callback on error */ onError?: (error: string) => void; }; /** * Full escrow-backed invoice display with lifecycle management. * * Must be used within a ``. * * ```tsx * router.push("/success")} * /> * ``` */ declare function EscrowInvoiceView({ invoiceId, role, statusEndpoint, escrowActionEndpoint, claimEndpoint, pollIntervalMs, className, style, onReleased, onRefunded, onDisputed, onError, }: EscrowInvoiceViewProps): react_jsx_runtime.JSX.Element; /** Props for the EscrowClaimStep component. */ type EscrowClaimStepProps = { /** The quoted escrow invoice to claim. Its escrow.escrowStatus should be "quoted". */ invoice: Invoice; /** Server endpoint for the claim POST (default: /api/pay/escrow/claim). */ claimEndpoint?: string; /** Server endpoint for invoice status polling (default: /api/pay/status). */ statusEndpoint?: string; /** Polling interval in ms while awaiting the deploy→awaiting_deposit transition (default: 4000). */ pollIntervalMs?: number; /** Additional CSS class names. */ className?: string; /** Custom styles. */ style?: React.CSSProperties; /** * Fired once the escrow reaches "awaiting_deposit" with an SCID present — i.e. * the contract is live and bound to the buyer. Receives the fresh invoice so the * parent can hand off to the deposit UI (EscrowInvoiceView). */ onClaimed?: (invoice: Invoice) => void; /** Callback on error. */ onError?: (error: string) => void; }; /** * Buyer CLAIM step for a quoted escrow invoice. * * ```tsx * setInvoice(inv)} // hand off to EscrowInvoiceView * /> * ``` */ declare function EscrowClaimStep({ invoice, claimEndpoint, statusEndpoint, pollIntervalMs, className, style, onClaimed, onError, }: EscrowClaimStepProps): react_jsx_runtime.JSX.Element; export { type DeroPayContextValue, DeroPayProvider, type DeroPayProviderProps, EscrowClaimStep, type EscrowClaimStepProps, EscrowInvoiceView, type EscrowInvoiceViewProps, InvoiceView, type InvoiceViewProps, PayWithDero, type PayWithDeroProps, PaymentStatus, type PaymentStatusProps, useDeroPayContext };