@dynamic-labs/sdk-react-core 0.19.0-alpha.10 → 0.19.0-alpha.11

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +8 -8
  5. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +3 -3
  6. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +4 -4
  7. package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +74 -0
  8. package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.d.ts +2 -0
  9. package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +70 -0
  10. package/src/lib/components/SyncPasskeyFlow/index.d.ts +1 -0
  11. package/src/lib/components/index.d.ts +1 -0
  12. package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -1
  13. package/src/lib/context/DynamicContext/DynamicContext.js +2 -1
  14. package/src/lib/context/DynamicContext/internalEvents/internalEvents.d.ts +2 -0
  15. package/src/lib/locale/en/translation.cjs +4 -3
  16. package/src/lib/locale/en/translation.js +4 -3
  17. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -1
  18. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -1
  19. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.types.d.ts +9 -0
  20. package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +20 -0
  21. package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.d.ts +2 -0
  22. package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +16 -0
  23. package/src/lib/styles/index.shadow.cjs +1 -1
  24. package/src/lib/styles/index.shadow.js +1 -1
  25. package/src/lib/utils/functions/isPasskeyEnabled/isPasskeyEnabled.cjs +10 -2
  26. package/src/lib/utils/functions/isPasskeyEnabled/isPasskeyEnabled.js +10 -2
  27. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +6 -2
  28. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
  29. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +6 -2
  30. package/src/lib/utils/hooks/usePromise/usePromise.cjs +5 -8
  31. package/src/lib/utils/hooks/usePromise/usePromise.js +5 -8
  32. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
  33. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
  34. package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
  35. package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
  36. package/src/lib/views/PasskeyIntroView/PasskeyIntroView.cjs +16 -7
  37. package/src/lib/views/PasskeyIntroView/PasskeyIntroView.js +17 -8
  38. package/src/lib/views/WalletList/data.cjs +8 -1
  39. package/src/lib/views/WalletList/data.d.ts +1 -1
  40. package/src/lib/views/WalletList/data.js +8 -1
  41. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -2
  42. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +3 -3
  43. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +41 -1
  44. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +41 -1
  45. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -2
  46. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
1
 
