@dynamic-labs/sdk-react-core 2.1.0-alpha.8 → 2.1.0-alpha.9

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 (90) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -12
  5. package/src/lib/components/Portal/Portal.cjs +2 -1
  6. package/src/lib/components/Portal/Portal.js +2 -1
  7. package/src/lib/components/SandboxIndicatorWrapper/SandboxIndicatorWrapper.d.ts +0 -2
  8. package/src/lib/components/Toolkit/components/index.d.ts +0 -6
  9. package/src/lib/components/Tooltip/Tooltip.cjs +2 -1
  10. package/src/lib/components/Tooltip/Tooltip.js +2 -1
  11. package/src/lib/context/DynamicContext/DynamicContext.cjs +0 -1
  12. package/src/lib/context/DynamicContext/DynamicContext.js +0 -1
  13. package/src/lib/context/DynamicContext/types/index.d.ts +0 -1
  14. package/src/lib/shared/utils/classes/storage/localStorage.cjs +2 -2
  15. package/src/lib/shared/utils/classes/storage/localStorage.js +2 -2
  16. package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.cjs +14 -0
  17. package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.d.ts +3 -0
  18. package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.js +10 -0
  19. package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/index.d.ts +1 -0
  20. package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -2
  21. package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -2
  22. package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs +3 -4
  23. package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.d.ts +1 -1
  24. package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js +4 -5
  25. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +1 -1
  26. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.d.ts +3 -1
  27. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +1 -1
  28. package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.cjs +5 -5
  29. package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.d.ts +3 -2
  30. package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.js +5 -5
  31. package/src/lib/utils/functions/hasEmbeddedWallet/hasEmbeddedWallet.cjs +7 -2
  32. package/src/lib/utils/functions/hasEmbeddedWallet/hasEmbeddedWallet.js +7 -2
  33. package/src/lib/utils/functions/index.d.ts +1 -1
  34. package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.cjs +2 -1
  35. package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.js +2 -1
  36. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +15 -10
  37. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +7 -2
  38. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +15 -10
  39. package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.cjs +3 -3
  40. package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.js +3 -3
  41. package/src/lib/utils/hooks/useElementById/useElementById.cjs +33 -18
  42. package/src/lib/utils/hooks/useElementById/useElementById.d.ts +3 -1
  43. package/src/lib/utils/hooks/useElementById/useElementById.js +33 -18
  44. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +9 -4
  45. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +6 -3
  46. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +9 -4
  47. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +2 -2
  48. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +1 -1
  49. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +2 -2
  50. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.cjs +7 -7
  51. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +2 -2
  52. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.js +7 -7
  53. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +24 -27
  54. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +6 -3
  55. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +24 -27
  56. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +16 -11
  57. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +4 -1
  58. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +16 -11
  59. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +2 -2
  60. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +2 -2
  61. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +2 -1
  62. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +2 -1
  63. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -3
  64. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -3
  65. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs +2 -1
  66. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js +2 -1
  67. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +5 -4
  68. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +6 -1
  69. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +5 -4
  70. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -1
  71. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -1
  72. package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs → createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs} +17 -18
  73. package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.d.ts → createEmbeddedWalletRequest/createEmbeddedWalletRequest.d.ts} +7 -3
  74. package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js → createEmbeddedWalletRequest/createEmbeddedWalletRequest.js} +17 -18
  75. package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/index.d.ts +1 -0
  76. package/src/lib/views/Passkey/utils/index.d.ts +1 -2
  77. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
  78. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
  79. package/src/lib/views/viewToComponentMap.d.ts +4 -2
  80. package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.cjs +2 -1
  81. package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.js +2 -1
  82. package/src/lib/utils/functions/isEmbeddedWalletPresent/index.d.ts +0 -1
  83. package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.cjs +0 -19
  84. package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.d.ts +0 -1
  85. package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.js +0 -15
  86. package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/index.d.ts +0 -1
  87. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +0 -65
  88. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.d.ts +0 -16
  89. package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +0 -61
  90. package/src/lib/views/Passkey/utils/createPregeneratedWallet/index.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [2.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.8...v2.1.0-alpha.9) (2024-04-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * headless create embedded wallet with optional passkey data parameter ([#5487](https://github.com/dynamic-labs/DynamicAuth/issues/5487)) ([891c3d7](https://github.com/dynamic-labs/DynamicAuth/commit/891c3d77a02a019140bcb8dd03b62b1afd69710e))
8
+
2
9
  ## [2.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.7...v2.1.0-alpha.8) (2024-04-26)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.1.0-alpha.8";
6
+ var version = "2.1.0-alpha.9";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.429",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "2.1.0-alpha.8";
2
+ var version = "2.1.0-alpha.9";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.429",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.1.0-alpha.8",
3
+ "version": "2.1.0-alpha.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -17,17 +17,17 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/iconic": "2.1.0-alpha.8",
21
- "@dynamic-labs/logger": "2.1.0-alpha.8",
22
- "@dynamic-labs/multi-wallet": "2.1.0-alpha.8",
23
- "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.8",
24
- "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.8",
25
- "@dynamic-labs/rpc-providers": "2.1.0-alpha.8",
26
- "@dynamic-labs/types": "2.1.0-alpha.8",
27
- "@dynamic-labs/utils": "2.1.0-alpha.8",
28
- "@dynamic-labs/viem-utils": "2.1.0-alpha.8",
29
- "@dynamic-labs/wallet-book": "2.1.0-alpha.8",
30
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.8",
20
+ "@dynamic-labs/iconic": "2.1.0-alpha.9",
21
+ "@dynamic-labs/logger": "2.1.0-alpha.9",
22
+ "@dynamic-labs/multi-wallet": "2.1.0-alpha.9",
23
+ "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.9",
24
+ "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.9",
25
+ "@dynamic-labs/rpc-providers": "2.1.0-alpha.9",
26
+ "@dynamic-labs/types": "2.1.0-alpha.9",
27
+ "@dynamic-labs/utils": "2.1.0-alpha.9",
28
+ "@dynamic-labs/viem-utils": "2.1.0-alpha.9",
29
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.9",
30
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.9",
31
31
  "eventemitter3": "5.0.1"
32
32
  },
33
33
  "devDependencies": {
@@ -106,7 +106,8 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
106
106
  style: { zIndex: zIndex ? zIndex - 2 : undefined }, className: 'portal__backdrop' })), jsxRuntime.jsx("div", { style: { zIndex }, children: children })] }));
