@unifold/connect-react 0.1.35 → 0.1.36

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/README.md CHANGED
@@ -134,6 +134,7 @@ Launches the deposit modal with the specified configuration. **Returns a Promise
134
134
  | `recipientAddress` | string | ✅ | Recipient wallet address |
135
135
  | `onSuccess` | function | - | Success callback (fired immediately) |
136
136
  | `onError` | function | - | Error callback (fired immediately) |
137
+ | `initialScreen` | `'main' \| 'transfer' \| 'card' \| 'tracker'` | - | `main` (default) = deposit menu. `transfer` / `card` use the **same geo/validation gates** as the menu. `tracker` opens the list **without** those gates. If not `main`, the header **back** is hidden (standalone); from `main`, back returns to the menu. Card quotes/onramp and tracker detail still show back for inner steps. |
137
138
 
138
139
  **Returns:** `Promise<DepositResult>`
139
140
 
@@ -172,6 +173,16 @@ try {
172
173
  console.error('Error:', error);
173
174
  }
174
175
 
176
+ // Standalone Transfer Crypto (geo checks + no back to menu by default)
177
+ await beginDeposit({
178
+ externalUserId: 'user_123',
179
+ destinationChainId: '137',
180
+ destinationTokenAddress: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
181
+ destinationTokenSymbol: 'USDC',
182
+ recipientAddress: '0x606C49ca2Fa4982F07016265040F777eD3DA3160',
183
+ initialScreen: 'transfer',
184
+ });
185
+
175
186
  // Hybrid (promise + callbacks)
176
187
  const depositPromise = beginDeposit({
177
188
  userId: 'user_123',
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, ChainType, DepositConfirmationMode, AllowedCountryResult } from '@unifold/ui-react';
4
- export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, DepositConfirmationMode, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
3
+ import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, DepositModalInitialScreen, ChainType, DepositConfirmationMode, AllowedCountryResult } from '@unifold/ui-react';
4
+ export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
5
5
  export { AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionRequest, OnrampSessionResponse, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SupportedChain, SupportedDepositTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, createDepositAddress, createOnrampSession, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, setApiConfig, useUserIp } from '@unifold/core';
6
6
 
7
7
  interface UnifoldConnectProviderConfig {
@@ -29,6 +29,8 @@ interface UnifoldConnectProviderConfig {
29
29
  fonts?: FontConfig;
30
30
  /** Component-specific token overrides */
31
31
  components?: ComponentConfig;
32
+ /** Default `initialScreen` for `beginDeposit()` when the call omits it */
33
+ defaultInitialScreen?: DepositModalInitialScreen;
32
34
  };
33
35
  }
