@dynamic-labs/sdk-react-core 0.19.0-alpha.8 → 0.19.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 (382) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +9 -9
  5. package/src/index.cjs +14 -5
  6. package/src/index.d.ts +1 -1
  7. package/src/index.js +8 -3
  8. package/src/lib/Main.cjs +2 -1
  9. package/src/lib/Main.js +2 -1
  10. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
  11. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
  12. package/src/lib/components/Divider/Divider.cjs +1 -1
  13. package/src/lib/components/Divider/Divider.js +1 -1
  14. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
  15. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
  16. package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +1 -0
  17. package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +1 -0
  18. package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
  19. package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
  20. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
  21. package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
  22. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -1
  23. package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
  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/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
  29. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
  30. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +1 -1
  31. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +1 -1
  32. package/src/lib/components/SignMessagePreview/SignMessagePreview.cjs +27 -0
  33. package/src/lib/components/SignMessagePreview/SignMessagePreview.d.ts +6 -0
  34. package/src/lib/components/SignMessagePreview/SignMessagePreview.js +23 -0
  35. package/src/lib/components/SignMessagePreview/SignMessagePreview.types.d.ts +8 -0
  36. package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.cjs +44 -0
  37. package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.d.ts +8 -0
  38. package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.js +40 -0
  39. package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/index.d.ts +1 -0
  40. package/src/lib/components/SignMessagePreview/components/index.d.ts +1 -0
  41. package/src/lib/components/SignMessagePreview/index.d.ts +1 -0
  42. package/src/lib/components/SignMessagePreview/utils/index.d.ts +1 -0
  43. package/src/lib/components/SignMessagePreview/utils/isSignTypedData/index.d.ts +1 -0
  44. package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.cjs +17 -0
  45. package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.d.ts +2 -0
  46. package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.js +13 -0
  47. package/src/lib/components/Toolkit/Toolkit.cjs +2 -1
  48. package/src/lib/components/Toolkit/Toolkit.js +2 -1
  49. package/src/lib/components/Toolkit/components/MultiWalletSwitch.cjs +1 -1
  50. package/src/lib/components/Toolkit/components/MultiWalletSwitch.d.ts +1 -2
  51. package/src/lib/components/Toolkit/components/MultiWalletSwitch.js +1 -1
  52. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
  53. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
  54. package/src/lib/components/UserAvatar/UserAvatar.cjs +22 -0
  55. package/src/lib/components/UserAvatar/UserAvatar.d.ts +7 -0
  56. package/src/lib/components/UserAvatar/UserAvatar.js +18 -0
  57. package/src/lib/components/UserProfile/UserProfile.cjs +9 -2
  58. package/src/lib/components/UserProfile/UserProfile.js +9 -2
  59. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
  60. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
  61. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +1 -1
  62. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +1 -1
  63. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
  64. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
  65. package/src/lib/components/UserProfileForm/UserProfileForm.cjs +1 -0
  66. package/src/lib/components/UserProfileForm/UserProfileForm.js +1 -0
  67. package/src/lib/components/index.d.ts +1 -0
  68. package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -3
  69. package/src/lib/context/DynamicContext/DynamicContext.js +2 -3
  70. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
  71. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
  72. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +1 -0
  73. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +1 -0
  74. package/src/lib/context/FundingContext/FundingContext.cjs +1 -0
  75. package/src/lib/context/FundingContext/FundingContext.js +1 -0
  76. package/src/lib/context/MockContext/MockContext.cjs +1 -1
  77. package/src/lib/context/MockContext/MockContext.js +1 -1
  78. package/src/lib/context/ViewContext/ViewContext.cjs +4 -19
  79. package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
  80. package/src/lib/context/ViewContext/ViewContext.js +5 -20
  81. package/src/lib/context/WalletContext/WalletContext.cjs +1 -1
  82. package/src/lib/context/WalletContext/WalletContext.js +1 -1
  83. package/src/lib/data/api.cjs +22 -16
  84. package/src/lib/data/api.d.ts +5 -3
  85. package/src/lib/data/api.js +22 -16
  86. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +5 -2
  87. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +5 -2
  88. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +1 -1
  89. package/src/lib/layout/DynamicAuthLayout/Header/header.js +1 -1
  90. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.cjs +5 -0
  91. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.js +5 -0
  92. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +4 -3
  93. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +4 -3
  94. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +61 -0
  95. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.d.ts +1 -0
  96. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +57 -0
  97. package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/index.d.ts +1 -0
  98. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +1 -1
  99. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +1 -1
  100. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +1 -1
  101. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +1 -1
  102. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +2 -2
  103. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +2 -2
  104. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -1
  105. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -1
  106. package/src/lib/layout/DynamicAuthLayout/HelpContent/index.d.ts +1 -0
  107. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +1 -1
  108. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +1 -1
  109. package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
  110. package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +1 -1
  111. package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -1
  112. package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -1
  113. package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -1
  114. package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -1
  115. package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -1
  116. package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -1
  117. package/src/lib/locale/en/translation.cjs +41 -1
  118. package/src/lib/locale/en/translation.js +39 -2
  119. package/src/lib/locale/locale.cjs +17 -4
  120. package/src/lib/locale/locale.d.ts +1 -0
  121. package/src/lib/locale/locale.js +17 -4
  122. package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -1
  123. package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -1
  124. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +3 -2
  125. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +3 -2
  126. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +1 -1
  127. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +1 -1
  128. package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +1 -1
  129. package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +1 -1
  130. package/src/lib/shared/assets/android-face-id.cjs +61 -0
  131. package/src/lib/shared/assets/android-face-id.js +37 -0
  132. package/src/lib/shared/assets/index.d.ts +6 -0
  133. package/src/lib/shared/assets/iphone-face-id.cjs +53 -0
  134. package/src/lib/shared/assets/iphone-face-id.js +29 -0
  135. package/src/lib/shared/assets/iphone-touch-id.cjs +72 -0
  136. package/src/lib/shared/assets/iphone-touch-id.js +48 -0
  137. package/src/lib/shared/assets/passkey-intro-icon.cjs +97 -0
  138. package/src/lib/shared/assets/passkey-intro-icon.js +73 -0
  139. package/src/lib/shared/assets/passkey-success-icon.cjs +94 -0
  140. package/src/lib/shared/assets/passkey-success-icon.js +70 -0
  141. package/src/lib/shared/assets/user-account-2.cjs +53 -0
  142. package/src/lib/shared/assets/user-account-2.js +29 -0
  143. package/src/lib/shared/types/index.d.ts +1 -0
  144. package/src/lib/shared/utils/functions/wallet/createWallet.cjs +7 -5
  145. package/src/lib/shared/utils/functions/wallet/createWallet.js +7 -5
  146. package/src/lib/styles/index.shadow.cjs +1 -1
  147. package/src/lib/styles/index.shadow.js +1 -1
  148. package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +72 -0
  149. package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.d.ts +2 -0
  150. package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +68 -0
  151. package/src/lib/utils/functions/getOauthLoginUrl/index.d.ts +1 -0
  152. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -1
  153. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +3 -0
  154. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +3 -0
  155. package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +1 -0
  156. package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +1 -0
  157. package/src/lib/utils/functions/index.d.ts +1 -0
  158. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -23
  159. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +9 -24
  160. package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +1 -1
  161. package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +1 -1
  162. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -2
  163. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -2
  164. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +1 -0
  165. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -0
  166. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +1 -0
  167. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +1 -0
  168. package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +1 -0
  169. package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +1 -0
  170. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +10 -5
  171. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.d.ts +3 -1
  172. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +10 -5
  173. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +1 -0
  174. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +1 -0
  175. package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +15 -1
  176. package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +15 -1
  177. package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +1 -0
  178. package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +1 -0
  179. package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +0 -4
  180. package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +0 -4
  181. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +1 -0
  182. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +1 -0
  183. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +5 -1
  184. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +5 -1
  185. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +44 -45
  186. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +45 -46
  187. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +1 -0
  188. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +1 -0
  189. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -0
  190. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -0
  191. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +1 -0
  192. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +1 -0
  193. package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +1 -0
  194. package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +1 -0
  195. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
  196. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
  197. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
  198. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
  199. package/src/lib/utils/hooks/useWallets/useWallets.cjs +15 -26
  200. package/src/lib/utils/hooks/useWallets/useWallets.js +16 -27
  201. package/src/lib/utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +1 -0
  202. package/src/lib/utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +1 -0
  203. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +1 -0
  204. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +1 -0
  205. package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
  206. package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
  207. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
  208. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -1
  209. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
  210. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
  211. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
  212. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
  213. package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +1 -1
  214. package/src/lib/views/CollectUserDataView/UserDataFields/index.js +1 -1
  215. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +4 -3
  216. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +4 -3
  217. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
  218. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
  219. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
  220. package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
  221. package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -0
  222. package/src/lib/views/EmailVerification/EmailVerification.js +1 -0
  223. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +12 -4
  224. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +12 -4
  225. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +1 -1
  226. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +1 -1
  227. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +1 -1
  228. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +1 -1
  229. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +1 -0
  230. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +1 -0
  231. package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
  232. package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
  233. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +1 -1
  234. package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +1 -1
  235. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -0
  236. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -0
  237. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -1
  238. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -1
  239. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -1
  240. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -1
  241. package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
  242. package/src/lib/views/NoAccess/NoAccess.js +1 -1
  243. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -1
  244. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -1
  245. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +1 -1
  246. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +1 -1
  247. package/src/lib/views/PasskeyIntroView/PasskeyIntroView.cjs +90 -0
  248. package/src/lib/views/PasskeyIntroView/PasskeyIntroView.d.ts +2 -0
  249. package/src/lib/views/PasskeyIntroView/PasskeyIntroView.js +86 -0
  250. package/src/lib/views/PasskeyIntroView/index.d.ts +1 -0
  251. package/src/lib/views/PasskeySuccessView/PasskeySuccessView.cjs +63 -0
  252. package/src/lib/views/PasskeySuccessView/PasskeySuccessView.d.ts +2 -0
  253. package/src/lib/views/PasskeySuccessView/PasskeySuccessView.js +59 -0
  254. package/src/lib/views/PasskeySuccessView/index.d.ts +1 -0
  255. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -1
  256. package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -1
  257. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -1
  258. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -1
  259. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -1
  260. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -1
  261. package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -1
  262. package/src/lib/views/QrCodeView/QrCodeView.js +1 -1
  263. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
  264. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
  265. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +1 -1
  266. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +1 -1
  267. package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
  268. package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
  269. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +4 -2
  270. package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +4 -2
  271. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +1 -1
  272. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +1 -1
  273. package/src/lib/views/WalletList/WalletList.cjs +1 -4
  274. package/src/lib/views/WalletList/WalletList.js +1 -4
  275. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
  276. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
  277. package/src/lib/views/WalletList/data.cjs +3 -15
  278. package/src/lib/views/WalletList/data.d.ts +4 -2
  279. package/src/lib/views/WalletList/data.js +3 -14
  280. package/src/lib/views/WalletLockedView/WalletLockedView.cjs +1 -1
  281. package/src/lib/views/WalletLockedView/WalletLockedView.js +1 -1
  282. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -1
  283. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -1
  284. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
  285. package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
  286. package/src/lib/views/viewToComponentMap.cjs +4 -0
  287. package/src/lib/views/viewToComponentMap.js +4 -0
  288. package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +1 -1
  289. package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +1 -1
  290. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +1 -1
  291. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +1 -1
  292. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +1 -1
  293. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +1 -1
  294. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +1 -1
  295. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +1 -1
  296. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -1
  297. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +1 -1
  298. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +4 -4
  299. package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +4 -4
  300. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -1
  301. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -1
  302. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -1
  303. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -1
  304. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
  305. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
  306. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -1
  307. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -1
  308. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +1 -1
  309. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -1
  310. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +1 -1
  311. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +1 -1
  312. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
  313. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
  314. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +4 -3
  315. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +4 -3
  316. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +1 -1
  317. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +1 -1
  318. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
  319. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
  320. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +1 -1
  321. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +1 -1
  322. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
  323. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
  324. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +1 -1
  325. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +1 -1
  326. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -1
  327. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -1
  328. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +3 -3
  329. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +3 -3
  330. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
  331. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
  332. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +1 -1
  333. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +1 -1
  334. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +7 -10
  335. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.d.ts +1 -0
  336. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +8 -11
  337. package/src/lib/widgets/DynamicWidget/hooks/index.d.ts +1 -0
  338. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
  339. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
  340. package/src/lib/widgets/DynamicWidget/hooks/useViewController/index.d.ts +1 -0
  341. package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.cjs +17 -0
  342. package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.d.ts +6 -0
  343. package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.js +13 -0
  344. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +1 -1
  345. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +1 -1
  346. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +1 -1
  347. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +1 -1
  348. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -1
  349. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -1
  350. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +1 -1
  351. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +1 -1
  352. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
  353. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
  354. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -1
  355. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -1
  356. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -1
  357. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -1
  358. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -1
  359. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -1
  360. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -1
  361. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -1
  362. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +2 -2
  363. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +2 -2
  364. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +4 -4
  365. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +4 -4
  366. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -1
  367. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -1
  368. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +1 -1
  369. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +1 -1
  370. package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.cjs +2 -3
  371. package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.js +2 -3
  372. package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +4 -4
  373. package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +4 -4
  374. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +1 -1
  375. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +1 -1
  376. package/src/lib/widgets/index.d.ts +0 -1
  377. package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs +0 -33
  378. package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.js +0 -29
  379. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs +0 -13
  380. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.d.ts +0 -2
  381. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.js +0 -9
  382. package/src/lib/widgets/OAuthIFrameContainer/index.d.ts +0 -1
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _tslib = require('../../../../../_virtual/_tslib.cjs');
6
6
  var React = require('react');
7
+ var sdkApi = require('@dynamic-labs/sdk-api');
7
8
  var types = require('@dynamic-labs/types');
8
9
  var utils = require('@dynamic-labs/utils');
9
10
  var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
@@ -22,12 +23,11 @@ require('ethers');
22
23
  require('../../../shared/consts/index.cjs');
23
24
  require('@dynamic-labs/multi-wallet');
24
25
  var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
25
- require('@dynamic-labs/sdk-api');
26
26
  var randomString = require('../../functions/randomString/randomString.cjs');
27
27
  var stringifyURIQuery = require('../../functions/stringifyURIQuery/stringifyURIQuery.cjs');
28
28
  var digestSHA256 = require('../../functions/digestSHA256/digestSHA256.cjs');
29
29
  var encodeBase64URL = require('../../functions/encodeBase64URL/encodeBase64URL.cjs');
30
- var getRedirectURIOrigin = require('../../functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs');
30
+ var getOauthLoginUrl = require('../../functions/getOauthLoginUrl/getOauthLoginUrl.cjs');
31
31
  var useCreateUserProfileByJWTCallback = require('../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs');
32
32
  var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
33
33
 
@@ -47,15 +47,16 @@ const providersWithoutWindowOpenerRefence = ['twitter'];
47
47
  // Hook to handle common social auth logic (for social linking and social sign in)
