@dynamic-labs/sdk-react-core 4.22.7 → 4.23.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 +21 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -1
- package/src/lib/client/client.cjs +2 -0
- package/src/lib/client/client.d.ts +1 -0
- package/src/lib/client/client.js +2 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/fetchOverride/fetchOverride.js +5 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +24 -6
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.d.ts +1 -1
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +26 -8
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.cjs +1 -1
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.js +1 -1
- package/src/lib/components/Search/Search.cjs +5 -1
- package/src/lib/components/Search/Search.js +5 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -1
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +9 -2
- package/src/lib/events/dynamicEvents.cjs +1 -0
- package/src/lib/events/dynamicEvents.d.ts +2 -2
- package/src/lib/events/dynamicEvents.js +1 -0
- package/src/lib/events/wallets.d.ts +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -1
- package/src/lib/locale/en/translation.cjs +28 -0
- package/src/lib/locale/en/translation.d.ts +28 -0
- package/src/lib/locale/en/translation.js +28 -0
- package/src/lib/shared/logger.cjs +1 -1
- package/src/lib/shared/logger.js +2 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +1 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +1 -0
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +1 -1
- package/src/lib/utils/functions/getTimeSince/index.d.ts +1 -0
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/isConnectOnly.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/index.d.ts +3 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAllowClose/useAllowClose.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.cjs +15 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.d.ts +6 -0
- package/src/lib/utils/hooks/useConnectWallet/HandleConnectWalletRejectionError.js +11 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +13 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +13 -6
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.cjs +1 -1
- package/src/lib/utils/hooks/useIsLoadingEmbeddedWallet/useIsLoadingEmbeddedWallet.js +1 -1
- package/src/lib/utils/hooks/useIsMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsMfaEnabled/useIsMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.cjs +15 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTotpMfaEnabled/useIsTotpMfaEnabled.js +11 -0
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -1
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +33 -18
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.d.ts +4 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +33 -18
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.cjs +1 -1
- package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.js +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +1 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +1 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +43 -6
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +43 -6
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/ExchangeList/ExchangeList.cjs +5 -5
- package/src/lib/views/ExchangeList/ExchangeList.js +5 -5
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +1 -1
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +1 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +4 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +4 -2
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +4 -4
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -2
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +0 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +0 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +42 -106
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +43 -107
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +119 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +115 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.cjs +170 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/WalletSecuritySection.js +166 -0
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/WalletSecuritySection/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useStartExchangeFunding/useStartExchangeFunding.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.cjs → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs} +8 -7
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView/ManageMfaWidgetView.js → ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js} +7 -6
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +5 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/index.d.ts +0 -1
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.cjs +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.d.ts +0 -0
- /package/src/lib/{widgets/DynamicWidget/helpers → utils/functions/getTimeSince}/getTimeSince.js +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/UserDeviceTile.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/index.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.cjs +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/views/{ManageMfaWidgetView → ManageTotpMfaWidgetView}/components/utils/sort.js +0 -0
|
@@ -92,6 +92,7 @@ const viewsThatPreventModalClose = [
|
|
|
92
92
|
'collect-user-data',
|
|
93
93
|
'login-with-email-verification',
|
|
94
94
|
'login-with-sms-verification',
|
|
95
|
+
'backup-unsuccessful',
|
|
95
96
|
];
|
|
96
97
|
/**
|
|
97
98
|
* When hasPendingMfaAction returns true, user is not able to close the modal in these views at all
|
|
@@ -88,6 +88,7 @@ const viewsThatPreventModalClose = [
|
|
|
88
88
|
'collect-user-data',
|
|
89
89
|
'login-with-email-verification',
|
|
90
90
|
'login-with-sms-verification',
|
|
91
|
+
'backup-unsuccessful',
|
|
91
92
|
];
|
|
92
93
|
/**
|
|
93
94
|
* When hasPendingMfaAction returns true, user is not able to close the modal in these views at all
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var shortenWalletAddress = require('../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
7
|
-
var getTimeSince = require('
|
|
7
|
+
var getTimeSince = require('../getTimeSince/getTimeSince.cjs');
|
|
8
8
|
|
|
9
9
|
/** Returns the name of the session or the shortened wallet address if no name is available */
|
|
10
10
|
const getSessionInformationName = (session) => { var _a; return (_a = session.origin) !== null && _a !== void 0 ? _a : shortenWalletAddress.shortenWalletAddress(session.sessionId); };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { shortenWalletAddress } from '../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
3
|
-
import { getTimeSince } from '
|
|
3
|
+
import { getTimeSince } from '../getTimeSince/getTimeSince.js';
|
|
4
4
|
|
|
5
5
|
/** Returns the name of the session or the shortened wallet address if no name is available */
|
|
6
6
|
const getSessionInformationName = (session) => { var _a; return (_a = session.origin) !== null && _a !== void 0 ? _a : shortenWalletAddress(session.sessionId); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getTimeSince } from './getTimeSince';
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
9
9
|
require('react');
|
|
10
10
|
require('@dynamic-labs-sdk/client');
|
|
11
11
|
require('../../../client/client.cjs');
|
|
12
|
-
require('../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@dynamic-labs-sdk/client';
|
|
7
7
|
import '../../../client/client.js';
|
|
8
|
-
import '../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../constants/colors.js';
|
|
@@ -9,8 +9,8 @@ require('react');
|
|
|
9
9
|
require('@dynamic-labs-sdk/client');
|
|
10
10
|
require('../../../../client/client.cjs');
|
|
11
11
|
require('../../../../../../_virtual/_tslib.cjs');
|
|
12
|
-
require('../../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../../shared/logger.cjs');
|
|
16
16
|
require('../../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import 'react';
|
|
|
5
5
|
import '@dynamic-labs-sdk/client';
|
|
6
6
|
import '../../../../client/client.js';
|
|
7
7
|
import '../../../../../../_virtual/_tslib.js';
|
|
8
|
-
import '../../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../../shared/logger.js';
|
|
12
12
|
import '../../../constants/colors.js';
|
|
@@ -86,11 +86,11 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
86
86
|
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
87
87
|
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
88
88
|
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
89
|
-
require('../../../../locale/locale.cjs');
|
|
90
89
|
require('@hcaptcha/react-hcaptcha');
|
|
91
90
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
92
91
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
93
92
|
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
93
|
+
require('../../../../locale/locale.cjs');
|
|
94
94
|
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
95
95
|
require('../../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
96
96
|
require('../../../../store/state/sendBalances.cjs');
|
|
@@ -82,11 +82,11 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
82
82
|
import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
83
83
|
import '../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
84
84
|
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
85
|
-
import '../../../../locale/locale.js';
|
|
86
85
|
import '@hcaptcha/react-hcaptcha';
|
|
87
86
|
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
88
87
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
89
88
|
import '../../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
89
|
+
import '../../../../locale/locale.js';
|
|
90
90
|
import '../../../../context/PasskeyContext/PasskeyContext.js';
|
|
91
91
|
import '../../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
92
92
|
import '../../../../store/state/sendBalances.js';
|
|
@@ -4,5 +4,5 @@ type DynamicEventListener<E extends keyof DynamicEvents> = (...args: EventArgs<D
|
|
|
4
4
|
/** Allows us to subscribe to all dynamicEvents with a hook, even the internal ones */
|
|
5
5
|
export declare const useInternalDynamicEvents: <E extends keyof import("../../../../events/auth").AuthEvents | keyof import("../../../../events/ui").UIEvents | keyof import("../../../../events/otp").OTPEvents | keyof import("../../../../events/wallets").WalletEvents | keyof import("../../../../events/passkey").PasskeyEvents | "farcasterConnectCancelled" | keyof import("../../../../events/embeddedWallet").EmbeddedWalletEvents | keyof import("../../../../events/multiWallet").MultiWalletInternalEvents | "tokenBalancesChanged" | "userProfileUpdated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
6
6
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
7
|
-
export declare const useDynamicEvents: <E extends "authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "embeddedWalletCreated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
7
|
+
export declare const useDynamicEvents: <E extends "authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "embeddedWalletCreated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
8
8
|
export {};
|
|
@@ -84,3 +84,6 @@ export { useSubmitExchangeFunding } from './useSubmitExchangeFunding';
|
|
|
84
84
|
export { useGetPasskeys } from './useGetPasskeys';
|
|
85
85
|
export { useRegisterPasskey } from './useRegisterPasskey';
|
|
86
86
|
export { useAuthenticatePasskeyMFA } from './useAuthenticatePasskeyMFA';
|
|
87
|
+
export { useIsMfaEnabled } from './useIsMfaEnabled';
|
|
88
|
+
export { useIsPasskeysMfaEnabled } from './useIsPasskeysMfaEnabled';
|
|
89
|
+
export { useIsTotpMfaEnabled } from './useIsTotpMfaEnabled';
|
|
@@ -9,8 +9,8 @@ require('react');
|
|
|
9
9
|
require('@dynamic-labs-sdk/client');
|
|
10
10
|
require('../../../../client/client.cjs');
|
|
11
11
|
require('../../../../../../_virtual/_tslib.cjs');
|
|
12
|
-
require('../../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../../shared/logger.cjs');
|
|
16
16
|
require('../../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import 'react';
|
|
|
5
5
|
import '@dynamic-labs-sdk/client';
|
|
6
6
|
import '../../../../client/client.js';
|
|
7
7
|
import '../../../../../../_virtual/_tslib.js';
|
|
8
|
-
import '../../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../../shared/logger.js';
|
|
12
12
|
import '../../../constants/colors.js';
|
|
@@ -9,8 +9,8 @@ require('react');
|
|
|
9
9
|
require('@dynamic-labs-sdk/client');
|
|
10
10
|
require('../../../client/client.cjs');
|
|
11
11
|
require('../../../../../_virtual/_tslib.cjs');
|
|
12
|
-
require('../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import 'react';
|
|
|
5
5
|
import '@dynamic-labs-sdk/client';
|
|
6
6
|
import '../../../client/client.js';
|
|
7
7
|
import '../../../../../_virtual/_tslib.js';
|
|
8
|
-
import '../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../constants/colors.js';
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs-sdk/client/core');
|
|
|
9
9
|
require('@dynamic-labs/sdk-api-core');
|
|
10
10
|
require('@dynamic-labs-sdk/client');
|
|
11
11
|
require('../../../client/client.cjs');
|
|
12
|
-
require('../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs-sdk/client/core';
|
|
|
5
5
|
import '@dynamic-labs/sdk-api-core';
|
|
6
6
|
import '@dynamic-labs-sdk/client';
|
|
7
7
|
import '../../../client/client.js';
|
|
8
|
-
import '../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../constants/colors.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
|
+
|
|
8
|
+
class HandleConnectWalletRejectionError extends utils.DynamicError {
|
|
9
|
+
constructor(walletConnector) {
|
|
10
|
+
super(`Connection was not established because handleConnectedWallet returned false for wallet connector ${walletConnector.key}`);
|
|
11
|
+
this.walletConnector = walletConnector;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.HandleConnectWalletRejectionError = HandleConnectWalletRejectionError;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
2
|
+
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
export declare class HandleConnectWalletRejectionError extends DynamicError {
|
|
4
|
+
walletConnector: WalletConnector;
|
|
5
|
+
constructor(walletConnector: WalletConnector);
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
|
+
|
|
4
|
+
class HandleConnectWalletRejectionError extends DynamicError {
|
|
5
|
+
constructor(walletConnector) {
|
|
6
|
+
super(`Connection was not established because handleConnectedWallet returned false for wallet connector ${walletConnector.key}`);
|
|
7
|
+
this.walletConnector = walletConnector;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { HandleConnectWalletRejectionError };
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
9
|
var utils = require('@dynamic-labs/utils');
|
|
9
10
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
|
-
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
11
11
|
var UserWalletsContext = require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
12
12
|
require('@dynamic-labs-sdk/client/core');
|
|
13
13
|
require('@dynamic-labs-sdk/client');
|
|
@@ -29,15 +29,16 @@ var getWalletUniqueId = require('../../functions/getWalletUniqueId/getWalletUniq
|
|
|
29
29
|
var connectedWalletsInfo = require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
30
30
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
31
31
|
var primaryWalletId = require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
32
|
-
require('../../../events/dynamicEvents.cjs');
|
|
32
|
+
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
33
33
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
34
34
|
require('../../../config/ApiEndpoint.cjs');
|
|
35
35
|
var session = require('../../../data/api/session/session.cjs');
|
|
36
36
|
require('../../../locale/locale.cjs');
|
|
37
|
-
var
|
|
37
|
+
var authMode = require('../../../store/state/authMode/authMode.cjs');
|
|
38
38
|
var getWalletConnectorForWallet = require('../../functions/getWalletConnectorForWallet/getWalletConnectorForWallet.cjs');
|
|
39
|
+
var isConnectOnly = require('../authenticationHooks/helpers/isConnectOnly.cjs');
|
|
39
40
|
var useDebounce = require('../useDebounce/useDebounce.cjs');
|
|
40
|
-
var
|
|
41
|
+
var HandleConnectWalletRejectionError = require('./HandleConnectWalletRejectionError.cjs');
|
|
41
42
|
var updateUserWalletsFromConnectedWallets = require('./updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.cjs');
|
|
42
43
|
|
|
43
44
|
const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId: primaryWalletId$1, walletConnectorOptions, handleConnectedWallet, setShowAuthFlow, isBridgeFlow, }) => {
|
|
@@ -186,12 +187,17 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
186
187
|
}
|
|
187
188
|
catch (error) {
|
|
188
189
|
if (error instanceof utils.CustomError) {
|
|
190
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionFailed', walletConnector, error);
|
|
189
191
|
throw error;
|
|
190
192
|
}
|
|
193
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionFailed', walletConnector, error);
|
|
194
|
+
throw new utils.MissingPublicAddressError();
|
|
191
195
|
}
|
|
192
196
|
// Throw a generic error for any errors we're not processing above
|
|
193
197
|
if (!walletAddress) {
|
|
194
|
-
|
|
198
|
+
const missingPublicAddressError = new utils.MissingPublicAddressError();
|
|
199
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionFailed', walletConnector, missingPublicAddressError);
|
|
200
|
+
throw missingPublicAddressError;
|
|
195
201
|
}
|
|
196
202
|
if (handleConnectedWallet && applyHandleConnectedWallet) {
|
|
197
203
|
const shouldProceedWithConnection = yield handleConnectedWallet({
|
|
@@ -202,6 +208,7 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
202
208
|
if (!shouldProceedWithConnection) {
|
|
203
209
|
walletConnectorCore.logger.info('Connection was not established because handleConnectedWallet returned false');
|
|
204
210
|
setShowAuthFlow(false);
|
|
211
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionFailed', walletConnector, new HandleConnectWalletRejectionError.HandleConnectWalletRejectionError(walletConnector));
|
|
205
212
|
return;
|
|
206
213
|
}
|
|
207
214
|
}
|
|
@@ -214,7 +221,7 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
214
221
|
// send information to backend to kick off background jobs
|
|
215
222
|
// so verify/sign on the next step could go by more quickly
|
|
216
223
|
// this is async work, but DO NOT AWAIT
|
|
217
|
-
session.createVisit({
|
|
224
|
+
void session.createVisit({
|
|
218
225
|
authMode: authMode$1,
|
|
219
226
|
chain: walletChain || '',
|
|
220
227
|
environmentId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Chain, GetAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
1
|
import { HardwareWalletEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import { Chain, GetAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { SetShowAuthFlow } from '../../../context/DynamicContext/hooks';
|
|
4
4
|
import { ConnectWalletResult } from '../../../context/DynamicContext/types';
|
|
5
|
-
import { HandleConnectedWallet,
|
|
5
|
+
import { HandleConnectedWallet, Wallet, WalletOption } from '../../../shared';
|
|
6
6
|
export type ConnectedWalletConnectorType = {
|
|
7
7
|
id: string;
|
|
8
8
|
walletChain?: Chain;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { HardwareWalletEnum } from '@dynamic-labs/sdk-api-core';
|
|
4
5
|
import { CustomError, MissingPublicAddressError } from '@dynamic-labs/utils';
|
|
5
6
|
import { getWalletConnectorByKey, logger, isHardwareWalletConnector, getWalletProvider } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
-
import { HardwareWalletEnum } from '@dynamic-labs/sdk-api-core';
|
|
7
7
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
8
8
|
import '@dynamic-labs-sdk/client/core';
|
|
9
9
|
import '@dynamic-labs-sdk/client';
|
|
@@ -25,15 +25,16 @@ import { getWalletUniqueId } from '../../functions/getWalletUniqueId/getWalletUn
|
|
|
25
25
|
import { useConnectedWalletsInfo, setConnectedWalletsInfo } from '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
26
26
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
27
27
|
import { resetPrimaryWalletId } from '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
28
|
-
import '../../../events/dynamicEvents.js';
|
|
28
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
29
29
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
30
30
|
import '../../../config/ApiEndpoint.js';
|
|
31
31
|
import { createVisit } from '../../../data/api/session/session.js';
|
|
32
32
|
import '../../../locale/locale.js';
|
|
33
|
-
import {
|
|
33
|
+
import { getAuthMode } from '../../../store/state/authMode/authMode.js';
|
|
34
34
|
import { getWalletConnectorForWallet } from '../../functions/getWalletConnectorForWallet/getWalletConnectorForWallet.js';
|
|
35
|
+
import { isConnectOnly } from '../authenticationHooks/helpers/isConnectOnly.js';
|
|
35
36
|
import { useDebounce } from '../useDebounce/useDebounce.js';
|
|
36
|
-
import {
|
|
37
|
+
import { HandleConnectWalletRejectionError } from './HandleConnectWalletRejectionError.js';
|
|
37
38
|
import { updateUserWalletsFromConnectedWallets } from './updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.js';
|
|
38
39
|
|
|
39
40
|
const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, walletConnectorOptions, handleConnectedWallet, setShowAuthFlow, isBridgeFlow, }) => {
|
|
@@ -182,12 +183,17 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
182
183
|
}
|
|
183
184
|
catch (error) {
|
|
184
185
|
if (error instanceof CustomError) {
|
|
186
|
+
dynamicEvents.emit('walletConnectionFailed', walletConnector, error);
|
|
185
187
|
throw error;
|
|
186
188
|
}
|
|
189
|
+
dynamicEvents.emit('walletConnectionFailed', walletConnector, error);
|
|
190
|
+
throw new MissingPublicAddressError();
|
|
187
191
|
}
|
|
188
192
|
// Throw a generic error for any errors we're not processing above
|
|
189
193
|
if (!walletAddress) {
|
|
190
|
-
|
|
194
|
+
const missingPublicAddressError = new MissingPublicAddressError();
|
|
195
|
+
dynamicEvents.emit('walletConnectionFailed', walletConnector, missingPublicAddressError);
|
|
196
|
+
throw missingPublicAddressError;
|
|
191
197
|
}
|
|
192
198
|
if (handleConnectedWallet && applyHandleConnectedWallet) {
|
|
193
199
|
const shouldProceedWithConnection = yield handleConnectedWallet({
|
|
@@ -198,6 +204,7 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
198
204
|
if (!shouldProceedWithConnection) {
|
|
199
205
|
logger.info('Connection was not established because handleConnectedWallet returned false');
|
|
200
206
|
setShowAuthFlow(false);
|
|
207
|
+
dynamicEvents.emit('walletConnectionFailed', walletConnector, new HandleConnectWalletRejectionError(walletConnector));
|
|
201
208
|
return;
|
|
202
209
|
}
|
|
203
210
|
}
|
|
@@ -210,7 +217,7 @@ const useConnectWallet = ({ enableVisitTrackingOnConnectOnly, environmentId, pri
|
|
|
210
217
|
// send information to backend to kick off background jobs
|
|
211
218
|
// so verify/sign on the next step could go by more quickly
|
|
212
219
|
// this is async work, but DO NOT AWAIT
|
|
213
|
-
createVisit({
|
|
220
|
+
void createVisit({
|
|
214
221
|
authMode,
|
|
215
222
|
chain: walletChain || '',
|
|
216
223
|
environmentId,
|
|
@@ -9,8 +9,8 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
9
9
|
require('@dynamic-labs-sdk/client');
|
|
10
10
|
require('../../../client/client.cjs');
|
|
11
11
|
require('../../../../../_virtual/_tslib.cjs');
|
|
12
|
-
require('../../constants/values.cjs');
|
|
13
12
|
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
14
|
require('@dynamic-labs/multi-wallet');
|
|
15
15
|
require('../../../shared/logger.cjs');
|
|
16
16
|
require('../../constants/colors.cjs');
|
|
@@ -5,8 +5,8 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
5
5
|
import '@dynamic-labs-sdk/client';
|
|
6
6
|
import '../../../client/client.js';
|
|
7
7
|
import '../../../../../_virtual/_tslib.js';
|
|
8
|
-
import '../../constants/values.js';
|
|
9
8
|
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
10
|
import '@dynamic-labs/multi-wallet';
|
|
11
11
|
import '../../../shared/logger.js';
|
|
12
12
|
import '../../constants/colors.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useIsMfaEnabled } from './useIsMfaEnabled';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var useIsPasskeysMfaEnabled = require('../useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.cjs');
|
|
7
|
+
var useIsTotpMfaEnabled = require('../useIsTotpMfaEnabled/useIsTotpMfaEnabled.cjs');
|
|
8
|
+
|
|
9
|
+
const useIsMfaEnabled = () => {
|
|
10
|
+
const isTotpMfaEnabled = useIsTotpMfaEnabled.useIsTotpMfaEnabled();
|
|
11
|
+
const isPasskeysMfaEnabled = useIsPasskeysMfaEnabled.useIsPasskeysMfaEnabled();
|
|
12
|
+
return isTotpMfaEnabled || isPasskeysMfaEnabled;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.useIsMfaEnabled = useIsMfaEnabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsMfaEnabled: () => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useIsPasskeysMfaEnabled } from '../useIsPasskeysMfaEnabled/useIsPasskeysMfaEnabled.js';
|
|
3
|
+
import { useIsTotpMfaEnabled } from '../useIsTotpMfaEnabled/useIsTotpMfaEnabled.js';
|
|
4
|
+
|
|
5
|
+
const useIsMfaEnabled = () => {
|
|
6
|
+
const isTotpMfaEnabled = useIsTotpMfaEnabled();
|
|
7
|
+
const isPasskeysMfaEnabled = useIsPasskeysMfaEnabled();
|
|
8
|
+
return isTotpMfaEnabled || isPasskeysMfaEnabled;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useIsMfaEnabled };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useIsPasskeysMfaEnabled } from './useIsPasskeysMfaEnabled';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
7
|
+
var projectSettings = require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
8
|
+
|
|
9
|
+
const useIsPasskeysMfaEnabled = () => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const projectSettings$1 = projectSettings.useProjectSettings();
|
|
12
|
+
return Boolean((_c = (_b = (_a = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.security) === null || _a === void 0 ? void 0 : _a.mfa) === null || _b === void 0 ? void 0 : _b.methods) === null || _c === void 0 ? void 0 : _c.find((method) => method.type === sdkApiCore.MFADeviceType.Passkey && method.enabled));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.useIsPasskeysMfaEnabled = useIsPasskeysMfaEnabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsPasskeysMfaEnabled: () => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { MFADeviceType } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { useProjectSettings } from '../../../store/state/projectSettings/projectSettings.js';
|
|
4
|
+
|
|
5
|
+
const useIsPasskeysMfaEnabled = () => {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const projectSettings = useProjectSettings();
|
|
8
|
+
return Boolean((_c = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security) === null || _a === void 0 ? void 0 : _a.mfa) === null || _b === void 0 ? void 0 : _b.methods) === null || _c === void 0 ? void 0 : _c.find((method) => method.type === MFADeviceType.Passkey && method.enabled));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useIsPasskeysMfaEnabled };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useIsTotpMfaEnabled } from './useIsTotpMfaEnabled';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
7
|
+
var projectSettings = require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
8
|
+
|
|
9
|
+
const useIsTotpMfaEnabled = () => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const projectSettings$1 = projectSettings.useProjectSettings();
|
|
12
|
+
return Boolean((_c = (_b = (_a = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.security) === null || _a === void 0 ? void 0 : _a.mfa) === null || _b === void 0 ? void 0 : _b.methods) === null || _c === void 0 ? void 0 : _c.find((method) => method.type === sdkApiCore.MFADeviceType.Totp && method.enabled));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.useIsTotpMfaEnabled = useIsTotpMfaEnabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsTotpMfaEnabled: () => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { MFADeviceType } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { useProjectSettings } from '../../../store/state/projectSettings/projectSettings.js';
|
|
4
|
+
|
|
5
|
+
const useIsTotpMfaEnabled = () => {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const projectSettings = useProjectSettings();
|
|
8
|
+
return Boolean((_c = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security) === null || _a === void 0 ? void 0 : _a.mfa) === null || _b === void 0 ? void 0 : _b.methods) === null || _c === void 0 ? void 0 : _c.find((method) => method.type === MFADeviceType.Totp && method.enabled));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useIsTotpMfaEnabled };
|
|
@@ -10,8 +10,8 @@ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
|
10
10
|
var client = require('../../../client/client.cjs');
|
|
11
11
|
var verifyTotpMfaDevice = require('../../../client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.cjs');
|
|
12
12
|
require('@dynamic-labs-sdk/client/core');
|
|
13
|
-
require('../../constants/values.cjs');
|
|
14
13
|
require('@dynamic-labs/utils');
|
|
14
|
+
require('../../constants/values.cjs');
|
|
15
15
|
require('@dynamic-labs/multi-wallet');
|
|
16
16
|
require('../../../shared/logger.cjs');
|
|
17
17
|
require('../../constants/colors.cjs');
|
|
@@ -6,8 +6,8 @@ import { MFADeviceType } from '@dynamic-labs/sdk-api-core';
|
|
|
6
6
|
import { useDynamicClient } from '../../../client/client.js';
|
|
7
7
|
import { verifyTotpMfaDevice } from '../../../client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.js';
|
|
8
8
|
import '@dynamic-labs-sdk/client/core';
|
|
9
|
-
import '../../constants/values.js';
|
|
10
9
|
import '@dynamic-labs/utils';
|
|
10
|
+
import '../../constants/values.js';
|
|
11
11
|
import '@dynamic-labs/multi-wallet';
|
|
12
12
|
import '../../../shared/logger.js';
|
|
13
13
|
import '../../constants/colors.js';
|