@dynamic-labs/sdk-react-core 4.5.3 → 4.6.0
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/CHANGELOG.md +15 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -1
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +1 -0
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.cjs +2 -1
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.js +2 -1
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +31 -4
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +31 -4
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +2 -1
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +3 -2
- package/src/lib/data/api/user/user.cjs +10 -0
- package/src/lib/data/api/user/user.d.ts +1 -0
- package/src/lib/data/api/user/user.js +10 -1
- package/src/lib/store/state/projectSettings/projectSettings.cjs +1 -0
- package/src/lib/store/state/projectSettings/projectSettings.d.ts +3 -1
- package/src/lib/store/state/projectSettings/projectSettings.js +1 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.cjs +6 -4
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.d.ts +6 -3
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.js +6 -4
- package/src/lib/utils/hooks/useDeleteUserAccount/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +119 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.d.ts +7 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +115 -0
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.cjs +9 -3
- package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.js +10 -4
- package/src/lib/utils/hooks/useFundWithWallet/utils/FilterWalletsForExternalFunding.cjs +27 -0
- package/src/lib/utils/hooks/useFundWithWallet/utils/FilterWalletsForExternalFunding.d.ts +2 -0
- package/src/lib/utils/hooks/useFundWithWallet/utils/FilterWalletsForExternalFunding.js +23 -0
- package/src/lib/utils/hooks/useFundWithWallet/utils/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +14 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +14 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/getPromptAmountParams.cjs +25 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/getPromptAmountParams.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/getPromptAmountParams.js +21 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.cjs +5 -23
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/useStartExternalWalletFunding.js +5 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.6.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.3...v4.6.0) (2025-02-10)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* expose method to refetch project settings ([#8048](https://github.com/dynamic-labs/dynamic-auth/issues/8048)) ([10af30c](https://github.com/dynamic-labs/dynamic-auth/commit/10af30cb5caf39b95eaae39ad831466f6f73b98a))
|
|
8
|
+
* add new hook to delete user ([#8013](https://github.com/dynamic-labs/dynamic-auth/issues/8013)) ([c312285](https://github.com/dynamic-labs/dynamic-auth/commit/c312285b4e4663eedf83a4c8c043715ba6c1a9ed))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add memos and fix state updates to prevent rerenders ([#8024](https://github.com/dynamic-labs/dynamic-auth/issues/8024)) ([89504c0](https://github.com/dynamic-labs/dynamic-auth/commit/89504c0efa29ed846a55d7eb3213a1b9b070368a))
|
|
14
|
+
* back button not working properly in the farcaster connect view ([#8051](https://github.com/dynamic-labs/dynamic-auth/issues/8051)) ([5fe4631](https://github.com/dynamic-labs/dynamic-auth/commit/5fe463105ce43dd7ec31cd90ee6922bd917ed9de))
|
|
15
|
+
* update wallet address when switching networks in cosmos ([#8016](https://github.com/dynamic-labs/dynamic-auth/issues/8016)) ([2925784](https://github.com/dynamic-labs/dynamic-auth/commit/29257846fa99600a67cf010447248451cd17ae60))
|
|
16
|
+
|
|
2
17
|
### [4.5.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.2...v4.5.3) (2025-02-09)
|
|
3
18
|
|
|
4
19
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.6.0";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.615",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
11
11
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.6.0";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.615",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
7
7
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.615",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
8
8
|
"country-list": "2.3.0",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
18
|
-
"@dynamic-labs/iconic": "4.
|
|
19
|
-
"@dynamic-labs/logger": "4.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
22
|
-
"@dynamic-labs/store": "4.
|
|
23
|
-
"@dynamic-labs/types": "4.
|
|
24
|
-
"@dynamic-labs/utils": "4.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.6.0",
|
|
18
|
+
"@dynamic-labs/iconic": "4.6.0",
|
|
19
|
+
"@dynamic-labs/logger": "4.6.0",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.6.0",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.6.0",
|
|
22
|
+
"@dynamic-labs/store": "4.6.0",
|
|
23
|
+
"@dynamic-labs/types": "4.6.0",
|
|
24
|
+
"@dynamic-labs/utils": "4.6.0",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.6.0",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.6.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -153,6 +153,7 @@ var useWalletOptions = require('./lib/utils/hooks/useWalletOptions/useWalletOpti
|
|
|
153
153
|
var useSyncMfaFlow = require('./lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs');
|
|
154
154
|
var useTelegramLogin = require('./lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs');
|
|
155
155
|
var useUpgradeEmbeddedWallet = require('./lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs');
|
|
156
|
+
var useDeleteUserAccount = require('./lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs');
|
|
156
157
|
var DynamicConnectButton = require('./lib/components/DynamicConnectButton/DynamicConnectButton.cjs');
|
|
157
158
|
require('./lib/components/InlineWidget/InlineWidget.cjs');
|
|
158
159
|
var IsBrowser = require('./lib/components/IsBrowser/IsBrowser.cjs');
|
|
@@ -281,6 +282,7 @@ exports.useWalletOptions = useWalletOptions.useWalletOptions;
|
|
|
281
282
|
exports.useSyncMfaFlow = useSyncMfaFlow.useSyncMfaFlow;
|
|
282
283
|
exports.useTelegramLogin = useTelegramLogin.useTelegramLogin;
|
|
283
284
|
exports.useUpgradeEmbeddedWallet = useUpgradeEmbeddedWallet.useUpgradeEmbeddedWallet;
|
|
285
|
+
exports.useDeleteUserAccount = useDeleteUserAccount.useDeleteUserAccount;
|
|
284
286
|
exports.DynamicConnectButton = DynamicConnectButton.DynamicConnectButton;
|
|
285
287
|
exports.IsBrowser = IsBrowser.IsBrowser;
|
|
286
288
|
exports.DynamicBridgeWidget = DynamicBridgeWidget.DynamicBridgeWidget;
|
package/src/index.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ export { FilterAndSortWallets, FilterBridgeChainsName, FilterChain, FilterWallet
|
|
|
114
114
|
export {
|
|
115
115
|
/** @deprecated */
|
|
116
116
|
DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
|
|
117
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, } from './lib/utils/hooks';
|
|
117
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, } from './lib/utils/hooks';
|
|
118
118
|
export {
|
|
119
119
|
/** @deprecated use useOnramp instead */
|
|
120
120
|
useFunding, } from './lib/utils/hooks/useFunding';
|
package/src/index.js
CHANGED
|
@@ -149,6 +149,7 @@ export { useWalletOptions } from './lib/utils/hooks/useWalletOptions/useWalletOp
|
|
|
149
149
|
export { useSyncMfaFlow } from './lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js';
|
|
150
150
|
export { useTelegramLogin } from './lib/utils/hooks/useTelegramLogin/useTelegramLogin.js';
|
|
151
151
|
export { useUpgradeEmbeddedWallet } from './lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js';
|
|
152
|
+
export { useDeleteUserAccount } from './lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js';
|
|
152
153
|
export { DynamicConnectButton } from './lib/components/DynamicConnectButton/DynamicConnectButton.js';
|
|
153
154
|
import './lib/components/InlineWidget/InlineWidget.js';
|
|
154
155
|
export { IsBrowser } from './lib/components/IsBrowser/IsBrowser.js';
|
|
@@ -327,7 +327,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
327
327
|
setRequiredWalletsConnected(!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) && Boolean(primaryWallet));
|
|
328
328
|
}, [bridgeChainsToConnect, primaryWallet]);
|
|
329
329
|
const walletConnectors = React.useMemo(() => linkedOrConnectedWallets.map((wallet) => wallet.connector), [linkedOrConnectedWallets]);
|
|
330
|
-
projectSettings.useFetchProjectSettings();
|
|
330
|
+
const { refetchProjectSettings } = projectSettings.useFetchProjectSettings();
|
|
331
331
|
nonce.useFetchNonce({
|
|
332
332
|
shouldFetch: shouldFetchNonce.shouldFetchNonce({ authMode }),
|
|
333
333
|
});
|
|
@@ -548,6 +548,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
548
548
|
qrcodeUri,
|
|
549
549
|
recommendedWallets,
|
|
550
550
|
redirectUrl: settings$1.redirectUrl,
|
|
551
|
+
refetchProjectSettings,
|
|
551
552
|
removeBridgeOnboardingCompleted,
|
|
552
553
|
removeConnectedWalletsInfo,
|
|
553
554
|
sdkHasLoaded,
|
|
@@ -663,6 +664,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
663
664
|
projectSettings$1,
|
|
664
665
|
qrcodeUri,
|
|
665
666
|
recommendedWallets,
|
|
667
|
+
refetchProjectSettings,
|
|
666
668
|
removeBridgeOnboardingCompleted,
|
|
667
669
|
removeConnectedWalletsInfo,
|
|
668
670
|
sdkHasLoaded,
|
|
@@ -323,7 +323,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
323
323
|
setRequiredWalletsConnected(!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) && Boolean(primaryWallet));
|
|
324
324
|
}, [bridgeChainsToConnect, primaryWallet]);
|
|
325
325
|
const walletConnectors = useMemo(() => linkedOrConnectedWallets.map((wallet) => wallet.connector), [linkedOrConnectedWallets]);
|
|
326
|
-
useFetchProjectSettings();
|
|
326
|
+
const { refetchProjectSettings } = useFetchProjectSettings();
|
|
327
327
|
useFetchNonce({
|
|
328
328
|
shouldFetch: shouldFetchNonce({ authMode }),
|
|
329
329
|
});
|
|
@@ -544,6 +544,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
544
544
|
qrcodeUri,
|
|
545
545
|
recommendedWallets,
|
|
546
546
|
redirectUrl: settings.redirectUrl,
|
|
547
|
+
refetchProjectSettings,
|
|
547
548
|
removeBridgeOnboardingCompleted,
|
|
548
549
|
removeConnectedWalletsInfo,
|
|
549
550
|
sdkHasLoaded,
|
|
@@ -659,6 +660,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
659
660
|
projectSettings,
|
|
660
661
|
qrcodeUri,
|
|
661
662
|
recommendedWallets,
|
|
663
|
+
refetchProjectSettings,
|
|
662
664
|
removeBridgeOnboardingCompleted,
|
|
663
665
|
removeConnectedWalletsInfo,
|
|
664
666
|
sdkHasLoaded,
|
|
@@ -105,6 +105,7 @@ export interface IDynamicContext {
|
|
|
105
105
|
qrcodeUri: string;
|
|
106
106
|
recommendedWallets?: RecommendedWallet[];
|
|
107
107
|
redirectUrl?: string;
|
|
108
|
+
refetchProjectSettings: () => Promise<ProjectSettings | undefined>;
|
|
108
109
|
removeConnectedWalletsInfo: () => void;
|
|
109
110
|
sdkHasLoaded: boolean;
|
|
110
111
|
secondaryWallets: Wallet[];
|
|
@@ -13,7 +13,7 @@ const useDynamicContext = () => {
|
|
|
13
13
|
if (context === undefined) {
|
|
14
14
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
15
15
|
}
|
|
16
|
-
const { accountSwitchState, authMode, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
16
|
+
const { accountSwitchState, authMode, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, refetchProjectSettings, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
17
17
|
const { setAuthMode } = useOverrides.useOverrides(context);
|
|
18
18
|
const externalSetShowAuthFlow = React.useCallback((value) => {
|
|
19
19
|
setShowAuthFlow(value, {
|
|
@@ -41,6 +41,7 @@ const useDynamicContext = () => {
|
|
|
41
41
|
networkConfigurations,
|
|
42
42
|
primaryWallet,
|
|
43
43
|
qrcodeUri,
|
|
44
|
+
refetchProjectSettings,
|
|
44
45
|
sdkHasLoaded,
|
|
45
46
|
selectedTabIndex,
|
|
46
47
|
sendWagmiSettings,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { IDynamicContext } from '../types';
|
|
3
|
-
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'awaitingSignatureState' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'sdkHasLoaded' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'userWithMissingInfo' | 'bridgeChains' | 'bridgeChainsToConnect' | 'setShowBridgeWidget' | 'sendWagmiSettings' | 'showDynamicUserProfile' | 'setAuthMode' | 'selectedTabIndex' | 'setSelectedTabIndex'> & {
|
|
3
|
+
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'awaitingSignatureState' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'refetchProjectSettings' | 'sdkHasLoaded' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'userWithMissingInfo' | 'bridgeChains' | 'bridgeChainsToConnect' | 'setShowBridgeWidget' | 'sendWagmiSettings' | 'showDynamicUserProfile' | 'setAuthMode' | 'selectedTabIndex' | 'setSelectedTabIndex'> & {
|
|
4
4
|
setShowAuthFlow: Dispatch<SetStateAction<boolean>>;
|
|
5
5
|
};
|
|
6
6
|
export declare const useDynamicContext: () => UseDynamicContext;
|
|
@@ -9,7 +9,7 @@ const useDynamicContext = () => {
|
|
|
9
9
|
if (context === undefined) {
|
|
10
10
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
11
11
|
}
|
|
12
|
-
const { accountSwitchState, authMode, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
12
|
+
const { accountSwitchState, authMode, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, refetchProjectSettings, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
13
13
|
const { setAuthMode } = useOverrides(context);
|
|
14
14
|
const externalSetShowAuthFlow = useCallback((value) => {
|
|
15
15
|
setShowAuthFlow(value, {
|
|
@@ -37,6 +37,7 @@ const useDynamicContext = () => {
|
|
|
37
37
|
networkConfigurations,
|
|
38
38
|
primaryWallet,
|
|
39
39
|
qrcodeUri,
|
|
40
|
+
refetchProjectSettings,
|
|
40
41
|
sdkHasLoaded,
|
|
41
42
|
selectedTabIndex,
|
|
42
43
|
sendWagmiSettings,
|
package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.cjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var React = require('react');
|
|
7
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
9
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
10
|
var getWalletAdditionalAddressByType = require('../../../utils/functions/getWalletAdditionalAddressByType/getWalletAdditionalAddressByType.cjs');
|
|
@@ -39,7 +40,7 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
39
40
|
],
|
|
40
41
|
initialData: [],
|
|
41
42
|
});
|
|
42
|
-
return onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider));
|
|
43
|
+
return React.useMemo(() => onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider)), [onrampProviders, projectSettingsOnramps]);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
exports.useEnabledOnrampProviders = useEnabledOnrampProviders;
|
package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { useMemo } from 'react';
|
|
3
4
|
import { getChainInfo, isBitcoinConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
5
|
import { WalletAddressType } from '@dynamic-labs/sdk-api-core';
|
|
5
6
|
import { getWalletAdditionalAddressByType } from '../../../utils/functions/getWalletAdditionalAddressByType/getWalletAdditionalAddressByType.js';
|
|
@@ -35,7 +36,7 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
35
36
|
],
|
|
36
37
|
initialData: [],
|
|
37
38
|
});
|
|
38
|
-
return onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider));
|
|
39
|
+
return useMemo(() => onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider)), [onrampProviders, projectSettingsOnramps]);
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
export { useEnabledOnrampProviders };
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
var localStorage = require('../../utils/constants/localStorage.cjs');
|
|
11
11
|
var getSiweStatement = require('../../utils/functions/getSiweStatement/getSiweStatement.cjs');
|
|
12
12
|
require('../../events/dynamicEvents.cjs');
|
|
@@ -92,6 +92,8 @@ require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidge
|
|
|
92
92
|
require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
93
93
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
94
94
|
require('../OnrampContext/OnrampContext.cjs');
|
|
95
|
+
var useFundWithWallet = require('../../utils/hooks/useFundWithWallet/useFundWithWallet.cjs');
|
|
96
|
+
var getPromptAmountParams = require('../../widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/getPromptAmountParams.cjs');
|
|
95
97
|
require('../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.cjs');
|
|
96
98
|
require('../../../index.cjs');
|
|
97
99
|
require('../../store/state/tokenBalances.cjs');
|
|
@@ -102,6 +104,7 @@ const useResponseHandlers = () => {
|
|
|
102
104
|
const { pushView } = ViewContext.useViewContext();
|
|
103
105
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
104
106
|
const { getCaptchaToken } = CaptchaContext.useCaptchaContext();
|
|
107
|
+
const { promptAmountAndFund } = useFundWithWallet.useFundWithWallet();
|
|
105
108
|
const verifyWallet = useVerifyWallet.useVerifyWallet({
|
|
106
109
|
displaySiweStatement,
|
|
107
110
|
environmentId,
|
|
@@ -117,16 +120,40 @@ const useResponseHandlers = () => {
|
|
|
117
120
|
}
|
|
118
121
|
// this completes the connection step
|
|
119
122
|
yield phantomRedirectConnector.getSession();
|
|
120
|
-
yield connectWallet(phantomRedirectConnector);
|
|
123
|
+
const connectResult = yield connectWallet(phantomRedirectConnector);
|
|
124
|
+
// Check if we have a connection type
|
|
125
|
+
const connectionType = utils.StorageService.getItem(utils.PHANTOM_REDIRECT_CONNECTION_TYPE_KEY);
|
|
126
|
+
// If this is an external wallet funding connection, then we need to
|
|
127
|
+
// complete the wallet transfer.
|
|
128
|
+
// If connectorConsumed is false that means that the connector has not yet
|
|
129
|
+
// verified this connection type and we should ignore it.
|
|
130
|
+
if ((connectionType === null || connectionType === void 0 ? void 0 : connectionType.connectorConsumed) &&
|
|
131
|
+
connectionType.type === 'external-wallet-funding') {
|
|
132
|
+
if (!connectResult)
|
|
133
|
+
return;
|
|
134
|
+
const wallet = phantomRedirectConnector.createWallet({
|
|
135
|
+
address: connectResult.address,
|
|
136
|
+
chain: phantomRedirectConnector.connectedChain,
|
|
137
|
+
connector: phantomRedirectConnector,
|
|
138
|
+
id: 'external-funding-wallet',
|
|
139
|
+
isAuthenticated: false,
|
|
140
|
+
key: phantomRedirectConnector.key,
|
|
141
|
+
});
|
|
142
|
+
const props = getPromptAmountParams.getPromptAmountParams({ externalWallet: wallet });
|
|
143
|
+
promptAmountAndFund(props);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
// Default behavior is to link a wallet
|
|
121
147
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: true });
|
|
122
148
|
pushView('pending-signature');
|
|
123
149
|
setSelectedWalletConnectorKey('phantom');
|
|
124
150
|
}), [
|
|
125
|
-
connectWallet,
|
|
126
151
|
phantomRedirectConnector,
|
|
127
|
-
|
|
152
|
+
connectWallet,
|
|
128
153
|
setShowAuthFlow,
|
|
129
154
|
pushView,
|
|
155
|
+
setSelectedWalletConnectorKey,
|
|
156
|
+
promptAmountAndFund,
|
|
130
157
|
]);
|
|
131
158
|
const completeWalletTransfer = useTransferWallet.useTransferWallet();
|
|
132
159
|
const handleUserResponse = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
+
import { StorageService, PHANTOM_REDIRECT_CONNECTION_TYPE_KEY } from '@dynamic-labs/utils';
|
|
4
5
|
import { isPhantomRedirectConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
-
import { StorageService } from '@dynamic-labs/utils';
|
|
6
6
|
import { PHANTOM_SIGNATURE_STATE } from '../../utils/constants/localStorage.js';
|
|
7
7
|
import { getSiweStatement } from '../../utils/functions/getSiweStatement/getSiweStatement.js';
|
|
8
8
|
import '../../events/dynamicEvents.js';
|
|
@@ -88,6 +88,8 @@ import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidget
|
|
|
88
88
|
import '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
89
89
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
90
90
|
import '../OnrampContext/OnrampContext.js';
|
|
91
|
+
import { useFundWithWallet } from '../../utils/hooks/useFundWithWallet/useFundWithWallet.js';
|
|
92
|
+
import { getPromptAmountParams } from '../../widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExternalWalletFunding/getPromptAmountParams/getPromptAmountParams.js';
|
|
91
93
|
import '../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.js';
|
|
92
94
|
import '../../../index.js';
|
|
93
95
|
import '../../store/state/tokenBalances.js';
|
|
@@ -98,6 +100,7 @@ const useResponseHandlers = () => {
|
|
|
98
100
|
const { pushView } = useViewContext();
|
|
99
101
|
const { setErrorMessage } = useErrorContext();
|
|
100
102
|
const { getCaptchaToken } = useCaptchaContext();
|
|
103
|
+
const { promptAmountAndFund } = useFundWithWallet();
|
|
101
104
|
const verifyWallet = useVerifyWallet({
|
|
102
105
|
displaySiweStatement,
|
|
103
106
|
environmentId,
|
|
@@ -113,16 +116,40 @@ const useResponseHandlers = () => {
|
|
|
113
116
|
}
|
|
114
117
|
// this completes the connection step
|
|
115
118
|
yield phantomRedirectConnector.getSession();
|
|
116
|
-
yield connectWallet(phantomRedirectConnector);
|
|
119
|
+
const connectResult = yield connectWallet(phantomRedirectConnector);
|
|
120
|
+
// Check if we have a connection type
|
|
121
|
+
const connectionType = StorageService.getItem(PHANTOM_REDIRECT_CONNECTION_TYPE_KEY);
|
|
122
|
+
// If this is an external wallet funding connection, then we need to
|
|
123
|
+
// complete the wallet transfer.
|
|
124
|
+
// If connectorConsumed is false that means that the connector has not yet
|
|
125
|
+
// verified this connection type and we should ignore it.
|
|
126
|
+
if ((connectionType === null || connectionType === void 0 ? void 0 : connectionType.connectorConsumed) &&
|
|
127
|
+
connectionType.type === 'external-wallet-funding') {
|
|
128
|
+
if (!connectResult)
|
|
129
|
+
return;
|
|
130
|
+
const wallet = phantomRedirectConnector.createWallet({
|
|
131
|
+
address: connectResult.address,
|
|
132
|
+
chain: phantomRedirectConnector.connectedChain,
|
|
133
|
+
connector: phantomRedirectConnector,
|
|
134
|
+
id: 'external-funding-wallet',
|
|
135
|
+
isAuthenticated: false,
|
|
136
|
+
key: phantomRedirectConnector.key,
|
|
137
|
+
});
|
|
138
|
+
const props = getPromptAmountParams({ externalWallet: wallet });
|
|
139
|
+
promptAmountAndFund(props);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// Default behavior is to link a wallet
|
|
117
143
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: true });
|
|
118
144
|
pushView('pending-signature');
|
|
119
145
|
setSelectedWalletConnectorKey('phantom');
|
|
120
146
|
}), [
|
|
121
|
-
connectWallet,
|
|
122
147
|
phantomRedirectConnector,
|
|
123
|
-
|
|
148
|
+
connectWallet,
|
|
124
149
|
setShowAuthFlow,
|
|
125
150
|
pushView,
|
|
151
|
+
setSelectedWalletConnectorKey,
|
|
152
|
+
promptAmountAndFund,
|
|
126
153
|
]);
|
|
127
154
|
const completeWalletTransfer = useTransferWallet();
|
|
128
155
|
const handleUserResponse = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -106,7 +106,8 @@ const UserFieldEditorContextProvider = ({ children, }) => {
|
|
|
106
106
|
return (jsxRuntime.jsx(DynamicBaseWidget.DynamicBaseWidget, { children: jsxRuntime.jsx(UserFieldEditorModal.UserFieldEditorModal, { fields: modalProps.fields, submitText: modalProps.submitText, title: modalProps.title, subtitle: modalProps.subtitle, onCancel: reject, onSubmit: onSubmit }) }));
|
|
107
107
|
});
|
|
108
108
|
}), [open]);
|
|
109
|
-
|
|
109
|
+
const value = React.useMemo(() => ({ open: openUserFieldEditor }), [openUserFieldEditor]);
|
|
110
|
+
return (jsxRuntime.jsxs(UserFieldEditorContext.Provider, { value: value, children: [modal, children] }));
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
exports.UserFieldEditorContext = UserFieldEditorContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { createContext, useCallback } from 'react';
|
|
4
|
+
import { createContext, useCallback, useMemo } from 'react';
|
|
5
5
|
import { UserFieldEditorModal } from '../../modals/UserFieldEditorModal/UserFieldEditorModal.js';
|
|
6
6
|
import '../../events/dynamicEvents.js';
|
|
7
7
|
import '@dynamic-labs/utils';
|
|
@@ -102,7 +102,8 @@ const UserFieldEditorContextProvider = ({ children, }) => {
|
|
|
102
102
|
return (jsx(DynamicBaseWidget, { children: jsx(UserFieldEditorModal, { fields: modalProps.fields, submitText: modalProps.submitText, title: modalProps.title, subtitle: modalProps.subtitle, onCancel: reject, onSubmit: onSubmit }) }));
|
|
103
103
|
});
|
|
104
104
|
}), [open]);
|
|
105
|
-
|
|
105
|
+
const value = useMemo(() => ({ open: openUserFieldEditor }), [openUserFieldEditor]);
|
|
106
|
+
return (jsxs(UserFieldEditorContext.Provider, { value: value, children: [modal, children] }));
|
|
106
107
|
};
|
|
107
108
|
|
|
108
109
|
export { UserFieldEditorContext, UserFieldEditorContextProvider };
|
|
@@ -86,6 +86,15 @@ const verifyMergeUsers = (environmentId, mergeConflictResolutions) => _tslib.__a
|
|
|
86
86
|
throw e;
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
+
const hardDeleteUser = (environmentId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
try {
|
|
91
|
+
yield api.sdkApi().hardDeleteUser({ environmentId });
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
yield utils.logResponseError(e, 'Error hardDeleteUser');
|
|
95
|
+
throw e;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
89
98
|
const refreshUserJwt = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ environmentId, }) {
|
|
90
99
|
try {
|
|
91
100
|
const response = yield api.sdkApi().refreshAuth({
|
|
@@ -133,6 +142,7 @@ const getUserFieldsCheck = (_c) => _tslib.__awaiter(void 0, [_c], void 0, functi
|
|
|
133
142
|
|
|
134
143
|
exports.getAuthenticatedUser = getAuthenticatedUser;
|
|
135
144
|
exports.getUserFieldsCheck = getUserFieldsCheck;
|
|
145
|
+
exports.hardDeleteUser = hardDeleteUser;
|
|
136
146
|
exports.mergeUserAccounts = mergeUserAccounts;
|
|
137
147
|
exports.refreshUserJwt = refreshUserJwt;
|
|
138
148
|
exports.updateUserProfileFields = updateUserProfileFields;
|
|
@@ -6,6 +6,7 @@ export type UpdateUserResponse = UpdateSelfResponse & {
|
|
|
6
6
|
export declare const updateUserProfileFields: (environmentId: string, fields: UserFields) => Promise<UpdateUserResponse>;
|
|
7
7
|
export declare const mergeUserAccounts: (environmentId: string) => Promise<UserProfile>;
|
|
8
8
|
export declare const verifyMergeUsers: (environmentId: string, mergeConflictResolutions: MergeUserConflictResolution[]) => Promise<UserProfile>;
|
|
9
|
+
export declare const hardDeleteUser: (environmentId: string) => Promise<void>;
|
|
9
10
|
export declare const refreshUserJwt: ({ environmentId, }: {
|
|
10
11
|
environmentId: string;
|
|
11
12
|
}) => Promise<UserProfile | undefined>;
|
|
@@ -82,6 +82,15 @@ const verifyMergeUsers = (environmentId, mergeConflictResolutions) => __awaiter(
|
|
|
82
82
|
throw e;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
+
const hardDeleteUser = (environmentId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
+
try {
|
|
87
|
+
yield sdkApi().hardDeleteUser({ environmentId });
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
yield logResponseError(e, 'Error hardDeleteUser');
|
|
91
|
+
throw e;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
85
94
|
const refreshUserJwt = (_a) => __awaiter(void 0, [_a], void 0, function* ({ environmentId, }) {
|
|
86
95
|
try {
|
|
87
96
|
const response = yield sdkApi().refreshAuth({
|
|
@@ -127,4 +136,4 @@ const getUserFieldsCheck = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
|
127
136
|
}
|
|
128
137
|
});
|
|
129
138
|
|
|
130
|
-
export { getAuthenticatedUser, getUserFieldsCheck, mergeUserAccounts, refreshUserJwt, updateUserProfileFields, verifyMergeUsers };
|
|
139
|
+
export { getAuthenticatedUser, getUserFieldsCheck, hardDeleteUser, mergeUserAccounts, refreshUserJwt, updateUserProfileFields, verifyMergeUsers };
|
|
@@ -119,6 +119,7 @@ const useFetchProjectSettings = ({ retries = 2, } = {}) => {
|
|
|
119
119
|
retries,
|
|
120
120
|
});
|
|
121
121
|
useDynamicEvents.useDynamicEvents('logout', retrigger);
|
|
122
|
+
return { refetchProjectSettings: retrigger };
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
exports.getProjectSettings = getProjectSettings;
|
|
@@ -8,4 +8,6 @@ export declare const useProjectSettingsExpiresAt: () => number | undefined;
|
|
|
8
8
|
export type UseProjectSettingsProps = {
|
|
9
9
|
retries?: number;
|
|
10
10
|
};
|
|
11
|
-
export declare const useFetchProjectSettings: ({ retries, }?: UseProjectSettingsProps) =>
|
|
11
|
+
export declare const useFetchProjectSettings: ({ retries, }?: UseProjectSettingsProps) => {
|
|
12
|
+
refetchProjectSettings: () => Promise<ProjectSettings | undefined>;
|
|
13
|
+
};
|
|
@@ -115,6 +115,7 @@ const useFetchProjectSettings = ({ retries = 2, } = {}) => {
|
|
|
115
115
|
retries,
|
|
116
116
|
});
|
|
117
117
|
useDynamicEvents('logout', retrigger);
|
|
118
|
+
return { refetchProjectSettings: retrigger };
|
|
118
119
|
};
|
|
119
120
|
|
|
120
121
|
export { getProjectSettings, resetProjectSettings, setProjectSettings, useFetchProjectSettings, useProjectSettings };
|
|
@@ -73,3 +73,4 @@ export { useDeviceFingerprint } from './useDeviceFingerprint';
|
|
|
73
73
|
export * from './useEmbeddedWallet';
|
|
74
74
|
export { useUpgradeEmbeddedWallet } from './useUpgradeEmbeddedWallet';
|
|
75
75
|
export { useAggregateWalletEvents } from './useAggregateWalletEvents';
|
|
76
|
+
export { useDeleteUserAccount } from './useDeleteUserAccount';
|
|
@@ -9,12 +9,14 @@ var React = require('react');
|
|
|
9
9
|
var reactDom = require('react-dom');
|
|
10
10
|
var useElementById = require('../useElementById/useElementById.cjs');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @returns {ConfirmationModalHookResult} An object with a method to open a modal and a reference to the modal itself.
|
|
12
|
+
/**
|
|
13
|
+
* Allows showing a modal for the user to confirm or cancel.
|
|
14
|
+
*
|
|
16
15
|
* The open method accepts a callback which receives a (resolve, reject) pair to be called if the user
|
|
17
16
|
* confirms or cancels the operation, and must return the ReactNode for the modal to be displayed.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} elementId The id of the modal root, to which the modal will be portalled
|
|
19
|
+
* @returns {ConfirmationModalHookResult} An object with a method to open a modal and a reference to the modal itself.
|
|
18
20
|
*/
|
|
19
21
|
const useConfirmationModal = ({ elementId, }) => {
|
|
20
22
|
const { createRootElement } = useElementById.useElementById();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ConfirmationModalHookProps, ConfirmationModalHookResult } from './useConfirmationModal.types';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
/**
|
|
3
|
+
* Allows showing a modal for the user to confirm or cancel.
|
|
4
|
+
*
|
|
5
5
|
* The open method accepts a callback which receives a (resolve, reject) pair to be called if the user
|
|
6
6
|
* confirms or cancels the operation, and must return the ReactNode for the modal to be displayed.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} elementId The id of the modal root, to which the modal will be portalled
|
|
9
|
+
* @returns {ConfirmationModalHookResult} An object with a method to open a modal and a reference to the modal itself.
|
|
7
10
|
*/
|
|
8
11
|
export declare const useConfirmationModal: <T, E = unknown>({ elementId, }: ConfirmationModalHookProps) => ConfirmationModalHookResult<T, E>;
|
|
@@ -5,12 +5,14 @@ import { useState, useCallback } from 'react';
|
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { useElementById } from '../useElementById/useElementById.js';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* @returns {ConfirmationModalHookResult} An object with a method to open a modal and a reference to the modal itself.
|
|
8
|
+
/**
|
|
9
|
+
* Allows showing a modal for the user to confirm or cancel.
|
|
10
|
+
*
|
|
12
11
|
* The open method accepts a callback which receives a (resolve, reject) pair to be called if the user
|
|
13
12
|
* confirms or cancels the operation, and must return the ReactNode for the modal to be displayed.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} elementId The id of the modal root, to which the modal will be portalled
|
|
15
|
+
* @returns {ConfirmationModalHookResult} An object with a method to open a modal and a reference to the modal itself.
|
|
14
16
|
*/
|
|
15
17
|
const useConfirmationModal = ({ elementId, }) => {
|
|
16
18
|
const { createRootElement } = useElementById();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDeleteUserAccount';
|