2
+ ## [0.19.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.10...v0.19.0-alpha.11) (2023-10-02)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **AuthProviderIcon:** ensure social icon shows up ([#3439](https://github.com/dynamic-labs/DynamicAuth/issues/3439)) ([5064f28](https://github.com/dynamic-labs/DynamicAuth/commit/5064f28af9125699c8e23597812c6c526bb8a213))
8
+ * fix passkey on Windows ([#3440](https://github.com/dynamic-labs/DynamicAuth/issues/3440)) ([c0da96c](https://github.com/dynamic-labs/DynamicAuth/commit/c0da96c17c6c10a736fb394b6b1e6be3ccd616b2))
9
+ * missing popper provider ([#3488](https://github.com/dynamic-labs/DynamicAuth/issues/3488)) ([d7ca76e](https://github.com/dynamic-labs/DynamicAuth/commit/d7ca76e21dc5e842c316a654cb20d9dd115d7204))
10
+ * passkey intro view should have a logout button ([#3466](https://github.com/dynamic-labs/DynamicAuth/issues/3466)) ([7ae626f](https://github.com/dynamic-labs/DynamicAuth/commit/7ae626fd2b2b6f685e48257c38ed00dae95d06e4))
11
+ * passkey intro view should not be closed until user create wallet ([#3458](https://github.com/dynamic-labs/DynamicAuth/issues/3458)) ([651459b](https://github.com/dynamic-labs/DynamicAuth/commit/651459b8d8a4ad131381ed8de52c9ef0c42191df))
12
+ * removing weird passkey intro logout button hover background ([#3490](https://github.com/dynamic-labs/DynamicAuth/issues/3490)) ([1adedfa](https://github.com/dynamic-labs/DynamicAuth/commit/1adedfaf87e6fd01e8528ff43ccf75fcb020ef65))
13
+ * resolve promise if there's no error, even if result is falsy ([#3477](https://github.com/dynamic-labs/DynamicAuth/issues/3477)) ([1b570dc](https://github.com/dynamic-labs/DynamicAuth/commit/1b570dc8ae6b104567790d93ebb57efed032ba1c))
14
+ * return promise from createEmbeddedWallet ([#3476](https://github.com/dynamic-labs/DynamicAuth/issues/3476)) ([5a9591e](https://github.com/dynamic-labs/DynamicAuth/commit/5a9591e0808d5d16fb886901902d763eabd8ec61))
15
+ * utilize the wallet connector key when looking up the wallet in localstorage during getWalletConnectorByKey ([#3386](https://github.com/dynamic-labs/DynamicAuth/issues/3386)) ([13a8ef4](https://github.com/dynamic-labs/DynamicAuth/commit/13a8ef4581e7799cc467bddb7cd1435dc4ab4de5))
16
+
2
17
  ## [0.19.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.9...v0.19.0-alpha.10) (2023-09-28)
3
18
 
4
19
 
package/package.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.19.0-alpha.10";
5
+ var version = "0.19.0-alpha.11";
6
6
  var dependencies = {
7
7
  "@dynamic-labs/iconic": "0.1.32",
8
8
  "@dynamic-labs/sdk-api": "0.0.281",
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.19.0-alpha.10";
1
+ var version = "0.19.0-alpha.11";
2
2
  var dependencies = {
3
3
  "@dynamic-labs/iconic": "0.1.32",
4
4
  "@dynamic-labs/sdk-api": "0.0.281",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.19.0-alpha.10",
3
+ "version": "0.19.0-alpha.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -17,13 +17,13 @@
17
17
  "react-focus-lock": "2.9.2",
18
18
  "react-i18next": "^13.2.0",
19
19
  "yup": "0.32.11",
20
- "@dynamic-labs/logger": "0.19.0-alpha.10",
21
- "@dynamic-labs/multi-wallet": "0.19.0-alpha.10",
22
- "@dynamic-labs/rpc-providers": "0.19.0-alpha.10",
23
- "@dynamic-labs/types": "0.19.0-alpha.10",
24
- "@dynamic-labs/utils": "0.19.0-alpha.10",
25
- "@dynamic-labs/wallet-book": "0.19.0-alpha.10",
26
- "@dynamic-labs/wallet-connector-core": "0.19.0-alpha.10",
20
+ "@dynamic-labs/logger": "0.19.0-alpha.11",
21
+ "@dynamic-labs/multi-wallet": "0.19.0-alpha.11",
22
+ "@dynamic-labs/rpc-providers": "0.19.0-alpha.11",
23
+ "@dynamic-labs/types": "0.19.0-alpha.11",
24
+ "@dynamic-labs/utils": "0.19.0-alpha.11",
25
+ "@dynamic-labs/wallet-book": "0.19.0-alpha.11",
26
+ "@dynamic-labs/wallet-connector-core": "0.19.0-alpha.11",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
29
29
  "devDependencies": {
@@ -57,9 +57,6 @@ const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
57
57
  if (walletConnectorCore.isEmailOTPWalletConnector(wallet.connector)) {
58
58
  return iconic.SignInWithEmailIcon;
59
59
  }
60
- if (walletConnectorCore.isEmbeddedConnector(wallet.connector)) {
61
- return embeddedWalletIcon.ReactComponent;
62
- }
63
60
  if (walletConnectorCore.isSocialWalletConnector(wallet.connector)) {
64
61
  const socialAccountDataForWallet = getReferencedAccount.getReferencedAccount(jwt, wallet.id);
65
62
  if (!socialAccountDataForWallet ||
@@ -75,6 +72,9 @@ const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
75
72
  logger.logger.error(err);
76
73
  }
77
74
  }
75
+ if (walletConnectorCore.isEmbeddedConnector(wallet.connector)) {
76
+ return embeddedWalletIcon.ReactComponent;
77
+ }
78
78
  return null;
79
79
  };
80
80
  const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { WalletIcon } from '@dynamic-labs/wallet-book';
3
- import { isEmailOTPWalletConnector, isEmbeddedConnector, isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { isEmailOTPWalletConnector, isSocialWalletConnector, isEmbeddedConnector } from '@dynamic-labs/wallet-connector-core';
4
4
  import { SignInWithEmailIcon } from '@dynamic-labs/iconic';
5
5
  import '@dynamic-labs/sdk-api';
6
6
  import { logger } from '../../shared/logger.js';
@@ -53,9 +53,6 @@ const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
53
53
  if (isEmailOTPWalletConnector(wallet.connector)) {
54
54
  return SignInWithEmailIcon;
55
55
  }
56
- if (isEmbeddedConnector(wallet.connector)) {
57
- return SvgEmbeddedWalletIcon;
58
- }
59
56
  if (isSocialWalletConnector(wallet.connector)) {
60
57
  const socialAccountDataForWallet = getReferencedAccount(jwt, wallet.id);
61
58
  if (!socialAccountDataForWallet ||
@@ -71,6 +68,9 @@ const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
71
68
  logger.error(err);
72
69
  }
73
70
  }
71
+ if (isEmbeddedConnector(wallet.connector)) {
72
+ return SvgEmbeddedWalletIcon;
73
+ }
74
74
  return null;
75
75
  };
76
76
  const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
8
+ require('@dynamic-labs/sdk-api');
9
+ require('../../shared/logger.cjs');
10
+ require('@dynamic-labs/iconic');
11
+ require('@dynamic-labs/wallet-connector-core');
12
+ require('../../context/ViewContext/ViewContext.cjs');
13
+ require('@dynamic-labs/wallet-book');
14
+ require('@dynamic-labs/utils');
15
+ var localStorage$1 = require('../../utils/constants/localStorage.cjs');
16
+ require('../../utils/constants/colors.cjs');
17
+ var localStorage = require('../../shared/utils/classes/storage/localStorage.cjs');
18
+ require('viem');
19
+ require('../../shared/consts/index.cjs');
20
+ require('../../config/ApiEndpoint.cjs');
21
+ require('@dynamic-labs/multi-wallet');
22
+ require('@dynamic-labs/rpc-providers');
23
+ require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
24
+ require('../../context/ErrorContext/ErrorContext.cjs');
25
+ require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
26
+ require('../../context/AccountExistsContext/AccountExistsContext.cjs');
27
+ require('react-dom');
28
+ require('../ShadowDOM/ShadowDOM.cjs');
29
+ require('../../context/ThemeContext/ThemeContext.cjs');
30
+ require('react-focus-lock');
31
+ require('../Transition/ZoomTransition/ZoomTransition.cjs');
32
+ require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
33
+ require('../Transition/OpacityTransition/OpacityTransition.cjs');
34
+ require('../IconButton/IconButton.cjs');
35
+ require('../Alert/Alert.cjs');
36
+ require('../Popper/Popper/Popper.cjs');
37
+ require('../Popper/PopperContext/PopperContext.cjs');
38
+ require('formik');
39
+ require('yup');
40
+ require('../InlineWidget/InlineWidget.cjs');
41
+ require('../MenuList/Dropdown/Dropdown.cjs');
42
+ require('../OverlayCard/OverlayCard.context.cjs');
43
+ require('../../views/CollectUserDataView/fieldsConfig.cjs');
44
+ require('../../context/MockContext/MockContext.cjs');
45
+ require('../../context/CaptchaContext/CaptchaContext.cjs');
46
+ require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
47
+ require('@dynamic-labs/types');
48
+ var useEmbeddedWallet = require('../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
49
+ require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
50
+ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
51
+
52
+ const SyncPasskeyFlow = () => {
53
+ const { projectSettings, isProjectSettingsLoading, authMode } = useInternalDynamicContext.useInternalDynamicContext();
54
+ const lastUsedWallet = localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET);
55
+ const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
56
+ React.useEffect(() => {
57
+ if (authMode === 'connect-only' ||
58
+ isProjectSettingsLoading ||
59
+ !projectSettings ||
60
+ lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
61
+ ) {
62
+ return;
63
+ }
64
+ try {
65
+ createEmbeddedWallet();
66
+ }
67
+ catch (error) {
68
+ return;
69
+ }
70
+ }, [isProjectSettingsLoading, projectSettings, lastUsedWallet]);
71
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {});
72
+ };
73
+
74
+ exports.SyncPasskeyFlow = SyncPasskeyFlow;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const SyncPasskeyFlow: FC;
@@ -0,0 +1,70 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useEffect } from 'react';
3
+ import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
4
+ import '@dynamic-labs/sdk-api';
5
+ import '../../shared/logger.js';
6
+ import '@dynamic-labs/iconic';
7
+ import '@dynamic-labs/wallet-connector-core';
8
+ import '../../context/ViewContext/ViewContext.js';
9
+ import '@dynamic-labs/wallet-book';
10
+ import '@dynamic-labs/utils';
11
+ import { LAST_USED_WALLET } from '../../utils/constants/localStorage.js';
12
+ import '../../utils/constants/colors.js';
13
+ import { LocalStorage } from '../../shared/utils/classes/storage/localStorage.js';
14
+ import 'viem';
15
+ import '../../shared/consts/index.js';
16
+ import '../../config/ApiEndpoint.js';
17
+ import '@dynamic-labs/multi-wallet';
18
+ import '@dynamic-labs/rpc-providers';
19
+ import '../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
20
+ import '../../context/ErrorContext/ErrorContext.js';
21
+ import '../../context/AccessDeniedContext/AccessDeniedContext.js';
22
+ import '../../context/AccountExistsContext/AccountExistsContext.js';
23
+ import 'react-dom';
24
+ import '../ShadowDOM/ShadowDOM.js';
25
+ import '../../context/ThemeContext/ThemeContext.js';
26
+ import 'react-focus-lock';
27
+ import '../Transition/ZoomTransition/ZoomTransition.js';
28
+ import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
29
+ import '../Transition/OpacityTransition/OpacityTransition.js';
30
+ import '../IconButton/IconButton.js';
31
+ import '../Alert/Alert.js';
32
+ import '../Popper/Popper/Popper.js';
33
+ import '../Popper/PopperContext/PopperContext.js';
34
+ import 'formik';
35
+ import 'yup';
36
+ import '../InlineWidget/InlineWidget.js';
37
+ import '../MenuList/Dropdown/Dropdown.js';
38
+ import '../OverlayCard/OverlayCard.context.js';
39
+ import '../../views/CollectUserDataView/fieldsConfig.js';
40
+ import '../../context/MockContext/MockContext.js';
41
+ import '../../context/CaptchaContext/CaptchaContext.js';
42
+ import '../../context/EmailVerificationContext/EmailVerificationContext.js';
43
+ import '@dynamic-labs/types';
44
+ import { useEmbeddedWallet } from '../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
45
+ import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
46
+ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
47
+
48
+ const SyncPasskeyFlow = () => {
49
+ const { projectSettings, isProjectSettingsLoading, authMode } = useInternalDynamicContext();
50
+ const lastUsedWallet = LocalStorage.getFromLS(LAST_USED_WALLET);
51
+ const { createEmbeddedWallet } = useEmbeddedWallet();
52
+ useEffect(() => {
53
+ if (authMode === 'connect-only' ||
54
+ isProjectSettingsLoading ||
55
+ !projectSettings ||
56
+ lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
57
+ ) {
58
+ return;
59
+ }
60
+ try {
61
+ createEmbeddedWallet();
62
+ }
63
+ catch (error) {
64
+ return;
65
+ }
66
+ }, [isProjectSettingsLoading, projectSettings, lastUsedWallet]);
67
+ return jsx(Fragment, {});
68
+ };
69
+
70
+ export { SyncPasskeyFlow };
@@ -0,0 +1 @@
1
+ export { SyncPasskeyFlow } from './SyncPasskeyFlow';
@@ -48,3 +48,4 @@ export * from './WalletInformationCard';
48
48
  export * from './MenuList';
49
49
  export * from './SocialSignIn';
50
50
  export * from './SignMessagePreview';
51
+ export * from './SyncPasskeyFlow';
@@ -62,6 +62,7 @@ require('formik');
62
62
  require('../../components/InlineWidget/InlineWidget.cjs');
63
63
  require('../../components/MenuList/Dropdown/Dropdown.cjs');
64
64
  require('../../components/OverlayCard/OverlayCard.context.cjs');
65
+ var SyncPasskeyFlow = require('../../components/SyncPasskeyFlow/SyncPasskeyFlow.cjs');
65
66
  var locale = require('../../locale/locale.cjs');
66
67
  var getMissingChains = require('../../utils/functions/getMissingChains/getMissingChains.cjs');
67
68
  var isSameWalletName = require('../../utils/functions/isSameWalletName/isSameWalletName.cjs');
@@ -714,7 +715,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
714
715
  isBridgeFlow,
715
716
  isFullyConnected,
716
717
  isMultiWalletEnabled: multiWallet,
717
- }), children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsxs(UserFieldEditorContext.UserFieldEditorContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
718
+ }), children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsxs(UserFieldEditorContext.UserFieldEditorContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncPasskeyFlow.SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
718
719
  };
719
720
 
720
721
  exports.DynamicContext = DynamicContext;
@@ -58,6 +58,7 @@ import 'formik';
58
58
  import '../../components/InlineWidget/InlineWidget.js';
59
59
  import '../../components/MenuList/Dropdown/Dropdown.js';
60
60
  import '../../components/OverlayCard/OverlayCard.context.js';
61
+ import { SyncPasskeyFlow } from '../../components/SyncPasskeyFlow/SyncPasskeyFlow.js';
61
62
  import { Locale } from '../../locale/locale.js';
62
63
  import { getMissingChains } from '../../utils/functions/getMissingChains/getMissingChains.js';
63
64
  import { isSameWalletName } from '../../utils/functions/isSameWalletName/isSameWalletName.js';
@@ -710,7 +711,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
710
711
  isBridgeFlow,
711
712
  isFullyConnected,
712
713
  isMultiWalletEnabled: multiWallet,
713
- }), children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsxs(UserFieldEditorContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
714
+ }), children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsxs(UserFieldEditorContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
714
715
  };
715
716
 
716
717
  export { DynamicContext, DynamicContextProvider, PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID };
@@ -3,6 +3,8 @@ import EventEmitter from 'eventemitter3';
3
3
  export type InternalEventMap = {
4
4
  emailVerificationResult: (param: boolean, email: string) => void;
5
5
  clearPrimaryWallet: () => void;
6
+ embeddedWalletCreated: (id: string) => void;
7
+ embeddedWalletFailed: (error: unknown) => void;
6
8
  };
7
9
  export type InternalEventEmitter = EventEmitter<InternalEventMap>;
8
10
  export declare const getInternalEvents: () => InternalEventEmitter;
@@ -46,6 +46,7 @@ var dyn_no_access = {
46
46
  };
47
47
  var dyn_passkey_intro = {
48
48
  button: "Set up a Passkey",
49
+ button_logout: "Log out",
49
50
  disabled: "Passkeys are not available on this device or browser. Please open on Chrome, Safari, or Brave to continue",
50
51
  helper: {
51
52
  section_1: {
@@ -63,9 +64,9 @@ var dyn_passkey_intro = {
63
64
  title: "Secure your account"
64
65
  };
65
66
  var dyn_passkey_success = {
66
- button: "Get started",
67
- subtitle: "Welcome to {{appName}}. Your account is all set up",
68
- title: "You're all set!"
67
+ button: "Continue",
68
+ subtitle: "That was a bit anticlimactic, we know. In the next page, we’ll explain what just happened.",
69
+ title: "That's it! You now have a wallet!"
69
70
  };
70
71
  var dyn_wallet_conect = {
71
72
  mobile: {
@@ -42,6 +42,7 @@ var dyn_no_access = {
42
42
  };
43
43
  var dyn_passkey_intro = {
44
44
  button: "Set up a Passkey",
45
+ button_logout: "Log out",
45
46
  disabled: "Passkeys are not available on this device or browser. Please open on Chrome, Safari, or Brave to continue",
46
47
  helper: {
47
48
  section_1: {
@@ -59,9 +60,9 @@ var dyn_passkey_intro = {
59
60
  title: "Secure your account"
60
61
  };
61
62
  var dyn_passkey_success = {
62
- button: "Get started",
63
- subtitle: "Welcome to {{appName}}. Your account is all set up",
64
- title: "You're all set!"
63
+ button: "Continue",
64
+ subtitle: "That was a bit anticlimactic, we know. In the next page, we’ll explain what just happened.",
65
+ title: "That's it! You now have a wallet!"
65
66
  };
66
67
  var dyn_wallet_conect = {
67
68
  mobile: {
@@ -32,6 +32,7 @@ require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetu
32
32
  require('../../context/ErrorContext/ErrorContext.cjs');
33
33
  require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
34
34
  require('../../context/AccountExistsContext/AccountExistsContext.cjs');
35
+ var getProperErrorMessage = require('./getProperErrorMessage.cjs');
35
36
  var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
36
37
  var IconButton = require('../../components/IconButton/IconButton.cjs');
37
38
  var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
@@ -87,7 +88,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
87
88
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
88
89
  return (jsxRuntime.jsx(Portal.Portal, { handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
89
90
  onUnmount: handleOnModalUnmount,
90
- }, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: "Requesting Signature" }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: signMessageError.reason || 'Something went wrong' }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview, { message: message.toString() }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(Button.Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, buttonRounded: 'default', children: "Cancel" }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, buttonRounded: 'default', loading: isLoading, children: "Sign" })] }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
91
+ }, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: "Requesting Signature" }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: getProperErrorMessage.getProperErrorMessage(signMessageError) }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview, { message: message.toString() }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(Button.Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, buttonRounded: 'default', children: "Cancel" }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, buttonRounded: 'default', loading: isLoading, children: "Sign" })] }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
91
92
  };
92
93
 
93
94
  exports.SignMessageConfirmationModal = SignMessageConfirmationModal;
@@ -28,6 +28,7 @@ import '../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup
28
28
  import '../../context/ErrorContext/ErrorContext.js';
29
29
  import '../../context/AccessDeniedContext/AccessDeniedContext.js';
30
30
  import '../../context/AccountExistsContext/AccountExistsContext.js';
31
+ import { getProperErrorMessage } from './getProperErrorMessage.js';
31
32
  import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
32
33
  import { IconButton } from '../../components/IconButton/IconButton.js';
33
34
  import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
@@ -83,7 +84,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
83
84
  const closeButton = (jsx(IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
84
85
  return (jsx(Portal, { handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
85
86
  onUnmount: handleOnModalUnmount,
86
- }, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: "Requesting Signature" }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: signMessageError.reason || 'Something went wrong' }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview, { message: message.toString() }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, buttonRounded: 'default', children: "Cancel" }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, buttonRounded: 'default', loading: isLoading, children: "Sign" })] }), jsx(PoweredByDynamic, {})] })] }) }) }));
87
+ }, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: "Requesting Signature" }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: getProperErrorMessage(signMessageError) }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview, { message: message.toString() }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, buttonRounded: 'default', children: "Cancel" }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, buttonRounded: 'default', loading: isLoading, children: "Sign" })] }), jsx(PoweredByDynamic, {})] })] }) }) }));
87
88
  };
88
89
 
89
90
  export { SignMessageConfirmationModal };
@@ -9,3 +9,12 @@ export type SignMessageConfirmationModalProps = {
9
9
  onSignMessage: (signedMessage: string) => void;
10
10
  };
11
11
  export type SignMessageConfirmationModalComponent = FC<SignMessageConfirmationModalProps>;
12
+ export type SignMessageErrorDetails = {
13
+ reason?: string;
14
+ cause?: {
15
+ code: number;
16
+ name: string;
17
+ message: string;
18
+ };
19
+ };
20
+ export type SignMessageError = Error & SignMessageErrorDetails;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const errorMap = {
6
+ 0: 'The operation either timed out or was not allowed.',
7
+ 16: 'Invalid Passkey signature. Select the passkey for this account and device.',
8
+ };
9
+ const getProperErrorMessage = (signMessageError) => {
10
+ var _a;
11
+ let error = signMessageError.reason || 'Something went wrong';
12
+ // turnkey request errors
13
+ if (((_a = signMessageError === null || signMessageError === void 0 ? void 0 : signMessageError.cause) === null || _a === void 0 ? void 0 : _a.code) !== undefined &&
14
+ errorMap[signMessageError.cause.code] !== undefined) {
15
+ error = errorMap[signMessageError.cause.code];
16
+ }
17
+ return error;
18
+ };
19
+
20
+ exports.getProperErrorMessage = getProperErrorMessage;
@@ -0,0 +1,2 @@
1
+ import { SignMessageError } from './SignMessageConfirmationModal.types';
2
+ export declare const getProperErrorMessage: (signMessageError: SignMessageError) => string;
@@ -0,0 +1,16 @@
1
+ const errorMap = {
2
+ 0: 'The operation either timed out or was not allowed.',
3
+ 16: 'Invalid Passkey signature. Select the passkey for this account and device.',
4
+ };
5
+ const getProperErrorMessage = (signMessageError) => {
6
+ var _a;
7
+ let error = signMessageError.reason || 'Something went wrong';
8
+ // turnkey request errors
9
+ if (((_a = signMessageError === null || signMessageError === void 0 ? void 0 : signMessageError.cause) === null || _a === void 0 ? void 0 : _a.code) !== undefined &&
10
+ errorMap[signMessageError.cause.code] !== undefined) {
11
+ error = errorMap[signMessageError.cause.code];
12
+ }
13
+ return error;
14
+ };
15
+
16
+ export { getProperErrorMessage };