@dynamic-labs/sdk-react-core 2.1.0-alpha.17 → 2.1.0-alpha.19
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 +18 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.cjs +15 -0
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.d.ts +2 -0
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.js +11 -0
- package/src/lib/components/MfaRecoveryIcon/index.d.ts +1 -0
- package/src/lib/components/Portal/Portal.cjs +0 -1
- package/src/lib/components/Portal/Portal.js +0 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +5 -2
- package/src/lib/components/SocialSignIn/SocialSignIn.js +5 -2
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.cjs +16 -28
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.js +16 -28
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -1
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +4 -5
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +4 -5
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +1 -1
- package/src/lib/context/PasskeyContext/PasskeyContext.js +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/api.cjs +2 -2
- package/src/lib/data/api/api.js +2 -2
- package/src/lib/data/api/user/user.cjs +3 -0
- package/src/lib/data/api/user/user.js +4 -1
- package/src/lib/locale/en/translation.cjs +38 -21
- package/src/lib/locale/en/translation.d.ts +38 -21
- package/src/lib/locale/en/translation.js +38 -21
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +19 -2
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +19 -2
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/mfa-recovery-icon.cjs +54 -0
- package/src/lib/shared/assets/mfa-recovery-icon.js +30 -0
- package/src/lib/shared/utils/functions/lastAuthenticatedAccount/index.d.ts +2 -2
- package/src/lib/shared/utils/functions/wallet/createWallet.d.ts +4 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.d.ts +2 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.cjs +21 -0
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.js +17 -0
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.cjs +6 -3
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +2 -1
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.js +7 -4
- package/src/lib/utils/functions/validateMfaRecoveryCode/index.d.ts +1 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.cjs +11 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.d.ts +1 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.js +7 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -3
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -3
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +8 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +8 -0
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +10 -1
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.d.ts +5 -0
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +10 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +21 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +21 -1
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +1 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +1 -0
- package/src/lib/utils/hooks/useMfaModals/index.d.ts +1 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +131 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.d.ts +8 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +127 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +24 -3
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +24 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -4
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +3 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +8 -4
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +42 -35
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +43 -36
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +7 -2
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +7 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -10
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -10
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.cjs +1 -1
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +5 -2
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +5 -2
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +116 -0
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.d.ts +2 -0
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +112 -0
- package/src/lib/views/MfaRecoveryView/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -2
- package/src/lib/views/viewToComponentMap.d.ts +2 -2
- package/src/lib/views/viewToComponentMap.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +5 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +5 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +3 -3
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +0 -131
- package/src/lib/views/EmailUpdate/EmailUpdate.d.ts +0 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +0 -127
- package/src/lib/views/EmailUpdate/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.18...v2.1.0-alpha.19) (2024-05-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add createUserProfileFromSDKUser ([#5596](https://github.com/dynamic-labs/DynamicAuth/issues/5596)) ([d37a1b4](https://github.com/dynamic-labs/DynamicAuth/commit/d37a1b4119f5ff4fff1e987d157f6d5abf105a8b))
|
|
8
|
+
* add headless social sign-in ([#5439](https://github.com/dynamic-labs/DynamicAuth/issues/5439)) ([e32fdf8](https://github.com/dynamic-labs/DynamicAuth/commit/e32fdf863718d661b90b592c8df734e92386ddf3))
|
|
9
|
+
* fetch custom fields in profile and update user ([#5627](https://github.com/dynamic-labs/DynamicAuth/issues/5627)) ([3940c25](https://github.com/dynamic-labs/DynamicAuth/commit/3940c2542bb330f3ed9a8eb98eed9d05c8fcb03a))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* include applinks details to AASA ([#5635](https://github.com/dynamic-labs/DynamicAuth/issues/5635)) ([ce94fec](https://github.com/dynamic-labs/DynamicAuth/commit/ce94fec80adbb3eb4efcb79d1aa2cc6eb35eab6f))
|
|
15
|
+
* include the appOrigin to every api call to create correct passkey ([#5636](https://github.com/dynamic-labs/DynamicAuth/issues/5636)) ([ee64df3](https://github.com/dynamic-labs/DynamicAuth/commit/ee64df3b90037bd29cca161e601973ef202c58f0))
|
|
16
|
+
* use PromptModal when using the DynamicMultiWalletPromptsWidget for pending connection views ([#5594](https://github.com/dynamic-labs/DynamicAuth/issues/5594)) ([c095b6e](https://github.com/dynamic-labs/DynamicAuth/commit/c095b6e4c974f02cfe632963be92d16bb201dfa5))
|
|
17
|
+
|
|
18
|
+
## [2.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.17...v2.1.0-alpha.18) (2024-05-15)
|
|
19
|
+
|
|
2
20
|
## [2.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.16...v2.1.0-alpha.17) (2024-05-15)
|
|
3
21
|
|
|
4
22
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "2.1.0-alpha.
|
|
6
|
+
var version = "2.1.0-alpha.19";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.444",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "2.1.0-alpha.
|
|
2
|
+
var version = "2.1.0-alpha.19";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.444",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.19",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
7
7
|
"directory": "packages/sdk-react-core"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
10
|
+
"@dynamic-labs/sdk-api-core": "0.0.444",
|
|
11
11
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
12
12
|
"country-list": "2.3.0",
|
|
13
13
|
"formik": "2.2.9",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
20
|
"zustand": "4.5.2",
|
|
21
|
-
"@dynamic-labs/iconic": "2.1.0-alpha.
|
|
22
|
-
"@dynamic-labs/logger": "2.1.0-alpha.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "2.1.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.
|
|
25
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "2.1.0-alpha.
|
|
27
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
28
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.1.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
21
|
+
"@dynamic-labs/iconic": "2.1.0-alpha.19",
|
|
22
|
+
"@dynamic-labs/logger": "2.1.0-alpha.19",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "2.1.0-alpha.19",
|
|
24
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.19",
|
|
25
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.19",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.19",
|
|
27
|
+
"@dynamic-labs/types": "2.1.0-alpha.19",
|
|
28
|
+
"@dynamic-labs/utils": "2.1.0-alpha.19",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.19",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.19",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.19",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var Icon = require('../Icon/Icon.cjs');
|
|
8
|
+
require('@dynamic-labs/iconic');
|
|
9
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
10
|
+
require('react');
|
|
11
|
+
var mfaRecoveryIcon = require('../../shared/assets/mfa-recovery-icon.cjs');
|
|
12
|
+
|
|
13
|
+
const MfaRecoveryScreenIcon = (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(mfaRecoveryIcon.ReactComponent, Object.assign({}, props, { "data-testid": 'mfa-recovery-icon' })) }));
|
|
14
|
+
|
|
15
|
+
exports.MfaRecoveryScreenIcon = MfaRecoveryScreenIcon;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Icon } from '../Icon/Icon.js';
|
|
4
|
+
import '@dynamic-labs/iconic';
|
|
5
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { ReactComponent as SvgMfaRecoveryIcon } from '../../shared/assets/mfa-recovery-icon.js';
|
|
8
|
+
|
|
9
|
+
const MfaRecoveryScreenIcon = (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgMfaRecoveryIcon, Object.assign({}, props, { "data-testid": 'mfa-recovery-icon' })) }));
|
|
10
|
+
|
|
11
|
+
export { MfaRecoveryScreenIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MfaRecoveryScreenIcon } from './MfaRecoveryIcon';
|
|
@@ -83,7 +83,6 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
|
|
|
83
83
|
const { view } = ViewContext.useViewContext();
|
|
84
84
|
const shouldCloseOnBackdropClick = (view === null || view === void 0 ? void 0 : view.type) &&
|
|
85
85
|
view.type !== 'collect-user-data' &&
|
|
86
|
-
view.type !== 'update-email' &&
|
|
87
86
|
view.type !== 'login-with-email-verification' &&
|
|
88
87
|
view.type !== 'login-with-sms-verification' &&
|
|
89
88
|
view.type !== 'verify-sms' &&
|
|
@@ -75,7 +75,6 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
|
|
|
75
75
|
const { view } = useViewContext();
|
|
76
76
|
const shouldCloseOnBackdropClick = (view === null || view === void 0 ? void 0 : view.type) &&
|
|
77
77
|
view.type !== 'collect-user-data' &&
|
|
78
|
-
view.type !== 'update-email' &&
|
|
79
78
|
view.type !== 'login-with-email-verification' &&
|
|
80
79
|
view.type !== 'login-with-sms-verification' &&
|
|
81
80
|
view.type !== 'verify-sms' &&
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
8
9
|
var iconic = require('@dynamic-labs/iconic');
|
|
9
10
|
require('@dynamic-labs/sdk-api-core');
|
|
10
11
|
var logger = require('../../shared/logger.cjs');
|
|
@@ -42,7 +43,6 @@ require('@dynamic-labs/types');
|
|
|
42
43
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
43
44
|
require('yup');
|
|
44
45
|
require('../../context/MockContext/MockContext.cjs');
|
|
45
|
-
require('react-i18next');
|
|
46
46
|
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
47
47
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
48
48
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -86,6 +86,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
|
|
|
86
86
|
|
|
87
87
|
const INTERNAL_MAX_INLINE_ITEMS = 5;
|
|
88
88
|
const SocialSignIn = ({ providers, onSelectProvider, isLoading, selectedProvider, testId, defaultProvider, numOfItemsToDisplay: externalMaxInlineItems = 5, collapsedLayout, }) => {
|
|
89
|
+
const { t } = reactI18next.useTranslation();
|
|
89
90
|
const iconThemeVariant = useIconThemeVariant.useIconThemeVariant();
|
|
90
91
|
// ====================================
|
|
91
92
|
// INLINE VS DEFAULT PROVIDERS
|
|
@@ -123,7 +124,9 @@ const SocialSignIn = ({ providers, onSelectProvider, isLoading, selectedProvider
|
|
|
123
124
|
'social-sign-in--tile__full-width': fullWidth,
|
|
124
125
|
}), children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon:
|
|
125
126
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
126
|
-
jsxRuntime.jsx(iconic.SocialIcon, { name: getProviderAsString(provider), variant: iconThemeVariant }), isSpinning: selectedProvider === provider, iconSize: 32 }), !insideCard && fullWidth && (jsxRuntime.
|
|
127
|
+
jsxRuntime.jsx(iconic.SocialIcon, { name: getProviderAsString(provider), variant: iconThemeVariant }), isSpinning: selectedProvider === provider, iconSize: 32 }), !insideCard && fullWidth && (jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', copykey: 'dyn_login.social.button_label', children: t('dyn_login.social.button_label', {
|
|
128
|
+
provider: providerLabel.providerLabel(provider),
|
|
129
|
+
}) }))] }, getProviderAsString(provider)));
|
|
127
130
|
if (!providers.length) {
|
|
128
131
|
logger.logger.error('Failed to render SocialSignInSection - no social providers enabled');
|
|
129
132
|
return null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
4
5
|
import { SocialIcon } from '@dynamic-labs/iconic';
|
|
5
6
|
import '@dynamic-labs/sdk-api-core';
|
|
6
7
|
import { logger } from '../../shared/logger.js';
|
|
@@ -38,7 +39,6 @@ import '@dynamic-labs/types';
|
|
|
38
39
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
39
40
|
import 'yup';
|
|
40
41
|
import '../../context/MockContext/MockContext.js';
|
|
41
|
-
import 'react-i18next';
|
|
42
42
|
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
43
43
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
44
44
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -82,6 +82,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
|
|
|
82
82
|
|
|
83
83
|
const INTERNAL_MAX_INLINE_ITEMS = 5;
|
|
84
84
|
const SocialSignIn = ({ providers, onSelectProvider, isLoading, selectedProvider, testId, defaultProvider, numOfItemsToDisplay: externalMaxInlineItems = 5, collapsedLayout, }) => {
|
|
85
|
+
const { t } = useTranslation();
|
|
85
86
|
const iconThemeVariant = useIconThemeVariant();
|
|
86
87
|
// ====================================
|
|
87
88
|
// INLINE VS DEFAULT PROVIDERS
|
|
@@ -119,7 +120,9 @@ const SocialSignIn = ({ providers, onSelectProvider, isLoading, selectedProvider
|
|
|
119
120
|
'social-sign-in--tile__full-width': fullWidth,
|
|
120
121
|
}), children: [jsx(IconWithSpinner, { Icon:
|
|
121
122
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
122
|
-
jsx(SocialIcon, { name: getProviderAsString(provider), variant: iconThemeVariant }), isSpinning: selectedProvider === provider, iconSize: 32 }), !insideCard && fullWidth && (
|
|
123
|
+
jsx(SocialIcon, { name: getProviderAsString(provider), variant: iconThemeVariant }), isSpinning: selectedProvider === provider, iconSize: 32 }), !insideCard && fullWidth && (jsx(Typography, { variant: 'button_primary', copykey: 'dyn_login.social.button_label', children: t('dyn_login.social.button_label', {
|
|
124
|
+
provider: providerLabel(provider),
|
|
125
|
+
}) }))] }, getProviderAsString(provider)));
|
|
123
126
|
if (!providers.length) {
|
|
124
127
|
logger.error('Failed to render SocialSignInSection - no social providers enabled');
|
|
125
128
|
return null;
|
|
@@ -13,21 +13,18 @@ require('@dynamic-labs/wallet-connector-core');
|
|
|
13
13
|
require('react/jsx-runtime');
|
|
14
14
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
15
15
|
require('@dynamic-labs/wallet-book');
|
|
16
|
-
var localStorage$1 = require('../../utils/constants/localStorage.cjs');
|
|
17
16
|
require('../../utils/constants/colors.cjs');
|
|
18
17
|
require('../../utils/constants/values.cjs');
|
|
19
|
-
|
|
18
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
19
|
require('@dynamic-labs/utils');
|
|
21
20
|
require('../../shared/consts/index.cjs');
|
|
22
|
-
require('../../events/
|
|
21
|
+
var useDynamicEvents = require('../../utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs');
|
|
23
22
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
23
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
25
24
|
require('@dynamic-labs/multi-wallet');
|
|
26
25
|
require('react-international-phone');
|
|
27
|
-
var isTurnkeyEnabled = require('../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
28
26
|
require('viem');
|
|
29
27
|
require('viem/chains');
|
|
30
|
-
var isCoinbaseWaasEnabled = require('../../utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.cjs');
|
|
31
28
|
require('../../config/ApiEndpoint.cjs');
|
|
32
29
|
require('../../locale/locale.cjs');
|
|
33
30
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
@@ -35,11 +32,12 @@ require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
|
35
32
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
36
33
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
37
34
|
require('react-dom');
|
|
35
|
+
require('../../events/dynamicEvents.cjs');
|
|
38
36
|
var useEmbeddedWallet = require('../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
39
37
|
var WalletContext = require('../../context/WalletContext/WalletContext.cjs');
|
|
40
38
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
41
39
|
require('@dynamic-labs/types');
|
|
42
|
-
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
40
|
+
var LoadingContext = require('../../context/LoadingContext/LoadingContext.cjs');
|
|
43
41
|
require('yup');
|
|
44
42
|
require('../../context/MockContext/MockContext.cjs');
|
|
45
43
|
require('react-i18next');
|
|
@@ -81,15 +79,17 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
81
79
|
const SyncEmbeddedWalletAuthFlow = () => {
|
|
82
80
|
const { projectSettings, isProjectSettingsLoading, user, primaryWalletId, walletConnectorOptions, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
83
81
|
const { isLoadingEmbeddedWallet } = WalletContext.useWalletContext();
|
|
84
|
-
const
|
|
85
|
-
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
82
|
+
const { loading: globalLoading } = LoadingContext.useLoadingContext();
|
|
83
|
+
const { createEmbeddedWallet, shouldAutoCreateEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
86
84
|
const triggeredCreate = React.useRef(false);
|
|
85
|
+
useDynamicEvents.useInternalDynamicEvents('logout', () => {
|
|
86
|
+
triggeredCreate.current = false;
|
|
87
|
+
});
|
|
87
88
|
// this is used to trigger createEmbeddedWallet
|
|
88
|
-
// when user didn't create a passkey after login
|
|
89
|
+
// when user didn't create a passkey after login,
|
|
89
90
|
// we force them to created it before they can use the app
|
|
90
91
|
// ** It must be an useEffect because some of the dependencies are async
|
|
91
92
|
React.useEffect(() => {
|
|
92
|
-
var _a, _b, _c, _d, _e, _f;
|
|
93
93
|
const createWallet = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
94
94
|
triggeredCreate.current = true;
|
|
95
95
|
try {
|
|
@@ -99,41 +99,29 @@ const SyncEmbeddedWalletAuthFlow = () => {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
const shouldCreateWallet = shouldAutoCreateEmbeddedWallet();
|
|
103
|
+
if (!shouldCreateWallet ||
|
|
104
|
+
!user ||
|
|
105
105
|
isProjectSettingsLoading ||
|
|
106
106
|
!projectSettings ||
|
|
107
|
-
!hasEmbeddedWalletProviderEnabled ||
|
|
108
107
|
!walletConnectorOptions.length || // no connectors to use for the embedded wallet
|
|
109
|
-
primaryWalletId || //should not override primary wallet
|
|
110
108
|
isLoadingEmbeddedWallet || // already has a wallet
|
|
111
|
-
|
|
109
|
+
globalLoading || // this will be true if auth is in progress
|
|
112
110
|
triggeredCreate.current // already triggered
|
|
113
111
|
) {
|
|
114
112
|
return;
|
|
115
113
|
}
|
|
116
|
-
// Turnkey specific rules
|
|
117
|
-
if (
|
|
118
|
-
// if coinbase is enabled it should still call createWallet, despite the turnkey rules
|
|
119
|
-
!isCoinbaseWaasEnabled.isCoinbaseWaasEnabled(projectSettings) &&
|
|
120
|
-
isTurnkeyEnabled.isTurnkeyEnabled(projectSettings) &&
|
|
121
|
-
// If customer allows user to skip passkey creation, don't trigger createEmbeddedWallet on refresh
|
|
122
|
-
(!((_b = (_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) ||
|
|
123
|
-
((_d = (_c = projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.embeddedWallets) === null || _d === void 0 ? void 0 : _d.allowSkippingAuthenticatorAtSignup) ||
|
|
124
|
-
!((_f = (_e = projectSettings.sdk) === null || _e === void 0 ? void 0 : _e.embeddedWallets) === null || _f === void 0 ? void 0 : _f.forceAuthenticatorAtSignup))) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
114
|
createWallet();
|
|
128
115
|
}, [
|
|
129
116
|
user,
|
|
130
117
|
isProjectSettingsLoading,
|
|
131
118
|
projectSettings,
|
|
132
119
|
primaryWalletId,
|
|
133
|
-
lastUsedWallet,
|
|
134
120
|
createEmbeddedWallet,
|
|
135
121
|
isLoadingEmbeddedWallet,
|
|
136
122
|
walletConnectorOptions,
|
|
123
|
+
globalLoading,
|
|
124
|
+
shouldAutoCreateEmbeddedWallet,
|
|
137
125
|
]);
|
|
138
126
|
return null;
|
|
139
127
|
};
|
|
@@ -9,21 +9,18 @@ import '@dynamic-labs/wallet-connector-core';
|
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import '../../context/ViewContext/ViewContext.js';
|
|
11
11
|
import '@dynamic-labs/wallet-book';
|
|
12
|
-
import { LAST_USED_WALLET } from '../../utils/constants/localStorage.js';
|
|
13
12
|
import '../../utils/constants/colors.js';
|
|
14
13
|
import '../../utils/constants/values.js';
|
|
15
|
-
import
|
|
14
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
16
15
|
import '@dynamic-labs/utils';
|
|
17
16
|
import '../../shared/consts/index.js';
|
|
18
|
-
import '../../events/
|
|
17
|
+
import { useInternalDynamicEvents } from '../../utils/hooks/events/useDynamicEvents/useDynamicEvents.js';
|
|
19
18
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
20
19
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
21
20
|
import '@dynamic-labs/multi-wallet';
|
|
22
21
|
import 'react-international-phone';
|
|
23
|
-
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
24
22
|
import 'viem';
|
|
25
23
|
import 'viem/chains';
|
|
26
|
-
import { isCoinbaseWaasEnabled } from '../../utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.js';
|
|
27
24
|
import '../../config/ApiEndpoint.js';
|
|
28
25
|
import '../../locale/locale.js';
|
|
29
26
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
@@ -31,11 +28,12 @@ import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
|
31
28
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
32
29
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
33
30
|
import 'react-dom';
|
|
31
|
+
import '../../events/dynamicEvents.js';
|
|
34
32
|
import { useEmbeddedWallet } from '../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
35
33
|
import { useWalletContext } from '../../context/WalletContext/WalletContext.js';
|
|
36
34
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
37
35
|
import '@dynamic-labs/types';
|
|
38
|
-
import '../../context/LoadingContext/LoadingContext.js';
|
|
36
|
+
import { useLoadingContext } from '../../context/LoadingContext/LoadingContext.js';
|
|
39
37
|
import 'yup';
|
|
40
38
|
import '../../context/MockContext/MockContext.js';
|
|
41
39
|
import 'react-i18next';
|
|
@@ -77,15 +75,17 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
77
75
|
const SyncEmbeddedWalletAuthFlow = () => {
|
|
78
76
|
const { projectSettings, isProjectSettingsLoading, user, primaryWalletId, walletConnectorOptions, } = useInternalDynamicContext();
|
|
79
77
|
const { isLoadingEmbeddedWallet } = useWalletContext();
|
|
80
|
-
const
|
|
81
|
-
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
78
|
+
const { loading: globalLoading } = useLoadingContext();
|
|
79
|
+
const { createEmbeddedWallet, shouldAutoCreateEmbeddedWallet } = useEmbeddedWallet();
|
|
82
80
|
const triggeredCreate = useRef(false);
|
|
81
|
+
useInternalDynamicEvents('logout', () => {
|
|
82
|
+
triggeredCreate.current = false;
|
|
83
|
+
});
|
|
83
84
|
// this is used to trigger createEmbeddedWallet
|
|
84
|
-
// when user didn't create a passkey after login
|
|
85
|
+
// when user didn't create a passkey after login,
|
|
85
86
|
// we force them to created it before they can use the app
|
|
86
87
|
// ** It must be an useEffect because some of the dependencies are async
|
|
87
88
|
useEffect(() => {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f;
|
|
89
89
|
const createWallet = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
90
|
triggeredCreate.current = true;
|
|
91
91
|
try {
|
|
@@ -95,41 +95,29 @@ const SyncEmbeddedWalletAuthFlow = () => {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const shouldCreateWallet = shouldAutoCreateEmbeddedWallet();
|
|
99
|
+
if (!shouldCreateWallet ||
|
|
100
|
+
!user ||
|
|
101
101
|
isProjectSettingsLoading ||
|
|
102
102
|
!projectSettings ||
|
|
103
|
-
!hasEmbeddedWalletProviderEnabled ||
|
|
104
103
|
!walletConnectorOptions.length || // no connectors to use for the embedded wallet
|
|
105
|
-
primaryWalletId || //should not override primary wallet
|
|
106
104
|
isLoadingEmbeddedWallet || // already has a wallet
|
|
107
|
-
|
|
105
|
+
globalLoading || // this will be true if auth is in progress
|
|
108
106
|
triggeredCreate.current // already triggered
|
|
109
107
|
) {
|
|
110
108
|
return;
|
|
111
109
|
}
|
|
112
|
-
// Turnkey specific rules
|
|
113
|
-
if (
|
|
114
|
-
// if coinbase is enabled it should still call createWallet, despite the turnkey rules
|
|
115
|
-
!isCoinbaseWaasEnabled(projectSettings) &&
|
|
116
|
-
isTurnkeyEnabled(projectSettings) &&
|
|
117
|
-
// If customer allows user to skip passkey creation, don't trigger createEmbeddedWallet on refresh
|
|
118
|
-
(!((_b = (_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) ||
|
|
119
|
-
((_d = (_c = projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.embeddedWallets) === null || _d === void 0 ? void 0 : _d.allowSkippingAuthenticatorAtSignup) ||
|
|
120
|
-
!((_f = (_e = projectSettings.sdk) === null || _e === void 0 ? void 0 : _e.embeddedWallets) === null || _f === void 0 ? void 0 : _f.forceAuthenticatorAtSignup))) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
110
|
createWallet();
|
|
124
111
|
}, [
|
|
125
112
|
user,
|
|
126
113
|
isProjectSettingsLoading,
|
|
127
114
|
projectSettings,
|
|
128
115
|
primaryWalletId,
|
|
129
|
-
lastUsedWallet,
|
|
130
116
|
createEmbeddedWallet,
|
|
131
117
|
isLoadingEmbeddedWallet,
|
|
132
118
|
walletConnectorOptions,
|
|
119
|
+
globalLoading,
|
|
120
|
+
shouldAutoCreateEmbeddedWallet,
|
|
133
121
|
]);
|
|
134
122
|
return null;
|
|
135
123
|
};
|
|
@@ -4,7 +4,7 @@ export type UserProfileFieldProps = {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
label?: string;
|
|
6
6
|
name: string;
|
|
7
|
-
value
|
|
7
|
+
value: string | boolean | null | undefined;
|
|
8
8
|
autoComplete?: string;
|
|
9
9
|
} & CopyKey;
|
|
10
10
|
export declare const UserProfileField: ({ name, label, value, copykey, autoComplete, }: UserProfileFieldProps) => JSX.Element;
|
|
@@ -11,6 +11,7 @@ export * from './CopyButton';
|
|
|
11
11
|
export * from './Divider';
|
|
12
12
|
export * from './DynamicConnectButton';
|
|
13
13
|
export * from './EmailIcon';
|
|
14
|
+
export * from './MfaRecoveryIcon';
|
|
14
15
|
export * from './EnterTileAnimation';
|
|
15
16
|
export * from './ErrorContainer';
|
|
16
17
|
export * from './FormFieldLabel';
|
|
@@ -303,8 +303,8 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
303
303
|
walletBook: walletBook$1,
|
|
304
304
|
});
|
|
305
305
|
const { getNameService, removeConnectedNameService } = useNameService.useNameService({
|
|
306
|
-
authToken,
|
|
307
306
|
currentWallet: primaryWallet !== null && primaryWallet !== void 0 ? primaryWallet : connectedWallets[0],
|
|
307
|
+
user,
|
|
308
308
|
});
|
|
309
309
|
const { clearAllWalletConnectSessions } = useClearWalletConnectSessions.useClearWalletConnectSessions({
|
|
310
310
|
connectors: walletConnectors,
|
|
@@ -299,8 +299,8 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
299
299
|
walletBook,
|
|
300
300
|
});
|
|
301
301
|
const { getNameService, removeConnectedNameService } = useNameService({
|
|
302
|
-
authToken,
|
|
303
302
|
currentWallet: primaryWallet !== null && primaryWallet !== void 0 ? primaryWallet : connectedWallets[0],
|
|
303
|
+
user,
|
|
304
304
|
});
|
|
305
305
|
const { clearAllWalletConnectSessions } = useClearWalletConnectSessions({
|
|
306
306
|
connectors: walletConnectors,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var decodeJwt = require('../../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
9
8
|
require('@dynamic-labs/sdk-api-core');
|
|
10
9
|
require('../../../../shared/logger.cjs');
|
|
11
10
|
require('@dynamic-labs/iconic');
|
|
@@ -22,7 +21,7 @@ require('@dynamic-labs/utils');
|
|
|
22
21
|
require('../../../../shared/consts/index.cjs');
|
|
23
22
|
var getWalletVerifiedCredential = require('../../../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.cjs');
|
|
24
23
|
|
|
25
|
-
const useNameService = ({ currentWallet,
|
|
24
|
+
const useNameService = ({ currentWallet, user }) => {
|
|
26
25
|
const [connectedNameService, setConnectedNameService, removeConnectedNameService,] = useLocalStorage.useLocalStorage(localStorage.CONNECTED_WALLET_NAME_SERVICE, null);
|
|
27
26
|
const lastFetchedNameServiceAddress = React.useRef();
|
|
28
27
|
const lastFetchedNameServiceNetwork = React.useRef();
|
|
@@ -60,16 +59,16 @@ const useNameService = ({ currentWallet, authToken }) => {
|
|
|
60
59
|
return undefined;
|
|
61
60
|
}), [setConnectedNameService]);
|
|
62
61
|
const getNameService = (address) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
var _a
|
|
62
|
+
var _a;
|
|
64
63
|
if (!currentWallet) {
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
67
66
|
const network = yield currentWallet.connector.getNetwork();
|
|
68
|
-
const verifiedCredentials =
|
|
67
|
+
const verifiedCredentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
69
68
|
//if there are verified credentials, check if there is a name service for the current wallet
|
|
70
69
|
if (verifiedCredentials) {
|
|
71
70
|
const verifiedCredential = getWalletVerifiedCredential.getWalletVerifiedCredential(currentWallet === null || currentWallet === void 0 ? void 0 : currentWallet.address, verifiedCredentials, currentWallet.chain);
|
|
72
|
-
if (verifiedCredential && ((
|
|
71
|
+
if (verifiedCredential && ((_a = verifiedCredential.nameService) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
73
72
|
return verifiedCredential.nameService;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NameServiceData } from '@dynamic-labs/sdk-api-core';
|
|
2
2
|
import { Wallet } from '../../../../shared';
|
|
3
|
+
import { UserProfile } from '../../../../..';
|
|
3
4
|
type Props = {
|
|
4
|
-
|
|
5
|
+
user: UserProfile | undefined;
|
|
5
6
|
currentWallet: Wallet | null;
|
|
6
7
|
};
|
|
7
|
-
export declare const useNameService: ({ currentWallet,
|
|
8
|
+
export declare const useNameService: ({ currentWallet, user }: Props) => {
|
|
8
9
|
getNameService: (address?: string) => Promise<NameServiceData | undefined>;
|
|
9
10
|
removeConnectedNameService: () => void;
|
|
10
11
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useRef, useCallback } from 'react';
|
|
4
|
-
import { decodeJwt } from '../../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
5
4
|
import '@dynamic-labs/sdk-api-core';
|
|
6
5
|
import '../../../../shared/logger.js';
|
|
7
6
|
import '@dynamic-labs/iconic';
|
|
@@ -18,7 +17,7 @@ import '@dynamic-labs/utils';
|
|
|
18
17
|
import '../../../../shared/consts/index.js';
|
|
19
18
|
import { getWalletVerifiedCredential } from '../../../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.js';
|
|
20
19
|
|
|
21
|
-
const useNameService = ({ currentWallet,
|
|
20
|
+
const useNameService = ({ currentWallet, user }) => {
|
|
22
21
|
const [connectedNameService, setConnectedNameService, removeConnectedNameService,] = useLocalStorage(CONNECTED_WALLET_NAME_SERVICE, null);
|
|
23
22
|
const lastFetchedNameServiceAddress = useRef();
|
|
24
23
|
const lastFetchedNameServiceNetwork = useRef();
|
|
@@ -56,16 +55,16 @@ const useNameService = ({ currentWallet, authToken }) => {
|
|
|
56
55
|
return undefined;
|
|
57
56
|
}), [setConnectedNameService]);
|
|
58
57
|
const getNameService = (address) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var _a
|
|
58
|
+
var _a;
|
|
60
59
|
if (!currentWallet) {
|
|
61
60
|
return;
|
|
62
61
|
}
|
|
63
62
|
const network = yield currentWallet.connector.getNetwork();
|
|
64
|
-
const verifiedCredentials =
|
|
63
|
+
const verifiedCredentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
65
64
|
//if there are verified credentials, check if there is a name service for the current wallet
|
|
66
65
|
if (verifiedCredentials) {
|
|
67
66
|
const verifiedCredential = getWalletVerifiedCredential(currentWallet === null || currentWallet === void 0 ? void 0 : currentWallet.address, verifiedCredentials, currentWallet.chain);
|
|
68
|
-
if (verifiedCredential && ((
|
|
67
|
+
if (verifiedCredential && ((_a = verifiedCredential.nameService) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
69
68
|
return verifiedCredential.nameService;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
@@ -133,7 +133,7 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
|
133
133
|
if (typeof window === 'undefined') {
|
|
134
134
|
return false;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
136
|
+
const hostname = utils.LocationService.getHostname();
|
|
137
137
|
if (!getUserPasskeysResult.data)
|
|
138
138
|
return false;
|
|
139
139
|
return getUserPasskeysResult.data.some((passkey) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { createContext, useContext, useState, useMemo, useCallback } from 'react';
|
|
5
|
-
import { getTLD } from '@dynamic-labs/utils';
|
|
5
|
+
import { LocationService, getTLD } from '@dynamic-labs/utils';
|
|
6
6
|
import '../../events/dynamicEvents.js';
|
|
7
7
|
import '../DynamicContext/DynamicContext.js';
|
|
8
8
|
import '@dynamic-labs/sdk-api-core';
|
|
@@ -129,7 +129,7 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
|
129
129
|
if (typeof window === 'undefined') {
|
|
130
130
|
return false;
|
|
131
131
|
}
|
|
132
|
-
const
|
|
132
|
+
const hostname = LocationService.getHostname();
|
|
133
133
|
if (!getUserPasskeysResult.data)
|
|
134
134
|
return false;
|
|
135
135
|
return getUserPasskeysResult.data.some((passkey) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { viewToComponentMap } from '../../../views/viewToComponentMap';
|
|
3
|
-
export type ViewType = 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | '
|
|
3
|
+
export type ViewType = 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'create-password-view' | 'wallet-claim-intro' | 'farcaster-connect-view';
|
|
4
4
|
export type ViewMapConstraint = Record<ViewType, FC<any>>;
|
|
5
5
|
type ComponentProps<T extends FC<any>> = T extends FC<infer P> ? P : never;
|
|
6
6
|
export type ViewMap = typeof viewToComponentMap;
|