@unifold/connect-react 0.1.52 → 0.1.54

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,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
+ import { QueryClient } from '@tanstack/react-query';
3
4
  import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, DepositModalInitialScreen, ChainType, DepositConfirmationMode, WithdrawTransactionInfo, AllowedCountryResult } from '@unifold/ui-react';
4
5
  export { AllowedCountryResult, BrowserWalletAmountQuickSelect, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ConfirmingView, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
5
6
  import { DepositEvent } from '@unifold/core';
@@ -7,6 +8,15 @@ export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDeposit
7
8
 
8
9
  interface UnifoldConnectProviderConfig {
9
10
  publishableKey: string;
11
+ /**
12
+ * Bring your own TanStack QueryClient. When provided, UnifoldProvider will
13
+ * use this client instead of creating its own, and will not add a
14
+ * QueryClientProvider wrapper (it assumes one already exists in the tree).
15
+ *
16
+ * This avoids shadowing the host app's QueryClient and lets Unifold hooks
17
+ * share the same cache, devtools, and default options as the rest of the app.
18
+ */
19
+ queryClient?: QueryClient;
10
20
  config?: {
11
21
  modalTitle?: string;
12
22
  /** Custom title for the withdraw modal. @default `"Withdraw"` */
@@ -178,7 +188,7 @@ interface WithdrawConfig {
178
188
  onClose?: () => void;
179
189
  }
180
190
 
181
- declare function UnifoldProvider({ children, publishableKey, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
191
+ declare function UnifoldProvider({ children, publishableKey, queryClient, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
182
192
  declare function useUnifold(): {
183
193
  publishableKey: string;
184
194
  beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
+ import { QueryClient } from '@tanstack/react-query';
3
4
  import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, DepositModalInitialScreen, ChainType, DepositConfirmationMode, WithdrawTransactionInfo, AllowedCountryResult } from '@unifold/ui-react';
4
5
  export { AllowedCountryResult, BrowserWalletAmountQuickSelect, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ConfirmingView, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
5
6
  import { DepositEvent } from '@unifold/core';
@@ -7,6 +8,15 @@ export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDeposit
7
8
 
8
9
  interface UnifoldConnectProviderConfig {
9
10
  publishableKey: string;
11
+ /**
12
+ * Bring your own TanStack QueryClient. When provided, UnifoldProvider will
13
+ * use this client instead of creating its own, and will not add a
14
+ * QueryClientProvider wrapper (it assumes one already exists in the tree).
15
+ *
16
+ * This avoids shadowing the host app's QueryClient and lets Unifold hooks
17
+ * share the same cache, devtools, and default options as the rest of the app.
18
+ */
19
+ queryClient?: QueryClient;
10
20
  config?: {
11
21
  modalTitle?: string;
12
22
  /** Custom title for the withdraw modal. @default `"Withdraw"` */
@@ -178,7 +188,7 @@ interface WithdrawConfig {
178
188
  onClose?: () => void;
179
189
  }
180
190
 
181
- declare function UnifoldProvider({ children, publishableKey, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
191
+ declare function UnifoldProvider({ children, publishableKey, queryClient, config, }: React.PropsWithChildren<UnifoldConnectProviderConfig>): react_jsx_runtime.JSX.Element;
182
192
  declare function useUnifold(): {
183
193
  publishableKey: string;
184
194
  beginDeposit: (config: DepositConfig) => Promise<DepositResult>;