107
107
  };
108
108
  const Portal = ({ children, isShown, handleClose, withBackdrop, zIndex, transitionEvents, elementId = 'dynamic-modal', }) => {
109
- const modalRootElementRef = useElementById.useElementById(elementId);
109
+ const { createRootElement } = useElementById.useElementById();
110
+ const modalRootElementRef = createRootElement(elementId);
110
111
  return reactDom.createPortal(jsxRuntime.jsx(ShadowDOM.ShadowDOM, { zIndex: zIndex, dataTestId: 'dynamic-modal-shadow', children: jsxRuntime.jsx(OpacityTransition.OpacityTransition, Object.assign({ isShown: isShown }, transitionEvents, { children: jsxRuntime.jsx(ModalComponent, { handleClose: handleClose, withBackdrop: withBackdrop, whiteList: (node) => modalRootElementRef.current.contains(node), children: children }) })) }), modalRootElementRef.current);
111
112
  };
112
113
 
@@ -98,7 +98,8 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
98
98
  style: { zIndex: zIndex ? zIndex - 2 : undefined }, className: 'portal__backdrop' })), jsx("div", { style: { zIndex }, children: children })] }));
99
99
  };
100
100
  const Portal = ({ children, isShown, handleClose, withBackdrop, zIndex, transitionEvents, elementId = 'dynamic-modal', }) => {
101
- const modalRootElementRef = useElementById(elementId);
101
+ const { createRootElement } = useElementById();
102
+ const modalRootElementRef = createRootElement(elementId);
102
103
  return createPortal(jsx(ShadowDOM, { zIndex: zIndex, dataTestId: 'dynamic-modal-shadow', children: jsx(OpacityTransition, Object.assign({ isShown: isShown }, transitionEvents, { children: jsx(ModalComponent, { handleClose: handleClose, withBackdrop: withBackdrop, whiteList: (node) => modalRootElementRef.current.contains(node), children: children }) })) }), modalRootElementRef.current);
103
104
  };
104
105
 
