@unifold/connect-react 0.1.23 → 0.1.24
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 +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +4 -4
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
|
|
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
|
|
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.js
CHANGED
|
@@ -1174,7 +1174,7 @@ __export(index_exports, {
|
|
|
1174
1174
|
i18n: () => i18n,
|
|
1175
1175
|
queryExecutions: () => queryExecutions,
|
|
1176
1176
|
setApiConfig: () => setApiConfig,
|
|
1177
|
-
useAllowedCountry: () =>
|
|
1177
|
+
useAllowedCountry: () => useAllowedCountry2,
|
|
1178
1178
|
useUnifold: () => useUnifold2,
|
|
1179
1179
|
useUserIp: () => useUserIp
|
|
1180
1180
|
});
|
|
@@ -16450,6 +16450,10 @@ function useUnifold2() {
|
|
|
16450
16450
|
closeDeposit: connectContext.closeDeposit
|
|
16451
16451
|
};
|
|
16452
16452
|
}
|
|
16453
|
+
function useAllowedCountry2() {
|
|
16454
|
+
const { publishableKey } = useUnifold2();
|
|
16455
|
+
return useAllowedCountry(publishableKey);
|
|
16456
|
+
}
|
|
16453
16457
|
// Annotate the CommonJS export names for ESM import in node:
|
|
16454
16458
|
0 && (module.exports = {
|
|
16455
16459
|
Button,
|
package/dist/index.mjs
CHANGED
|
@@ -16424,6 +16424,10 @@ function useUnifold2() {
|
|
|
16424
16424
|
closeDeposit: connectContext.closeDeposit
|
|
16425
16425
|
};
|
|
16426
16426
|
}
|
|
16427
|
+
function useAllowedCountry2() {
|
|
16428
|
+
const { publishableKey } = useUnifold2();
|
|
16429
|
+
return useAllowedCountry(publishableKey);
|
|
16430
|
+
}
|
|
16427
16431
|
export {
|
|
16428
16432
|
Button,
|
|
16429
16433
|
ExecutionStatus,
|
|
@@ -16447,7 +16451,7 @@ export {
|
|
|
16447
16451
|
i18n,
|
|
16448
16452
|
queryExecutions,
|
|
16449
16453
|
setApiConfig,
|
|
16450
|
-
useAllowedCountry,
|
|
16454
|
+
useAllowedCountry2 as useAllowedCountry,
|
|
16451
16455
|
useUnifold2 as useUnifold,
|
|
16452
16456
|
useUserIp
|
|
16453
16457
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unifold/connect-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
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",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@tanstack/react-query": "^5.62.15",
|
|
28
|
-
"@unifold/core": "0.1.
|
|
29
|
-
"@unifold/ui-react": "0.1.
|
|
30
|
-
"@unifold/react-provider": "0.1.
|
|
28
|
+
"@unifold/core": "0.1.24",
|
|
29
|
+
"@unifold/ui-react": "0.1.24",
|
|
30
|
+
"@unifold/react-provider": "0.1.24"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/react": "^19.0.0",
|