@unifold/ui-react 0.1.41 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork } from '@unifold/core';
2
+ import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, SupportedDestinationTokensResponse, VerifyAddressResponse } from '@unifold/core';
3
3
  export { ChainType } from '@unifold/core';
4
+ import * as _tanstack_react_query from '@tanstack/react-query';
4
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
- import * as React from 'react';
6
+ import * as React$1 from 'react';
6
7
  import { VariantProps } from 'class-variance-authority';
7
8
  import * as DialogPrimitive from '@radix-ui/react-dialog';
8
9
  import * as SelectPrimitive from '@radix-ui/react-select';
@@ -13,6 +14,11 @@ type DepositConfirmationMode = "auto_ui" | "auto_silent" | "manual";
13
14
  interface UseDepositPollingOptions {
14
15
  userId: string | undefined;
15
16
  publishableKey: string;
17
+ /**
18
+ * When provided, polls executions via the payment-intent-scoped endpoint
19
+ * instead of the user-scoped queryExecutions endpoint.
20
+ */
21
+ clientSecret?: string;
16
22
  /** Controls when polling starts and whether a waiting UI is shown.
17
23
  * - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
18
24
  * - "auto_silent": After 10s, starts polling silently (no waiting UI)
@@ -49,7 +55,7 @@ interface UseDepositPollingResult {
49
55
  /** Call this when user clicks "I've made the deposit" (manual mode) */
50
56
  handleIveDeposited: () => void;
51
57
  }