@@ -1,2 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- export declare const SandboxIndicatorWrapper: FC<PropsWithChildren>;
@@ -1,6 +0,0 @@
1
- export { ThemeSwitch } from './ThemeSwitch';
2
- export { PrimaryColorInput } from './PrimaryColorInput';
3
- export { AuthModeSwitch } from './AuthModeSwitch';
4
- export { LoginWithEmailSwitch } from './LoginWithEmailSwitch';
5
- export { LoginWithEmailViewDisplayPriorityOrderSwitch } from './LoginWithEmailViewDisplayPriorityOrderSwitch';
6
- export { TemplateSelect } from './TemplateSelect';
@@ -79,7 +79,8 @@ require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage
79
79
  require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
80
80
 
81
81
  const Tooltip = ({ children, content, className, as: Tag = 'span', copykey, }) => {
82
- const portalRoot = useElementById.useElementById('dynamic-tooltips');
82
+ const { createRootElement } = useElementById.useElementById();
83
+ const portalRoot = createRootElement('dynamic-tooltips');
83
84
  const [vector, setVector] = React.useState([0, 0]);
84
85
  const childrenRef = React.useRef(null);
85
86
  const [visible, setVisible] = React.useState(false);
@@ -75,7 +75,8 @@ import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.
75
75
  import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
76
76
 
77
77
  const Tooltip = ({ children, content, className, as: Tag = 'span', copykey, }) => {
78
- const portalRoot = useElementById('dynamic-tooltips');
78
+ const { createRootElement } = useElementById();
79
+ const portalRoot = createRootElement('dynamic-tooltips');
79
80
  const [vector, setVector] = useState([0, 0]);
80
81
  const childrenRef = useRef(null);
81
82
  const [visible, setVisible] = useState(false);
@@ -444,7 +444,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
444
444
  customPrivacyPolicy,
445
445
  customTermsOfServices,
446
446
  debugError,
447
- decodedAuthToken: decodeJwt.decodeJwt(getAuthToken.getAuthToken()),
448
447
  decodedOnboardingOnlyToken: decodeJwt.decodeJwt(onboardingOnlyJwt),
449
448
  defaultNumberOfWalletsToShow,
450
449
  desktopUri,
@@ -440,7 +440,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
440
440
  customPrivacyPolicy,
441
441
  customTermsOfServices,
442
442
  debugError,
443
- decodedAuthToken: decodeJwt(getAuthToken()),
444
443
  decodedOnboardingOnlyToken: decodeJwt(onboardingOnlyJwt),
445
444
  defaultNumberOfWalletsToShow,
446
445
  desktopUri,
@@ -78,7 +78,6 @@ export interface IDynamicContext {
78
78
  customPrivacyPolicy?: ReactNode;
79
79
  customTermsOfServices?: ReactNode;
80
80
  debugError: boolean;
81
- decodedAuthToken: Omit<DynamicJwt, 'jwt'> | undefined;
82
81
  decodedOnboardingOnlyToken: Omit<DynamicJwt, 'jwt'> | undefined;
83
82
  defaultNumberOfWalletsToShow: number;
84
83
  desktopUri: string;
@@ -17,8 +17,8 @@ class LocalStorage {
17
17
  static getDynamicLSKey(key) {
18
18
  return `${key}${LocalStorage.getSuffix()}`;
19
19
  }
20
- static validateRequest(key, fromAuxiliarAuthFunctions) {
21
- if (key === localStorage.AUTH_TOKEN && !fromAuxiliarAuthFunctions) {
20
+ static validateRequest(key, fromAuxiliaryAuthFunctions) {
21
+ if (key === localStorage.AUTH_TOKEN && !fromAuxiliaryAuthFunctions) {
22
22
  throw new Error('You cannot access AUTH_TOKEN through localStorage. Use getAuthToken/ storeAuthToken helper functions instead');
23
23
  }
24
24
  }
@@ -13,8 +13,8 @@ class LocalStorage {
13
13
  static getDynamicLSKey(key) {
14
14
  return `${key}${LocalStorage.getSuffix()}`;
15
15
  }
16
- static validateRequest(key, fromAuxiliarAuthFunctions) {
17
- if (key === AUTH_TOKEN && !fromAuxiliarAuthFunctions) {
16
+ static validateRequest(key, fromAuxiliaryAuthFunctions) {
17
+ if (key === AUTH_TOKEN && !fromAuxiliaryAuthFunctions) {
18
18
  throw new Error('You cannot access AUTH_TOKEN through localStorage. Use getAuthToken/ storeAuthToken helper functions instead');
19
19
  }
20
20
  }
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const addPasskeyIdentifierToWalletConnector = (walletConnector, user) => {
7
+ var _a;
8
+ const passkeyIdentifier = (user === null || user === void 0 ? void 0 : user.phoneNumber) ||
9
+ ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => vc.oauthDisplayName)) === null || _a === void 0 ? void 0 : _a.oauthDisplayName) ||
10
+ '';
11
+ walletConnector.setPasskeyIdentifier(passkeyIdentifier);
12
+ };
13
+
14
+ exports.addPasskeyIdentifierToWalletConnector = addPasskeyIdentifierToWalletConnector;
@@ -0,0 +1,3 @@
1
+ import { IPasskeyWalletConnector } from '@dynamic-labs/wallet-connector-core';
2
+ import { UserProfile } from '@dynamic-labs/types';
3
+ export declare const addPasskeyIdentifierToWalletConnector: (walletConnector: IPasskeyWalletConnector, user: UserProfile) => void;
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ const addPasskeyIdentifierToWalletConnector = (walletConnector, user) => {
3
+ var _a;
4
+ const passkeyIdentifier = (user === null || user === void 0 ? void 0 : user.phoneNumber) ||
5
+ ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => vc.oauthDisplayName)) === null || _a === void 0 ? void 0 : _a.oauthDisplayName) ||
6
+ '';
7
+ walletConnector.setPasskeyIdentifier(passkeyIdentifier);
8
+ };
9
+
10
+ export { addPasskeyIdentifierToWalletConnector };
@@ -0,0 +1 @@
1
+ export { addPasskeyIdentifierToWalletConnector } from './addPasskeyIdentifierToWalletConnector';
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var index = require('../../../shared/utils/functions/lastAuthenticatedAccount/index.cjs');
7
7
 
8
8
  const createUserProfile = (decodedJwt) => {
9
- var _a;
10
9
  const wallet = index.lastAuthenticatedAccount(decodedJwt);
11
10
  const kyc = {
12
11
  alias: decodedJwt.alias,
@@ -30,7 +29,7 @@ const createUserProfile = (decodedJwt) => {
30
29
  team: decodedJwt.team,
31
30
  username: decodedJwt.username,
32
31
  };
33
- const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = index.lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
32
+ const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: (wallet === null || wallet === void 0 ? void 0 : wallet.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
34
33
  return userProfile;
35
34
  };
36
35
 
@@ -2,7 +2,6 @@
2
2
  import { lastAuthenticatedAccount } from '../../../shared/utils/functions/lastAuthenticatedAccount/index.js';
3
3
 
4
4
  const createUserProfile = (decodedJwt) => {
5
- var _a;
6
5
  const wallet = lastAuthenticatedAccount(decodedJwt);
7
6
  const kyc = {
8
7
  alias: decodedJwt.alias,
@@ -26,7 +25,7 @@ const createUserProfile = (decodedJwt) => {
26
25
  team: decodedJwt.team,
27
26
  username: decodedJwt.username,
28
27
  };
29
- const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
28
+ const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: (wallet === null || wallet === void 0 ? void 0 : wallet.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
30
29
  return userProfile;
31
30
  };
32
31
 
@@ -19,13 +19,12 @@ require('@dynamic-labs/utils');
19
19
  require('../../../shared/consts/index.cjs');
20
20
 
21
21
  // TODO: Check if this is actually returning the correct verified credential
22
- const findEmbeddedWalletFromVerifiedCredentials = (jwt, chain) => {
22
+ const findEmbeddedWalletFromVerifiedCredentials = (jwt, chains) => {
23
23
  var _a;
24
24
  const decodedJwt = decodeJwt.decodeJwt(jwt);
25
25
  const verifiedCredentials = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.filter(({ walletProvider }) => walletProvider === 'embeddedWallet');
26
- if ((verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.length) && chain) {
27
- const chainName = values.ChainEnumToVerifiedCredentialName[chain];
28
- return verifiedCredentials.find(({ chain }) => chain === chainName);
26
+ if ((verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.length) && (chains === null || chains === void 0 ? void 0 : chains.length)) {
27
+ return verifiedCredentials.find(({ chain }) => chain && chains.includes(values.VerifiedCredentialNameToChainEnum[chain]));
29
28
  }
30
29
  return verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.shift();
31
30
  };
@@ -1 +1 @@
1
- export declare const findEmbeddedWalletFromVerifiedCredentials: (jwt: string, chain?: string) => import("@dynamic-labs/sdk-api-core").JwtVerifiedCredential | undefined;
1
+ export declare const findEmbeddedWalletFromVerifiedCredentials: (jwt: string, chains?: string[]) => import("@dynamic-labs/sdk-api-core").JwtVerifiedCredential | undefined;
@@ -9,19 +9,18 @@ import '../../../context/ViewContext/ViewContext.js';
9
9
  import 'react';
10
10
  import '@dynamic-labs/wallet-book';
11
11
  import '../../constants/colors.js';
12
- import { ChainEnumToVerifiedCredentialName } from '../../constants/values.js';
12
+ import { VerifiedCredentialNameToChainEnum } from '../../constants/values.js';
13
13
  import '../../../shared/utils/classes/storage/localStorage.js';
14
14
  import '@dynamic-labs/utils';
15
15
  import '../../../shared/consts/index.js';
16
16
 
17
17
  // TODO: Check if this is actually returning the correct verified credential
18
- const findEmbeddedWalletFromVerifiedCredentials = (jwt, chain) => {
18
+ const findEmbeddedWalletFromVerifiedCredentials = (jwt, chains) => {
19
19
  var _a;
20
20
  const decodedJwt = decodeJwt(jwt);
21
21
  const verifiedCredentials = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.filter(({ walletProvider }) => walletProvider === 'embeddedWallet');
22
- if ((verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.length) && chain) {
23
- const chainName = ChainEnumToVerifiedCredentialName[chain];
24
- return verifiedCredentials.find(({ chain }) => chain === chainName);
22
+ if ((verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.length) && (chains === null || chains === void 0 ? void 0 : chains.length)) {
23
+ return verifiedCredentials.find(({ chain }) => chain && chains.includes(VerifiedCredentialNameToChainEnum[chain]));
25
24
  }
26
25
  return verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.shift();
27
26
  };
@@ -19,7 +19,7 @@ const findTurnkeyWalletByPrimaryChain = (walletOptions, chainConfigurations, ver
19
19
  const walletConnector = findTurnkeyWalletByChain(walletOptions, values.ChainEnumToVerifiedCredentialName[primaryEmbeddedChain]);
20
20
  const turnkeyVC = verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.find(({ walletName, chain }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) &&
21
21
  chain === values.ChainEnumToVerifiedCredentialName[primaryEmbeddedChain]);
22
- if (!turnkeyVC || !walletConnector) {
22
+ if (!walletConnector) {
23
23
  return undefined;
24
24
  }
25
25
  return Object.assign(Object.assign({}, turnkeyVC), walletConnector);
@@ -2,7 +2,9 @@ import { ChainConfiguration, JwtVerifiedCredential } from '@dynamic-labs/sdk-api
2
2
  import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
3
  import { WalletOption } from '../../../shared';
4
4
  export declare const findTurnkeyWalletByChain: (walletOptions: WalletOption[] | undefined, chainName: string | undefined) => WalletOption | undefined;
5
- export declare const findTurnkeyWalletByPrimaryChain: (walletOptions: WalletOption[] | undefined, chainConfigurations: ChainConfiguration[] | undefined, verifiedCredentials: JwtVerifiedCredential[]) => (JwtVerifiedCredential & WalletOption) | undefined;
5
+ type FindTurnkeyWalletByChainResult = (JwtVerifiedCredential & WalletOption) | WalletOption | undefined;
6
+ export declare const findTurnkeyWalletByPrimaryChain: (walletOptions: WalletOption[] | undefined, chainConfigurations: ChainConfiguration[] | undefined, verifiedCredentials: JwtVerifiedCredential[]) => FindTurnkeyWalletByChainResult;
6
7
  export declare const findTurnkeyWalletByAddress: (walletOptions: WalletOption[] | undefined, verifiedCredentials: JwtVerifiedCredential[], address: string | undefined) => (JwtVerifiedCredential & {
7
8
  walletConnector?: WalletConnector;
8
9
  }) | undefined;
10
+ export {};
@@ -15,7 +15,7 @@ const findTurnkeyWalletByPrimaryChain = (walletOptions, chainConfigurations, ver
15
15
  const walletConnector = findTurnkeyWalletByChain(walletOptions, ChainEnumToVerifiedCredentialName[primaryEmbeddedChain]);
16
16
  const turnkeyVC = verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.find(({ walletName, chain }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) &&
17
17
  chain === ChainEnumToVerifiedCredentialName[primaryEmbeddedChain]);
18
- if (!turnkeyVC || !walletConnector) {
18
+ if (!walletConnector) {
19
19
  return undefined;
20
20
  }
21
21
  return Object.assign(Object.assign({}, turnkeyVC), walletConnector);
@@ -5,19 +5,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  /**
7
7
  * This will return a string which we can present to the user credential type
8
- * @param decodedJwt
8
+ * @param user
9
9
  * @param type optional parameter to check for specific credential type
10
10
  * @returns JwtVerifiedCredentialFormatEnum | undefined
11
11
  */
12
- const getUserVerifiedCredentialType = (decodedJwt, type) => {
12
+ const getUserVerifiedCredentialType = (user, type) => {
13
13
  var _a, _b, _c;
14
- if (!decodedJwt) {
14
+ if (!user) {
15
15
  return undefined;
16
16
  }
17
17
  if (type) {
18
- return (_b = (_a = decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((credentials) => credentials.format === type)) === null || _b === void 0 ? void 0 : _b.format;
18
+ return (_b = (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((credentials) => credentials.format === type)) === null || _b === void 0 ? void 0 : _b.format;
19
19
  }
20
- const verifiedCredential = (_c = decodedJwt.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find((credentials) => credentials.id === decodedJwt.lastVerifiedCredentialId);
20
+ const verifiedCredential = (_c = user.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find((credentials) => credentials.id === user.lastVerifiedCredentialId);
21
21
  return verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.format;
22
22
  };
23
23
 
@@ -1,8 +1,9 @@
1
1
  import { DynamicJwt, JwtVerifiedCredentialFormatEnum } from '@dynamic-labs/sdk-api-core';
2
+ import { UserProfile } from '../../../..';
2
3
  /**
3
4
  * This will return a string which we can present to the user credential type
4
- * @param decodedJwt
5
+ * @param user
5
6
  * @param type optional parameter to check for specific credential type
6
7
  * @returns JwtVerifiedCredentialFormatEnum | undefined
7
8
  */
8
- export declare const getUserVerifiedCredentialType: (decodedJwt: DynamicJwt | undefined, type?: JwtVerifiedCredentialFormatEnum) => JwtVerifiedCredentialFormatEnum | undefined;
9
+ export declare const getUserVerifiedCredentialType: (user: UserProfile | DynamicJwt | undefined, type?: JwtVerifiedCredentialFormatEnum) => JwtVerifiedCredentialFormatEnum | undefined;
@@ -1,19 +1,19 @@
1
1
  'use client'
2
2
  /**
3
3
  * This will return a string which we can present to the user credential type
4
- * @param decodedJwt
4
+ * @param user
5
5
  * @param type optional parameter to check for specific credential type
6
6
  * @returns JwtVerifiedCredentialFormatEnum | undefined
7
7
  */
8
- const getUserVerifiedCredentialType = (decodedJwt, type) => {
8
+ const getUserVerifiedCredentialType = (user, type) => {
9
9
  var _a, _b, _c;
10
- if (!decodedJwt) {
10
+ if (!user) {
11
11
  return undefined;
12
12
  }
13
13
  if (type) {
14
- return (_b = (_a = decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((credentials) => credentials.format === type)) === null || _b === void 0 ? void 0 : _b.format;
14
+ return (_b = (_a = user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find((credentials) => credentials.format === type)) === null || _b === void 0 ? void 0 : _b.format;
15
15
  }
16
- const verifiedCredential = (_c = decodedJwt.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find((credentials) => credentials.id === decodedJwt.lastVerifiedCredentialId);
16
+ const verifiedCredential = (_c = user.verifiedCredentials) === null || _c === void 0 ? void 0 : _c.find((credentials) => credentials.id === user.lastVerifiedCredentialId);
17
17
  return verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.format;
18
18
  };
19
19
 
@@ -3,13 +3,18 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var isEmbeddedWalletPresent = require('../isEmbeddedWalletPresent/isEmbeddedWalletPresent.cjs');
6
+ var findEmbeddedWalletFromVerifiedCredentials = require('../findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs');
7
7
 
8
8
  const hasEmbeddedWallet = (jwt, walletName) => {
9
+ var _a;
9
10
  if (!jwt) {
10
11
  return false;
11
12
  }
12
- return isEmbeddedWalletPresent.isEmbeddedWalletPresent(jwt, walletName);
13
+ const embeddedWallet = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(jwt);
14
+ if (!walletName) {
15
+ return Boolean(embeddedWallet);
16
+ }
17
+ return Boolean((_a = embeddedWallet === null || embeddedWallet === void 0 ? void 0 : embeddedWallet.walletName) === null || _a === void 0 ? void 0 : _a.startsWith(walletName));
13
18
  };
14
19
 
15
20
  exports.hasEmbeddedWallet = hasEmbeddedWallet;
@@ -1,11 +1,16 @@
1
1
  'use client'
2
- import { isEmbeddedWalletPresent } from '../isEmbeddedWalletPresent/isEmbeddedWalletPresent.js';
2
+ import { findEmbeddedWalletFromVerifiedCredentials } from '../findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
3
3
 
4
4
  const hasEmbeddedWallet = (jwt, walletName) => {
5
+ var _a;
5
6
  if (!jwt) {
6
7
  return false;
7
8
  }
8
- return isEmbeddedWalletPresent(jwt, walletName);
9
+ const embeddedWallet = findEmbeddedWalletFromVerifiedCredentials(jwt);
10
+ if (!walletName) {
11
+ return Boolean(embeddedWallet);
12
+ }
13
+ return Boolean((_a = embeddedWallet === null || embeddedWallet === void 0 ? void 0 : embeddedWallet.walletName) === null || _a === void 0 ? void 0 : _a.startsWith(walletName));
9
14
  };
10
15
 
11
16
  export { hasEmbeddedWallet };
@@ -36,7 +36,7 @@ export * from './groupBy';
36
36
  export * from './isAccountAbstractionWallet';
37
37
  export * from './isEmailProviderEnabled';
38
38
  export * from './isEmailValid';
39
- export * from './isEmbeddedWalletPresent';
39
+ export * from './addPasskeyIdentifierToWalletConnector';
40
40
  export * from './isMagicConnector';
41
41
  export * from './isNetworkUnsupported';
42
42
  export * from './isOnrampProvider';
@@ -17,7 +17,8 @@ var useElementById = require('../useElementById/useElementById.cjs');
17
17
  * confirms or cancels the operation, and must return the ReactNode for the modal to be displayed.
18
18
  */
19
19
  const useConfirmationModal = ({ elementId, }) => {
20
- const modalRootElementRef = useElementById.useElementById(elementId);
20
+ const { createRootElement } = useElementById.useElementById();
21
+ const modalRootElementRef = createRootElement(elementId);
21
22
  const [node, setNode] = React.useState(null);
22
23
  const open = React.useCallback((builder) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
23
24
  const promise = new Promise((resolve, reject) => {
@@ -13,7 +13,8 @@ import { useElementById } from '../useElementById/useElementById.js';
13
13
  * confirms or cancels the operation, and must return the ReactNode for the modal to be displayed.
14
14
  */
15
15
  const useConfirmationModal = ({ elementId, }) => {
16
- const modalRootElementRef = useElementById(elementId);
16
+ const { createRootElement } = useElementById();
17
+ const modalRootElementRef = createRootElement(elementId);
17
18
  const [node, setNode] = useState(null);
18
19
  const open = useCallback((builder) => __awaiter(void 0, void 0, void 0, function* () {
19
20
  const promise = new Promise((resolve, reject) => {
@@ -34,9 +34,8 @@ require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
34
34
  require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
35
35
  require('../../../context/VerificationContext/VerificationContext.cjs');
36
36
  require('react-dom');
37
- var createEmbeddedWalletWithPasskey = require('../../../views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs');
37
+ var createEmbeddedWalletRequest = require('../../../views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs');
38
38
  var findPasskeyEmailWalletConnector = require('../../../views/Passkey/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.cjs');
39
- var createPregeneratedWallet = require('../../../views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs');
40
39
  var smartWallet = require('../useWalletConnectors/utils/smartWallet/smartWallet.cjs');
41
40
  var findPrimaryEmbeddedChain = require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
42
41
  require('../../../context/WalletContext/WalletContext.cjs');
@@ -84,7 +83,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
84
83
  // This hook needs to be async that's why it's not using useMutation
85
84
  const useCreateDynamicEmbeddedWalletMutation = () => {
86
85
  var _a, _b;
87
- const { setPrimaryWalletId, setCallback, setUser, user, setShowAuthFlow, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
86
+ const { setPrimaryWalletId, setUser, user, setShowAuthFlow, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
88
87
  const [isLoading, setIsLoading] = React.useState(false);
89
88
  const [error, setError] = React.useState();
90
89
  const embeddedChainConfig = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.chainConfigurations) || [];
@@ -92,19 +91,18 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
92
91
  const embeddedChains = embeddedChainConfig
93
92
  .filter((chain) => chain.enabled)
94
93
  .map((c) => (c.name === 'SOL' ? sdkApiCore.ChainEnum.Sol : sdkApiCore.ChainEnum.Evm));
95
- const createDynamicEmbeddedWalletMutation = React.useCallback((_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, }) {
94
+ const createDynamicEmbeddedWalletMutation = React.useCallback((_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, options, chains, }) {
96
95
  var _d, _e;
97
96
  setIsLoading(true);
98
- const createEmbeddedWalletMethodToUse = withAuthenticator
99
- ? createEmbeddedWalletWithPasskey.createEmbeddedWalletWithPasskey
100
- : createPregeneratedWallet.createPregeneratedWallet;
101
97
  try {
102
- const { embeddedWalletVerifiedCredential, decodedJwt: updatedDecodedJwt, signersResponse, walletConnector, } = yield createEmbeddedWalletMethodToUse({
98
+ const { embeddedWalletVerifiedCredential, decodedJwt: updatedDecodedJwt, signersResponse, walletConnector, } = yield createEmbeddedWalletRequest.createEmbeddedWalletRequest({
103
99
  authToken,
104
- chains: embeddedChains,
100
+ chains: chains !== null && chains !== void 0 ? chains : embeddedChains,
105
101
  environmentId,
106
102
  user: user !== null && user !== void 0 ? user : createUserProfile.createUserProfile(decodedJwt),
107
103
  walletConnector: findPasskeyEmailWalletConnector.findPasskeyEmailWalletConnector(walletConnectorOptions, primaryEmbeddedChain),
104
+ webAuthnAttestation: options === null || options === void 0 ? void 0 : options.webAuthnAttestation,
105
+ withAuthenticator,
108
106
  });
109
107
  const turnkeyVerifiedCredentials = (_d = updatedDecodedJwt === null || updatedDecodedJwt === void 0 ? void 0 : updatedDecodedJwt.verifiedCredentials) === null || _d === void 0 ? void 0 : _d.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'));
110
108
  /** It's not authenticated if it's a turnkey wallet that still hasn't created a passkey */
@@ -141,7 +139,14 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
141
139
  finally {
142
140
  setIsLoading(false);
143
141
  }
144
- }), [setCallback, setPrimaryWalletId, setShowAuthFlow, setUser, user]);
142
+ }), [
143
+ embeddedChains,
144
+ primaryEmbeddedChain,
145
+ setPrimaryWalletId,
146
+ setShowAuthFlow,
147
+ setUser,
148
+ user,
149
+ ]);
145
150
  return {
146
151
  createDynamicEmbeddedWalletMutation,
147
152
  error,
@@ -1,4 +1,5 @@
1
- import { DynamicJwt } from '@dynamic-labs/sdk-api-core';
1
+ import { DynamicJwt, ChainEnum } from '@dynamic-labs/sdk-api-core';
2
+ import { WebAuthnAttestation } from '@dynamic-labs/wallet-connector-core';
2
3
  import { WalletOption } from '../../../shared';
3
4
  type MutationProps = {
4
5
  authToken: string | undefined;
@@ -6,9 +7,13 @@ type MutationProps = {
6
7
  walletConnectorOptions: WalletOption[];
7
8
  decodedJwt: DynamicJwt;
8
9
  withAuthenticator: boolean;
10
+ options?: {
11
+ webAuthnAttestation: WebAuthnAttestation;
12
+ };
13
+ chains?: ChainEnum[];
9
14
  };
10
15
  export declare const useCreateDynamicEmbeddedWalletMutation: () => {
11
- createDynamicEmbeddedWalletMutation: ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, }: MutationProps) => Promise<void>;
16
+ createDynamicEmbeddedWalletMutation: ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, options, chains, }: MutationProps) => Promise<void>;
12
17
  error: unknown;
13
18
  isLoading: boolean;
14
19
  };