34
36
  interface DepositResult {
@@ -54,6 +56,13 @@ interface DepositConfig {
54
56
  onError?: (error: DepositError) => void;
55
57
  /** Called when the user dismisses the deposit dialog (X button, Escape key, or programmatic close) */
56
58
  onClose?: () => void;
59
+ /**
60
+ * Which screen opens first: menu (`main`, default), `transfer`, `card`, or `tracker`.
61
+ * `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
62
+ * (deposit history is always reachable). If not `main`, the header back control is hidden (nothing to return to);
63
+ * card quotes/onramp and tracker detail still show back for inner navigation.
64
+ */
65
+ initialScreen?: DepositModalInitialScreen;
57
66
  }
58
67
  declare function UnifoldProvider({ children, publishableKey, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
59
68
  declare function useUnifold(): {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, ChainType, DepositConfirmationMode, AllowedCountryResult } from '@unifold/ui-react';
4
- export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, DepositConfirmationMode, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
3
+ import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, DepositModalInitialScreen, ChainType, DepositConfirmationMode, AllowedCountryResult } from '@unifold/ui-react';
4
+ export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
5
5
  export { AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionRequest, OnrampSessionResponse, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SupportedChain, SupportedDepositTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, createDepositAddress, createOnrampSession, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, setApiConfig, useUserIp } from '@unifold/core';
6
6
 
7
7
  interface UnifoldConnectProviderConfig {
@@ -29,6 +29,8 @@ interface UnifoldConnectProviderConfig {
29
29
  fonts?: FontConfig;
30
30
  /** Component-specific token overrides */
31
31
  components?: ComponentConfig;
32
+ /** Default `initialScreen` for `beginDeposit()` when the call omits it */
33
+ defaultInitialScreen?: DepositModalInitialScreen;
32
34
  };
33
35
  }
34
36
  interface DepositResult {
@@ -54,6 +56,13 @@ interface DepositConfig {
54
56
  onError?: (error: DepositError) => void;
55
57
  /** Called when the user dismisses the deposit dialog (X button, Escape key, or programmatic close) */
56
58
  onClose?: () => void;
59
+ /**
60
+ * Which screen opens first: menu (`main`, default), `transfer`, `card`, or `tracker`.
61
+ * `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
62
+ * (deposit history is always reachable). If not `main`, the header back control is hidden (nothing to return to);
63
+ * card quotes/onramp and tracker detail still show back for inner navigation.
64
+ */
65
+ initialScreen?: DepositModalInitialScreen;
57
66
  }
58
67
  declare function UnifoldProvider({ children, publishableKey, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
59
68
  declare function useUnifold(): {
package/dist/index.js CHANGED
@@ -21337,14 +21337,23 @@ function DepositModal({
21337
21337
  onDepositSuccess,
21338
21338
  onDepositError,
21339
21339
  theme = "dark",
21340
- hideOverlay = false
21340
+ hideOverlay = false,
21341
+ initialScreen = "main"
21341
21342
  }) {
21342
21343
  const { colors: colors2, fonts, components } = useTheme();
21344
+ const effectiveInitialScreen = (0, import_react8.useMemo)(() => {
21345
+ const s = initialScreen ?? "main";
21346
+ if (s === "tracker" && hideDepositTracker) return "main";
21347
+ return s;
21348
+ }, [initialScreen, hideDepositTracker]);
21343
21349
  const [containerEl, setContainerEl] = (0, import_react8.useState)(null);
21344
21350
  const containerCallbackRef = (0, import_react8.useCallback)((el) => {
21345
21351
  setContainerEl(el);
21346
21352
  }, []);
21347
- const [view, setView] = (0, import_react8.useState)("main");
21353
+ const [view, setView] = (0, import_react8.useState)(
21354
+ effectiveInitialScreen
21355
+ );
21356
+ const resetViewTimeoutRef = (0, import_react8.useRef)(null);
21348
21357
  const [cardView, setCardView] = (0, import_react8.useState)(
21349
21358
  "amount"
21350
21359
  );
@@ -21464,6 +21473,43 @@ function DepositModal({
21464
21473
  const template = errors[code] ?? addressValidationMessages.defaultError;
21465
21474
  return interpolate(template, metadata);
21466
21475
  };
21476
+ const openingScreen = effectiveInitialScreen;
21477
+ const sessionOpenedFromMenu = openingScreen === "main";
21478
+ const standaloneNeedsDepositPrereq = openingScreen !== "main" && (view === "transfer" || view === "card");
21479
+ let depositPrerequisiteBody;
21480
+ if (isCountryLoading || isAddressValidationLoading || tokensLoading || walletsLoading || !projectConfig) {
21481
+ depositPrerequisiteBody = standaloneNeedsDepositPrereq ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, { variant: "with-icons" }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
21482
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, { variant: "with-icons" }),
21483
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, { variant: "with-icons" }),
21484
+ !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, {})
21485
+ ] });
21486
+ } else if (countryError) {
21487
+ depositPrerequisiteBody = /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21488
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21489
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
21490
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "We couldn't verify your location. Please check your connection and try again." })
21491
+ ] });
21492
+ } else if (!isAllowed) {
21493
+ depositPrerequisiteBody = /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21494
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21495
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
21496
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
21497
+ ] });
21498
+ } else if (isAddressValid === false) {
21499
+ depositPrerequisiteBody = /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21500
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21501
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
21502
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
21503
+ addressFailureCode,
21504
+ addressFailureMetadata
21505
+ ) })
21506
+ ] });
21507
+ } else {
21508
+ depositPrerequisiteBody = null;
21509
+ }
21510
+ const showBackTransfer = sessionOpenedFromMenu;
21511
+ const showBackCard = cardView !== "amount" || sessionOpenedFromMenu;
21512
+ const showBackTracker = selectedExecution !== null || sessionOpenedFromMenu;
21467
21513
  const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
21468
21514
  const handleWalletDisconnect = () => {
21469
21515
  setUserDisconnectedWallet(true);
@@ -21474,13 +21520,37 @@ function DepositModal({
21474
21520
  };
21475
21521
  const handleClose = () => {
21476
21522
  onOpenChange(false);
21477
- setTimeout(() => {
21478
- setView("main");
21523
+ if (resetViewTimeoutRef.current) {
21524
+ clearTimeout(resetViewTimeoutRef.current);
21525
+ }
21526
+ resetViewTimeoutRef.current = setTimeout(() => {
21527
+ setView(effectiveInitialScreen);
21479
21528
  setCardView("amount");
21480
21529
  setExchangeView("providers");
21481
21530
  setBrowserWalletInfo(null);
21531
+ resetViewTimeoutRef.current = null;
21482
21532
  }, 200);
21483
21533
  };
21534
+ (0, import_react8.useLayoutEffect)(() => {
21535
+ if (!open) return;
21536
+ if (resetViewTimeoutRef.current) {
21537
+ clearTimeout(resetViewTimeoutRef.current);
21538
+ resetViewTimeoutRef.current = null;
21539
+ }
21540
+ setView(effectiveInitialScreen);
21541
+ setCardView("amount");
21542
+ setExchangeView("providers");
21543
+ setBrowserWalletInfo(null);
21544
+ setSelectedExecution(null);
21545
+ }, [open, effectiveInitialScreen]);
21546
+ (0, import_react8.useEffect)(
21547
+ () => () => {
21548
+ if (resetViewTimeoutRef.current) {
21549
+ clearTimeout(resetViewTimeoutRef.current);
21550
+ }
21551
+ },
21552
+ []
21553
+ );
21484
21554
  const handleBack = () => {
21485
21555
  if (view === "card" && cardView === "quotes") {
21486
21556
  setCardView("amount");
@@ -21593,95 +21663,64 @@ function DepositModal({
21593
21663
  publishableKey
21594
21664
  }
21595
21665
  ),
21596
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: isCountryLoading || isAddressValidationLoading || tokensLoading || walletsLoading || !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
21597
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, { variant: "with-icons" }),
21598
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, { variant: "with-icons" }),
21599
- !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SkeletonButton, {})
21600
- ] }) : countryError ? (
21601
- /* Error state - couldn't verify location */
21602
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21603
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21604
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
21605
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "We couldn't verify your location. Please check your connection and try again." })
21606
- ] })
21607
- ) : !isAllowed ? (
21608
- /* Blocked country state (isAllowed is false or null without error) */
21609
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21610
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21611
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
21612
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
21613
- ] })
21614
- ) : isAddressValid === false ? (
21615
- /* Invalid recipient address state (e.g., Algorand not opted in) */
21616
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21617
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21618
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
21619
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
21620
- addressFailureCode,
21621
- addressFailureMetadata
21622
- ) })
21623
- ] })
21624
- ) : (
21625
- /* Normal deposit options */
21626
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
21627
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21628
- TransferCryptoButton,
21629
- {
21630
- onClick: () => setView("transfer"),
21631
- title: t6.transferCrypto.title,
21632
- subtitle: t6.transferCrypto.subtitle,
21633
- featuredTokens: projectConfig.transfer_crypto.networks
21634
- }
21635
- ),
21636
- enableConnectWallet && !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21637
- BrowserWalletButton,
21638
- {
21639
- onClick: handleBrowserWalletClick,
21640
- onConnectClick: handleWalletConnectClick,
21641
- onDisconnect: handleWalletDisconnect,
21642
- chainType: browserWalletChainType,
21643
- publishableKey
21644
- }
21645
- ),
21646
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21647
- DepositWithCardButton,
21648
- {
21649
- onClick: () => setView("card"),
21650
- title: t6.depositWithCard.title,
21651
- subtitle: t6.depositWithCard.subtitle,
21652
- paymentNetworks: projectConfig.payment_networks.networks
21653
- }
21654
- ),
21655
- showPayWithExchange && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21656
- PayWithExchangeButton,
21657
- {
21658
- onClick: () => setView("exchange"),
21659
- title: t6.payWithExchange.title,
21660
- subtitle: t6.payWithExchange.subtitle,
21661
- exchanges,
21662
- loading: exchangesLoading
21663
- }
21664
- ),
21665
- !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21666
- DepositTrackerButton,
21667
- {
21668
- onClick: () => {
21669
- setAllExecutions(depositExecutions);
21670
- setView("tracker");
21671
- },
21672
- title: "Deposit Tracker",
21673
- subtitle: "Track your deposit progress",
21674
- badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
21675
- }
21676
- )
21677
- ] })
21678
- ) })
21666
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody ?? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
21667
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21668
+ TransferCryptoButton,
21669
+ {
21670
+ onClick: () => setView("transfer"),
21671
+ title: t6.transferCrypto.title,
21672
+ subtitle: t6.transferCrypto.subtitle,
21673
+ featuredTokens: projectConfig?.transfer_crypto.networks
21674
+ }
21675
+ ),
21676
+ enableConnectWallet && !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21677
+ BrowserWalletButton,
21678
+ {
21679
+ onClick: handleBrowserWalletClick,
21680
+ onConnectClick: handleWalletConnectClick,
21681
+ onDisconnect: handleWalletDisconnect,
21682
+ chainType: browserWalletChainType,
21683
+ publishableKey
21684
+ }
21685
+ ),
21686
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21687
+ DepositWithCardButton,
21688
+ {
21689
+ onClick: () => setView("card"),
21690
+ title: t6.depositWithCard.title,
21691
+ subtitle: t6.depositWithCard.subtitle,
21692
+ paymentNetworks: projectConfig?.payment_networks.networks
21693
+ }
21694
+ ),
21695
+ showPayWithExchange && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21696
+ PayWithExchangeButton,
21697
+ {
21698
+ onClick: () => setView("exchange"),
21699
+ title: t6.payWithExchange.title,
21700
+ subtitle: t6.payWithExchange.subtitle,
21701
+ exchanges,
21702
+ loading: exchangesLoading
21703
+ }
21704
+ ),
21705
+ !hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21706
+ DepositTrackerButton,
21707
+ {
21708
+ onClick: () => {
21709
+ setAllExecutions(depositExecutions);
21710
+ setView("tracker");
21711
+ },
21712
+ title: "Deposit Tracker",
21713
+ subtitle: "Track your deposit progress",
21714
+ badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
21715
+ }
21716
+ )
21717
+ ] }) })
21679
21718
  ] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
21680
21719
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21681
21720
  DepositHeader,
21682
21721
  {
21683
21722
  title: t6.transferCrypto.title,
21684
- showBack: true,
21723
+ showBack: showBackTransfer,
21685
21724
  onBack: handleBack,
21686
21725
  onClose: handleClose,
21687
21726
  showBalance: showBalanceHeader,
@@ -21693,7 +21732,7 @@ function DepositModal({
21693
21732
  publishableKey
21694
21733
  }
21695
21734
  ),
21696
- transferInputVariant === "single_input" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21735
+ standaloneNeedsDepositPrereq && depositPrerequisiteBody !== null ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody }) : transferInputVariant === "single_input" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21697
21736
  TransferCryptoSingleInput,
21698
21737
  {
21699
21738
  userId,
@@ -21729,7 +21768,7 @@ function DepositModal({
21729
21768
  DepositHeader,
21730
21769
  {
21731
21770
  title: selectedExecution ? "Deposit Details" : "Deposit Tracker",
21732
- showBack: true,
21771
+ showBack: showBackTracker,
21733
21772
  onBack: handleBack,
21734
21773
  onClose: handleClose
21735
21774
  }
@@ -21754,7 +21793,7 @@ function DepositModal({
21754
21793
  DepositHeader,
21755
21794
  {
21756
21795
  title: cardView === "quotes" ? t6.quotes : t6.depositWithCard.title,
21757
- showBack: true,
21796
+ showBack: showBackCard,
21758
21797
  onBack: handleBack,
21759
21798
  onClose: handleClose,
21760
21799
  badge: cardView === "quotes" ? { count: quotesCount } : void 0,
@@ -21767,7 +21806,7 @@ function DepositModal({
21767
21806
  publishableKey
21768
21807
  }
21769
21808
  ),
21770
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21809
+ standaloneNeedsDepositPrereq && depositPrerequisiteBody !== null ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
21771
21810
  BuyWithCard,
21772
21811
  {
21773
21812
  userId,
@@ -22060,7 +22099,8 @@ function UnifoldProvider2({
22060
22099
  enablePayWithExchange: config?.enablePayWithExchange,
22061
22100
  onDepositSuccess: handleDepositSuccess,
22062
22101
  onDepositError: handleDepositError,
22063
- theme: resolvedTheme
22102
+ theme: resolvedTheme,
22103
+ initialScreen: depositConfig.initialScreen ?? config?.defaultInitialScreen
22064
22104
  }
22065
22105
  )
22066
22106
  ]
package/dist/index.mjs CHANGED
@@ -1218,7 +1218,14 @@ function useUnifold() {
1218
1218
  }
1219
1219
 
1220
1220
  // ../ui-react/dist/index.mjs
1221
- import { useState as useState26, useEffect as useEffect20, useCallback as useCallback32 } from "react";
1221
+ import {
1222
+ useState as useState26,
1223
+ useEffect as useEffect20,
1224
+ useLayoutEffect as useLayoutEffect22,
1225
+ useCallback as useCallback32,
1226
+ useRef as useRef52,
1227
+ useMemo as useMemo82
1228
+ } from "react";
1222
1229
 
1223
1230
  // ../../node_modules/.pnpm/lucide-react@0.454.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
1224
1231
  import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
@@ -21312,14 +21319,23 @@ function DepositModal({
21312
21319
  onDepositSuccess,
21313
21320
  onDepositError,
21314
21321
  theme = "dark",
21315
- hideOverlay = false
21322
+ hideOverlay = false,
21323
+ initialScreen = "main"
21316
21324
  }) {
21317
21325
  const { colors: colors2, fonts, components } = useTheme();
21326
+ const effectiveInitialScreen = useMemo82(() => {
21327
+ const s = initialScreen ?? "main";
21328
+ if (s === "tracker" && hideDepositTracker) return "main";
21329
+ return s;
21330
+ }, [initialScreen, hideDepositTracker]);
21318
21331
  const [containerEl, setContainerEl] = useState26(null);
21319
21332
  const containerCallbackRef = useCallback32((el) => {
21320
21333
  setContainerEl(el);
21321
21334
  }, []);
21322
- const [view, setView] = useState26("main");
21335
+ const [view, setView] = useState26(
21336
+ effectiveInitialScreen
21337
+ );
21338
+ const resetViewTimeoutRef = useRef52(null);
21323
21339
  const [cardView, setCardView] = useState26(
21324
21340
  "amount"
21325
21341
  );
@@ -21439,6 +21455,43 @@ function DepositModal({
21439
21455
  const template = errors[code] ?? addressValidationMessages.defaultError;
21440
21456
  return interpolate(template, metadata);
21441
21457
  };
21458
+ const openingScreen = effectiveInitialScreen;
21459
+ const sessionOpenedFromMenu = openingScreen === "main";
21460
+ const standaloneNeedsDepositPrereq = openingScreen !== "main" && (view === "transfer" || view === "card");
21461
+ let depositPrerequisiteBody;
21462
+ if (isCountryLoading || isAddressValidationLoading || tokensLoading || walletsLoading || !projectConfig) {
21463
+ depositPrerequisiteBody = standaloneNeedsDepositPrereq ? /* @__PURE__ */ jsx48(SkeletonButton, { variant: "with-icons" }) : /* @__PURE__ */ jsxs43(Fragment11, { children: [
21464
+ /* @__PURE__ */ jsx48(SkeletonButton, { variant: "with-icons" }),
21465
+ /* @__PURE__ */ jsx48(SkeletonButton, { variant: "with-icons" }),
21466
+ !hideDepositTracker && /* @__PURE__ */ jsx48(SkeletonButton, {})
21467
+ ] });
21468
+ } else if (countryError) {
21469
+ depositPrerequisiteBody = /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21470
+ /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21471
+ /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
21472
+ /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "We couldn't verify your location. Please check your connection and try again." })
21473
+ ] });
21474
+ } else if (!isAllowed) {
21475
+ depositPrerequisiteBody = /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21476
+ /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21477
+ /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
21478
+ /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
21479
+ ] });
21480
+ } else if (isAddressValid === false) {
21481
+ depositPrerequisiteBody = /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21482
+ /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21483
+ /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
21484
+ /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
21485
+ addressFailureCode,
21486
+ addressFailureMetadata
21487
+ ) })
21488
+ ] });
21489
+ } else {
21490
+ depositPrerequisiteBody = null;
21491
+ }
21492
+ const showBackTransfer = sessionOpenedFromMenu;
21493
+ const showBackCard = cardView !== "amount" || sessionOpenedFromMenu;
21494
+ const showBackTracker = selectedExecution !== null || sessionOpenedFromMenu;
21442
21495
  const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
21443
21496
  const handleWalletDisconnect = () => {
21444
21497
  setUserDisconnectedWallet(true);
@@ -21449,13 +21502,37 @@ function DepositModal({
21449
21502
  };
21450
21503
  const handleClose = () => {
21451
21504
  onOpenChange(false);
21452
- setTimeout(() => {
21453
- setView("main");
21505
+ if (resetViewTimeoutRef.current) {
21506
+ clearTimeout(resetViewTimeoutRef.current);
21507
+ }
21508
+ resetViewTimeoutRef.current = setTimeout(() => {
21509
+ setView(effectiveInitialScreen);
21454
21510
  setCardView("amount");
21455
21511
  setExchangeView("providers");
21456
21512
  setBrowserWalletInfo(null);
21513
+ resetViewTimeoutRef.current = null;
21457
21514
  }, 200);
21458
21515
  };
21516
+ useLayoutEffect22(() => {
21517
+ if (!open) return;
21518
+ if (resetViewTimeoutRef.current) {
21519
+ clearTimeout(resetViewTimeoutRef.current);
21520
+ resetViewTimeoutRef.current = null;
21521
+ }
21522
+ setView(effectiveInitialScreen);
21523
+ setCardView("amount");
21524
+ setExchangeView("providers");
21525
+ setBrowserWalletInfo(null);
21526
+ setSelectedExecution(null);
21527
+ }, [open, effectiveInitialScreen]);
21528
+ useEffect20(
21529
+ () => () => {
21530
+ if (resetViewTimeoutRef.current) {
21531
+ clearTimeout(resetViewTimeoutRef.current);
21532
+ }
21533
+ },
21534
+ []
21535
+ );
21459
21536
  const handleBack = () => {
21460
21537
  if (view === "card" && cardView === "quotes") {
21461
21538
  setCardView("amount");
@@ -21568,95 +21645,64 @@ function DepositModal({
21568
21645
  publishableKey
21569
21646
  }
21570
21647
  ),
21571
- /* @__PURE__ */ jsx48("div", { className: "uf-pb-4 uf-space-y-3", children: isCountryLoading || isAddressValidationLoading || tokensLoading || walletsLoading || !projectConfig ? /* @__PURE__ */ jsxs43(Fragment11, { children: [
21572
- /* @__PURE__ */ jsx48(SkeletonButton, { variant: "with-icons" }),
21573
- /* @__PURE__ */ jsx48(SkeletonButton, { variant: "with-icons" }),
21574
- !hideDepositTracker && /* @__PURE__ */ jsx48(SkeletonButton, {})
21575
- ] }) : countryError ? (
21576
- /* Error state - couldn't verify location */
21577
- /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21578
- /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21579
- /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "Unable to Verify Location" }),
21580
- /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "We couldn't verify your location. Please check your connection and try again." })
21581
- ] })
21582
- ) : !isAllowed ? (
21583
- /* Blocked country state (isAllowed is false or null without error) */
21584
- /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21585
- /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(MapPinOff, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21586
- /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: "No Tokens Available" }),
21587
- /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: "There are no supported tokens available from your current location." })
21588
- ] })
21589
- ) : isAddressValid === false ? (
21590
- /* Invalid recipient address state (e.g., Algorand not opted in) */
21591
- /* @__PURE__ */ jsxs43("div", { className: "uf-flex uf-flex-col uf-items-center uf-justify-center uf-py-8 uf-px-4 uf-text-center", children: [
21592
- /* @__PURE__ */ jsx48("div", { className: "uf-w-16 uf-h-16 uf-rounded-full uf-bg-muted uf-flex uf-items-center uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsx48(TriangleAlert, { className: "uf-w-8 uf-h-8 uf-text-muted-foreground" }) }),
21593
- /* @__PURE__ */ jsx48("h3", { className: "uf-text-lg uf-font-semibold uf-text-foreground uf-mb-2", children: addressValidationMessages.unableToReceiveFunds }),
21594
- /* @__PURE__ */ jsx48("p", { className: "uf-text-sm uf-text-muted-foreground uf-max-w-[280px]", children: getAddressValidationErrorMessage(
21595
- addressFailureCode,
21596
- addressFailureMetadata
21597
- ) })
21598
- ] })
21599
- ) : (
21600
- /* Normal deposit options */
21601
- /* @__PURE__ */ jsxs43(Fragment11, { children: [
21602
- /* @__PURE__ */ jsx48(
21603
- TransferCryptoButton,
21604
- {
21605
- onClick: () => setView("transfer"),
21606
- title: t6.transferCrypto.title,
21607
- subtitle: t6.transferCrypto.subtitle,
21608
- featuredTokens: projectConfig.transfer_crypto.networks
21609
- }
21610
- ),
21611
- enableConnectWallet && !isMobileView && /* @__PURE__ */ jsx48(
21612
- BrowserWalletButton,
21613
- {
21614
- onClick: handleBrowserWalletClick,
21615
- onConnectClick: handleWalletConnectClick,
21616
- onDisconnect: handleWalletDisconnect,
21617
- chainType: browserWalletChainType,
21618
- publishableKey
21619
- }
21620
- ),
21621
- /* @__PURE__ */ jsx48(
21622
- DepositWithCardButton,
21623
- {
21624
- onClick: () => setView("card"),
21625
- title: t6.depositWithCard.title,
21626
- subtitle: t6.depositWithCard.subtitle,
21627
- paymentNetworks: projectConfig.payment_networks.networks
21628
- }
21629
- ),
21630
- showPayWithExchange && /* @__PURE__ */ jsx48(
21631
- PayWithExchangeButton,
21632
- {
21633
- onClick: () => setView("exchange"),
21634
- title: t6.payWithExchange.title,
21635
- subtitle: t6.payWithExchange.subtitle,
21636
- exchanges,
21637
- loading: exchangesLoading
21638
- }
21639
- ),
21640
- !hideDepositTracker && /* @__PURE__ */ jsx48(
21641
- DepositTrackerButton,
21642
- {
21643
- onClick: () => {
21644
- setAllExecutions(depositExecutions);
21645
- setView("tracker");
21646
- },
21647
- title: "Deposit Tracker",
21648
- subtitle: "Track your deposit progress",
21649
- badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
21650
- }
21651
- )
21652
- ] })
21653
- ) })
21648
+ /* @__PURE__ */ jsx48("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody ?? /* @__PURE__ */ jsxs43(Fragment11, { children: [
21649
+ /* @__PURE__ */ jsx48(
21650
+ TransferCryptoButton,
21651
+ {
21652
+ onClick: () => setView("transfer"),
21653
+ title: t6.transferCrypto.title,
21654
+ subtitle: t6.transferCrypto.subtitle,
21655
+ featuredTokens: projectConfig?.transfer_crypto.networks
21656
+ }
21657
+ ),
21658
+ enableConnectWallet && !isMobileView && /* @__PURE__ */ jsx48(
21659
+ BrowserWalletButton,
21660
+ {
21661
+ onClick: handleBrowserWalletClick,
21662
+ onConnectClick: handleWalletConnectClick,
21663
+ onDisconnect: handleWalletDisconnect,
21664
+ chainType: browserWalletChainType,
21665
+ publishableKey
21666
+ }
21667
+ ),
21668
+ /* @__PURE__ */ jsx48(
21669
+ DepositWithCardButton,
21670
+ {
21671
+ onClick: () => setView("card"),
21672
+ title: t6.depositWithCard.title,
21673
+ subtitle: t6.depositWithCard.subtitle,
21674
+ paymentNetworks: projectConfig?.payment_networks.networks
21675
+ }
21676
+ ),
21677
+ showPayWithExchange && /* @__PURE__ */ jsx48(
21678
+ PayWithExchangeButton,
21679
+ {
21680
+ onClick: () => setView("exchange"),
21681
+ title: t6.payWithExchange.title,
21682
+ subtitle: t6.payWithExchange.subtitle,
21683
+ exchanges,
21684
+ loading: exchangesLoading
21685
+ }
21686
+ ),
21687
+ !hideDepositTracker && /* @__PURE__ */ jsx48(
21688
+ DepositTrackerButton,
21689
+ {
21690
+ onClick: () => {
21691
+ setAllExecutions(depositExecutions);
21692
+ setView("tracker");
21693
+ },
21694
+ title: "Deposit Tracker",
21695
+ subtitle: "Track your deposit progress",
21696
+ badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
21697
+ }
21698
+ )
21699
+ ] }) })
21654
21700
  ] }) : view === "transfer" ? /* @__PURE__ */ jsxs43(Fragment11, { children: [
21655
21701
  /* @__PURE__ */ jsx48(
21656
21702
  DepositHeader,
21657
21703
  {
21658
21704
  title: t6.transferCrypto.title,
21659
- showBack: true,
21705
+ showBack: showBackTransfer,
21660
21706
  onBack: handleBack,
21661
21707
  onClose: handleClose,
21662
21708
  showBalance: showBalanceHeader,
@@ -21668,7 +21714,7 @@ function DepositModal({
21668
21714
  publishableKey
21669
21715
  }
21670
21716
  ),
21671
- transferInputVariant === "single_input" ? /* @__PURE__ */ jsx48(
21717
+ standaloneNeedsDepositPrereq && depositPrerequisiteBody !== null ? /* @__PURE__ */ jsx48("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody }) : transferInputVariant === "single_input" ? /* @__PURE__ */ jsx48(
21672
21718
  TransferCryptoSingleInput,
21673
21719
  {
21674
21720
  userId,
@@ -21704,7 +21750,7 @@ function DepositModal({
21704
21750
  DepositHeader,
21705
21751
  {
21706
21752
  title: selectedExecution ? "Deposit Details" : "Deposit Tracker",
21707
- showBack: true,
21753
+ showBack: showBackTracker,
21708
21754
  onBack: handleBack,
21709
21755
  onClose: handleClose
21710
21756
  }
@@ -21729,7 +21775,7 @@ function DepositModal({
21729
21775
  DepositHeader,
21730
21776
  {
21731
21777
  title: cardView === "quotes" ? t6.quotes : t6.depositWithCard.title,
21732
- showBack: true,
21778
+ showBack: showBackCard,
21733
21779
  onBack: handleBack,
21734
21780
  onClose: handleClose,
21735
21781
  badge: cardView === "quotes" ? { count: quotesCount } : void 0,
@@ -21742,7 +21788,7 @@ function DepositModal({
21742
21788
  publishableKey
21743
21789
  }
21744
21790
  ),
21745
- /* @__PURE__ */ jsx48(
21791
+ standaloneNeedsDepositPrereq && depositPrerequisiteBody !== null ? /* @__PURE__ */ jsx48("div", { className: "uf-pb-4 uf-space-y-3", children: depositPrerequisiteBody }) : /* @__PURE__ */ jsx48(
21746
21792
  BuyWithCard,
21747
21793
  {
21748
21794
  userId,
@@ -22035,7 +22081,8 @@ function UnifoldProvider2({
22035
22081
  enablePayWithExchange: config?.enablePayWithExchange,
22036
22082
  onDepositSuccess: handleDepositSuccess,
22037
22083
  onDepositError: handleDepositError,
22038
- theme: resolvedTheme
22084
+ theme: resolvedTheme,
22085
+ initialScreen: depositConfig.initialScreen ?? config?.defaultInitialScreen
22039
22086
  }
22040
22087
  )
22041
22088
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/connect-react",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "description": "Unifold Connect React - Complete React SDK with UI components for crypto deposits",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@tanstack/react-query": "^5.90.11",
34
- "@unifold/core": "0.1.35",
35
- "@unifold/ui-react": "0.1.35",
36
- "@unifold/react-provider": "0.1.35"
34
+ "@unifold/core": "0.1.36",
35
+ "@unifold/ui-react": "0.1.36",
36
+ "@unifold/react-provider": "0.1.36"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^19.0.0",