52
- declare function useDepositPolling({ userId, publishableKey, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
58
+ declare function useDepositPolling({ userId, publishableKey, clientSecret, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
53
59
 
54
60
  declare global {
55
61
  interface Window {
@@ -92,6 +98,36 @@ interface EthereumProvider {
92
98
 
93
99
  /** Quick amount chips on the browser wallet "Enter amount" step */
94
100
  type BrowserWalletAmountQuickSelect = "usd" | "percentage";
101
+ interface SolanaWalletProvider {
102
+ isPhantom?: boolean;
103
+ isConnected?: boolean;
104
+ publicKey?: {
105
+ toString(): string;
106
+ };
107
+ connect(opts?: {
108
+ onlyIfTrusted?: boolean;
109
+ }): Promise<{
110
+ publicKey: {
111
+ toString(): string;
112
+ };
113
+ }>;
114
+ disconnect(): Promise<void>;
115
+ signTransaction(transaction: any): Promise<any>;
116
+ on(event: string, callback: (...args: unknown[]) => void): void;
117
+ off(event: string, callback: (...args: unknown[]) => void): void;
118
+ }
119
+ interface EvmWalletProvider {
120
+ isMetaMask?: boolean;
121
+ isPhantom?: boolean;
122
+ isCoinbaseWallet?: boolean;
123
+ selectedAddress?: string;
124
+ request(args: {
125
+ method: string;
126
+ params?: unknown[];
127
+ }): Promise<unknown>;
128
+ on(event: string, callback: (...args: unknown[]) => void): void;
129
+ removeListener(event: string, callback: (...args: unknown[]) => void): void;
130
+ }
95
131
 
96
132
  type DepositModalInitialScreen = "main" | "transfer" | "card" | "tracker";
97
133
  interface DepositModalProps {
@@ -193,6 +229,8 @@ declare function DepositHeader({ title, subtitle, showBack, showClose, onBack, o
193
229
  interface TransferCryptoSingleInputProps {
194
230
  userId: string;
195
231
  publishableKey: string;
232
+ /** When provided, polls executions via the payment-intent-scoped endpoint instead of user-scoped. */
233
+ clientSecret?: string;
196
234
  recipientAddress?: string;
197
235
  destinationChainType?: ChainType;
198
236
  destinationChainId?: string;
@@ -219,8 +257,23 @@ interface TransferCryptoSingleInputProps {
219
257
  code?: string;
220
258
  }) => void;
221
259
  wallets?: Wallet[];
260
+ /** Called when the user changes the selected source token/chain. */
261
+ onSourceTokenChange?: (info: {
262
+ symbol: string;
263
+ chainType: string;
264
+ chainId: string;
265
+ tokenAddress: string;
266
+ minimumDepositAmountUsd: number;
267
+ }) => void;
268
+ /** Checkout mode: estimated source amount to send (from /public/quotes). Shown above the QR code. */
269
+ checkoutQuote?: {
270
+ sourceAmount: string;
271
+ sourceTokenDecimals: number;
272
+ sourceTokenSymbol: string;
273
+ sourceAmountUsd: string | null;
274
+ } | null;
222
275
  }
223
- declare function TransferCryptoSingleInput({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
276
+ declare function TransferCryptoSingleInput({ userId, publishableKey, clientSecret, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, onSourceTokenChange, checkoutQuote, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
224
277
 
225
278
  interface TransferCryptoDoubleInputProps {
226
279
  userId: string;
@@ -367,8 +420,10 @@ interface DepositDetailContentProps {
367
420
  execution: AutoSwapResponse;
368
421
  /** Merged into root (e.g. wider horizontal padding in embedded deposit details). */
369
422
  className?: string;
423
+ /** Use "withdraw" to show "Withdrawal Tx" instead of "Deposit Tx" in details. */
424
+ variant?: "deposit" | "withdraw";
370
425
  }
371
- declare function DepositDetailContent({ execution, className, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
426
+ declare function DepositDetailContent({ execution, className, variant, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
372
427
 
373
428
  interface DepositPollingUiProps {
374
429
  depositConfirmationMode: DepositConfirmationMode;
@@ -392,8 +447,223 @@ interface ConfirmingViewProps {
392
447
  onClose: () => void;
393
448
  executions?: AutoSwapResponse[];
394
449
  isPolling?: boolean;
450
+ onNewDeposit?: () => void;
451
+ onDone?: () => void;
452
+ paymentIntentStatus?: string;
453
+ /** Live amount_received_usd from the payment intent (updates via polling). */
454
+ amountReceivedUsd?: string;
455
+ /** Snapshot of amount_received_usd taken when the transaction was submitted. */
456
+ amountReceivedUsdAtSubmission?: string | null;
457
+ }
458
+ declare function ConfirmingView({ isConfirming, onClose, executions, isPolling, onNewDeposit, onDone, paymentIntentStatus, amountReceivedUsd, amountReceivedUsdAtSubmission, }: ConfirmingViewProps): react_jsx_runtime.JSX.Element;
459
+
460
+ interface CheckoutModalProps {
461
+ open: boolean;
462
+ onOpenChange: (open: boolean) => void;
463
+ clientSecret: string;
464
+ publishableKey: string;
465
+ modalTitle?: string;
466
+ /** Enable browser wallet connection option. Defaults to false */
467
+ enableConnectWallet?: boolean;
468
+ theme?: "light" | "dark" | "auto";
469
+ onCheckoutSuccess?: (data: {
470
+ paymentIntentId: string;
471
+ status: string;
472
+ }) => void;
473
+ onCheckoutError?: (error: {
474
+ message: string;
475
+ error?: unknown;
476
+ code?: string;
477
+ }) => void;
478
+ }
479
+ declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableConnectWallet, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
480
+
481
+ interface WithdrawTransactionInfo {
482
+ /** Source (sending) chain type */
483
+ sourceChainType: ChainType;
484
+ /** Source (sending) chain ID */
485
+ sourceChainId: string;
486
+ /** Source token contract address — the token being sent */
487
+ sourceTokenAddress: string;
488
+ /** Source token symbol */
489
+ sourceTokenSymbol: string;
490
+ /** Destination (receiving) chain type */
491
+ destinationChainType: string;
492
+ /** Destination (receiving) chain ID */
493
+ destinationChainId: string;
494
+ /** Destination token contract address */
495
+ destinationTokenAddress: string;
496
+ /** Destination token symbol */
497
+ destinationTokenSymbol: string;
498
+ amount: string;
499
+ amountBaseUnit: string;
500
+ /** The Unifold deposit wallet address to send funds to */
501
+ withdrawIntentAddress: string;
502
+ /** The user-provided final destination address */
503
+ recipientAddress: string;
504
+ }
505
+ interface WithdrawModalProps {
506
+ open: boolean;
507
+ onOpenChange: (open: boolean) => void;
508
+ publishableKey: string;
509
+ modalTitle?: string;
510
+ externalUserId: string;
511
+ sourceChainType: ChainType;
512
+ sourceChainId: string;
513
+ sourceTokenAddress: string;
514
+ sourceTokenSymbol?: string;
515
+ recipientAddress?: string;
516
+ senderAddress: string;
517
+ onWithdraw?: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
518
+ onWithdrawSuccess?: (data: {
519
+ message: string;
520
+ transaction?: unknown;
521
+ }) => void;
522
+ onWithdrawError?: (error: {
523
+ message: string;
524
+ error?: unknown;
525
+ code?: string;
526
+ }) => void;
527
+ theme?: "light" | "dark" | "auto";
528
+ hideOverlay?: boolean;
529
+ }
530
+ declare function WithdrawModal({ open, onOpenChange, publishableKey, modalTitle, externalUserId, sourceChainType, sourceChainId, sourceTokenAddress, sourceTokenSymbol, recipientAddress: recipientAddressProp, senderAddress, onWithdraw, onWithdrawSuccess, onWithdrawError, theme, hideOverlay, }: WithdrawModalProps): react_jsx_runtime.JSX.Element;
531
+
532
+ interface WithdrawTokenSelectorProps {
533
+ tokens: DestinationToken[];
534
+ onSelect: (token: DestinationToken, chain: DestinationTokenChain) => void;
535
+ onBack: () => void;
536
+ }
537
+ declare function WithdrawTokenSelector({ tokens, onSelect, onBack, }: WithdrawTokenSelectorProps): react_jsx_runtime.JSX.Element;
538
+
539
+ interface WithdrawDoubleInputProps {
540
+ tokens: DestinationToken[];
541
+ selectedTokenSymbol: string | null;
542
+ selectedChainKey: string | null;
543
+ onTokenChange: (symbol: string) => void;
544
+ onChainChange: (chainKey: string) => void;
545
+ isLoading?: boolean;
546
+ }
547
+ declare function WithdrawDoubleInput({ tokens, selectedTokenSymbol, selectedChainKey, onTokenChange, onChainChange, isLoading, }: WithdrawDoubleInputProps): react_jsx_runtime.JSX.Element;
548
+
549
+ interface AddressBalanceResult {
550
+ balanceBaseUnit: string;
551
+ balanceHuman: string;
552
+ balanceUsd: string | null;
553
+ exchangeRate: string | null;
554
+ decimals: number;
555
+ symbol: string;
556
+ }
557
+ /**
558
+ * Hook to fetch a token balance for a given address.
559
+ * Uses React Query for caching and deduplication.
560
+ */
561
+ declare function useAddressBalance(params: {
562
+ address?: string;
563
+ chainType?: ChainType;
564
+ chainId?: string;
565
+ tokenAddress?: string;
566
+ publishableKey: string;
567
+ enabled?: boolean;
568
+ }): _tanstack_react_query.UseQueryResult<AddressBalanceResult | null, Error>;
569
+
570
+ type DetectedWallet = {
571
+ name: string;
572
+ address: string;
573
+ } & ({
574
+ chainFamily: "evm";
575
+ provider: EvmWalletProvider;
576
+ } | {
577
+ chainFamily: "solana";
578
+ provider: SolanaWalletProvider;
579
+ });
580
+ declare function sendEvmWithdraw(params: {
581
+ provider: EvmWalletProvider;
582
+ fromAddress: string;
583
+ depositWalletAddress: string;
584
+ sourceTokenAddress: string;
585
+ sourceChainId: string;
586
+ amountBaseUnit: string;
587
+ }): Promise<string>;
588
+ declare function sendSolanaWithdraw(params: {
589
+ provider: SolanaWalletProvider;
590
+ fromAddress: string;
591
+ depositWalletAddress: string;
592
+ sourceTokenAddress: string;
593
+ amountBaseUnit: string;
594
+ publishableKey: string;
595
+ }): Promise<string>;
596
+ declare const HYPERCORE_CHAIN_ID = "1337";
597
+ declare function isHypercoreChain(chainId: string): boolean;
598
+ declare function sendHypercoreWithdraw(params: {
599
+ provider: EvmWalletProvider;
600
+ fromAddress: string;
601
+ depositWalletAddress: string;
602
+ sourceTokenAddress: string;
603
+ amount: string;
604
+ tokenSymbol: string;
605
+ publishableKey: string;
606
+ }): Promise<void>;
607
+
608
+ declare function detectBrowserWallet(chainType: string, senderAddress?: string): Promise<DetectedWallet | null>;
609
+
610
+ interface WithdrawFormProps {
611
+ publishableKey: string;
612
+ externalUserId: string;
613
+ sourceChainType: ChainType;
614
+ selectedToken: DestinationToken | null;
615
+ selectedChain: DestinationTokenChain | null;
616
+ sourceTokenSymbol?: string;
617
+ recipientAddressProp?: string;
618
+ balanceData: AddressBalanceResult | null;
619
+ isLoadingBalance: boolean;
620
+ minimumWithdrawAmountUsd: number | null;
621
+ estimatedProcessingTime: number | null;
622
+ maxSlippagePercent: number | null;
623
+ priceImpactPercent: number | null;
624
+ /** Detected browser wallet with provider ref — used for SDK-native sends */
625
+ detectedWallet: DetectedWallet | null;
626
+ sourceChainId: string;
627
+ sourceTokenAddress: string;
628
+ isWalletMatch: boolean;
629
+ connectedWalletName: string | null;
630
+ canWithdraw: boolean;
631
+ onWithdraw?: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
632
+ onWithdrawError?: (error: {
633
+ message: string;
634
+ error?: unknown;
635
+ code?: string;
636
+ }) => void;
637
+ /** Creates the deposit wallet and starts polling. Returns the wallet address + id. */
638
+ onDepositWalletCreation: (params: {
639
+ destinationChainType: string;
640
+ destinationChainId: string;
641
+ destinationTokenAddress: string;
642
+ recipientAddress: string;
643
+ }) => Promise<{
644
+ id: string;
645
+ address: string;
646
+ }>;
647
+ /** Called after a successful withdraw submit — navigates to confirming view */
648
+ onWithdrawSubmitted?: (txInfo: WithdrawTransactionInfo) => void;
649
+ /** Optional element rendered on the left side of the footer row (e.g. tracker link) */
650
+ footerLeft?: React.ReactNode;
395
651
  }
396
- declare function ConfirmingView({ isConfirming, onClose, executions, isPolling, }: ConfirmingViewProps): react_jsx_runtime.JSX.Element;
652
+ declare function WithdrawForm({ publishableKey, externalUserId, sourceChainType, selectedToken, selectedChain, sourceTokenSymbol, recipientAddressProp, balanceData, isLoadingBalance, minimumWithdrawAmountUsd, estimatedProcessingTime, maxSlippagePercent, priceImpactPercent, detectedWallet, sourceChainId, sourceTokenAddress, isWalletMatch, connectedWalletName, canWithdraw, onWithdraw, onWithdrawError, onDepositWalletCreation, onWithdrawSubmitted, footerLeft, }: WithdrawFormProps): react_jsx_runtime.JSX.Element;
653
+
654
+ interface WithdrawExecutionItemProps {
655
+ execution: AutoSwapResponse;
656
+ onClick?: () => void;
657
+ }
658
+ declare function WithdrawExecutionItem({ execution, onClick, }: WithdrawExecutionItemProps): react_jsx_runtime.JSX.Element;
659
+
660
+ interface WithdrawConfirmingViewProps {
661
+ txInfo: WithdrawTransactionInfo;
662
+ executions: AutoSwapResponse[];
663
+ onClose: () => void;
664
+ onViewTracker: () => void;
665
+ }
666
+ declare function WithdrawConfirmingView({ txInfo, executions, onClose, onViewTracker, }: WithdrawConfirmingViewProps): react_jsx_runtime.JSX.Element;
397
667
 
398
668
  interface CurrencyListItemProps {
399
669
  currency: FiatCurrency;
@@ -414,17 +684,17 @@ declare const buttonVariants: (props?: ({
414
684
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
415
685
  size?: "default" | "icon" | "sm" | "lg" | null | undefined;
416
686
  } & class_variance_authority_types.ClassProp) | undefined) => string;
417
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
687
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
418
688
  asChild?: boolean;
419
689
  }
420
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
690
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
421
691
 
422
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
423
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
424
- declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
425
- declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
426
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
427
- interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
692
+ declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
693
+ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
694
+ declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
695
+ declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
696
+ declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
697
+ interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
428
698
  /** Render inline without portal, overlay, or close button (for embedded/inline mode) */
429
699
  hideOverlay?: boolean;
430
700
  /**
@@ -437,30 +707,30 @@ interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof Dialo
437
707
  /** Merged into `DialogOverlay` (e.g. z-index above in-app layers such as deposit toasts). */
438
708
  overlayClassName?: string;
439
709
  }
440
- declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
710
+ declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
441
711
  declare const DialogHeader: {
442
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
712
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
443
713
  displayName: string;
444
714
  };
445
715
  declare const DialogFooter: {
446
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
716
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
447
717
  displayName: string;
448
718
  };
449
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
450
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
451
-
452
- declare const Select: React.FC<SelectPrimitive.SelectProps>;
453
- declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
454
- declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
455
- declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
456
- declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
457
- declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
458
- declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
459
- declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
460
- declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
461
- declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
462
-
463
- declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
719
+ declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
720
+ declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
721
+
722
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
723
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
724
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
725
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
726
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
727
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
728
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
729
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
730
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
731
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
732
+
733
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
464
734
  /**
465
735
  * Tooltip wrapper that supports both hover (desktop) and tap-to-toggle (mobile).
466
736
  *
@@ -468,13 +738,13 @@ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
468
738
  * This wrapper adds controlled open state so the trigger's onClick can toggle it,
469
739
  * while preserving the default hover behavior on desktop.
470
740
  */
471
- declare function Tooltip({ children, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
741
+ declare function Tooltip({ children, ...props }: React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
472
742
  /**
473
743
  * Tooltip trigger that adds click-to-toggle for mobile/touch support.
474
744
  * On desktop, hover still works as usual via Radix's built-in behavior.
475
745
  */
476
- declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
477
- declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
746
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
747
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
478
748
 
479
749
  /**
480
750
  * Result of the useAllowedCountry hook
@@ -515,6 +785,109 @@ interface AllowedCountryResult {
515
785
  */
516
786
  declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
517
787
 
788
+ interface UsePaymentIntentParams {
789
+ clientSecret: string;
790
+ publishableKey: string;
791
+ /** Whether the query should execute. Defaults to true. */
792
+ enabled?: boolean;
793
+ /** Polling interval in ms. Defaults to 5000 (5s). Set to 0 to disable. */
794
+ pollingInterval?: number;
795
+ }
796
+ /**
797
+ * Hook to retrieve and poll a payment intent via react-query.
798
+ *
799
+ * Fetches the payment intent on mount and polls at the configured interval
800
+ * so `amount_received_usd` and `status` stay up-to-date in the UI.
801
+ */
802
+ declare function usePaymentIntent(params: UsePaymentIntentParams): _tanstack_react_query.UseQueryResult<PaymentIntent, Error>;
803
+
804
+ interface UseDepositQuoteParams {
805
+ publishableKey: string;
806
+ sourceChainType: string;
807
+ sourceChainId: string;
808
+ sourceTokenAddress: string;
809
+ destinationAmount: string;
810
+ destinationChainType: string;
811
+ destinationChainId: string;
812
+ destinationTokenAddress: string;
813
+ enabled?: boolean;
814
+ }
815
+ /**
816
+ * Hook to fetch a deposit quote via react-query.
817
+ *
818
+ * Returns the estimated source token amount needed to receive a specific
819
+ * destination amount, accounting for bridge fees and slippage.
820
+ * Server-side cached for 1 minute; client re-fetches on param change.
821
+ */
822
+ declare function useDepositQuote(params: UseDepositQuoteParams): _tanstack_react_query.UseQueryResult<DepositQuote, Error>;
823
+
824
+ interface UseWithdrawPollingOptions {
825
+ userId: string | undefined;
826
+ publishableKey: string;
827
+ depositWalletId?: string;
828
+ enabled?: boolean;
829
+ onWithdrawSuccess?: (data: {
830
+ message: string;
831
+ transaction?: unknown;
832
+ executionId?: string;
833
+ }) => void;
834
+ onWithdrawError?: (error: {
835
+ message: string;
836
+ error?: unknown;
837
+ code?: string;
838
+ }) => void;
839
+ }
840
+ interface UseWithdrawPollingResult {
841
+ executions: AutoSwapResponse[];
842
+ isPolling: boolean;
843
+ }
844
+ declare function useWithdrawPolling({ userId, publishableKey, depositWalletId, enabled, onWithdrawSuccess, onWithdrawError, }: UseWithdrawPollingOptions): UseWithdrawPollingResult;
845
+
846
+ /**
847
+ * Hook to fetch supported destination tokens with caching and deduplication via react-query.
848
+ * Used in the withdraw flow to show available tokens the user can withdraw to.
849
+ *
850
+ * @param publishableKey - Publishable key for API calls
851
+ * @param enabled - Whether to fetch (defaults to true)
852
+ */
853
+ declare function useSupportedDestinationTokens(publishableKey: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<SupportedDestinationTokensResponse, Error>;
854
+
855
+ interface UseVerifyRecipientAddressParams {
856
+ chainType?: string;
857
+ chainId?: string;
858
+ tokenAddress?: string;
859
+ recipientAddress?: string;
860
+ publishableKey: string;
861
+ enabled?: boolean;
862
+ }
863
+ /**
864
+ * Hook to verify a recipient address via React Query.
865
+ * Debounced by the caller — only fires when all params are present and enabled is true.
866
+ * Caches results by the full (chain + token + address) tuple.
867
+ */
868
+ declare function useVerifyRecipientAddress(params: UseVerifyRecipientAddressParams): _tanstack_react_query.UseQueryResult<VerifyAddressResponse, Error>;
869
+
870
+ interface SourceTokenValidationResult {
871
+ isSupported: boolean;
872
+ minimumAmountUsd: number | null;
873
+ estimatedProcessingTime: number | null;
874
+ maxSlippagePercent: number | null;
875
+ priceImpactPercent: number | null;
876
+ errorMessage: string | null;
877
+ }
878
+ /**
879
+ * Hook to validate that a source token is supported for withdrawal
880
+ * by checking it against /supported_deposit_tokens.
881
+ */
882
+ declare function useSourceTokenValidation(params: {
883
+ sourceChainType?: string;
884
+ sourceChainId?: string;
885
+ sourceTokenAddress?: string;
886
+ sourceTokenSymbol?: string;
887
+ publishableKey: string;
888
+ enabled?: boolean;
889
+ }): _tanstack_react_query.UseQueryResult<SourceTokenValidationResult, Error>;
890
+
518
891
  /**
519
892
  * Unifold color palette for React (Web)
520
893
  * Matches the React Native theme colors
@@ -757,7 +1130,7 @@ interface ThemeContextValue {
757
1130
  isDark: boolean;
758
1131
  }
759
1132
  interface ThemeProviderProps {
760
- children: React.ReactNode;
1133
+ children: React$1.ReactNode;
761
1134
  /** Force a specific theme mode, or 'auto' to use system preference */
762
1135
  mode?: ThemeMode | "auto";
763
1136
  /** Simple accent/primary color override (applies to both light and dark) */
@@ -791,4 +1164,4 @@ declare function cn(...inputs: ClassValue[]): string;
791
1164
  */
792
1165
  declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
793
1166
 
794
- export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, buttonVariants, cn, colors, defaultColors, getColors, mergeColors, resolveComponentTokens, truncateAddress, useAllowedCountry, useDepositPolling, useTheme };
1167
+ export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, CheckoutModal, type CheckoutModalProps, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, HYPERCORE_CHAIN_ID, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, type UseDepositQuoteParams, type UsePaymentIntentParams, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, isHypercoreChain, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useDepositQuote, usePaymentIntent, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };