@dynamic-labs/sdk-react-core 3.0.0-alpha.52 → 3.0.0-alpha.54

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 (543) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +13 -13
  5. package/src/index.cjs +8 -6
  6. package/src/index.d.ts +1 -1
  7. package/src/index.js +5 -4
  8. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +18 -30
  9. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.d.ts +1 -1
  10. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +19 -31
  11. package/src/lib/components/Divider/Divider.cjs +3 -3
  12. package/src/lib/components/Divider/Divider.d.ts +2 -2
  13. package/src/lib/components/Divider/Divider.js +4 -4
  14. package/src/lib/components/EmailForm/EmailForm.cjs +1 -1
  15. package/src/lib/components/EmailForm/EmailForm.js +1 -1
  16. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -1
  17. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -1
  18. package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -1
  19. package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -1
  20. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -1
  21. package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -1
  22. package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +5 -4
  23. package/src/lib/components/NeedHelpSection/NeedHelpSection.js +6 -5
  24. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +1 -1
  25. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +1 -1
  26. package/src/lib/components/NetworkPicker/components/Network/Network.cjs +1 -1
  27. package/src/lib/components/NetworkPicker/components/Network/Network.js +1 -1
  28. package/src/lib/components/NetworkPicker/components/NetworkControlSkeleton/NetworkControlSkeleton.cjs +1 -1
  29. package/src/lib/components/NetworkPicker/components/NetworkControlSkeleton/NetworkControlSkeleton.js +1 -1
  30. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
  31. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
  32. package/src/lib/components/PhoneNumberField/PhoneNumberField.cjs +1 -1
  33. package/src/lib/components/PhoneNumberField/PhoneNumberField.js +1 -1
  34. package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +1 -1
  35. package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +1 -1
  36. package/src/lib/components/QrCodeWrapper/QrCodeWrapper.cjs +2 -2
  37. package/src/lib/components/QrCodeWrapper/QrCodeWrapper.js +2 -2
  38. package/src/lib/components/RenderView/RenderView.cjs +1 -1
  39. package/src/lib/components/RenderView/RenderView.js +1 -1
  40. package/src/lib/components/SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.cjs +11 -10
  41. package/src/lib/components/SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.js +12 -11
  42. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +3 -2
  43. package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +0 -1
  44. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +3 -2
  45. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +7 -4
  46. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +0 -2
  47. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +7 -4
  48. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +8 -3
  49. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.d.ts +0 -1
  50. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +8 -3
  51. package/src/lib/components/SendBalancePageLayout/utils.cjs +3 -1
  52. package/src/lib/components/SendBalancePageLayout/utils.d.ts +1 -1
  53. package/src/lib/components/SendBalancePageLayout/utils.js +3 -1
  54. package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.cjs +1 -1
  55. package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.js +1 -1
  56. package/src/lib/components/TransactionCard/TransactionCard.cjs +2 -2
  57. package/src/lib/components/TransactionCard/TransactionCard.d.ts +1 -2
  58. package/src/lib/components/TransactionCard/TransactionCard.js +2 -2
  59. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +24 -22
  60. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +0 -3
  61. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +24 -22
  62. package/src/lib/components/TransactionConfirmationPageLayout/utils.cjs +2 -2
  63. package/src/lib/components/TransactionConfirmationPageLayout/utils.d.ts +1 -1
  64. package/src/lib/components/TransactionConfirmationPageLayout/utils.js +2 -2
  65. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +4 -2
  66. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +0 -1
  67. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +4 -2
  68. package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
  69. package/src/lib/components/UserProfile/UserProfile.js +1 -1
  70. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
  71. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
  72. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +1 -1
  73. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +1 -1
  74. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
  75. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
  76. package/src/lib/context/DynamicContext/DynamicContext.cjs +9 -13
  77. package/src/lib/context/DynamicContext/DynamicContext.js +9 -13
  78. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -1
  79. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -1
  80. package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +2 -2
  81. package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +9 -4
  82. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +6 -5
  83. package/src/lib/context/DynamicContext/types/SocialSettings.d.ts +7 -0
  84. package/src/lib/context/DynamicContext/types/index.d.ts +1 -0
  85. package/src/lib/context/MockContext/MockContext.cjs +1 -1
  86. package/src/lib/context/MockContext/MockContext.js +1 -1
  87. package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.d.ts +2 -2
  88. package/src/lib/context/ReinitializeContext/ReinitializeContextProvider.cjs +1 -1
  89. package/src/lib/context/ReinitializeContext/ReinitializeContextProvider.js +1 -1
  90. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +2 -2
  91. package/src/lib/context/UserWalletsContext/UserWalletsContext.d.ts +1 -1
  92. package/src/lib/context/WalletContext/WalletContext.cjs +1 -84
  93. package/src/lib/context/WalletContext/WalletContext.d.ts +1 -2
  94. package/src/lib/context/WalletContext/WalletContext.js +1 -84
  95. package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.cjs +1 -1
  96. package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.js +1 -1
  97. package/src/lib/data/api/api.cjs +1 -1
  98. package/src/lib/data/api/api.js +1 -1
  99. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +1 -1
  100. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +1 -1
  101. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +1 -1
  102. package/src/lib/layout/DynamicAuthLayout/Header/header.js +1 -1
  103. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +1 -1
  104. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +1 -1
  105. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +1 -1
  106. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +1 -1
  107. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +1 -1
  108. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +1 -1
  109. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +1 -1
  110. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +1 -1
  111. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -1
  112. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -1
  113. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +1 -1
  114. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +1 -1
  115. package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
  116. package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +1 -1
  117. package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -1
  118. package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -1
  119. package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -1
  120. package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -1
  121. package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -1
  122. package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -1
  123. package/src/lib/locale/en/translation.cjs +39 -5
  124. package/src/lib/locale/en/translation.d.ts +39 -5
  125. package/src/lib/locale/en/translation.js +39 -5
  126. package/src/lib/modals/ConfirmationModal/ConfirmationModal.cjs +1 -1
  127. package/src/lib/modals/ConfirmationModal/ConfirmationModal.js +1 -1
  128. package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.cjs +1 -1
  129. package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.js +1 -1
  130. package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -1
  131. package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -1
  132. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +11 -10
  133. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +12 -11
  134. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.cjs +4 -4
  135. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.d.ts +1 -1
  136. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.js +4 -4
  137. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.types.d.ts +2 -0
  138. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +2 -9
  139. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +2 -9
  140. package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +1 -1
  141. package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +1 -1
  142. package/src/lib/shared/assets/arrow-circle-right.cjs +54 -0
  143. package/src/lib/shared/assets/arrow-circle-right.js +30 -0
  144. package/src/lib/shared/assets/index.d.ts +1 -0
  145. package/src/lib/shared/types/wallets.d.ts +2 -2
  146. package/src/lib/shared/utils/functions/usingSessionKeys/usingSessionKeys.cjs +1 -1
  147. package/src/lib/shared/utils/functions/usingSessionKeys/usingSessionKeys.js +2 -2
  148. package/src/lib/shared/utils/functions/wallet/createWallet.d.ts +2 -2
  149. package/src/lib/store/actions/sendBalanceActions/index.d.ts +1 -1
  150. package/src/lib/store/actions/sendBalanceActions/sendBalanceActions.cjs +8 -0
  151. package/src/lib/store/actions/sendBalanceActions/sendBalanceActions.d.ts +1 -0
  152. package/src/lib/store/actions/sendBalanceActions/sendBalanceActions.js +8 -1
  153. package/src/lib/store/store.cjs +2 -0
  154. package/src/lib/store/store.js +2 -0
  155. package/src/lib/store/types.d.ts +2 -0
  156. package/src/lib/store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.cjs +1 -1
  157. package/src/lib/store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.js +1 -1
  158. package/src/lib/styles/index.shadow.cjs +1 -1
  159. package/src/lib/styles/index.shadow.js +1 -1
  160. package/src/lib/utils/constants/errors.cjs +0 -2
  161. package/src/lib/utils/constants/errors.js +1 -2
  162. package/src/lib/utils/functions/fiatUtils/fiatUtils.d.ts +2 -2
  163. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.d.ts +2 -2
  164. package/src/lib/utils/{hooks/useWalletConnectors/utils/findWallet/findWallet.cjs → functions/findWalletOptionFor/findWalletOptionFor.cjs} +3 -3
  165. package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.d.ts +3 -0
  166. package/src/lib/utils/{hooks/useWalletConnectors/utils/findWallet/findWallet.js → functions/findWalletOptionFor/findWalletOptionFor.js} +3 -3
  167. package/src/lib/utils/functions/findWalletOptionFor/index.d.ts +1 -0
  168. package/src/lib/utils/functions/generateMessages/index.cjs +3 -2
  169. package/src/lib/utils/functions/generateMessages/index.js +3 -2
  170. package/src/lib/utils/functions/getEmbeddedWalletAuthHandler/getEmbeddedWalletAuthHandler.d.ts +2 -2
  171. package/src/lib/utils/functions/getEnabledEmbeddedWalletProviders/getEnabledEmbeddedWalletProviders.cjs +1 -1
  172. package/src/lib/utils/functions/getEnabledEmbeddedWalletProviders/getEnabledEmbeddedWalletProviders.js +1 -1
  173. package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.cjs +1 -1
  174. package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.js +1 -1
  175. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -2
  176. package/src/lib/utils/functions/getWalletConnectorForWallet/getWalletConnectorForWallet.d.ts +2 -2
  177. package/src/lib/utils/functions/index.d.ts +0 -2
  178. package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.d.ts +1 -1
  179. package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs +1 -1
  180. package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js +1 -1
  181. package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.cjs +1 -1
  182. package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.js +1 -1
  183. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.cjs +1 -1
  184. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.js +1 -1
  185. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.d.ts +2 -2
  186. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.d.ts +2 -2
  187. package/src/lib/utils/hooks/index.d.ts +1 -0
  188. package/src/lib/utils/hooks/multiWallet/index.d.ts +0 -1
  189. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +8 -7
  190. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
  191. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +9 -8
  192. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.d.ts +2 -2
  193. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +1 -1
  194. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -4
  195. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +3 -4
  196. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
  197. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +4 -6
  198. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +1 -1
  199. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +5 -7
  200. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +86 -61
  201. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +3 -3
  202. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +87 -63
  203. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +32 -30
  204. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +1 -1
  205. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +33 -31
  206. package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.d.ts +1 -1
  207. package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +7 -6
  208. package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +7 -6
  209. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +11 -9
  210. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +12 -10
  211. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +8 -12
  212. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +8 -12
  213. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.cjs +1 -1
  214. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.js +1 -1
  215. package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +6 -5
  216. package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +6 -5
  217. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +12 -11
  218. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.d.ts +2 -2
  219. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +12 -11
  220. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +3 -3
  221. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +3 -3
  222. package/src/lib/utils/hooks/useSmartWallets/index.d.ts +1 -0
  223. package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.cjs +159 -0
  224. package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.d.ts +18 -0
  225. package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.js +155 -0
  226. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +6 -1
  227. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +7 -2
  228. package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs +1 -4
  229. package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.js +1 -4
  230. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +3 -0
  231. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +3 -0
  232. package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.cjs +1 -1
  233. package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.d.ts +2 -2
  234. package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.js +1 -1
  235. package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +1 -1
  236. package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +1 -1
  237. package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +1 -1
  238. package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +1 -1
  239. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +7 -87
  240. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +2 -2
  241. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +8 -88
  242. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +9 -79
  243. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +4 -10
  244. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +10 -80
  245. package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +5 -89
  246. package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.d.ts +2 -3
  247. package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +5 -89
  248. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +4 -4
  249. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +5 -5
  250. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +26 -29
  251. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
  252. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +26 -29
  253. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
  254. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.d.ts +6 -6
  255. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
  256. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.types.d.ts +4 -4
  257. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +16 -7
  258. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +2 -2
  259. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +16 -7
  260. package/src/lib/views/AccessBlockedView/AccessBlockedView.cjs +1 -1
  261. package/src/lib/views/AccessBlockedView/AccessBlockedView.js +1 -1
  262. package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
  263. package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
  264. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
  265. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -1
  266. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +1 -1
  267. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +1 -1
  268. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
  269. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
  270. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
  271. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
  272. package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.cjs +2 -2
  273. package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.js +2 -2
  274. package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.cjs +1 -1
  275. package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.js +1 -1
  276. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +1 -1
  277. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +1 -1
  278. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +1 -1
  279. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +1 -1
  280. package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +3 -3
  281. package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +3 -3
  282. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
  283. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
  284. package/src/lib/views/EmailVerification/EmailVerification.cjs +20 -19
  285. package/src/lib/views/EmailVerification/EmailVerification.js +21 -20
  286. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
  287. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
  288. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +52 -52
  289. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +53 -53
  290. package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +1 -1
  291. package/src/lib/views/EnterPasswordView/EnterPasswordView.js +1 -1
  292. package/src/lib/views/FarcasterConnectView/FarcasterConnectView.cjs +1 -1
  293. package/src/lib/views/FarcasterConnectView/FarcasterConnectView.js +1 -1
  294. package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.cjs +1 -1
  295. package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.js +1 -1
  296. package/src/lib/views/LoginView/LoginViewSection/LoginViewSection.cjs +1 -1
  297. package/src/lib/views/LoginView/LoginViewSection/LoginViewSection.js +1 -1
  298. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +1 -1
  299. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +1 -1
  300. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +1 -1
  301. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +1 -1
  302. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +1 -1
  303. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +1 -1
  304. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +1 -1
  305. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +1 -1
  306. package/src/lib/views/LoginView/sections/ToggleableSection/ToggleableSection.cjs +1 -1
  307. package/src/lib/views/LoginView/sections/ToggleableSection/ToggleableSection.js +1 -1
  308. package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +2 -2
  309. package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +2 -2
  310. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +1 -1
  311. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +1 -1
  312. package/src/lib/views/MergeUserAccountsConflictsView/MergeUserAccountsConflictsView.cjs +1 -1
  313. package/src/lib/views/MergeUserAccountsConflictsView/MergeUserAccountsConflictsView.js +1 -1
  314. package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +1 -1
  315. package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +1 -1
  316. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +1 -1
  317. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +1 -1
  318. package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +2 -2
  319. package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +2 -2
  320. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +1 -1
  321. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +1 -1
  322. package/src/lib/views/MfaSecureDeviceHelpView/MfaSecureDeviceHelpView.cjs +1 -1
  323. package/src/lib/views/MfaSecureDeviceHelpView/MfaSecureDeviceHelpView.js +1 -1
  324. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +1 -1
  325. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +1 -1
  326. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -1
  327. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -1
  328. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -1
  329. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -1
  330. package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
  331. package/src/lib/views/NoAccess/NoAccess.js +1 -1
  332. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -1
  333. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -1
  334. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +1 -1
  335. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +1 -1
  336. package/src/lib/views/Passkey/EmbeddedAuthChoice/AuthChoiceInfo/AuthChoiceInfo.cjs +1 -1
  337. package/src/lib/views/Passkey/EmbeddedAuthChoice/AuthChoiceInfo/AuthChoiceInfo.js +1 -1
  338. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.cjs +35 -33
  339. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.d.ts +1 -1
  340. package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.js +35 -33
  341. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.cjs +2 -2
  342. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.js +2 -2
  343. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs +1 -1
  344. package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js +1 -1
  345. package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs +1 -1
  346. package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.js +1 -1
  347. package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +2 -2
  348. package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +2 -2
  349. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +35 -33
  350. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.d.ts +1 -1
  351. package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +35 -33
  352. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +33 -31
  353. package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +33 -31
  354. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -2
  355. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -2
  356. package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +1 -1
  357. package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +1 -1
  358. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -1
  359. package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -1
  360. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -1
  361. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -1
  362. package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs +1 -1
  363. package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js +1 -1
  364. package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.cjs +1 -1
  365. package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.js +1 -1
  366. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +28 -11
  367. package/src/lib/views/SendBalanceView/SendBalanceView.js +28 -11
  368. package/src/lib/views/SmsVerification/SmsVerification.cjs +1 -1
  369. package/src/lib/views/SmsVerification/SmsVerification.js +1 -1
  370. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
  371. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
  372. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +1 -1
  373. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +1 -1
  374. package/src/lib/{utils/functions/getEOAWallet/getEOAWallet.cjs → views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.cjs} +57 -50
  375. package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.d.ts +9 -0
  376. package/src/lib/{utils/functions/getEOAWallet/getEOAWallet.js → views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.js} +57 -50
  377. package/src/lib/views/SyncWalletView/AutoReconnectingView/index.d.ts +1 -0
  378. package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.cjs +126 -0
  379. package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.d.ts +9 -0
  380. package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.js +122 -0
  381. package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/index.d.ts +1 -0
  382. package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.cjs +101 -0
  383. package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.d.ts +10 -0
  384. package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.js +97 -0
  385. package/src/lib/views/SyncWalletView/SwitchWalletView/index.d.ts +1 -0
  386. package/src/lib/views/SyncWalletView/SyncWalletView.cjs +74 -49
  387. package/src/lib/views/SyncWalletView/SyncWalletView.d.ts +2 -0
  388. package/src/lib/views/SyncWalletView/SyncWalletView.js +75 -50
  389. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +4 -2
  390. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +0 -2
  391. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +4 -2
  392. package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
  393. package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
  394. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +1 -1
  395. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +1 -1
  396. package/src/lib/views/WalletGroupView/WalletGroupView.cjs +2 -2
  397. package/src/lib/views/WalletGroupView/WalletGroupView.js +2 -2
  398. package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +2 -2
  399. package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +2 -2
  400. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +1 -1
  401. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +1 -1
  402. package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.cjs +1 -1
  403. package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.js +1 -1
  404. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
  405. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
  406. package/src/lib/views/WalletLockedView/WalletLockedView.cjs +1 -1
  407. package/src/lib/views/WalletLockedView/WalletLockedView.js +1 -1
  408. package/src/lib/views/WalletRedirectView/WalletRedirectView.cjs +1 -1
  409. package/src/lib/views/WalletRedirectView/WalletRedirectView.js +1 -1
  410. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
  411. package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
  412. package/src/lib/views/viewToComponentMap.cjs +1 -1
  413. package/src/lib/views/viewToComponentMap.js +1 -1
  414. package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +1 -1
  415. package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +1 -1
  416. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +1 -1
  417. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +1 -1
  418. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +1 -1
  419. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +1 -1
  420. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +1 -1
  421. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +1 -1
  422. package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +1 -1
  423. package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +1 -1
  424. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
  425. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -1
  426. package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +1 -1
  427. package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +1 -1
  428. package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +1 -1
  429. package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +1 -1
  430. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -1
  431. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -1
  432. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -1
  433. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -1
  434. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +1 -1
  435. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +1 -1
  436. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +1 -1
  437. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +1 -1
  438. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +8 -7
  439. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +8 -7
  440. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/TokenBalanceItem/TokenBalanceItem.cjs +1 -1
  441. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/TokenBalanceItem/TokenBalanceItem.js +1 -1
  442. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/TokenBalanceList/TokenBalanceList.cjs +1 -1
  443. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/TokenBalanceList/TokenBalanceList.js +1 -1
  444. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -1
  445. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -1
  446. package/src/lib/widgets/DynamicWidget/components/BottomNavBar/BottomNavBar.cjs +1 -1
  447. package/src/lib/widgets/DynamicWidget/components/BottomNavBar/BottomNavBar.js +1 -1
  448. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -2
  449. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -2
  450. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
  451. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
  452. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -1
  453. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -1
  454. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -1
  455. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -1
  456. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +1 -1
  457. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +1 -1
  458. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
  459. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
  460. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +1 -1
  461. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +1 -1
  462. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
  463. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
  464. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +1 -1
  465. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +1 -1
  466. package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.cjs +1 -1
  467. package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.js +1 -1
  468. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -1
  469. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -1
  470. package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.cjs +1 -1
  471. package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.js +1 -1
  472. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -1
  473. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -1
  474. package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.cjs +8 -5
  475. package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.d.ts +3 -2
  476. package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.js +8 -5
  477. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +2 -2
  478. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +3 -1
  479. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +2 -2
  480. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +2 -1
  481. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.d.ts +1 -0
  482. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +2 -1
  483. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +3 -3
  484. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +1 -0
  485. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +3 -3
  486. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +8 -10
  487. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +8 -10
  488. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -1
  489. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -1
  490. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +1 -1
  491. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +1 -1
  492. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
  493. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
  494. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -1
  495. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -1
  496. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -1
  497. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -1
  498. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -1
  499. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -1
  500. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -1
  501. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -1
  502. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
  503. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
  504. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -1
  505. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -1
  506. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +1 -1
  507. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +1 -1
  508. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +1 -1
  509. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +1 -1
  510. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.cjs +1 -1
  511. package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.js +1 -1
  512. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +1 -1
  513. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +1 -1
  514. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
  515. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
  516. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +46 -45
  517. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +47 -46
  518. package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +1 -1
  519. package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +1 -1
  520. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +1 -1
  521. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +1 -1
  522. package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.cjs +0 -40
  523. package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.d.ts +0 -3
  524. package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.js +0 -36
  525. package/src/lib/utils/functions/createOwnerWallet/index.d.ts +0 -1
  526. package/src/lib/utils/functions/getEOAWallet/getEOAWallet.d.ts +0 -3
  527. package/src/lib/utils/functions/getEOAWallet/index.d.ts +0 -1
  528. package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.cjs +0 -8
  529. package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.js +0 -4
  530. package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +0 -14
  531. package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +0 -10
  532. package/src/lib/utils/hooks/events/useWindowEvent/useWindowEvent.cjs +0 -25
  533. package/src/lib/utils/hooks/events/useWindowEvent/useWindowEvent.js +0 -21
  534. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/index.d.ts +0 -1
  535. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +0 -209
  536. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +0 -1
  537. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +0 -205
  538. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.d.ts +0 -3
  539. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/index.d.ts +0 -1
  540. package/src/lib/utils/hooks/useWalletsConnectionState/index.d.ts +0 -1
  541. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +0 -184
  542. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +0 -12
  543. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +0 -180
@@ -1,6 +1,6 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../../_virtual/_tslib.js';
3
- import { useCallback } from 'react';
3
+ import { useCallback, useMemo } from 'react';
4
4
  import { JwtVerifiedCredentialFormatEnum } from '@dynamic-labs/sdk-api-core';
5
5
  import { DynamicError, EmbeddedWalletException } from '@dynamic-labs/utils';
6
6
  import { isSessionKeyCompatibleWalletConnector } from '@dynamic-labs/wallet-connector-core';
@@ -30,7 +30,6 @@ import '../../../../locale/locale.js';
30
30
  import { refreshUserJwt } from '../../../../data/api/user/user.js';
31
31
  import { getUserWalletsFromVerifiedCredentials } from '../../../functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.js';
32
32
  import { addPasskeyIdentifierToWalletConnector } from '../../../functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.js';
33
- import { getEOAWallet } from '../../../functions/getEOAWallet/getEOAWallet.js';
34
33
  import { getUserVerifiedCredentialType } from '../../../functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.js';
35
34
  import { hasEmbeddedWallet } from '../../../functions/hasEmbeddedWallet/hasEmbeddedWallet.js';
36
35
  import { getEmbeddedWalletAuthHandler } from '../../../functions/getEmbeddedWalletAuthHandler/getEmbeddedWalletAuthHandler.js';