48
48
  const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
49
49
  var _a;
50
- const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, setIsVerificationInProgress, } = useInternalDynamicContext.useInternalDynamicContext();
50
+ const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, setIsVerificationInProgress, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
51
51
  const { setView } = ViewContext.useViewContext();
52
52
  const { setErrorMessage, setError: setContextError } = ErrorContext.useErrorContext();
53
53
  const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
54
54
  const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback.useCreateUserProfileByJWTCallback();
55
55
  const [isProcessing, setIsProcessing] = React.useState(false);
56
56
  const [error, setError] = React.useState();
57
- const providersWaitingOauthMessages = React.useRef({});
57
+ const providersWaitingOauthMessage = React.useRef({});
58
58
  const authWindowInterval = React.useRef();
59
+ const shouldPool = React.useRef(false);
59
60
  const userJwt = (_a = getAuthToken.getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
60
61
  const clearError = () => {
61
62
  setError(undefined);
@@ -69,23 +70,26 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
69
70
  onError === null || onError === void 0 ? void 0 : onError();
70
71
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
71
72
  };
72
- const addOAuthIFrame = (url) => {
73
- const container = document.getElementById('oauth-iframe-container');
74
- let oauthIFrame = document.getElementById('oauth-iframe');
75
- if (!container || oauthIFrame) {
73
+ const poolOauthResult = (provider, state) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
74
+ if (!shouldPool.current) {
76
75
  return;
77
76
  }
78
- oauthIFrame = document.createElement('iframe');
79
- oauthIFrame.setAttribute('id', 'oauth-iframe');
80
- oauthIFrame.setAttribute('src', url);
81
- container.appendChild(oauthIFrame);
82
- };
83
- const removeOAuthIFrame = () => {
84
- const oauthIFrame = document.getElementById('oauth-iframe');
85
- if (oauthIFrame) {
86
- oauthIFrame.remove();
77
+ const result = yield api.getOAuthResult(environmentId, provider, {
78
+ state,
79
+ });
80
+ if ((result === null || result === void 0 ? void 0 : result.status) !== sdkApi.OauthResultStatus.Completed) {
81
+ setTimeout(() => poolOauthResult(provider, state), 1000);
82
+ return;
87
83
  }
88
- };
84
+ shouldPool.current = false;
85
+ const authMessage = {
86
+ code: result === null || result === void 0 ? void 0 : result.code,
87
+ error: result === null || result === void 0 ? void 0 : result.error,
88
+ provider,
89
+ type: 'authorization_response',
90
+ };
91
+ window.postMessage(authMessage, '*');
92
+ });
89
93
  const checkValidProvider = (provider) => {
90
94
  if (!provider) {
91
95
  handleError(types.SocialOAuthErrorCode.NO_PROVIDER, 'Provider is required');
@@ -149,7 +153,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
149
153
  }
150
154
  });
