@unifold/connect-react 0.1.23 → 0.1.25

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,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 } from '@unifold/ui-react';
4
- export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, useAllowedCountry } from '@unifold/ui-react';
3
+ import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, AllowedCountryResult } from '@unifold/ui-react';
4
+ export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
5
5
  export { AutoSwapRequest, AutoSwapResponse, 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 {
@@ -53,5 +53,28 @@ declare function useUnifold(): {
53
53
  beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
54
54
  closeDeposit: () => void;
55
55
  };
56
+ /**
57
+ * Convenience wrapper for useAllowedCountry that automatically passes publishableKey from context
58
+ *
59
+ * This wrapper makes it easy for developers to check geo-restrictions without manually
60
+ * passing the publishableKey.
61
+ *
62
+ * @returns AllowedCountryResult with isAllowed status and location info
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * import { useAllowedCountry } from '@unifold/connect-react';
67
+ *
68
+ * function MyComponent() {
69
+ * const { isAllowed, isLoading, error } = useAllowedCountry();
70
+ *
71
+ * if (isLoading) return <Loading />;
72
+ * if (!isAllowed) return <GeoBlocked />;
73
+ *
74
+ * return <YourContent />;
75
+ * }
76
+ * ```
77
+ */
78
+ declare function useAllowedCountry(): AllowedCountryResult;
56
79
 
57
- export { type DepositConfig, type DepositError, type DepositResult, type UnifoldConnectProviderConfig, UnifoldProvider, useUnifold };
80
+ export { type DepositConfig, type DepositError, type DepositResult, type UnifoldConnectProviderConfig, UnifoldProvider, useAllowedCountry, 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 } from '@unifold/ui-react';
4
- export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, useAllowedCountry } from '@unifold/ui-react';
3
+ import { ThemeMode, ThemeConfig, FontConfig, ComponentConfig, AllowedCountryResult } from '@unifold/ui-react';
4
+ export { AllowedCountryResult, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ContainerTokens, CustomThemeColors, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode } from '@unifold/ui-react';
5
5
  export { AutoSwapRequest, AutoSwapResponse, 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 {
@@ -53,5 +53,28 @@ declare function useUnifold(): {
53
53
  beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
54
54
  closeDeposit: () => void;
55
55
  };
56
+ /**
57
+ * Convenience wrapper for useAllowedCountry that automatically passes publishableKey from context
58
+ *
59
+ * This wrapper makes it easy for developers to check geo-restrictions without manually
60
+ * passing the publishableKey.
61
+ *
62
+ * @returns AllowedCountryResult with isAllowed status and location info
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * import { useAllowedCountry } from '@unifold/connect-react';
67
+ *
68
+ * function MyComponent() {
69
+ * const { isAllowed, isLoading, error } = useAllowedCountry();
70
+ *
71
+ * if (isLoading) return <Loading />;
72
+ * if (!isAllowed) return <GeoBlocked />;
73
+ *
74
+ * return <YourContent />;
75
+ * }
76
+ * ```
77
+ */
78
+ declare function useAllowedCountry(): AllowedCountryResult;
56
79
 
57
- export { type DepositConfig, type DepositError, type DepositResult, type UnifoldConnectProviderConfig, UnifoldProvider, useUnifold };
80
+ export { type DepositConfig, type DepositError, type DepositResult, type UnifoldConnectProviderConfig, UnifoldProvider, useAllowedCountry, useUnifold };