@@ -44,12 +43,13 @@ import 'react-dom';
44
43
  import { useElementById } from '../../useElementById/useElementById.js';
45
44
  import { useWalletContext } from '../../../../context/WalletContext/WalletContext.js';
46
45
  import { useIsTurnkeyWallet } from '../../useIsTurnkeyWallet/useIsTurnkeyWallet.js';
47
- import { validateTurnkeyProviderEnabled } from '../../../validations/validateTurnkeyProviderEnabled/validateTurnkeyProviderEnabled.js';
48
- import { canRestoreEmbeddedWalletSession, restoreEmbeddedWalletSession } from '../../../../views/Passkey/utils/passkeyRecovery/passkeyRecovery.js';
49
46
  import { cleanupExport, initExport, exportCredential } from '../../../../views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js';
47
+ import { canRestoreEmbeddedWalletSession, restoreEmbeddedWalletSession } from '../../../../views/Passkey/utils/passkeyRecovery/passkeyRecovery.js';
48
+ import { validateTurnkeyProviderEnabled } from '../../../validations/validateTurnkeyProviderEnabled/validateTurnkeyProviderEnabled.js';
50
49
  import { usePasskeyRecovery } from '../../usePasskeyRecovery/usePasskeyRecovery.js';
51
- import { useTurnkey } from './useTurnkey/useTurnkey.js';
50
+ import { useSmartWallets } from '../../useSmartWallets/useSmartWallets.js';
52
51
  import { EmbeddedWalletVersion, iframeContainerId, iframeElementId, revealIframeElementId, revealIframeContainerId } from './constants.js';