151
155
  const connectSocialAccount = (provider, validator) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
152
- var _b;
156
+ var _b, _c;
153
157
  clearInterval(authWindowInterval.current);
154
158
  clearError();
155
159
  setIsProcessing(true);
@@ -160,15 +164,15 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
160
164
  if (validator && !validator(provider)) {
161
165
  return;
162
166
  }
167
+ const authWindow = window.open('', '_blank', 'width=500,height=600');
163
168
  const state = randomString.randomString(8);
164
169
  const verifier = randomString.randomString(43);
165
170
  const clearListeners = () => {
166
- removeOAuthIFrame();
167
171
  window.removeEventListener('message', handleAuthWindowMessage);
168
- providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: false });
172
+ providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: false });
169
173
  };
170
174
  const handleAuthWindowMessage = (event) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
171
- var _c;
175
+ var _d;
172
176
  const message = event.data;
173
177
  const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
174
178
  if (isAuthorizationMessage) {
@@ -180,7 +184,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
180
184
  return;
181
185
  }
182
186
  setIsProcessing(true);
183
- if (!((_c = providersWaitingOauthMessages.current) === null || _c === void 0 ? void 0 : _c[provider])) {
187
+ if (!((_d = providersWaitingOauthMessage.current) === null || _d === void 0 ? void 0 : _d[provider])) {
184
188
  handleError(types.SocialOAuthErrorCode.SESSION_TIMEOUT, `Connecting ${provider} account session timeout.`);
185
189
  return;
186
190
  }
@@ -202,16 +206,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
202
206
  }
203
207
  setIsProcessing(false);
204
208
  });
205
- const loginUrl = yield api.getOauthLoginUrl(environmentId, provider, String(userJwt));
209
+ const loginUrl = getOauthLoginUrl.getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider, environmentId);
206
210
  if (!loginUrl) {
207
211
  handleError(types.SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`);
208
212
  return;
209
213
  }
210
- // we need to use an iframe to be the intermediary in communications between the popup and the sdk
211
- // because of twitter limitations with accessing the window.opener and BroadcastChannel not working between
212
- // different origins (our api redirect page and the app where the sdk is running)
213
- const oauthIFrameUrl = `${getRedirectURIOrigin.getRedirectURIOrigin(loginUrl)}/sdkoauth`;
214
- addOAuthIFrame(oauthIFrameUrl);
215
214
  let oauthLoginUrl = loginUrl;
216
215
  if (providersRequiringPkce.includes(provider)) {
217
216
  const digest = yield digestSHA256.digestSHA256(verifier);
@@ -222,16 +221,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
222
221
  });
223
222
  oauthLoginUrl = `${loginUrl}&${pkceParams}`;
224
223
  }
225
- if (!((_b = providersWaitingOauthMessages.current) === null || _b === void 0 ? void 0 : _b[provider])) {
224
+ if (!((_c = providersWaitingOauthMessage.current) === null || _c === void 0 ? void 0 : _c[provider])) {
226
225
  window.addEventListener('message', handleAuthWindowMessage);
227
- providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: true });
228
- }
229
- const authWindow = window.open(oauthLoginUrl, '_blank', 'width=500,height=600');
230
- if (authWindow === null || typeof authWindow === 'undefined') {
231
- // Pop-ups are blocked
232
- handleError(types.SocialOAuthErrorCode.OAUTH_WINDOW_BLOCKED, 'Please allow popups and try again.');
233
- return;
226
+ providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: true });
234
227
  }
228
+ authWindow === null || authWindow === void 0 ? void 0 : authWindow.location.assign(oauthLoginUrl);
235
229
  if (!providersWithoutWindowOpenerRefence.includes(provider)) {
236
230
  // For provider that support window.opener, we need to clear all states/listeners when the window is closed
237
231
  authWindowInterval.current = setInterval(() => {
@@ -242,26 +236,31 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
242
236
  clearInterval(authWindowInterval.current);
243
237
  setIsProcessing(false);
244
238
  // user didn't complete oauth
245
- if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
239
+ if ((_a = providersWaitingOauthMessage.current) === null || _a === void 0 ? void 0 : _a[provider]) {
246
240
  onError === null || onError === void 0 ? void 0 : onError();
247
241
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
248
242
  }
249
243
  }, 2000);
250
244
  }
251
245
  else {
252
- // For provider that don't support window.opener, we need to use a timeout to try to detect when the
253
- // window is closed
254
- authWindowInterval.current = setInterval(() => {
255
- var _a;
256
- // user didn't complete oauth
257
- if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
246
+ // For provider that don't support window.opener, we need to use a timeout to pool the oauth result
247
+ // If we don't get a valid result in {async sessionTimeout} ms, we'll assume the user closed the window
248
+ // and we'll clear all states/listeners
249
+ // start pooling oauth result
250
+ shouldPool.current = true;
251
+ poolOauthResult(provider, state);
252
+ authWindowInterval.current = setInterval(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
253
+ var _e;
254
+ shouldPool.current = false;
255
+ // clear all states/listeners, assuming user closed the window before completing oauth
256
+ if ((_e = providersWaitingOauthMessage.current) === null || _e === void 0 ? void 0 : _e[provider]) {
258
257
  clearListeners();
259
258
  handleError(types.SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Connecting ${provider} account window timeout.`);
260
259
  }
261
260
  clearInterval(authWindowInterval.current);
262
261
  setIsProcessing(false);
263
262
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
264
- }, sessionTimeout);
263
+ }), sessionTimeout);
265
264
  }
266
265
  });
267
266
  return {
@@ -1,9 +1,10 @@
1
1
  import { __awaiter } from '../../../../../_virtual/_tslib.js';
2
2
  import { useState, useRef } from 'react';
3
+ import { OauthResultStatus } from '@dynamic-labs/sdk-api';
3
4
  import { SocialOAuthErrorCode } from '@dynamic-labs/types';
4
5
  import { SocialAccountAlreadyExistsError, NoAccessError } from '@dynamic-labs/utils';
5
6
  import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
6
- import { getOauthLoginUrl, verifyOAuth, signInOAuth } from '../../../data/api.js';
7
+ import { getOAuthResult, verifyOAuth, signInOAuth } from '../../../data/api.js';
7
8
  import { useUpdateUserProfileByJWTCallback } from '../useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
8
9
  import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
9
10
  import '@dynamic-labs/iconic';
@@ -18,12 +19,11 @@ import 'ethers';
18
19
  import '../../../shared/consts/index.js';
19
20
  import '@dynamic-labs/multi-wallet';
20
21
  import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
21
- import '@dynamic-labs/sdk-api';
22
22
  import { randomString } from '../../functions/randomString/randomString.js';
23
23
  import { stringifyURIQuery } from '../../functions/stringifyURIQuery/stringifyURIQuery.js';
24
24
  import { digestSHA256 } from '../../functions/digestSHA256/digestSHA256.js';
25
25
  import { encodeBase64URL } from '../../functions/encodeBase64URL/encodeBase64URL.js';
26
- import { getRedirectURIOrigin } from '../../functions/getRedirectURIOrigin/getRedirectURIOrigin.js';
26
+ import { getOauthLoginUrl } from '../../functions/getOauthLoginUrl/getOauthLoginUrl.js';
27
27
  import { useCreateUserProfileByJWTCallback } from '../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js';
28
28
  import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
29
29
 
@@ -43,15 +43,16 @@ const providersWithoutWindowOpenerRefence = ['twitter'];
43
43
  // Hook to handle common social auth logic (for social linking and social sign in)
44
44
  const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
45
45
  var _a;
46
- const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, setIsVerificationInProgress, } = useInternalDynamicContext();
46
+ const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, setIsVerificationInProgress, projectSettings, } = useInternalDynamicContext();
47
47
  const { setView } = useViewContext();
48
48
  const { setErrorMessage, setError: setContextError } = useErrorContext();
49
49
  const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
50
50
  const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback();
51
51
  const [isProcessing, setIsProcessing] = useState(false);
52
52
  const [error, setError] = useState();
53
- const providersWaitingOauthMessages = useRef({});
53
+ const providersWaitingOauthMessage = useRef({});
54
54
  const authWindowInterval = useRef();
