@unifold/ui-react 0.1.61 → 0.1.63

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
@@ -131,7 +131,7 @@ interface EvmWalletProvider {
131
131
  removeListener?(event: string, callback: (...args: unknown[]) => void): void;
132
132
  }
133
133
 
134
- type DepositModalInitialScreen = "main" | "transfer" | "card" | "cashapp" | "tracker";
134
+ type DepositModalInitialScreen = "main" | "transfer" | "card" | "cashapp" | "tracker" | "pay_with_exchange" | "exchange_connect" | "wallet_connect";
135
135
  interface DepositModalProps {
136
136
  open: boolean;
137
137
  onOpenChange: (open: boolean) => void;
@@ -160,9 +160,9 @@ interface DepositModalProps {
160
160
  */
161
161
  contractCalls?: EvmContractCall[];
162
162
  /**
163
- * Pre-select source token/chain in the Transfer Crypto view.
163
+ * Prefer a source token/chain in Transfer Crypto, Wallet Connect, and Connect Exchange flows.
164
164
  * All four props are optional. To match, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
165
- * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
165
+ * If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
166
166
  */
167
167
  defaultSourceChainType?: ChainType;
168
168
  /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
@@ -171,6 +171,7 @@ interface DepositModalProps {
171
171
  defaultSourceTokenAddress?: string;
172
172
  /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
173
173
  defaultSourceSymbol?: string;
174
+ /** Hide the "Deposit Tracker" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false (shown). */
174
175
  hideDepositTracker?: boolean;
175
176
  /** Show balance in deposit modal header. Defaults to false */
176
177
  showBalanceHeader?: boolean;
@@ -182,20 +183,22 @@ interface DepositModalProps {
182
183
  * - "manual": User must click "I've made the deposit" to start polling
183
184
  */
184
185
  depositConfirmationMode?: DepositConfirmationMode;
185
- /** Enable browser wallet connection option. Defaults to false */
186
+ /** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
187
+ enableTransferCrypto?: boolean;
188
+ /** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
186
189
  enableConnectWallet?: boolean;
187
190
  /**
188
191
  * Connect Wallet → Enter amount: percentage chips (10%, 25%, 50%, 75%, MAX) from USD balance, or fixed USD ($25…).
189
192
  * @default "percentage"
190
193
  */
191
194
  browserWalletAmountQuickSelect?: BrowserWalletAmountQuickSelect;
192
- /** Enable "Pay with Exchange" option. Overrides dashboard default. Defaults to dashboard value or true. */
195
+ /** Enable "Pay with Exchange" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
193
196
  enablePayWithExchange?: boolean;
194
- /** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Defaults to dashboard value or true. */
197
+ /** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
195
198
  enableFiatOnramp?: boolean;
196
- /** Enable "Connect Exchange" option for direct Coinbase Connect integration. Defaults to false. */
199
+ /** Enable "Connect Exchange" option for direct Coinbase Connect integration. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
197
200
  enableConnectExchange?: boolean;
198
- /** Enable "Pay with Cash App" option. Defaults to false. */
201
+ /** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
199
202
  enableCashApp?: boolean;
200
203
  /** Deposit with Card — onramp step: hide the You use / You buy / You receive card. @default false */
201
204
  hideDepositFlowInfo?: boolean;
@@ -218,7 +221,7 @@ interface DepositModalProps {
218
221
  /** First screen when the modal opens. Default `main` (deposit menu). */
219
222
  initialScreen?: DepositModalInitialScreen;
220
223
  }
221
- declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
224
+ declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
222
225
 
223
226
  interface DepositHeaderProps {
224
227
  title: string;
@@ -485,9 +488,15 @@ interface CoinbaseConnectProps {
485
488
  onBack?: () => void;
486
489
  onDisconnect?: () => void;
487
490
  skipToHoldings?: boolean;
491
+ /** Whether back navigation from the root view is available (false when opened as a standalone initial screen). */
492
+ canGoBack?: boolean;
488
493
  onExecutionsChange?: (executions: AutoSwapResponse[]) => void;
494
+ defaultSourceChainType?: ChainType;
495
+ defaultSourceChainId?: string;
496
+ defaultSourceTokenAddress?: string;
497
+ defaultSourceSymbol?: string;
489
498
  }
490
- declare function CoinbaseConnect({ publishableKey, userId, wallets, recipientAddress, destinationTokenAddress, destinationChainId, destinationChainType, onTransferSuccess, onTransferError, onClose, onBack: parentOnBack, onDisconnect, skipToHoldings, onExecutionsChange, }: CoinbaseConnectProps): react_jsx_runtime.JSX.Element | null;
499
+ declare function CoinbaseConnect({ publishableKey, userId, wallets, recipientAddress, destinationTokenAddress, destinationChainId, destinationChainType, onTransferSuccess, onTransferError, onClose, onBack: parentOnBack, onDisconnect, skipToHoldings, canGoBack, onExecutionsChange, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, }: CoinbaseConnectProps): react_jsx_runtime.JSX.Element | null;
491
500
  declare namespace CoinbaseConnect {
492
501
  var displayName: string;
493
502
  }
@@ -546,12 +555,14 @@ interface CheckoutModalProps {
546
555
  clientSecret: string;
547
556
  publishableKey: string;
548
557
  modalTitle?: string;
549
- /** Enable browser wallet connection option. Defaults to false */
558
+ /** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
559
+ enableTransferCrypto?: boolean;
560
+ /** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
550
561
  enableConnectWallet?: boolean;
551
562
  /**
552
- * Pre-select source token/chain in the Transfer Crypto view.
563
+ * Prefer a source token/chain in Transfer Crypto and Wallet Connect flows.
553
564
  * All four props are optional. To match, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
554
- * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
565
+ * If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
555
566
  */
556
567
  defaultSourceChainType?: ChainType;
557
568
  /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
@@ -571,7 +582,7 @@ interface CheckoutModalProps {
571
582
  code?: string;
572
583
  }) => void;
573
584
  }
574
- declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
585
+ declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
575
586
 
576
587
  interface WithdrawTransactionInfo {
577
588
  /** Source (sending) chain type */
package/dist/index.d.ts CHANGED
@@ -131,7 +131,7 @@ interface EvmWalletProvider {
131
131
  removeListener?(event: string, callback: (...args: unknown[]) => void): void;
132
132
  }
133
133
 
134
- type DepositModalInitialScreen = "main" | "transfer" | "card" | "cashapp" | "tracker";
134
+ type DepositModalInitialScreen = "main" | "transfer" | "card" | "cashapp" | "tracker" | "pay_with_exchange" | "exchange_connect" | "wallet_connect";
135
135
  interface DepositModalProps {
136
136
  open: boolean;
137
137
  onOpenChange: (open: boolean) => void;
@@ -160,9 +160,9 @@ interface DepositModalProps {
160
160
  */
161
161
  contractCalls?: EvmContractCall[];
162
162
  /**
163
- * Pre-select source token/chain in the Transfer Crypto view.
163
+ * Prefer a source token/chain in Transfer Crypto, Wallet Connect, and Connect Exchange flows.
164
164
  * All four props are optional. To match, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
165
- * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
165
+ * If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
166
166
  */
167
167
  defaultSourceChainType?: ChainType;
168
168
  /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
@@ -171,6 +171,7 @@ interface DepositModalProps {
171
171
  defaultSourceTokenAddress?: string;
172
172
  /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
173
173
  defaultSourceSymbol?: string;
174
+ /** Hide the "Deposit Tracker" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false (shown). */
174
175
  hideDepositTracker?: boolean;
175
176
  /** Show balance in deposit modal header. Defaults to false */
176
177
  showBalanceHeader?: boolean;
@@ -182,20 +183,22 @@ interface DepositModalProps {
182
183
  * - "manual": User must click "I've made the deposit" to start polling
183
184
  */
184
185
  depositConfirmationMode?: DepositConfirmationMode;
185
- /** Enable browser wallet connection option. Defaults to false */
186
+ /** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
187
+ enableTransferCrypto?: boolean;
188
+ /** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
186
189
  enableConnectWallet?: boolean;
187
190
  /**
188
191
  * Connect Wallet → Enter amount: percentage chips (10%, 25%, 50%, 75%, MAX) from USD balance, or fixed USD ($25…).
189
192
  * @default "percentage"
190
193
  */
191
194
  browserWalletAmountQuickSelect?: BrowserWalletAmountQuickSelect;
192
- /** Enable "Pay with Exchange" option. Overrides dashboard default. Defaults to dashboard value or true. */
195
+ /** Enable "Pay with Exchange" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
193
196
  enablePayWithExchange?: boolean;
194
- /** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Defaults to dashboard value or true. */
197
+ /** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
195
198
  enableFiatOnramp?: boolean;
196
- /** Enable "Connect Exchange" option for direct Coinbase Connect integration. Defaults to false. */
199
+ /** Enable "Connect Exchange" option for direct Coinbase Connect integration. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
197
200
  enableConnectExchange?: boolean;
198
- /** Enable "Pay with Cash App" option. Defaults to false. */
201
+ /** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
199
202
  enableCashApp?: boolean;
200
203
  /** Deposit with Card — onramp step: hide the You use / You buy / You receive card. @default false */
201
204
  hideDepositFlowInfo?: boolean;
@@ -218,7 +221,7 @@ interface DepositModalProps {
218
221
  /** First screen when the modal opens. Default `main` (deposit menu). */
219
222
  initialScreen?: DepositModalInitialScreen;
220
223
  }
221
- declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
224
+ declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
222
225
 
223
226
  interface DepositHeaderProps {
224
227
  title: string;
@@ -485,9 +488,15 @@ interface CoinbaseConnectProps {
485
488
  onBack?: () => void;
486
489
  onDisconnect?: () => void;
487
490
  skipToHoldings?: boolean;
491
+ /** Whether back navigation from the root view is available (false when opened as a standalone initial screen). */
492
+ canGoBack?: boolean;
488
493
  onExecutionsChange?: (executions: AutoSwapResponse[]) => void;
494
+ defaultSourceChainType?: ChainType;
495
+ defaultSourceChainId?: string;
496
+ defaultSourceTokenAddress?: string;
497
+ defaultSourceSymbol?: string;
489
498
  }
490
- declare function CoinbaseConnect({ publishableKey, userId, wallets, recipientAddress, destinationTokenAddress, destinationChainId, destinationChainType, onTransferSuccess, onTransferError, onClose, onBack: parentOnBack, onDisconnect, skipToHoldings, onExecutionsChange, }: CoinbaseConnectProps): react_jsx_runtime.JSX.Element | null;
499
+ declare function CoinbaseConnect({ publishableKey, userId, wallets, recipientAddress, destinationTokenAddress, destinationChainId, destinationChainType, onTransferSuccess, onTransferError, onClose, onBack: parentOnBack, onDisconnect, skipToHoldings, canGoBack, onExecutionsChange, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, }: CoinbaseConnectProps): react_jsx_runtime.JSX.Element | null;
491
500
  declare namespace CoinbaseConnect {
492
501
  var displayName: string;
493
502
  }
@@ -546,12 +555,14 @@ interface CheckoutModalProps {
546
555
  clientSecret: string;
547
556
  publishableKey: string;
548
557
  modalTitle?: string;
549
- /** Enable browser wallet connection option. Defaults to false */
558
+ /** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
559
+ enableTransferCrypto?: boolean;
560
+ /** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
550
561
  enableConnectWallet?: boolean;
551
562
  /**
552
- * Pre-select source token/chain in the Transfer Crypto view.
563
+ * Prefer a source token/chain in Transfer Crypto and Wallet Connect flows.
553
564
  * All four props are optional. To match, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
554
- * If omitted or no match is found in `/supported_deposit_tokens`, the first available token and chain are used.
565
+ * If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
555
566
  */
556
567
  defaultSourceChainType?: ChainType;
557
568
  /** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
@@ -571,7 +582,7 @@ interface CheckoutModalProps {
571
582
  code?: string;
572
583
  }) => void;
573
584
  }
574
- declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
585
+ declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
575
586
 
576
587
  interface WithdrawTransactionInfo {
577
588
  /** Source (sending) chain type */