52
+ import { useTurnkey } from './useTurnkey/useTurnkey.js';
53
53
  import '../../../../context/ThemeContext/ThemeContext.js';
54
54
  import '../../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
55
55
  import '@dynamic-labs/types';
@@ -105,6 +105,12 @@ import '../../../../context/ConnectWithOtpContext/constants.js';
105
105
  import '../../../../context/ReinitializeContext/ReinitializeContextProvider.js';
106
106
  import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
107
107
 
108
+ const isConnectorSessionKeyActive = (connector) => {
109
+ var _a;
110
+ if (!connector || !isSessionKeyCompatibleWalletConnector(connector))
111
+ return false;
112
+ return Boolean((_a = connector.sessionKeys) === null || _a === void 0 ? void 0 : _a.publicKey);
113
+ };
108
114
  // Hook exposed to customers
109
115
  /**
110
116
  *
@@ -121,21 +127,21 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
121
127
  * }
122
128
  */
123
129
  const useSecureEnclaveEmbeddedWallet = () => {
124
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
130
+ var _a, _b, _c, _d;
125
131
  const { projectSettings, primaryWallet, user, environmentId, walletConnectorOptions, } = useInternalDynamicContext();
126
132
  const { createTurnkeyWallet } = useTurnkey();
127
133
  const { hasRecoveryEmail } = useIsTurnkeyWallet();
128
134
  const { createRootElement } = useElementById();
129
135
  const { isLoadingEmbeddedWallet, setIsLoadingEmbeddedWallet } = useWalletContext();
130
- const wallet = getEOAWallet(primaryWallet, (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || []);
131
- const primaryConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
136
+ const { getEOAWallet } = useSmartWallets();
137
+ const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
132
138
  const userHasEmbeddedWallet = useCallback(() => hasEmbeddedWallet(user, 'turnkey'), [user]);
133
- const getWalletVersion = () => {
139
+ const getWalletVersion = useCallback(() => {
134
140
  if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
135
141
  return EmbeddedWalletVersion.V2;
136
142
  }
137
143
  return EmbeddedWalletVersion.V1;
138
- };
144
+ }, [wallet === null || wallet === void 0 ? void 0 : wallet.connector]);
139
145
  const { shouldInitRecovery, initPasskeyRecoveryProcess } = usePasskeyRecovery();
140
146
  /**
141
147
  * Creates a new secure enclave embedded wallet according to the settings from the dashboard
@@ -144,13 +150,13 @@ const useSecureEnclaveEmbeddedWallet = () => {
144
150
  * @returns Promise<Wallet | undefined>
145
151
  */
146
152
  const createEmbeddedWallet = useCallback((chains, options) => __awaiter(void 0, void 0, void 0, function* () {
147
- var _l;
153
+ var _e;
148
154
  if (!user) {
149
155
  throw new DynamicError(USER_NOT_LOGGED_IN);
150
156
  }
151
157
  const userWalletsCredentials = getUserWalletsFromVerifiedCredentials(user);
152
158
  const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(user, chains);
153
- const isManualMode = ((_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _l === void 0 ? void 0 : _l.automaticEmbeddedWalletCreation) === false;
159
+ const isManualMode = ((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _e === void 0 ? void 0 : _e.automaticEmbeddedWalletCreation) === false;
154
160
  // if user has a wallet and it's not embedded,
155
161
  // throw error to follow another flow and set up the right wallet
156
162
  // However, if the user is in manual mode continue.
@@ -169,14 +175,14 @@ const useSecureEnclaveEmbeddedWallet = () => {
169
175
  * @param chain - chain parameter to create the wallet for
170
176
  * @returns Promise<UserProfile | undefined>
171
177
  */
172
- const createEmbeddedWalletAccount$1 = useCallback((_m) => __awaiter(void 0, [_m], void 0, function* ({ chain }) {
173
- var _o, _p, _q;
178
+ const createEmbeddedWalletAccount$1 = useCallback((_f) => __awaiter(void 0, [_f], void 0, function* ({ chain }) {
179
+ var _g, _h, _j;
174
180
  if (!user) {
175
181
  throw new Error(USER_NOT_LOGGED_IN);
176
182
  }
177
183
  validateTurnkeyProviderEnabled(projectSettings);
178
184
  const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(user);
179
- const turnkeyWalletId = (_o = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _o === void 0 ? void 0 : _o.turnkeyHDWalletId;
185
+ const turnkeyWalletId = (_g = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _g === void 0 ? void 0 : _g.turnkeyHDWalletId;
180
186
  if (!turnkeyWalletId) {
181
187
  throw new DynamicError('No HD wallet was found for this user to derive a wallet account. Use createEmbeddedWallet first', 'NoHdWalletFound');
182
188
  }
@@ -185,14 +191,14 @@ const useSecureEnclaveEmbeddedWallet = () => {
185
191
  environmentId,
186
192
  });
187
193
  if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
188
- yield ((_p = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _p === void 0 ? void 0 : _p.createOrRestoreSession({
194
+ yield ((_h = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _h === void 0 ? void 0 : _h.createOrRestoreSession({
189
195
  ignoreRestore: true,
190
196
  }));
191
197
  }
192
198
  else if (yield shouldInitRecovery()) {
193
199
  yield initPasskeyRecoveryProcess('email');
194
200
  }
195
- const signedRequest = yield ((_q = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _q === void 0 ? void 0 : _q.stampCreateWalletAccountRequest({
201
+ const signedRequest = yield ((_j = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _j === void 0 ? void 0 : _j.stampCreateWalletAccountRequest({
196
202
  request: requestToStamp,
197
203
  }));
198
204
  yield createEmbeddedWalletAccount({
@@ -202,11 +208,11 @@ const useSecureEnclaveEmbeddedWallet = () => {
202
208
  return refreshUserJwt({ environmentId });
203
209
  }), [
204
210
  environmentId,
211
+ wallet === null || wallet === void 0 ? void 0 : wallet.connector,
205
212
  initPasskeyRecoveryProcess,
206
213
  projectSettings,
207
214
  shouldInitRecovery,
208
215
  user,
209
- wallet === null || wallet === void 0 ? void 0 : wallet.connector,
210
216
  ]);
211
217
  /**
212
218
  * Creates or restores a secure enclave embedded wallet session
@@ -215,18 +221,18 @@ const useSecureEnclaveEmbeddedWallet = () => {
215
221
  * @returns Promise<'session_created' | 'session_restored'> - returns a string indicating the status of the session
216
222
  */
217
223
  const createOrRestoreSession = useCallback((options) => __awaiter(void 0, void 0, void 0, function* () {
218
- var _r, _s, _t, _u, _v, _w, _x, _y, _z;
224
+ var _k, _l, _m, _o, _p, _q;
219
225
  if (!user) {
220
226
  throw new DynamicError(USER_NOT_LOGGED_IN);
221
227
  }
222
- const isSessionKeyCompatibleAAConnector = ((_r = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _r === void 0 ? void 0 : _r.key) === 'zerodev'
223
- ? isSessionKeyCompatibleWalletConnector((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector).getEOAConnector())
224
- : false;
225
- if (isSessionKeyCompatibleWalletConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector)) {
226
- return yield ((_s = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _s === void 0 ? void 0 : _s.createOrRestoreSession());
228
+ const primaryConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
229
+ if (primaryConnector &&
230
+ isSessionKeyCompatibleWalletConnector(primaryConnector)) {
231
+ return primaryConnector.createOrRestoreSession();
227
232
  }
228
- else if (isSessionKeyCompatibleAAConnector) {
229
- return yield ((_t = (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector).getEOAConnector()) === null || _t === void 0 ? void 0 : _t.createOrRestoreSession());
233
+ const eoaConnector = wallet === null || wallet === void 0 ? void 0 : wallet.connector;
234
+ if (eoaConnector && isSessionKeyCompatibleWalletConnector(eoaConnector)) {
235
+ return eoaConnector.createOrRestoreSession();
230
236
  }
231
237
  const turnkeyRecoveryHandler = getEmbeddedWalletAuthHandler(wallet === null || wallet === void 0 ? void 0 : wallet.connector);
232
238
  if (turnkeyRecoveryHandler.isSessionActive()) {
@@ -234,12 +240,12 @@ const useSecureEnclaveEmbeddedWallet = () => {
234
240
  }
235
241
  const turnkeyAuthIframeContainerRef = createRootElement(iframeContainerId);
236
242
  // try to restore session if possible
237
- if (canRestoreEmbeddedWalletSession((_u = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _u === void 0 ? void 0 : _u.sessionKeyDuration)) {
243
+ if (canRestoreEmbeddedWalletSession((_k = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _k === void 0 ? void 0 : _k.sessionKeyDuration)) {
238
244
  try {
239
245
  const sessionRestored = yield restoreEmbeddedWalletSession({
240
246
  iframeContainer: turnkeyAuthIframeContainerRef.current,
241
247
  iframeElementId,
242
- sessionExpiration: getEmbeddedWalletSessionExpiration((_w = (_v = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _v === void 0 ? void 0 : _v.embeddedWallets) === null || _w === void 0 ? void 0 : _w.sessionKeyDuration),
248
+ sessionExpiration: getEmbeddedWalletSessionExpiration((_m = (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.embeddedWallets) === null || _m === void 0 ? void 0 : _m.sessionKeyDuration),
243
249
  user,
244
250
  wallet: primaryWallet,
245
251
  });
@@ -258,7 +264,7 @@ const useSecureEnclaveEmbeddedWallet = () => {
258
264
  if (!userHasEmbeddedWallet() || !hasRecoveryEmail) {
259
265
  throw new DynamicError('User does not have a secure enclave wallet or a verified email', INVALID_WALLET_DATA);
260
266
  }
261
- const organizationId = (_z = (_y = (_x = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _x === void 0 ? void 0 : _x.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _y === void 0 ? void 0 : _y.walletProperties) === null || _z === void 0 ? void 0 : _z.turnkeySubOrganizationId;
267
+ const organizationId = (_q = (_p = (_o = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _o === void 0 ? void 0 : _o.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _p === void 0 ? void 0 : _p.walletProperties) === null || _q === void 0 ? void 0 : _q.turnkeySubOrganizationId;
262
268
  yield turnkeyRecoveryHandler.verifyRecoveryCode(options.oneTimeCode, organizationId);
263
269
  const sessionSettings = {
264
270
  createdAt: new Date().getTime(),
@@ -272,7 +278,7 @@ const useSecureEnclaveEmbeddedWallet = () => {
272
278
  user,
273
279
  hasRecoveryEmail,
274
280
  primaryWallet,
275
- (_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.sessionKeyDuration,
281
+ (_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.embeddedWallets) === null || _c === void 0 ? void 0 : _c.sessionKeyDuration,
276
282
  userHasEmbeddedWallet,
277
283
  wallet === null || wallet === void 0 ? void 0 : wallet.connector,
278
284
  ]);
@@ -282,12 +288,12 @@ const useSecureEnclaveEmbeddedWallet = () => {
282
288
  * @returns Promise<WebAuthnAttestation>
283
289
  */
284
290
  const createPasskey = useCallback((options) => __awaiter(void 0, void 0, void 0, function* () {
285
- var _0, _1;
291
+ var _r, _s;
286
292
  if (!user) {
287
293
  throw new DynamicError(USER_NOT_LOGGED_IN);
288
294
  }
289
295
  validateTurnkeyProviderEnabled(projectSettings);
290
- const turnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_0 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _0 === void 0 ? void 0 : _0.chainConfigurations, user.verifiedCredentials);
296
+ const turnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _r === void 0 ? void 0 : _r.chainConfigurations, user.verifiedCredentials);
291
297
  if (!(turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector)) {
292
298
  throw new DynamicError('Wallet connector not found', INVALID_WALLET_DATA);
293
299
  }
@@ -302,7 +308,7 @@ const useSecureEnclaveEmbeddedWallet = () => {
302
308
  if (!('id' in turnkeyWallet) || !hasEmailVC) {
303
309
  return walletConnector.getWebAuthnAttestation();
304
310
  }
305
- const turnkeySubOrganizationId = (_1 = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletProperties) === null || _1 === void 0 ? void 0 : _1.turnkeySubOrganizationId;
311
+ const turnkeySubOrganizationId = (_s = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletProperties) === null || _s === void 0 ? void 0 : _s.turnkeySubOrganizationId;
306
312
  if (!turnkeySubOrganizationId) {
307
313
  throw new DynamicError('No sub organization id found for the wallet', INVALID_WALLET_DATA);
308
314
  }
@@ -345,18 +351,17 @@ const useSecureEnclaveEmbeddedWallet = () => {
345
351
  });
346
352
  return data.passkeys;
347
353
  }), [user, environmentId]);
348
- const isEmailAuthSessionActive = (_d = ((wallet === null || wallet === void 0 ? void 0 : wallet.connector) &&
349
- 'getAuthenticatorHandler' in wallet.connector &&
350
- ((_c = getEmbeddedWalletAuthHandler(wallet.connector)) === null || _c === void 0 ? void 0 : _c.isSessionActive()))) !== null && _d !== void 0 ? _d : false;
351
- const isSessionKeySessionAAActive = ((_e = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _e === void 0 ? void 0 : _e.key) === 'zerodev' &&
352
- isSessionKeyCompatibleWalletConnector((wallet === null || wallet === void 0 ? void 0 : wallet.connector).getEOAConnector()) &&
353
- ((_h = (_g = (_f = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _f === void 0 ? void 0 : _f.getEOAConnector()) === null || _g === void 0 ? void 0 : _g.sessionKeys) === null || _h === void 0 ? void 0 : _h.publicKey);
354
- const isSessionKeySessionActive = (_k = Boolean(primaryConnector &&
355
- isSessionKeyCompatibleWalletConnector(primaryConnector) &&
356
- ((_j = primaryConnector.sessionKeys) === null || _j === void 0 ? void 0 : _j.publicKey))) !== null && _k !== void 0 ? _k : false;
354
+ const isEmailAuthSessionActive = useMemo(() => {
355
+ var _a;
356
+ const eoaConnector = wallet === null || wallet === void 0 ? void 0 : wallet.connector;
357
+ if (!eoaConnector || !('getAuthenticatorHandler' in eoaConnector))
358
+ return false;
359
+ return (_a = getEmbeddedWalletAuthHandler(eoaConnector)) === null || _a === void 0 ? void 0 : _a.isSessionActive();
360
+ }, [wallet === null || wallet === void 0 ? void 0 : wallet.connector]);
361
+ const isSessionKeySessionAAActive = useMemo(() => isConnectorSessionKeyActive(wallet === null || wallet === void 0 ? void 0 : wallet.connector), [wallet === null || wallet === void 0 ? void 0 : wallet.connector]);
362
+ const isSessionKeySessionActive = useMemo(() => isConnectorSessionKeyActive(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector), [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector]);
357
363
  /**
358
364
  * Checks if the embedded wallet session is active
359
- * @returns boolean
360
365
  */
361
366
  const isSessionActive = isEmailAuthSessionActive ||
362
367
  isSessionKeySessionActive ||
@@ -367,16 +372,16 @@ const useSecureEnclaveEmbeddedWallet = () => {
367
372
  * and the html container id to render the iframe into
368
373
  * @returns Promise<string> - returns the embedded wallet recovery phrase or private key
369
374
  */
370
- const revealEmbeddedWalletKey = (_2) => __awaiter(void 0, [_2], void 0, function* ({ type, htmlContainerId, }) {
371
- var _3, _4, _5, _6, _7, _8;
375
+ const revealEmbeddedWalletKey = useCallback((_t) => __awaiter(void 0, [_t], void 0, function* ({ type, htmlContainerId, }) {
376
+ var _u, _v, _w, _x, _y, _z;
372
377
  if (!user) {
373
378
  throw new DynamicError(USER_NOT_LOGGED_IN);
374
379
  }
375
380
  yield cleanupExport({
376
- wallet,
381
+ wallet: wallet,
377
382
  });
378
- const turnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_3 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _3 === void 0 ? void 0 : _3.chainConfigurations, user === null || user === void 0 ? void 0 : user.verifiedCredentials);
379
- const turnkeyHDWalletId = (_4 = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletProperties) === null || _4 === void 0 ? void 0 : _4.turnkeyHDWalletId;
383
+ const turnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_u = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _u === void 0 ? void 0 : _u.chainConfigurations, user === null || user === void 0 ? void 0 : user.verifiedCredentials);
384
+ const turnkeyHDWalletId = (_v = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletProperties) === null || _v === void 0 ? void 0 : _v.turnkeyHDWalletId;
380
385
  if (type === 'recoveryPhrase' && !turnkeyHDWalletId) {
381
386
  type = 'privateKey';
382
387
  }
@@ -385,26 +390,26 @@ const useSecureEnclaveEmbeddedWallet = () => {
385
390
  // since it will show unrelated turnkey content
386
391
  iframeContainerElement.current.style.display = 'none';
387
392
  if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
388
- yield ((_5 = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _5 === void 0 ? void 0 : _5.createOrRestoreSession());
393
+ yield ((_w = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _w === void 0 ? void 0 : _w.createOrRestoreSession());
389
394
  }
390
395
  yield initExport({
391
396
  iframeContainer: iframeContainerElement.current,
392
397
  iframeElementId: revealIframeElementId,
393
- wallet,
398
+ wallet: wallet,
394
399
  });
395
400
  try {
396
401
  yield exportCredential({
397
402
  address: type === 'privateKey' ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
398
403
  environmentId,
399
404
  user,
400
- wallet,
405
+ wallet: wallet,
401
406
  });
402
407
  }
403
- catch (_9) {
408
+ catch (_0) {
404
409
  if (isSessionKeyCompatibleWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector) &&
405
- ((_6 = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _6 === void 0 ? void 0 : _6.removeSessionKeys)) {
406
- yield ((_7 = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _7 === void 0 ? void 0 : _7.removeSessionKeys());
407
- yield ((_8 = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _8 === void 0 ? void 0 : _8.createOrRestoreSession({
410
+ ((_x = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _x === void 0 ? void 0 : _x.removeSessionKeys)) {
411
+ yield ((_y = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _y === void 0 ? void 0 : _y.removeSessionKeys());
412
+ yield ((_z = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _z === void 0 ? void 0 : _z.createOrRestoreSession({
408
413
  ignoreRestore: true,
409
414
  }));
410
415
  }
@@ -412,24 +417,31 @@ const useSecureEnclaveEmbeddedWallet = () => {
412
417
  address: type === 'privateKey' ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
413
418
  environmentId,
414
419
  user,
415
- wallet,
420
+ wallet: wallet,
416
421
  });
417
422
  }
418
423
  // show the iframe container after the export is done
419
424
  // to show the exported content only
420
425
  iframeContainerElement.current.style.display = 'block';
421
426
  return true;
422
- });
427
+ }), [
428
+ createRootElement,
429
+ environmentId,
430
+ wallet,
431
+ (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _d === void 0 ? void 0 : _d.chainConfigurations,
432
+ user,
433
+ walletConnectorOptions,
434
+ ]);
423
435
  /**
424
436
  * Sends a one-time code to the user so they can create a session or add a new passkey
425
437
  * @returns Promise<'code_sent'>
426
438
  */
427
439
  const sendOneTimeCode = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
428
- var _10, _11;
440
+ var _1, _2;
429
441
  if (!user) {
430
442
  throw new DynamicError(USER_NOT_LOGGED_IN);
431
443
  }
432
- const targetTurnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_10 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _10 === void 0 ? void 0 : _10.chainConfigurations, user.verifiedCredentials);
444
+ const targetTurnkeyWallet = findTurnkeyWalletByPrimaryChain(walletConnectorOptions, (_1 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _1 === void 0 ? void 0 : _1.chainConfigurations, user.verifiedCredentials);
433
445
  if (!targetTurnkeyWallet || !('id' in targetTurnkeyWallet)) {
434
446
  throw new DynamicError('User does not have a valid secure enclave wallet', INVALID_WALLET_DATA);
435
447
  }
@@ -440,7 +452,7 @@ const useSecureEnclaveEmbeddedWallet = () => {
440
452
  throw new DynamicError('Session is active. No need to create a new one', ACTIVE_SESSION);
441
453
  }
442
454
  const turnkeyAuthIframeContainerRef = createRootElement(iframeContainerId);
443
- const publicKey = yield turnkeyAuthenticatorHandler.initRecovery('email', turnkeyAuthIframeContainerRef.current, iframeElementId, getEmbeddedWalletSessionExpiration((_11 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _11 === void 0 ? void 0 : _11.sessionKeyDuration));
455
+ const publicKey = yield turnkeyAuthenticatorHandler.initRecovery('email', turnkeyAuthIframeContainerRef.current, iframeElementId, getEmbeddedWalletSessionExpiration((_2 = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _2 === void 0 ? void 0 : _2.sessionKeyDuration));
444
456
  if (!publicKey) {
445
457
  throw new DynamicError(ERROR_SENDING_CODE);
446
458
  }
@@ -459,7 +471,7 @@ const useSecureEnclaveEmbeddedWallet = () => {
459
471
  projectSettings,
460
472
  walletConnectorOptions,
461
473
  ]);
462
- return {
474
+ return useMemo(() => ({
463
475
  createEmbeddedWallet,
464
476
  createEmbeddedWalletAccount: createEmbeddedWalletAccount$1,
465
477
  createOrRestoreSession,
@@ -471,7 +483,19 @@ const useSecureEnclaveEmbeddedWallet = () => {
471
483
  revealEmbeddedWalletKey,
472
484
  sendOneTimeCode,
473
485
  userHasEmbeddedWallet,
474
- };
486
+ }), [
487
+ createEmbeddedWallet,
488
+ createEmbeddedWalletAccount$1,
489
+ createOrRestoreSession,
490
+ createPasskey,
491
+ getPasskeys,
492
+ getWalletVersion,
493
+ isLoadingEmbeddedWallet,
494
+ isSessionActive,
495
+ revealEmbeddedWalletKey,
496
+ sendOneTimeCode,
497
+ userHasEmbeddedWallet,
498
+ ]);
475
499
  };
476
500
 
477
- export { useSecureEnclaveEmbeddedWallet };
501
+ export { isConnectorSessionKeyActive, useSecureEnclaveEmbeddedWallet };
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
7
7
  var React = require('react');
8
8
  var sdkApiCore = require('@dynamic-labs/sdk-api-core');
9
9
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
10
+ require('../../../../../context/DynamicContext/DynamicContext.cjs');
10
11
  var logger = require('../../../../../shared/logger.cjs');
11
12
  require('@dynamic-labs/iconic');
12
13
  require('react/jsx-runtime');
@@ -18,7 +19,6 @@ require('../../../../../shared/utils/classes/storage/localStorage.cjs');
18
19
  require('../../../../../shared/utils/classes/storage/sessionStorage.cjs');
19
20
  require('@dynamic-labs/utils');
20
21
  require('../../../../../shared/consts/index.cjs');
21
- require('../../../../../context/DynamicContext/DynamicContext.cjs');
22
22
  var dynamicEvents = require('../../../../../events/dynamicEvents.cjs');
23
23
  require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
24
24
  require('../../../../../context/ErrorContext/ErrorContext.cjs');
@@ -39,10 +39,11 @@ require('../../../../../context/VerificationContext/VerificationContext.cjs');
39
39
  require('react-dom');
40
40
  var useCreateDynamicEmbeddedWalletMutation = require('../../../useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs');
41
41
  require('../../../../../context/WalletContext/WalletContext.cjs');
42
+ var useSmartWallets = require('../../../useSmartWallets/useSmartWallets.cjs');
42
43
  var findPrimaryEmbeddedChain = require('../../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
43
- var smartWallet = require('../../../useWalletConnectors/utils/smartWallet/smartWallet.cjs');
44
- var findPasskeyEmailWalletConnector = require('../../../../../views/Passkey/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.cjs');
45
44
  require('../constants.cjs');
45
+ var findPasskeyEmailWalletConnector = require('../../../../../views/Passkey/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.cjs');
46
+ var smartWallet = require('../../../useWalletConnectors/utils/smartWallet/smartWallet.cjs');
46
47
  require('../../../../../context/ThemeContext/ThemeContext.cjs');
47
48
  require('../../../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
48
49
  require('@dynamic-labs/types');
@@ -102,8 +103,8 @@ var useInternalDynamicContext = require('../../../../../context/DynamicContext/u
102
103
  const useTurnkey = () => {
103
104
  const { projectSettings, setPrimaryWalletId, walletConnectorOptions, setShowAuthFlow, environmentId, user, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
104
105
  const { setView } = ViewContext.useViewContext();
105
- const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
106
106
  const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
107
+ const { getEOAWallet } = useSmartWallets.useSmartWallets();
107
108
  const startHeadlessEmbeddedWalletCreationFlow = React.useCallback((chains, options) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
108
109
  yield createDynamicEmbeddedWalletMutation({
109
110
  chains,
@@ -145,7 +146,7 @@ const useTurnkey = () => {
145
146
  });
146
147
  }), [setShowAuthFlow, setView]);
147
148
  const returnEmbeddedWallet = React.useCallback((embeddedWalletVerifiedCredential) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
148
- var _a, _b, _c, _d;
149
+ var _a, _b;
149
150
  const { chain } = embeddedWalletVerifiedCredential;
150
151
  const turnkeyWallet = findTurnkeyWallet.findTurnkeyWalletByChain(walletConnectorOptions, chain);
151
152
  let newPrimaryWalletId = null;
@@ -169,28 +170,29 @@ const useTurnkey = () => {
169
170
  setPrimaryWalletId(newPrimaryWalletId);
170
171
  /** It's not authenticated if it still hasn't created a passkey */
171
172
  const isAuthenticated = Boolean((_b = embeddedWalletVerifiedCredential.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached);
172
- const passkeyWallet = new walletConnectorCore.Wallet({
173
- address: (yield ((_c = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _c === void 0 ? void 0 : _c.getAddress())) || '',
174
- chain: ((_d = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _d === void 0 ? void 0 : _d.connectedChain) || '',
175
- connector: (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) || {},
173
+ if (!(turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector)) {
174
+ throw new Error('Could not find the embedded wallet connector');
175
+ }
176
+ const connector = turnkeyWallet.walletConnector;
177
+ const passkeyWallet = connector.createWallet({
178
+ address: (yield connector.getAddress()) || '',
179
+ chain: connector.connectedChain,
180
+ connector,
176
181
  id: embeddedWalletVerifiedCredential.id,
177
182
  isAuthenticated,
178
- isPrimary: newPrimaryWalletId === embeddedWalletVerifiedCredential.id,
179
- key: embeddedWalletVerifiedCredential.walletName ||
180
- (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector.key) ||
181
- '',
183
+ key: embeddedWalletVerifiedCredential.walletName || connector.key || '',
182
184
  });
183
185
  return Promise.resolve(passkeyWallet);
184
186
  }), [setPrimaryWalletId, walletConnectorOptions, user]);
185
187
  const createTurnkeyWallet = React.useCallback((chains, options) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
186
- var _e, _f, _g, _h, _j;
188
+ var _c, _d, _e, _f, _g;
187
189
  if (!user) {
188
190
  throw new Error(errors.USER_NOT_LOGGED_IN);
189
191
  }
190
- const isManualMode = ((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _e === void 0 ? void 0 : _e.automaticEmbeddedWalletCreation) === false;
191
- const isSessionKeyCompatibleWallet = walletConnectorCore.isSessionKeyCompatibleWalletConnector(walletConnector) ||
192
- ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev' &&
193
- walletConnectorCore.isSessionKeyCompatibleWalletConnector(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getEOAConnector()));
192
+ const isManualMode = ((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) === false;
193
+ const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
194
+ const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
195
+ (eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
194
196
  const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(user, chains);
195
197
  const userWalletsCredentials = getUserWalletsFromVerifiedCredentials.getUserWalletsFromVerifiedCredentials(user);
196
198
  // If the user doesn't have a wallet, or if the customer is in Manual
@@ -200,10 +202,10 @@ const useTurnkey = () => {
200
202
  if (!(userWalletsCredentials === null || userWalletsCredentials === void 0 ? void 0 : userWalletsCredentials.length) ||
201
203
  (!embeddedWalletVerifiedCredential && isManualMode)) {
202
204
  const hasEmailVC = getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
203
- if ((!((_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _f === void 0 ? void 0 : _f.forceAuthenticatorAtSignup) &&
205
+ if ((!((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _d === void 0 ? void 0 : _d.forceAuthenticatorAtSignup) &&
204
206
  hasEmailVC) ||
205
207
  (options === null || options === void 0 ? void 0 : options.webAuthnAttestation) ||
206
- isSessionKeyCompatibleWallet) {
208
+ isSessionKeyCompatible) {
207
209
  // create embedded wallet fully headless
208
210
  return startHeadlessEmbeddedWalletCreationFlow(chains, options);
209
211
  }
@@ -217,19 +219,18 @@ const useTurnkey = () => {
217
219
  // backend if this called as part of a new user sign up.
218
220
  if (embeddedWalletVerifiedCredential &&
219
221
  user.newUser &&
220
- ((_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _g === void 0 ? void 0 : _g.automaticEmbeddedWalletCreation)) {
222
+ ((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _e === void 0 ? void 0 : _e.automaticEmbeddedWalletCreation)) {
221
223
  const walletConnector = findPasskeyEmailWalletConnector.findPasskeyEmailWalletConnector(walletConnectorOptions, findPrimaryEmbeddedChain.findPrimaryEmbeddedChain(projectSettings));
222
224
  if (!walletConnector) {
223
- throw new Error('Could not find the Embedded wallet connector');
225
+ throw new Error('Could not find the embedded wallet connector');
224
226
  }
225
- const wallet = new walletConnectorCore.Wallet({
227
+ const wallet = walletConnector.createWallet({
226
228
  address: (yield walletConnector.getAddress()) || '',
227
- chain: walletConnector.connectedChain || '',
229
+ chain: walletConnector.connectedChain,
228
230
  connector: walletConnector,
229
231
  id: embeddedWalletVerifiedCredential.id,
230
- isAuthenticated: Boolean((_h = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _h === void 0 ? void 0 : _h.isAuthenticatorAttached),
231
- isPrimary: true,
232
- key: (_j = embeddedWalletVerifiedCredential.walletName) !== null && _j !== void 0 ? _j : walletConnector.key,
232
+ isAuthenticated: Boolean((_f = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _f === void 0 ? void 0 : _f.isAuthenticatorAttached),
233
+ key: (_g = embeddedWalletVerifiedCredential.walletName) !== null && _g !== void 0 ? _g : walletConnector.key,
233
234
  });
234
235
  setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
235
236
  dynamicEvents.dynamicEvents.emit('embeddedWalletCreated', wallet, embeddedWalletVerifiedCredential, user);
@@ -245,13 +246,14 @@ const useTurnkey = () => {
245
246
  }), [
246
247
  user,
247
248
  projectSettings,
248
- returnEmbeddedWallet,
249
- setPrimaryWalletId,
249
+ primaryWallet,
250
+ getEOAWallet,
250
251
  setShowAuthFlow,
252
+ returnEmbeddedWallet,
251
253
  startHeadlessEmbeddedWalletCreationFlow,
252
254
  startPasskeyEmbeddedWalletCreationFlow,
253
255
  walletConnectorOptions,
254
- walletConnector,
256
+ setPrimaryWalletId,
255
257
  ]);
256
258
  return {
257
259
  createTurnkeyWallet,
@@ -1,5 +1,5 @@
1
1
  import { EmbeddedWalletChainEnum } from '@dynamic-labs/sdk-api-core';
2
- import { WebAuthnAttestation, Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ import { Wallet, WebAuthnAttestation } from '@dynamic-labs/wallet-connector-core';
3
3
  export declare const useTurnkey: () => {
4
4
  readonly createTurnkeyWallet: (chains?: EmbeddedWalletChainEnum[], options?: {
5
5
  webAuthnAttestation: WebAuthnAttestation;