55
+ const shouldPool = useRef(false);
55
56
  const userJwt = (_a = getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
56
57
  const clearError = () => {
57
58
  setError(undefined);
@@ -65,23 +66,26 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
65
66
  onError === null || onError === void 0 ? void 0 : onError();
66
67
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
67
68
  };
68
- const addOAuthIFrame = (url) => {
69
- const container = document.getElementById('oauth-iframe-container');
70
- let oauthIFrame = document.getElementById('oauth-iframe');
71
- if (!container || oauthIFrame) {
69
+ const poolOauthResult = (provider, state) => __awaiter(void 0, void 0, void 0, function* () {
70
+ if (!shouldPool.current) {
72
71
  return;
73
72
  }
74
- oauthIFrame = document.createElement('iframe');
75
- oauthIFrame.setAttribute('id', 'oauth-iframe');
76
- oauthIFrame.setAttribute('src', url);
77
- container.appendChild(oauthIFrame);
78
- };
79
- const removeOAuthIFrame = () => {
80
- const oauthIFrame = document.getElementById('oauth-iframe');
81
- if (oauthIFrame) {
82
- oauthIFrame.remove();
73
+ const result = yield getOAuthResult(environmentId, provider, {
74
+ state,
75
+ });
76
+ if ((result === null || result === void 0 ? void 0 : result.status) !== OauthResultStatus.Completed) {
77
+ setTimeout(() => poolOauthResult(provider, state), 1000);
78
+ return;
83
79
  }
84
- };
80
+ shouldPool.current = false;
81
+ const authMessage = {
82
+ code: result === null || result === void 0 ? void 0 : result.code,
83
+ error: result === null || result === void 0 ? void 0 : result.error,
84
+ provider,
85
+ type: 'authorization_response',
86
+ };
87
+ window.postMessage(authMessage, '*');
88
+ });
85
89
  const checkValidProvider = (provider) => {
86
90
  if (!provider) {
87
91
  handleError(SocialOAuthErrorCode.NO_PROVIDER, 'Provider is required');
@@ -145,7 +149,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
145
149
  }
146
150
  });
147
151
  const connectSocialAccount = (provider, validator) => __awaiter(void 0, void 0, void 0, function* () {
148
- var _b;
152
+ var _b, _c;
149
153
  clearInterval(authWindowInterval.current);
150
154
  clearError();
151
155
  setIsProcessing(true);
@@ -156,15 +160,15 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
156
160
  if (validator && !validator(provider)) {
157
161
  return;
158
162
  }
163
+ const authWindow = window.open('', '_blank', 'width=500,height=600');
159
164
  const state = randomString(8);
160
165
  const verifier = randomString(43);
161
166
  const clearListeners = () => {
162
- removeOAuthIFrame();
163
167
  window.removeEventListener('message', handleAuthWindowMessage);
164
- providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: false });
168
+ providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: false });
165
169
  };
166
170
  const handleAuthWindowMessage = (event) => __awaiter(void 0, void 0, void 0, function* () {
167
- var _c;
171
+ var _d;
168
172
  const message = event.data;
169
173
  const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
170
174
  if (isAuthorizationMessage) {
@@ -176,7 +180,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
176
180
  return;
177
181
  }
178
182
  setIsProcessing(true);
179
- if (!((_c = providersWaitingOauthMessages.current) === null || _c === void 0 ? void 0 : _c[provider])) {
183
+ if (!((_d = providersWaitingOauthMessage.current) === null || _d === void 0 ? void 0 : _d[provider])) {
180
184
  handleError(SocialOAuthErrorCode.SESSION_TIMEOUT, `Connecting ${provider} account session timeout.`);
181
185
  return;
182
186
  }
@@ -198,16 +202,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
198
202
  }
199
203
  setIsProcessing(false);
200
204
  });
201
- const loginUrl = yield getOauthLoginUrl(environmentId, provider, String(userJwt));
205
+ const loginUrl = getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider, environmentId);
202
206
  if (!loginUrl) {
203
207
  handleError(SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`);
204
208
  return;
205
209
  }
206
- // we need to use an iframe to be the intermediary in communications between the popup and the sdk
207
- // because of twitter limitations with accessing the window.opener and BroadcastChannel not working between
208
- // different origins (our api redirect page and the app where the sdk is running)
209
- const oauthIFrameUrl = `${getRedirectURIOrigin(loginUrl)}/sdkoauth`;
210
- addOAuthIFrame(oauthIFrameUrl);
211
210
  let oauthLoginUrl = loginUrl;
212
211
  if (providersRequiringPkce.includes(provider)) {
213
212
  const digest = yield digestSHA256(verifier);
@@ -218,16 +217,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
218
217
  });
219
218
  oauthLoginUrl = `${loginUrl}&${pkceParams}`;
220
219
  }
221
- if (!((_b = providersWaitingOauthMessages.current) === null || _b === void 0 ? void 0 : _b[provider])) {
220
+ if (!((_c = providersWaitingOauthMessage.current) === null || _c === void 0 ? void 0 : _c[provider])) {
222
221
  window.addEventListener('message', handleAuthWindowMessage);
223
- providersWaitingOauthMessages.current = Object.assign(Object.assign({}, providersWaitingOauthMessages.current), { [provider]: true });
224
- }
225
- const authWindow = window.open(oauthLoginUrl, '_blank', 'width=500,height=600');
226
- if (authWindow === null || typeof authWindow === 'undefined') {
227
- // Pop-ups are blocked
228
- handleError(SocialOAuthErrorCode.OAUTH_WINDOW_BLOCKED, 'Please allow popups and try again.');
229
- return;
222
+ providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: true });
230
223
  }
224
+ authWindow === null || authWindow === void 0 ? void 0 : authWindow.location.assign(oauthLoginUrl);
231
225
  if (!providersWithoutWindowOpenerRefence.includes(provider)) {
232
226
  // For provider that support window.opener, we need to clear all states/listeners when the window is closed
233
227
  authWindowInterval.current = setInterval(() => {
@@ -238,26 +232,31 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
238
232
  clearInterval(authWindowInterval.current);
239
233
  setIsProcessing(false);
240
234
  // user didn't complete oauth
241
- if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
235
+ if ((_a = providersWaitingOauthMessage.current) === null || _a === void 0 ? void 0 : _a[provider]) {
242
236
  onError === null || onError === void 0 ? void 0 : onError();
243
237
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
244
238
  }
245
239
  }, 2000);
246
240
  }
247
241
  else {
248
- // For provider that don't support window.opener, we need to use a timeout to try to detect when the
249
- // window is closed
250
- authWindowInterval.current = setInterval(() => {
251
- var _a;
252
- // user didn't complete oauth
253
- if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
242
+ // For provider that don't support window.opener, we need to use a timeout to pool the oauth result
243
+ // If we don't get a valid result in {async sessionTimeout} ms, we'll assume the user closed the window
244
+ // and we'll clear all states/listeners
245
+ // start pooling oauth result
246
+ shouldPool.current = true;
247
+ poolOauthResult(provider, state);
248
+ authWindowInterval.current = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
249
+ var _e;
250
+ shouldPool.current = false;
251
+ // clear all states/listeners, assuming user closed the window before completing oauth
252
+ if ((_e = providersWaitingOauthMessage.current) === null || _e === void 0 ? void 0 : _e[provider]) {
254
253
  clearListeners();
255
254
  handleError(SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Connecting ${provider} account window timeout.`);
256
255
  }
257
256
  clearInterval(authWindowInterval.current);
258
257
  setIsProcessing(false);
259
258
  onSettled === null || onSettled === void 0 ? void 0 : onSettled();
260
- }, sessionTimeout);
259
+ }), sessionTimeout);
261
260
  }
262
261
  });
263
262
  return {
@@ -24,6 +24,7 @@ var isEmailVerificationRequired = require('../../../functions/authenication/isEm
24
24
  require('../../../../context/ErrorContext/ErrorContext.cjs');
25
25
  require('@dynamic-labs/multi-wallet');
26
26
  require('@dynamic-labs/sdk-api');
27
+ require('../../../../config/ApiEndpoint.cjs');
27
28
  require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
28
29
  require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
29
30
  require('../../../../context/CaptchaContext/CaptchaContext.cjs');
@@ -20,6 +20,7 @@ import { isEmailVerificationRequired } from '../../../functions/authenication/is
20
20
  import '../../../../context/ErrorContext/ErrorContext.js';
21
21
  import '@dynamic-labs/multi-wallet';
22
22
  import '@dynamic-labs/sdk-api';
23
+ import '../../../../config/ApiEndpoint.js';
23
24
  import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
24
25
  import '../../../../context/AccountExistsContext/AccountExistsContext.js';
25
26
  import '../../../../context/CaptchaContext/CaptchaContext.js';
@@ -23,6 +23,7 @@ require('../../../shared/consts/index.cjs');
23
23
  var getVerifyArgs = require('../../functions/getVerifyArgs/getVerifyArgs.cjs');
24
24
  var createUserProfile = require('../../functions/createUserProfile/createUserProfile.cjs');
25
25
  require('@dynamic-labs/sdk-api');
26
+ require('../../../config/ApiEndpoint.cjs');
26
27
  var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
27
28
  var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
28
29
  var getSiweStatement = require('../../functions/getSiweStatement/getSiweStatement.cjs');
@@ -19,6 +19,7 @@ import '../../../shared/consts/index.js';
19
19
  import { getVerifyArgs } from '../../functions/getVerifyArgs/getVerifyArgs.js';
20
20
  import { createUserProfile } from '../../functions/createUserProfile/createUserProfile.js';
21
21
  import '@dynamic-labs/sdk-api';
22
+ import '../../../config/ApiEndpoint.js';
22
23
  import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
23
24
  import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
24
25
  import { getSiweStatement } from '../../functions/getSiweStatement/getSiweStatement.js';
@@ -18,6 +18,7 @@ require('ethers');
18
18
  require('../../../shared/consts/index.cjs');
19
19
  require('@dynamic-labs/multi-wallet');
20
20
  var getReferencedAccount = require('../../functions/getReferencedAccount/getReferencedAccount.cjs');
21
+ require('../../../config/ApiEndpoint.cjs');
21
22
 
22
23
  /**
23
24
  * This function will use a referenced account to kick off the social wallet
@@ -14,6 +14,7 @@ import 'ethers';
14
14
  import '../../../shared/consts/index.js';
15
15
  import '@dynamic-labs/multi-wallet';
16
16
  import { getReferencedAccount } from '../../functions/getReferencedAccount/getReferencedAccount.js';
17
+ import '../../../config/ApiEndpoint.js';
17
18
 
18
19
  /**
19
20
  * This function will use a referenced account to kick off the social wallet
@@ -19,6 +19,7 @@ var isSameWalletName = require('../../../../functions/isSameWalletName/isSameWal
19
19
  require('@dynamic-labs/multi-wallet');
20
20
  require('@dynamic-labs/sdk-api');
21
21
  var shouldManuallyReconnectOnRefresh = require('../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
22
+ require('../../../../../config/ApiEndpoint.cjs');
22
23
 
23
24
  const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
24
25
  const decodedJwt = decodeJwt.decodeJwt(authToken);
@@ -15,6 +15,7 @@ import { isSameWalletName } from '../../../../functions/isSameWalletName/isSameW
15
15
  import '@dynamic-labs/multi-wallet';
16
16
  import '@dynamic-labs/sdk-api';
17
17
  import { shouldManuallyReconnectOnRefresh } from '../../../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
18
+ import '../../../../../config/ApiEndpoint.js';
18
19
 
19
20
  const createLinkedWalletsFromWalletOptions = ({ authToken, walletOptions, primaryWalletId, }) => {
20
21
  const decodedJwt = decodeJwt(authToken);
@@ -21,9 +21,9 @@ require('ethers');
21
21
  require('../../../shared/consts/index.cjs');
22
22
  require('@dynamic-labs/multi-wallet');
23
23
  var requiresTwoStepAuthentication = require('../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs');
24
+ require('../../../config/ApiEndpoint.cjs');
24
25
  var isSelectedWalletAlreadyConnected = require('../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs');
25
26
  var useConnectAndSign = require('../authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
26
- require('../../../config/ApiEndpoint.cjs');
27
27
  require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
28
28
  require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
29
29
  var useConnectAndSignSplitSteps = require('../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
@@ -17,9 +17,9 @@ import 'ethers';
17
17
  import '../../../shared/consts/index.js';
18
18
  import '@dynamic-labs/multi-wallet';
19
19
  import { requiresTwoStepAuthentication } from '../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js';
20
+ import '../../../config/ApiEndpoint.js';
20
21
  import { isSelectedWalletAlreadyConnected } from '../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js';
21
22
  import { useConnectAndSign } from '../authenticationHooks/useConnectAndSign/useConnectAndSign.js';
22
- import '../../../config/ApiEndpoint.js';
23
23
  import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
24
24
  import '../../../context/AccountExistsContext/AccountExistsContext.js';
25
25
  import { useConnectAndSignSplitSteps } from '../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
@@ -20,6 +20,7 @@ require('ethers');
20
20
  require('../../../shared/consts/index.cjs');
21
21
  require('../../../context/DynamicContext/DynamicContext.cjs');
22
22
  require('@dynamic-labs/multi-wallet');
23
+ require('../../../config/ApiEndpoint.cjs');
23
24
  require('../../../components/ShadowDOM/ShadowDOM.cjs');
24
25
  require('../../../context/ThemeContext/ThemeContext.cjs');
25
26
  require('react-dom');
@@ -27,7 +28,6 @@ require('react-focus-lock');
27
28
  require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
28
29
  require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
29
30
  require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
30
- require('../../../config/ApiEndpoint.cjs');
31
31
  require('@dynamic-labs/rpc-providers');
32
32
  require('../useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
33
33
  require('../../../context/ErrorContext/ErrorContext.cjs');
@@ -16,6 +16,7 @@ import 'ethers';
16
16
  import '../../../shared/consts/index.js';
17
17
  import '../../../context/DynamicContext/DynamicContext.js';
18
18
  import '@dynamic-labs/multi-wallet';
19
+ import '../../../config/ApiEndpoint.js';
19
20
  import '../../../components/ShadowDOM/ShadowDOM.js';
20
21
  import '../../../context/ThemeContext/ThemeContext.js';
21
22
  import 'react-dom';
@@ -23,7 +24,6 @@ import 'react-focus-lock';
23
24
  import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
24
25
  import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
25
26
  import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
26
- import '../../../config/ApiEndpoint.js';
27
27
  import '@dynamic-labs/rpc-providers';
28
28
  import '../useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
29
29
  import '../../../context/ErrorContext/ErrorContext.js';
@@ -10,33 +10,22 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference,
10
10
  const wallets = React.useMemo(() => {
11
11
  if (!projectSettings || !Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length)
12
12
  return [];
13
- const installedWallets = data.getInstalledWallets(projectSettings, {
14
- appLogoUrl,
15
- appName,
16
- customerApiProviders: projectSettings.providers || [],
17
- deepLinkPreference,
18
- flowNetwork,
19
- networkConfigurations,
20
- skipMemo: true,
21
- walletBook,
22
- walletConnectV1Bridge,
23
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
24
- walletUiUtils,
13
+ return data.getWallets({
14
+ getSupportedWalletOpts: {
15
+ appLogoUrl,
16
+ appName,
17
+ customerApiProviders: projectSettings.providers || [],
18
+ deepLinkPreference,
19
+ flowNetwork,
20
+ networkConfigurations,
21
+ skipMemo: true,
22
+ walletBook,
23
+ walletConnectV1Bridge,
24
+ walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
25
+ walletUiUtils,
26
+ },
27
+ settings: projectSettings,
25
28
  });
26
- const notInstalledWallets = data.getNotInstalledWallets(projectSettings, {
27
- appLogoUrl,
28
- appName,
29
- customerApiProviders: projectSettings.providers || [],
30
- deepLinkPreference,
31
- flowNetwork,
32
- networkConfigurations,
33
- skipMemo: true,
34
- walletBook,
35
- walletConnectV1Bridge,
36
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
37
- walletUiUtils,
38
- });
39
- return [...installedWallets, ...notInstalledWallets];
40
29
  // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
41
30
  }, [
42
31
  appLogoUrl,