@unifold/ui-react 0.1.41 → 0.1.42

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, 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';
@@ -92,6 +93,36 @@ interface EthereumProvider {
92
93
 
93
94
  /** Quick amount chips on the browser wallet "Enter amount" step */
94
95
  type BrowserWalletAmountQuickSelect = "usd" | "percentage";
96
+ interface SolanaWalletProvider {
97
+ isPhantom?: boolean;
98
+ isConnected?: boolean;
99
+ publicKey?: {
100
+ toString(): string;
101
+ };
102
+ connect(opts?: {
103
+ onlyIfTrusted?: boolean;
104
+ }): Promise<{
105
+ publicKey: {
106
+ toString(): string;
107
+ };
108
+ }>;
109
+ disconnect(): Promise<void>;
110
+ signTransaction(transaction: any): Promise<any>;
111
+ on(event: string, callback: (...args: unknown[]) => void): void;
112
+ off(event: string, callback: (...args: unknown[]) => void): void;
113
+ }
114
+ interface EvmWalletProvider {
115
+ isMetaMask?: boolean;
116
+ isPhantom?: boolean;
117
+ isCoinbaseWallet?: boolean;
118
+ selectedAddress?: string;
119
+ request(args: {
120
+ method: string;
121
+ params?: unknown[];
122
+ }): Promise<unknown>;
123
+ on(event: string, callback: (...args: unknown[]) => void): void;
124
+ removeListener(event: string, callback: (...args: unknown[]) => void): void;
125
+ }
95
126
 
96
127
  type DepositModalInitialScreen = "main" | "transfer" | "card" | "tracker";
97
128
  interface DepositModalProps {
@@ -367,8 +398,10 @@ interface DepositDetailContentProps {
367
398
  execution: AutoSwapResponse;
368
399
  /** Merged into root (e.g. wider horizontal padding in embedded deposit details). */
369
400
  className?: string;
401
+ /** Use "withdraw" to show "Withdrawal Tx" instead of "Deposit Tx" in details. */
402
+ variant?: "deposit" | "withdraw";
370
403
  }
371
- declare function DepositDetailContent({ execution, className, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
404
+ declare function DepositDetailContent({ execution, className, variant, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
372
405
 
373
406
  interface DepositPollingUiProps {
374
407
  depositConfirmationMode: DepositConfirmationMode;
@@ -395,6 +428,181 @@ interface ConfirmingViewProps {
395
428
  }
396
429
  declare function ConfirmingView({ isConfirming, onClose, executions, isPolling, }: ConfirmingViewProps): react_jsx_runtime.JSX.Element;
397
430
 
431
+ interface WithdrawTransactionInfo {
432
+ /** Source (sending) chain type */
433
+ sourceChainType: ChainType;
434
+ /** Source (sending) chain ID */
435
+ sourceChainId: string;
436
+ /** Source token contract address — the token being sent */
437
+ sourceTokenAddress: string;
438
+ /** Source token symbol */
439
+ sourceTokenSymbol: string;
440
+ /** Destination (receiving) chain type */
441
+ destinationChainType: string;
442
+ /** Destination (receiving) chain ID */
443
+ destinationChainId: string;
444
+ /** Destination token contract address */
445
+ destinationTokenAddress: string;
446
+ /** Destination token symbol */
447
+ destinationTokenSymbol: string;
448
+ amount: string;
449
+ amountBaseUnit: string;
450
+ /** The Unifold deposit wallet address to send funds to */
451
+ withdrawIntentAddress: string;
452
+ /** The user-provided final destination address */
453
+ recipientAddress: string;
454
+ }
455
+ interface WithdrawModalProps {
456
+ open: boolean;
457
+ onOpenChange: (open: boolean) => void;
458
+ publishableKey: string;
459
+ modalTitle?: string;
460
+ externalUserId: string;
461
+ sourceChainType: ChainType;
462
+ sourceChainId: string;
463
+ sourceTokenAddress: string;
464
+ sourceTokenSymbol?: string;
465
+ recipientAddress?: string;
466
+ senderAddress: string;
467
+ onWithdraw?: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
468
+ onWithdrawSuccess?: (data: {
469
+ message: string;
470
+ transaction?: unknown;
471
+ }) => void;
472
+ onWithdrawError?: (error: {
473
+ message: string;
474
+ error?: unknown;
475
+ code?: string;
476
+ }) => void;
477
+ theme?: "light" | "dark" | "auto";
478
+ hideOverlay?: boolean;
479
+ }
480
+ 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;
481
+
482
+ interface WithdrawTokenSelectorProps {
483
+ tokens: DestinationToken[];
484
+ onSelect: (token: DestinationToken, chain: DestinationTokenChain) => void;
485
+ onBack: () => void;
486
+ }
487
+ declare function WithdrawTokenSelector({ tokens, onSelect, onBack, }: WithdrawTokenSelectorProps): react_jsx_runtime.JSX.Element;
488
+
489
+ interface WithdrawDoubleInputProps {
490
+ tokens: DestinationToken[];
491
+ selectedTokenSymbol: string | null;
492
+ selectedChainKey: string | null;
493
+ onTokenChange: (symbol: string) => void;
494
+ onChainChange: (chainKey: string) => void;
495
+ isLoading?: boolean;
496
+ }
497
+ declare function WithdrawDoubleInput({ tokens, selectedTokenSymbol, selectedChainKey, onTokenChange, onChainChange, isLoading, }: WithdrawDoubleInputProps): react_jsx_runtime.JSX.Element;
498
+
499
+ interface AddressBalanceResult {
500
+ balanceBaseUnit: string;
501
+ balanceHuman: string;
502
+ balanceUsd: string | null;
503
+ exchangeRate: string | null;
504
+ decimals: number;
505
+ symbol: string;
506
+ }
507
+ /**
508
+ * Hook to fetch a token balance for a given address.
509
+ * Uses React Query for caching and deduplication.
510
+ */
511
+ declare function useAddressBalance(params: {
512
+ address?: string;
513
+ chainType?: ChainType;
514
+ chainId?: string;
515
+ tokenAddress?: string;
516
+ publishableKey: string;
517
+ enabled?: boolean;
518
+ }): _tanstack_react_query.UseQueryResult<AddressBalanceResult | null, Error>;
519
+
520
+ type DetectedWallet = {
521
+ name: string;
522
+ address: string;
523
+ } & ({
524
+ chainFamily: "evm";
525
+ provider: EvmWalletProvider;
526
+ } | {
527
+ chainFamily: "solana";
528
+ provider: SolanaWalletProvider;
529
+ });
530
+ declare function sendEvmWithdraw(params: {
531
+ provider: EvmWalletProvider;
532
+ fromAddress: string;
533
+ depositWalletAddress: string;
534
+ sourceTokenAddress: string;
535
+ sourceChainId: string;
536
+ amountBaseUnit: string;
537
+ }): Promise<string>;
538
+ declare function sendSolanaWithdraw(params: {
539
+ provider: SolanaWalletProvider;
540
+ fromAddress: string;
541
+ depositWalletAddress: string;
542
+ sourceTokenAddress: string;
543
+ amountBaseUnit: string;
544
+ publishableKey: string;
545
+ }): Promise<string>;
546
+ declare function detectBrowserWallet(chainType: string, senderAddress?: string): Promise<DetectedWallet | null>;
547
+
548
+ interface WithdrawFormProps {
549
+ publishableKey: string;
550
+ externalUserId: string;
551
+ sourceChainType: ChainType;
552
+ selectedToken: DestinationToken | null;
553
+ selectedChain: DestinationTokenChain | null;
554
+ sourceTokenSymbol?: string;
555
+ recipientAddressProp?: string;
556
+ balanceData: AddressBalanceResult | null;
557
+ isLoadingBalance: boolean;
558
+ minimumWithdrawAmountUsd: number | null;
559
+ estimatedProcessingTime: number | null;
560
+ maxSlippagePercent: number | null;
561
+ priceImpactPercent: number | null;
562
+ /** Detected browser wallet with provider ref — used for SDK-native sends */
563
+ detectedWallet: DetectedWallet | null;
564
+ sourceChainId: string;
565
+ sourceTokenAddress: string;
566
+ isWalletMatch: boolean;
567
+ connectedWalletName: string | null;
568
+ canWithdraw: boolean;
569
+ onWithdraw?: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
570
+ onWithdrawError?: (error: {
571
+ message: string;
572
+ error?: unknown;
573
+ code?: string;
574
+ }) => void;
575
+ /** Creates the deposit wallet and starts polling. Returns the wallet address + id. */
576
+ onDepositWalletCreation: (params: {
577
+ destinationChainType: string;
578
+ destinationChainId: string;
579
+ destinationTokenAddress: string;
580
+ recipientAddress: string;
581
+ }) => Promise<{
582
+ id: string;
583
+ address: string;
584
+ }>;
585
+ /** Called after a successful withdraw submit — navigates to confirming view */
586
+ onWithdrawSubmitted?: (txInfo: WithdrawTransactionInfo) => void;
587
+ /** Optional element rendered on the left side of the footer row (e.g. tracker link) */
588
+ footerLeft?: React.ReactNode;
589
+ }
590
+ 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;
591
+
592
+ interface WithdrawExecutionItemProps {
593
+ execution: AutoSwapResponse;
594
+ onClick?: () => void;
595
+ }
596
+ declare function WithdrawExecutionItem({ execution, onClick, }: WithdrawExecutionItemProps): react_jsx_runtime.JSX.Element;
597
+
598
+ interface WithdrawConfirmingViewProps {
599
+ txInfo: WithdrawTransactionInfo;
600
+ executions: AutoSwapResponse[];
601
+ onClose: () => void;
602
+ onViewTracker: () => void;
603
+ }
604
+ declare function WithdrawConfirmingView({ txInfo, executions, onClose, onViewTracker, }: WithdrawConfirmingViewProps): react_jsx_runtime.JSX.Element;
605
+
398
606
  interface CurrencyListItemProps {
399
607
  currency: FiatCurrency;
400
608
  isSelected: boolean;
@@ -414,17 +622,17 @@ declare const buttonVariants: (props?: ({
414
622
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
415
623
  size?: "default" | "icon" | "sm" | "lg" | null | undefined;
416
624
  } & class_variance_authority_types.ClassProp) | undefined) => string;
417
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
625
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
418
626
  asChild?: boolean;
419
627
  }
420
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
628
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
421
629
 
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> {
630
+ declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
631
+ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
632
+ declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
633
+ declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
634
+ declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
635
+ interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
428
636
  /** Render inline without portal, overlay, or close button (for embedded/inline mode) */
429
637
  hideOverlay?: boolean;
430
638
  /**
@@ -437,30 +645,30 @@ interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof Dialo
437
645
  /** Merged into `DialogOverlay` (e.g. z-index above in-app layers such as deposit toasts). */
438
646
  overlayClassName?: string;
439
647
  }
440
- declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
648
+ declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
441
649
  declare const DialogHeader: {
442
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
650
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
443
651
  displayName: string;
444
652
  };
445
653
  declare const DialogFooter: {
446
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
654
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
447
655
  displayName: string;
448
656
  };
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>;
657
+ declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
658
+ declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
659
+
660
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
661
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
662
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
663
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
664
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
665
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
666
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
667
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
668
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
669
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
670
+
671
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
464
672
  /**
465
673
  * Tooltip wrapper that supports both hover (desktop) and tap-to-toggle (mobile).
466
674
  *
@@ -468,13 +676,13 @@ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
468
676
  * This wrapper adds controlled open state so the trigger's onClick can toggle it,
469
677
  * while preserving the default hover behavior on desktop.
470
678
  */
471
- declare function Tooltip({ children, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
679
+ declare function Tooltip({ children, ...props }: React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
472
680
  /**
473
681
  * Tooltip trigger that adds click-to-toggle for mobile/touch support.
474
682
  * On desktop, hover still works as usual via Radix's built-in behavior.
475
683
  */
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>>;
684
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
685
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
478
686
 
479
687
  /**
480
688
  * Result of the useAllowedCountry hook
@@ -515,6 +723,73 @@ interface AllowedCountryResult {
515
723
  */
516
724
  declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
517
725
 
726
+ interface UseWithdrawPollingOptions {
727
+ userId: string | undefined;
728
+ publishableKey: string;
729
+ depositWalletId?: string;
730
+ enabled?: boolean;
731
+ onWithdrawSuccess?: (data: {
732
+ message: string;
733
+ transaction?: unknown;
734
+ executionId?: string;
735
+ }) => void;
736
+ onWithdrawError?: (error: {
737
+ message: string;
738
+ error?: unknown;
739
+ code?: string;
740
+ }) => void;
741
+ }
742
+ interface UseWithdrawPollingResult {
743
+ executions: AutoSwapResponse[];
744
+ isPolling: boolean;
745
+ }
746
+ declare function useWithdrawPolling({ userId, publishableKey, depositWalletId, enabled, onWithdrawSuccess, onWithdrawError, }: UseWithdrawPollingOptions): UseWithdrawPollingResult;
747
+
748
+ /**
749
+ * Hook to fetch supported destination tokens with caching and deduplication via react-query.
750
+ * Used in the withdraw flow to show available tokens the user can withdraw to.
751
+ *
752
+ * @param publishableKey - Publishable key for API calls
753
+ * @param enabled - Whether to fetch (defaults to true)
754
+ */
755
+ declare function useSupportedDestinationTokens(publishableKey: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<SupportedDestinationTokensResponse, Error>;
756
+
757
+ interface UseVerifyRecipientAddressParams {
758
+ chainType?: string;
759
+ chainId?: string;
760
+ tokenAddress?: string;
761
+ recipientAddress?: string;
762
+ publishableKey: string;
763
+ enabled?: boolean;
764
+ }
765
+ /**
766
+ * Hook to verify a recipient address via React Query.
767
+ * Debounced by the caller — only fires when all params are present and enabled is true.
768
+ * Caches results by the full (chain + token + address) tuple.
769
+ */
770
+ declare function useVerifyRecipientAddress(params: UseVerifyRecipientAddressParams): _tanstack_react_query.UseQueryResult<VerifyAddressResponse, Error>;
771
+
772
+ interface SourceTokenValidationResult {
773
+ isSupported: boolean;
774
+ minimumAmountUsd: number | null;
775
+ estimatedProcessingTime: number | null;
776
+ maxSlippagePercent: number | null;
777
+ priceImpactPercent: number | null;
778
+ errorMessage: string | null;
779
+ }
780
+ /**
781
+ * Hook to validate that a source token is supported for withdrawal
782
+ * by checking it against /supported_deposit_tokens.
783
+ */
784
+ declare function useSourceTokenValidation(params: {
785
+ sourceChainType?: string;
786
+ sourceChainId?: string;
787
+ sourceTokenAddress?: string;
788
+ sourceTokenSymbol?: string;
789
+ publishableKey: string;
790
+ enabled?: boolean;
791
+ }): _tanstack_react_query.UseQueryResult<SourceTokenValidationResult, Error>;
792
+
518
793
  /**
519
794
  * Unifold color palette for React (Web)
520
795
  * Matches the React Native theme colors
@@ -757,7 +1032,7 @@ interface ThemeContextValue {
757
1032
  isDark: boolean;
758
1033
  }
759
1034
  interface ThemeProviderProps {
760
- children: React.ReactNode;
1035
+ children: React$1.ReactNode;
761
1036
  /** Force a specific theme mode, or 'auto' to use system preference */
762
1037
  mode?: ThemeMode | "auto";
763
1038
  /** Simple accent/primary color override (applies to both light and dark) */
@@ -791,4 +1066,4 @@ declare function cn(...inputs: ClassValue[]): string;
791
1066
  */
792
1067
  declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
793
1068
 
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 };
1069
+ 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, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, 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, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };