@dynamic-labs/sdk-react-core 1.0.0-alpha.7 → 1.0.0-alpha.8

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 (93) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +9 -9
  5. package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +1 -1
  6. package/src/lib/components/NeedHelpSection/NeedHelpSection.js +1 -1
  7. package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +68 -0
  8. package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.d.ts +6 -0
  9. package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +64 -0
  10. package/src/lib/components/PasskeyCreatedSuccessBanner/index.d.ts +1 -0
  11. package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs +24 -0
  12. package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.d.ts +6 -0
  13. package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js +20 -0
  14. package/src/lib/components/SecureTurnkeyWalletCard/index.d.ts +1 -0
  15. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -1
  16. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -1
  17. package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +5 -2
  18. package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +5 -2
  19. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +6 -2
  20. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +6 -2
  21. package/src/lib/components/index.d.ts +2 -0
  22. package/src/lib/context/DynamicContext/DynamicContext.cjs +7 -1
  23. package/src/lib/context/DynamicContext/DynamicContext.js +7 -1
  24. package/src/lib/context/DynamicContext/hooks/index.d.ts +1 -0
  25. package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/index.d.ts +1 -0
  26. package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.cjs +23 -0
  27. package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.d.ts +4 -0
  28. package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.js +19 -0
  29. package/src/lib/context/DynamicContext/types/index.d.ts +2 -0
  30. package/src/lib/data/api.cjs +14 -11
  31. package/src/lib/data/api.d.ts +2 -2
  32. package/src/lib/data/api.js +14 -11
  33. package/src/lib/locale/en/translation.cjs +70 -0
  34. package/src/lib/locale/en/translation.d.ts +70 -0
  35. package/src/lib/locale/en/translation.js +70 -0
  36. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +6 -2
  37. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +6 -2
  38. package/src/lib/styles/index.shadow.cjs +1 -1
  39. package/src/lib/styles/index.shadow.js +1 -1
  40. package/src/lib/utils/hooks/index.d.ts +1 -0
  41. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/index.d.ts +1 -0
  42. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +83 -0
  43. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +15 -0
  44. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +79 -0
  45. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +11 -3
  46. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +11 -3
  47. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +57 -33
  48. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
  49. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +57 -33
  50. package/src/lib/utils/hooks/useIsTurnkeyWallet/index.d.ts +1 -0
  51. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +37 -0
  52. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.d.ts +6 -0
  53. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +33 -0
  54. package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
  55. package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
  56. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
  57. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
  58. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +1 -1
  59. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +1 -1
  60. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
  61. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
  62. package/src/lib/views/LoginView/useLoginView.cjs +101 -84
  63. package/src/lib/views/LoginView/useLoginView.js +102 -85
  64. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +20 -50
  65. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +1 -6
  66. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +20 -50
  67. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +7 -2
  68. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +7 -2
  69. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +11 -7
  70. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +11 -7
  71. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +8 -10
  72. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +8 -10
  73. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +56 -0
  74. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.d.ts +13 -0
  75. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +52 -0
  76. package/src/lib/views/Passkey/utils/createPregeneratedWallet/index.d.ts +1 -0
  77. package/src/lib/views/Passkey/utils/index.d.ts +1 -0
  78. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
  79. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
  80. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +4 -1
  81. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +4 -1
  82. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -1
  83. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -1
  84. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +8 -5
  85. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +8 -5
  86. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
  87. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
  88. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +11 -2
  89. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +11 -2
  90. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +2 -1
  91. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +2 -1
  92. package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
  93. package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
@@ -100,6 +100,7 @@ import { useNameService } from './hooks/useNameService/useNameService.js';
100
100
  import { useSelectedWalletConnector } from './hooks/useSelectedWalletConnector/useSelectedWalletConnector.js';
101
101
  import { useSetShowAuthFlowWithInit } from './hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.js';
102
102
  import { useVerificationInProgress } from './hooks/useVerificationInProgress/useVerificationInProgress.js';
103
+ import { useShowPasskeyCreateSuccess } from './hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.js';
103
104
  import { getInternalEvents } from './internalEvents/internalEvents.js';
104
105
  import { useCustomerCallbacks } from './useCustomerCallbacks/useCustomerCallbacks.js';
105
106
  import { useCustomerAuthFlowCallbacks } from './useCustomerCallbacks/useCustomerAuthFlowCallbacks.js';
@@ -459,6 +460,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
459
460
  clearAllWalletConnectSessions,
460
461
  removeConnectedWalletsInfo,
461
462
  ]);
463
+ const { showPasskeyCreatedSuccess, setShowPasskeyCreatedSuccess } = useShowPasskeyCreateSuccess();
462
464
  const value = useMemo(() => {
463
465
  var _a, _b, _c;
464
466
  return ({
@@ -556,6 +558,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
556
558
  setShowAuthFlow: setShowAuthFlowWithInit,
557
559
  setShowBridgeWidget,
558
560
  setShowDynamicUserProfile,
561
+ setShowPasskeyCreatedSuccess,
559
562
  setShowQrcodeModal,
560
563
  setShowWidgetStatePopup,
561
564
  setUser,
@@ -564,6 +567,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
564
567
  showBridgeWidget,
565
568
  showDynamicUserProfile,
566
569
  showLockedWalletView,
570
+ showPasskeyCreatedSuccess,
567
571
  showQrcodeModal,
568
572
  showWidgetStatePopup,
569
573
  signWithEmailWalletName,
@@ -621,6 +625,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
621
625
  isSingleWalletAccount,
622
626
  isVerificationInProgress,
623
627
  legacyIsVerifying,
628
+ user,
624
629
  linkedOrConnectedWallets,
625
630
  loadingNetwork,
626
631
  loginWithEmail,
@@ -660,6 +665,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
660
665
  setSdkHasLoaded,
661
666
  setSelectedWalletConnectorKey,
662
667
  setShowAuthFlowWithInit,
668
+ setShowPasskeyCreatedSuccess,
663
669
  setShowQrcodeModal,
664
670
  setUser,
665
671
  shadowDOMEnabled,
@@ -667,6 +673,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
667
673
  showBridgeWidget,
668
674
  showDynamicUserProfile,
669
675
  showLockedWalletView,
676
+ showPasskeyCreatedSuccess,
670
677
  showQrcodeModal,
671
678
  showWidgetStatePopup,
672
679
  signWithEmailWalletName,
@@ -678,7 +685,6 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
678
685
  termsOfServiceUrl,
679
686
  theme,
680
687
  toolkitEnabled,
681
- user,
682
688
  walletUiUtils,
683
689
  wallets,
684
690
  walletsFilter,
@@ -4,3 +4,4 @@ export * from './useNameService';
4
4
  export * from './useSelectedWalletConnector';
5
5
  export * from './useSetShowAuthFlowWithInit';
6
6
  export * from './useVerificationInProgress';
7
+ export * from './useShowPasskeyCreateSuccess';
@@ -0,0 +1 @@
1
+ export { useShowPasskeyCreateSuccess } from './useShowPasskeyCreateSuccess';
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ const useShowPasskeyCreateSuccess = () => {
8
+ const [showPasskeyCreatedSuccess, _setShowPasskeyCreatedSuccess] = React.useState(false);
9
+ // Show the success message for 2 seconds then hide it
10
+ // The logic is here to not have to duplicate it in multiple views
11
+ const setShowPasskeyCreatedSuccess = () => {
12
+ _setShowPasskeyCreatedSuccess(true);
13
+ setTimeout(() => {
14
+ _setShowPasskeyCreatedSuccess(false);
15
+ }, 2000);
16
+ };
17
+ return {
18
+ setShowPasskeyCreatedSuccess,
19
+ showPasskeyCreatedSuccess,
20
+ };
21
+ };
22
+
23
+ exports.useShowPasskeyCreateSuccess = useShowPasskeyCreateSuccess;
@@ -0,0 +1,4 @@
1
+ export declare const useShowPasskeyCreateSuccess: () => {
2
+ setShowPasskeyCreatedSuccess: () => void;
3
+ showPasskeyCreatedSuccess: boolean;
4
+ };
@@ -0,0 +1,19 @@
1
+ import { useState } from 'react';
2
+
3
+ const useShowPasskeyCreateSuccess = () => {
4
+ const [showPasskeyCreatedSuccess, _setShowPasskeyCreatedSuccess] = useState(false);
5
+ // Show the success message for 2 seconds then hide it
6
+ // The logic is here to not have to duplicate it in multiple views
7
+ const setShowPasskeyCreatedSuccess = () => {
8
+ _setShowPasskeyCreatedSuccess(true);
9
+ setTimeout(() => {
10
+ _setShowPasskeyCreatedSuccess(false);
11
+ }, 2000);
12
+ };
13
+ return {
14
+ setShowPasskeyCreatedSuccess,
15
+ showPasskeyCreatedSuccess,
16
+ };
17
+ };
18
+
19
+ export { useShowPasskeyCreateSuccess };
@@ -107,6 +107,7 @@ export interface IDynamicContext {
107
107
  /** The unwrapped version of setShowAuthFlow. See useSetShowAuthFlowWithInit.ts for context */
108
108
  internalSetShowAuthFlow: Dispatch<SetStateAction<boolean>>;
109
109
  setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
110
+ setShowPasskeyCreatedSuccess: VoidFunction;
110
111
  setShowQrcodeModal: Dispatch<SetStateAction<boolean>>;
111
112
  setShowWidgetStatePopup: Dispatch<SetStateAction<boolean>>;
112
113
  setUser: Dispatch<SetStateAction<UserProfile | undefined>>;
@@ -122,6 +123,7 @@ export interface IDynamicContext {
122
123
  */
123
124
  showBridgeWidget: boolean;
124
125
  showLockedWalletView?: boolean;
126
+ showPasskeyCreatedSuccess: boolean;
125
127
  showQrcodeModal: boolean;
126
128
  showWidgetStatePopup: boolean;
127
129
  signWithEmailWalletName?: string;
@@ -475,19 +475,22 @@ const mergeUserAccounts = (userJwt, environmentId) => _tslib.__awaiter(void 0, v
475
475
  }
476
476
  });
477
477
  const createTurnkeyEvmEmbeddedWallet = ({ attestation, challenge, environmentId, userJwt, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
478
+ const embeddedWallets = [
479
+ {
480
+ chain: sdkApi$1.ChainEnum.Evm,
481
+ embeddedWalletProvider: sdkApi$1.EmbeddedWalletProviderEnum.Turnkeyhd,
482
+ isAuthenticatorAttached: false,
483
+ },
484
+ ];
485
+ if (attestation && challenge) {
486
+ embeddedWallets[0] = Object.assign(Object.assign({}, embeddedWallets[0]), { embeddedWalletSpecificOpts: {
487
+ attestation,
488
+ challenge,
489
+ }, isAuthenticatorAttached: true });
490
+ }
478
491
  return sdkApi(userJwt).createEmbeddedWallets({
479
492
  createEmbeddedWalletsRequest: {
480
- embeddedWallets: [
481
- {
482
- chain: sdkApi$1.ChainEnum.Evm,
483
- embeddedWalletProvider: sdkApi$1.EmbeddedWalletProviderEnum.Turnkeyhd,
484
- embeddedWalletSpecificOpts: {
485
- attestation,
486
- challenge,
487
- },
488
- isAuthenticatorAttached: true,
489
- },
490
- ],
493
+ embeddedWallets,
491
494
  },
492
495
  environmentId,
493
496
  });
@@ -76,8 +76,8 @@ export declare const mergeUserAccounts: (userJwt: string, environmentId: string)
76
76
  export type CreateTurnkeyEvmEmbeddedWalletProps = {
77
77
  userJwt: string;
78
78
  environmentId: string;
79
- attestation: PasskeyRegistrationCredential;
80
- challenge: string;
79
+ attestation?: PasskeyRegistrationCredential;
80
+ challenge?: string;
81
81
  };
82
82
  export declare const createTurnkeyEvmEmbeddedWallet: ({ attestation, challenge, environmentId, userJwt, }: CreateTurnkeyEvmEmbeddedWalletProps) => Promise<VerifyResponse>;
83
83
  export type InitPasskeyRecoveryProps = {
@@ -471,19 +471,22 @@ const mergeUserAccounts = (userJwt, environmentId) => __awaiter(void 0, void 0,
471
471
  }
472
472
  });
473
473
  const createTurnkeyEvmEmbeddedWallet = ({ attestation, challenge, environmentId, userJwt, }) => __awaiter(void 0, void 0, void 0, function* () {
474
+ const embeddedWallets = [
475
+ {
476
+ chain: ChainEnum.Evm,
477
+ embeddedWalletProvider: EmbeddedWalletProviderEnum.Turnkeyhd,
478
+ isAuthenticatorAttached: false,
479
+ },
480
+ ];
481
+ if (attestation && challenge) {
482
+ embeddedWallets[0] = Object.assign(Object.assign({}, embeddedWallets[0]), { embeddedWalletSpecificOpts: {
483
+ attestation,
484
+ challenge,
485
+ }, isAuthenticatorAttached: true });
486
+ }
474
487
  return sdkApi(userJwt).createEmbeddedWallets({
475
488
  createEmbeddedWalletsRequest: {
476
- embeddedWallets: [
477
- {
478
- chain: ChainEnum.Evm,
479
- embeddedWalletProvider: EmbeddedWalletProviderEnum.Turnkeyhd,
480
- embeddedWalletSpecificOpts: {
481
- attestation,
482
- challenge,
483
- },
484
- isAuthenticatorAttached: true,
485
- },
486
- ],
489
+ embeddedWallets,
487
490
  },
488
491
  environmentId,
489
492
  });
@@ -480,6 +480,16 @@ const translation = {
480
480
  hang_tight: 'Hang tight while we get things ready for you',
481
481
  verification_succeeded: 'Verification code confirmed',
482
482
  },
483
+ /**
484
+ * @description copy key for passkey created success banner
485
+ * @default
486
+ * {
487
+ text: 'A new passkey has been created',
488
+ }
489
+ */
490
+ dyn_passkey_created_success: {
491
+ text: 'A new passkey has been created',
492
+ },
483
493
  /**
484
494
  * @description copy keys for passkey intro view
485
495
  * @default
@@ -569,6 +579,66 @@ const translation = {
569
579
  title: 'Initiate Request',
570
580
  },
571
581
  },
582
+ /**
583
+ * @description copy keys for passkeys creation flow for existent embedded wallets
584
+ * @default
585
+ * {
586
+ code: {
587
+ description: 'An email has been sent from',
588
+ input_label: 'Enter your code here...',
589
+ title: 'Enter email code',
590
+ resend: {
591
+ button: 'Resend code',
592
+ text: "Didn't receive a code?",
593
+ },
594
+ },
595
+ complete: {
596
+ complete_button: 'Create a passkey',
597
+ description:
598
+ 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
599
+ title: 'Secure your account',
600
+ },
601
+ start: {
602
+ description:
603
+ 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
604
+ start_button: 'Send me an email',
605
+ title: 'Send Email Code',
606
+ },
607
+ }
608
+ */
609
+ dyn_passkey_secure_modal: {
610
+ code: {
611
+ description: 'An email has been sent from',
612
+ input_label: 'Enter your code here...',
613
+ title: 'Enter email code',
614
+ resend: {
615
+ button: 'Resend code',
616
+ text: "Didn't receive a code?",
617
+ },
618
+ },
619
+ complete: {
620
+ complete_button: 'Create a passkey',
621
+ description: 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
622
+ title: 'Secure your account',
623
+ },
624
+ start: {
625
+ description: 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
626
+ start_button: 'Send me an email',
627
+ title: 'Send Email Code',
628
+ },
629
+ },
630
+ /**
631
+ * @description copy keys for secure pregenerated embedded wallet
632
+ * @default
633
+ * {
634
+ description: 'Some features are not available until you add a security method to your account.',
635
+ secure_button: 'Secure your account',
636
+ }
637
+ */
638
+ dyn_secure_pregenerated_wallet: {
639
+ description: 'Some features are not available until you add a security method to your account.',
640
+ secure_button: 'Secure your account',
641
+ },
572
642
  /**
573
643
  * @description copy keys for send transaction flow views
574
644
  * @default
@@ -475,6 +475,16 @@ export declare const translation: {
475
475
  hang_tight: string;
476
476
  verification_succeeded: string;
477
477
  };
478
+ /**
479
+ * @description copy key for passkey created success banner
480
+ * @default
481
+ * {
482
+ text: 'A new passkey has been created',
483
+ }
484
+ */
485
+ dyn_passkey_created_success: {
486
+ text: string;
487
+ };
478
488
  /**
479
489
  * @description copy keys for passkey intro view
480
490
  * @default
@@ -564,6 +574,66 @@ export declare const translation: {
564
574
  title: string;
565
575
  };
566
576
  };
577
+ /**
578
+ * @description copy keys for passkeys creation flow for existent embedded wallets
579
+ * @default
580
+ * {
581
+ code: {
582
+ description: 'An email has been sent from',
583
+ input_label: 'Enter your code here...',
584
+ title: 'Enter email code',
585
+ resend: {
586
+ button: 'Resend code',
587
+ text: "Didn't receive a code?",
588
+ },
589
+ },
590
+ complete: {
591
+ complete_button: 'Create a passkey',
592
+ description:
593
+ 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
594
+ title: 'Secure your account',
595
+ },
596
+ start: {
597
+ description:
598
+ 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
599
+ start_button: 'Send me an email',
600
+ title: 'Send Email Code',
601
+ },
602
+ }
603
+ */
604
+ dyn_passkey_secure_modal: {
605
+ code: {
606
+ description: string;
607
+ input_label: string;
608
+ title: string;
609
+ resend: {
610
+ button: string;
611
+ text: string;
612
+ };
613
+ };
614
+ complete: {
615
+ complete_button: string;
616
+ description: string;
617
+ title: string;
618
+ };
619
+ start: {
620
+ description: string;
621
+ start_button: string;
622
+ title: string;
623
+ };
624
+ };
625
+ /**
626
+ * @description copy keys for secure pregenerated embedded wallet
627
+ * @default
628
+ * {
629
+ description: 'Some features are not available until you add a security method to your account.',
630
+ secure_button: 'Secure your account',
631
+ }
632
+ */
633
+ dyn_secure_pregenerated_wallet: {
634
+ description: string;
635
+ secure_button: string;
636
+ };
567
637
  /**
568
638
  * @description copy keys for send transaction flow views
569
639
  * @default
@@ -476,6 +476,16 @@ const translation = {
476
476
  hang_tight: 'Hang tight while we get things ready for you',
477
477
  verification_succeeded: 'Verification code confirmed',
478
478
  },
479
+ /**
480
+ * @description copy key for passkey created success banner
481
+ * @default
482
+ * {
483
+ text: 'A new passkey has been created',
484
+ }
485
+ */
486
+ dyn_passkey_created_success: {
487
+ text: 'A new passkey has been created',
488
+ },
479
489
  /**
480
490
  * @description copy keys for passkey intro view
481
491
  * @default
@@ -565,6 +575,66 @@ const translation = {
565
575
  title: 'Initiate Request',
566
576
  },
567
577
  },
578
+ /**
579
+ * @description copy keys for passkeys creation flow for existent embedded wallets
580
+ * @default
581
+ * {
582
+ code: {
583
+ description: 'An email has been sent from',
584
+ input_label: 'Enter your code here...',
585
+ title: 'Enter email code',
586
+ resend: {
587
+ button: 'Resend code',
588
+ text: "Didn't receive a code?",
589
+ },
590
+ },
591
+ complete: {
592
+ complete_button: 'Create a passkey',
593
+ description:
594
+ 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
595
+ title: 'Secure your account',
596
+ },
597
+ start: {
598
+ description:
599
+ 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
600
+ start_button: 'Send me an email',
601
+ title: 'Send Email Code',
602
+ },
603
+ }
604
+ */
605
+ dyn_passkey_secure_modal: {
606
+ code: {
607
+ description: 'An email has been sent from',
608
+ input_label: 'Enter your code here...',
609
+ title: 'Enter email code',
610
+ resend: {
611
+ button: 'Resend code',
612
+ text: "Didn't receive a code?",
613
+ },
614
+ },
615
+ complete: {
616
+ complete_button: 'Create a passkey',
617
+ description: 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
618
+ title: 'Secure your account',
619
+ },
620
+ start: {
621
+ description: 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
622
+ start_button: 'Send me an email',
623
+ title: 'Send Email Code',
624
+ },
625
+ },
626
+ /**
627
+ * @description copy keys for secure pregenerated embedded wallet
628
+ * @default
629
+ * {
630
+ description: 'Some features are not available until you add a security method to your account.',
631
+ secure_button: 'Secure your account',
632
+ }
633
+ */
634
+ dyn_secure_pregenerated_wallet: {
635
+ description: 'Some features are not available until you add a security method to your account.',
636
+ secure_button: 'Secure your account',
637
+ },
568
638
  /**
569
639
  * @description copy keys for send transaction flow views
570
640
  * @default
@@ -38,6 +38,7 @@ require('../../components/OverlayCard/OverlayCard.context.cjs');
38
38
  require('../../context/FooterAnimationContext/index.cjs');
39
39
  require('../../context/MockContext/MockContext.cjs');
40
40
  require('../../context/QrCodeContext/QrCodeContext.cjs');
41
+ var useIsTurnkeyWallet = require('../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
41
42
  var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
42
43
  require('../../context/WalletGroupContext/WalletGroupContext.cjs');
43
44
  require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
@@ -54,6 +55,7 @@ require('yup');
54
55
  var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
55
56
  require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
56
57
  require('@dynamic-labs/types');
58
+ var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
57
59
  require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
58
60
  require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
59
61
  require('formik');
@@ -63,9 +65,10 @@ var IconButton = require('../../components/IconButton/IconButton.cjs');
63
65
  var Typography = require('../../components/Typography/Typography.cjs');
64
66
  require('../../components/Alert/Alert.cjs');
65
67
  var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
68
+ var SecureTurnkeyWalletCard = require('../../components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs');
69
+ var PasskeyCreatedSuccessBanner = require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
66
70
  require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
67
71
  var getProperErrorMessage = require('./getProperErrorMessage.cjs');
68
- var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
69
72
  require('../../components/InlineWidget/InlineWidget.cjs');
70
73
  require('../../components/MenuList/Dropdown/Dropdown.cjs');
71
74
  var Modal = require('../../components/Modal/Modal.cjs');
@@ -80,6 +83,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
80
83
  usePreventPageScroll.usePreventPageScroll(true);
81
84
  const didConfirmRef = React.useRef(false);
82
85
  const [show, setShow] = React.useState(true);
86
+ const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
83
87
  const { t } = reactI18next.useTranslation();
84
88
  const handleOnReject = React.useCallback(() => {
85
89
  didConfirmRef.current = false;
@@ -100,7 +104,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
100
104
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
101
105
  return (jsxRuntime.jsx(Portal.Portal, { handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
102
106
  onUnmount: handleOnModalUnmount,
103
- }, 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: t('dyn_sign_message.title') }), 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, children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
107
+ }, 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.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), 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.jsx(SecureTurnkeyWalletCard.SecureTurnkeyWalletCard, { className: 'sign-message-confirmation__secure-wallet' }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(Button.Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, disabled: isTurnkeyWalletWithoutAuthenticator, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
104
108
  };
105
109
 
106
110
  exports.SignMessageConfirmationModal = SignMessageConfirmationModal;
@@ -34,6 +34,7 @@ import '../../components/OverlayCard/OverlayCard.context.js';
34
34
  import '../../context/FooterAnimationContext/index.js';
35
35
  import '../../context/MockContext/MockContext.js';
36
36
  import '../../context/QrCodeContext/QrCodeContext.js';
37
+ import { useIsTurnkeyWallet } from '../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
37
38
  import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
38
39
  import '../../context/WalletGroupContext/WalletGroupContext.js';
39
40
  import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
@@ -50,6 +51,7 @@ import 'yup';
50
51
  import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
51
52
  import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
52
53
  import '@dynamic-labs/types';
54
+ import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
53
55
  import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
54
56
  import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
55
57
  import 'formik';
@@ -59,9 +61,10 @@ import { IconButton } from '../../components/IconButton/IconButton.js';
59
61
  import { Typography } from '../../components/Typography/Typography.js';
60
62
  import '../../components/Alert/Alert.js';
61
63
  import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
64
+ import { SecureTurnkeyWalletCard } from '../../components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js';
65
+ import { PasskeyCreatedSuccessBanner } from '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
62
66
  import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
63
67
  import { getProperErrorMessage } from './getProperErrorMessage.js';
64
- import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
65
68
  import '../../components/InlineWidget/InlineWidget.js';
66
69
  import '../../components/MenuList/Dropdown/Dropdown.js';
67
70
  import { Modal } from '../../components/Modal/Modal.js';
@@ -76,6 +79,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
76
79
  usePreventPageScroll(true);
77
80
  const didConfirmRef = useRef(false);
78
81
  const [show, setShow] = useState(true);
82
+ const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
79
83
  const { t } = useTranslation();
80
84
  const handleOnReject = useCallback(() => {
81
85
  didConfirmRef.current = false;
@@ -96,7 +100,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
96
100
  const closeButton = (jsx(IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
97
101
  return (jsx(Portal, { handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
98
102
  onUnmount: handleOnModalUnmount,
99
- }, 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: t('dyn_sign_message.title') }), 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, children: t('dyn_sign_message.cancel_button') }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
103
+ }, 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 }) }), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), 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() }) })] }), jsx(SecureTurnkeyWalletCard, { className: 'sign-message-confirmation__secure-wallet' }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, disabled: isTurnkeyWalletWithoutAuthenticator, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
100
104
  };
101
105
 
102
106
  export { SignMessageConfirmationModal };