@dynamic-labs/sdk-react-core 0.17.0-RC.17 → 0.17.0-RC.19

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 (284) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.cjs +10 -10
  3. package/package.js +10 -10
  4. package/package.json +17 -17
  5. package/src/index.cjs +8 -0
  6. package/src/index.js +5 -0
  7. package/src/lib/Main.cjs +2 -0
  8. package/src/lib/Main.js +2 -0
  9. package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +2 -0
  10. package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +2 -0
  11. package/src/lib/components/AnimatePresence/AnimatePresence.cjs +2 -0
  12. package/src/lib/components/AnimatePresence/AnimatePresence.js +2 -0
  13. package/src/lib/components/AppOriginTile/AppOriginTile.types.d.ts +1 -1
  14. package/src/lib/components/Divider/Divider.cjs +2 -0
  15. package/src/lib/components/Divider/Divider.js +2 -0
  16. package/src/lib/components/ErrorContainer/ErrorContainer.cjs +2 -2
  17. package/src/lib/components/ErrorContainer/ErrorContainer.d.ts +3 -1
  18. package/src/lib/components/ErrorContainer/ErrorContainer.js +2 -2
  19. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
  20. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
  21. package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
  22. package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
  23. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
  24. package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
  25. package/src/lib/components/Input/Input.cjs +13 -6
  26. package/src/lib/components/Input/Input.js +14 -7
  27. package/src/lib/components/Input/Input.types.d.ts +4 -0
  28. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +2 -0
  29. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +2 -0
  30. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -0
  31. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -0
  32. package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
  33. package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
  34. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
  35. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
  36. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
  37. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
  38. package/src/lib/components/OverlayCard/OverlayCard.cjs +2 -0
  39. package/src/lib/components/OverlayCard/OverlayCard.js +2 -0
  40. package/src/lib/components/Portal/Portal.cjs +2 -0
  41. package/src/lib/components/Portal/Portal.js +2 -0
  42. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +24 -0
  43. package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +10 -0
  44. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +22 -0
  45. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +16 -0
  46. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +8 -0
  47. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/index.d.ts +1 -0
  48. package/src/lib/components/SendBalancePageLayout/components/index.d.ts +1 -0
  49. package/src/lib/components/SendBalancePageLayout/index.d.ts +2 -0
  50. package/src/lib/components/Tooltip/Tooltip.cjs +2 -0
  51. package/src/lib/components/Tooltip/Tooltip.js +2 -0
  52. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +1 -1
  53. package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +11 -0
  54. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +11 -0
  55. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +2 -0
  56. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +2 -0
  57. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -0
  58. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
  59. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
  60. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
  61. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -0
  62. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -0
  63. package/src/lib/components/index.d.ts +1 -0
  64. package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -2
  65. package/src/lib/context/DynamicContext/DynamicContext.js +3 -2
  66. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
  67. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
  68. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +2 -0
  69. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +2 -0
  70. package/src/lib/context/QrCodeContext/QrCodeContext.cjs +2 -0
  71. package/src/lib/context/QrCodeContext/QrCodeContext.js +2 -0
  72. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +59 -20
  73. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +3 -1
  74. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +60 -21
  75. package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
  76. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
  77. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
  78. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +2 -0
  79. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +2 -0
  80. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +2 -0
  81. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +2 -0
  82. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
  83. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
  84. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +1 -0
  85. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +1 -0
  86. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
  87. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
  88. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +13 -3
  89. package/src/lib/layout/DynamicAuthLayout/Header/header.js +13 -3
  90. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
  91. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
  92. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +22 -70
  93. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +24 -72
  94. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -3
  95. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +2 -1
  96. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +2 -1
  97. package/src/lib/shared/utils/functions/index.d.ts +1 -0
  98. package/src/lib/shared/utils/functions/trimEnd/index.d.ts +1 -0
  99. package/src/lib/shared/utils/functions/trimEnd/trimEnd.cjs +13 -0
  100. package/src/lib/shared/utils/functions/trimEnd/trimEnd.d.ts +1 -0
  101. package/src/lib/shared/utils/functions/trimEnd/trimEnd.js +9 -0
  102. package/src/lib/shared/utils/hooks/index.d.ts +2 -0
  103. package/src/lib/shared/utils/hooks/useIsMounted/index.d.ts +1 -0
  104. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.cjs +18 -0
  105. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.d.ts +1 -0
  106. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.js +14 -0
  107. package/src/lib/styles/index.shadow.cjs +1 -1
  108. package/src/lib/styles/index.shadow.js +1 -1
  109. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +12 -0
  110. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.d.ts +1 -0
  111. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +8 -0
  112. package/src/lib/utils/functions/getAppOrigin/index.d.ts +1 -0
  113. package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.cjs +29 -0
  114. package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.d.ts +7 -0
  115. package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.js +25 -0
  116. package/src/lib/utils/functions/getReferencedAccount/index.d.ts +1 -0
  117. package/src/lib/utils/functions/index.d.ts +2 -0
  118. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
  119. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
  120. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
  121. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
  122. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +12 -3
  123. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +12 -3
  124. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
  125. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
  126. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +37 -0
  127. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +8 -0
  128. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +33 -0
  129. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +7 -0
  130. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +8 -1
  131. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -3
  132. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -3
  133. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
  134. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
  135. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +19 -17
  136. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +19 -17
  137. package/src/lib/utils/hooks/useWallets/useWallets.cjs +26 -36
  138. package/src/lib/utils/hooks/useWallets/useWallets.d.ts +1 -2
  139. package/src/lib/utils/hooks/useWallets/useWallets.js +27 -37
  140. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +2 -0
  141. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
  142. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -0
  143. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -0
  144. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -0
  145. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -0
  146. package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
  147. package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
  148. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
  149. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
  150. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
  151. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
  152. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
  153. package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
  154. package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
  155. package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
  156. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -0
  157. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
  158. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +2 -0
  159. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +2 -0
  160. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -0
  161. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -0
  162. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +2 -0
  163. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +2 -0
  164. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -1
  165. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -1
  166. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
  167. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
  168. package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
  169. package/src/lib/views/NoAccess/NoAccess.js +1 -0
  170. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
  171. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
  172. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
  173. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
  174. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
  175. package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
  176. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
  177. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
  178. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
  179. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
  180. package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
  181. package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
  182. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -8
  183. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -8
  184. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +58 -0
  185. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.d.ts +2 -0
  186. package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +54 -0
  187. package/src/lib/views/SocialWrongAccountView/index.d.ts +1 -0
  188. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +92 -0
  189. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +13 -0
  190. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +88 -0
  191. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.cjs +6 -1
  192. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.d.ts +1 -0
  193. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.js +6 -1
  194. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.cjs +2 -0
  195. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.js +2 -0
  196. package/src/lib/views/TransactionConfirmationView/index.d.ts +2 -0
  197. package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +2 -0
  198. package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +2 -0
  199. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
  200. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
  201. package/src/lib/views/WalletList/data.cjs +4 -5
  202. package/src/lib/views/WalletList/data.d.ts +2 -2
  203. package/src/lib/views/WalletList/data.js +4 -5
  204. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
  205. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
  206. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
  207. package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
  208. package/src/lib/views/viewToComponentMap.cjs +2 -0
  209. package/src/lib/views/viewToComponentMap.js +2 -0
  210. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
  211. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
  212. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -0
  213. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -0
  214. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -0
  215. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -0
  216. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
  217. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
  218. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
  219. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
  220. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -0
  221. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -0
  222. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -0
  223. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -0
  224. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -0
  225. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -0
  226. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +2 -0
  227. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +2 -0
  228. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +2 -0
  229. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +2 -0
  230. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
  231. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
  232. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
  233. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
  234. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
  235. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
  236. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
  237. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
  238. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
  239. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
  240. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -0
  241. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -0
  242. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +11 -5
  243. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +11 -5
  244. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
  245. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
  246. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +2 -0
  247. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +2 -0
  248. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
  249. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
  250. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
  251. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
  252. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +2 -0
  253. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +2 -0
  254. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
  255. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
  256. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -0
  257. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -0
  258. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +2 -0
  259. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +2 -0
  260. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -0
  261. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -0
  262. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -0
  263. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -0
  264. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -0
  265. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -0
  266. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -0
  267. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -0
  268. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -0
  269. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -0
  270. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -0
  271. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -0
  272. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
  273. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
  274. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
  275. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
  276. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +2 -0
  277. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +2 -0
  278. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
  279. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
  280. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
  281. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
  282. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/index.d.ts +0 -0
  283. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/index.d.ts +0 -0
  284. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.d.ts +0 -0
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../../_virtual/_tslib.cjs');
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
+ require('../../constants/colors.cjs');
8
+ require('@dynamic-labs/multi-wallet');
9
+ require('@dynamic-labs/utils');
10
+ require('@dynamic-labs/sdk-api');
11
+ require('../../../shared/logger.cjs');
12
+ require('@dynamic-labs/iconic');
13
+ require('react/jsx-runtime');
14
+ require('../../../context/ViewContext/ViewContext.cjs');
15
+ require('react');
16
+ require('ethers');
17
+ var getReferencedAccount = require('../../functions/getReferencedAccount/getReferencedAccount.cjs');
18
+
19
+ /**
20
+ * This function will use a referenced account to kick off the social wallet
21
+ * authentication. This is useful in the multiwallet scenario where the user
22
+ * wants to set their disconnected social wallet as their primary wallet, in
23
+ * which case the wallet needs to be reconnected
24
+ */
25
+ const reconnectSocialWallet = (jwt, wallet) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
26
+ if (!walletConnectorCore.isSocialWalletConnector(wallet.connector)) {
27
+ return;
28
+ }
29
+ const socialAccountDataForWallet = getReferencedAccount.getReferencedAccount(jwt, wallet.id);
30
+ if (!socialAccountDataForWallet ||
31
+ !socialAccountDataForWallet.oauthProvider) {
32
+ return;
33
+ }
34
+ yield wallet.connector.connect(socialAccountDataForWallet.oauthProvider);
35
+ });
36
+
37
+ exports.reconnectSocialWallet = reconnectSocialWallet;
@@ -0,0 +1,8 @@
1
+ import { Wallet } from '../../../shared';
2
+ /**
3
+ * This function will use a referenced account to kick off the social wallet
4
+ * authentication. This is useful in the multiwallet scenario where the user
5
+ * wants to set their disconnected social wallet as their primary wallet, in
6
+ * which case the wallet needs to be reconnected
7
+ */
8
+ export declare const reconnectSocialWallet: (jwt: string | undefined, wallet: Wallet) => Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { __awaiter } from '../../../../../_virtual/_tslib.js';
2
+ import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import '../../constants/colors.js';
4
+ import '@dynamic-labs/multi-wallet';
5
+ import '@dynamic-labs/utils';
6
+ import '@dynamic-labs/sdk-api';
7
+ import '../../../shared/logger.js';
8
+ import '@dynamic-labs/iconic';
9
+ import 'react/jsx-runtime';
10
+ import '../../../context/ViewContext/ViewContext.js';
11
+ import 'react';
12
+ import 'ethers';
13
+ import { getReferencedAccount } from '../../functions/getReferencedAccount/getReferencedAccount.js';
14
+
15
+ /**
16
+ * This function will use a referenced account to kick off the social wallet
17
+ * authentication. This is useful in the multiwallet scenario where the user
18
+ * wants to set their disconnected social wallet as their primary wallet, in
19
+ * which case the wallet needs to be reconnected
20
+ */
21
+ const reconnectSocialWallet = (jwt, wallet) => __awaiter(void 0, void 0, void 0, function* () {
22
+ if (!isSocialWalletConnector(wallet.connector)) {
23
+ return;
24
+ }
25
+ const socialAccountDataForWallet = getReferencedAccount(jwt, wallet.id);
26
+ if (!socialAccountDataForWallet ||
27
+ !socialAccountDataForWallet.oauthProvider) {
28
+ return;
29
+ }
30
+ yield wallet.connector.connect(socialAccountDataForWallet.oauthProvider);
31
+ });
32
+
33
+ export { reconnectSocialWallet };
@@ -21,6 +21,7 @@ var isSameWalletName = require('../../functions/isSameWalletName/isSameWalletNam
21
21
  require('@dynamic-labs/multi-wallet');
22
22
  require('@dynamic-labs/sdk-api');
23
23
  var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
24
+ var reconnectSocialWallet = require('./reconnectSocialWallet.cjs');
24
25
 
25
26
  const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWalletWidgetState, setDesktopUri, setMultiWalletWidgetState, setQrcodeUri, }) => {
26
27
  const [showQrcodeModal, setShowQrcodeModal] = React.useState(false);
@@ -140,6 +141,11 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
140
141
  emailConnector.setEmail(email);
141
142
  }
142
143
  }
144
+ if (walletConnectorCore.isSocialWalletConnector(newPrimaryWallet.connector) &&
145
+ !newPrimaryWallet.connected) {
146
+ reconnectSocialWallet.reconnectSocialWallet(authToken, newPrimaryWallet);
147
+ return;
148
+ }
143
149
  /* istanbul ignore next */
144
150
  const publicAddress = yield newPrimaryWallet.connector.fetchPublicAddress({
145
151
  onDesktopUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
@@ -166,6 +172,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
166
172
  logger.logger.error('Failed to connect to wallet');
167
173
  }
168
174
  }), [
175
+ authToken,
169
176
  checkIfAccountChangeIsRequired,
170
177
  checkIfShowQrCodeModal,
171
178
  getPrimaryWallet,
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from '../../../../../_virtual/_tslib.js';
2
2
  import { useState, useCallback, useEffect } from 'react';
3
- import { isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { isEmailWalletConnector, isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
4
4
  import { DynamicError } from '@dynamic-labs/utils';
5
5
  import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
6
6
  import { logger } from '../../../shared/logger.js';
@@ -17,6 +17,7 @@ import { isSameWalletName } from '../../functions/isSameWalletName/isSameWalletN
17
17
  import '@dynamic-labs/multi-wallet';
18
18
  import '@dynamic-labs/sdk-api';
19
19
  import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
20
+ import { reconnectSocialWallet } from './reconnectSocialWallet.js';
20
21
 
21
22
  const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWalletWidgetState, setDesktopUri, setMultiWalletWidgetState, setQrcodeUri, }) => {
22
23
  const [showQrcodeModal, setShowQrcodeModal] = useState(false);
@@ -136,6 +137,11 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
136
137
  emailConnector.setEmail(email);
137
138
  }
138
139
  }
140
+ if (isSocialWalletConnector(newPrimaryWallet.connector) &&
141
+ !newPrimaryWallet.connected) {
142
+ reconnectSocialWallet(authToken, newPrimaryWallet);
143
+ return;
144
+ }
139
145
  /* istanbul ignore next */
140
146
  const publicAddress = yield newPrimaryWallet.connector.fetchPublicAddress({
141
147
  onDesktopUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
@@ -162,6 +168,7 @@ const useWalletConnectors = ({ authToken, wallets: availableWallets, multiWallet
162
168
  logger.error('Failed to connect to wallet');
163
169
  }
164
170
  }), [
171
+ authToken,
165
172
  checkIfAccountChangeIsRequired,
166
173
  checkIfShowQrCodeModal,
167
174
  getPrimaryWallet,
@@ -91,17 +91,16 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
91
91
  primaryWallet.connector.setupEventListeners({
92
92
  onAccountChange: (accounts) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
93
93
  const [newAddress] = accounts;
94
- yield computeConnectedStateForWallets();
95
94
  const newWallet = secondaryWallets.find((wallet) => walletConnectorCore.isSameAddress(wallet.address, newAddress, wallet.chain));
96
95
  if (walletConnectorCore.isSameAddress(newAddress, primaryWallet.address, primaryWallet.chain)) {
97
96
  setMultiWalletWidgetState('idle');
98
97
  }
99
98
  else if (!multiWallet) {
100
99
  yield handleLogOut();
100
+ return;
101
101
  }
102
102
  else if (multiWalletWidgetState === 'awaiting_account_switch') {
103
103
  handleAccountChangeWhenAwaitingAccountSwitch(true, newAddress);
104
- yield computeConnectedStateForWallets();
105
104
  }
106
105
  else if (multiWalletWidgetState === 'idle' && newWallet) {
107
106
  setPrimaryWalletId(newWallet.id);
@@ -110,6 +109,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
110
109
  if (user) {
111
110
  setMultiWalletWidgetState('detected_new_wallet');
112
111
  setSelectedWalletConnector(primaryWallet.connector);
112
+ yield computeConnectedStateForWallets();
113
113
  return;
114
114
  }
115
115
  connectWalletByAddressAndChain(primaryWallet.connector.name, newAddress, primaryWallet.chain);
@@ -118,9 +118,9 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
118
118
  logger.logger.error(`Unexpected multiWalletWidgetState (${multiWalletWidgetState}) and onAccountChange combination. Resetting state to idle.`);
119
119
  setMultiWalletWidgetState('idle');
120
120
  }
121
+ yield computeConnectedStateForWallets();
121
122
  }),
122
123
  onChainChange: (chain) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
123
- /* istanbul ignore next */
124
124
  setNetwork(parseInt(chain));
125
125
  }),
126
126
  onDisconnect: handleLogOut,
@@ -137,6 +137,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
137
137
  secondaryWallets,
138
138
  setSelectedWalletConnector,
139
139
  handleAccountChangeWhenAwaitingAccountSwitch,
140
+ setPrimaryWalletId,
140
141
  ]);
141
142
  const addSecondaryWalletEventListeners = React.useCallback((seen) => {
142
143
  const secondaryListeners = {
@@ -87,17 +87,16 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
87
87
  primaryWallet.connector.setupEventListeners({
88
88
  onAccountChange: (accounts) => __awaiter(void 0, void 0, void 0, function* () {
89
89
  const [newAddress] = accounts;
90
- yield computeConnectedStateForWallets();
91
90
  const newWallet = secondaryWallets.find((wallet) => isSameAddress(wallet.address, newAddress, wallet.chain));
92
91
  if (isSameAddress(newAddress, primaryWallet.address, primaryWallet.chain)) {
93
92
  setMultiWalletWidgetState('idle');
94
93
  }
95
94
  else if (!multiWallet) {
96
95
  yield handleLogOut();
96
+ return;
97
97
  }
98
98
  else if (multiWalletWidgetState === 'awaiting_account_switch') {
99
99
  handleAccountChangeWhenAwaitingAccountSwitch(true, newAddress);
100
- yield computeConnectedStateForWallets();
101
100
  }
102
101
  else if (multiWalletWidgetState === 'idle' && newWallet) {
103
102
  setPrimaryWalletId(newWallet.id);
@@ -106,6 +105,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
106
105
  if (user) {
107
106
  setMultiWalletWidgetState('detected_new_wallet');
108
107
  setSelectedWalletConnector(primaryWallet.connector);
108
+ yield computeConnectedStateForWallets();
109
109
  return;
110
110
  }
111
111
  connectWalletByAddressAndChain(primaryWallet.connector.name, newAddress, primaryWallet.chain);
@@ -114,9 +114,9 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
114
114
  logger.error(`Unexpected multiWalletWidgetState (${multiWalletWidgetState}) and onAccountChange combination. Resetting state to idle.`);
115
115
  setMultiWalletWidgetState('idle');
116
116
  }
117
+ yield computeConnectedStateForWallets();
117
118
  }),
118
119
  onChainChange: (chain) => __awaiter(void 0, void 0, void 0, function* () {
119
- /* istanbul ignore next */
120
120
  setNetwork(parseInt(chain));
121
121
  }),
122
122
  onDisconnect: handleLogOut,
@@ -133,6 +133,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
133
133
  secondaryWallets,
134
134
  setSelectedWalletConnector,
135
135
  handleAccountChangeWhenAwaitingAccountSwitch,
136
+ setPrimaryWalletId,
136
137
  ]);
137
138
  const addSecondaryWalletEventListeners = useCallback((seen) => {
138
139
  const secondaryListeners = {
@@ -18,9 +18,9 @@ require('react/jsx-runtime');
18
18
  require('react');
19
19
  require('ethers');
20
20
  var requiresTwoStepAuthentication = require('../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs');
21
+ require('../../../shared/consts/index.cjs');
21
22
  var useConnectAndSign = require('../authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
22
23
  require('../../../config/ApiEndpoint.cjs');
23
- require('../../../shared/consts/index.cjs');
24
24
  var useConnectAndSignSplitSteps = require('../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
25
25
  var isSelectedWalletAlreadyConnected = require('../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs');
26
26
 
@@ -14,9 +14,9 @@ import 'react/jsx-runtime';
14
14
  import 'react';
15
15
  import 'ethers';
16
16
  import { requiresTwoStepAuthentication } from '../../functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js';
17
+ import '../../../shared/consts/index.js';
17
18
  import { useConnectAndSign } from '../authenticationHooks/useConnectAndSign/useConnectAndSign.js';
18
19
  import '../../../config/ApiEndpoint.js';
19
- import '../../../shared/consts/index.js';
20
20
  import { useConnectAndSignSplitSteps } from '../authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
21
21
  import { isSelectedWalletAlreadyConnected } from '../../functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js';
22
22
 
@@ -8,40 +8,42 @@ var React = require('react');
8
8
  var SignMessageConfirmationModal = require('../../../modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs');
9
9
  var TransactionConfirmationModal = require('../../../modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs');
10
10
  var useConfirmationModal = require('../useConfirmationModal/useConfirmationModal.cjs');
11
- require('../../constants/colors.cjs');
12
- require('@dynamic-labs/multi-wallet');
13
- require('@dynamic-labs/utils');
14
- var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
15
- require('@dynamic-labs/wallet-connector-core');
16
- require('@dynamic-labs/sdk-api');
17
11
 
18
12
  const useWalletUiUtils = ({ appLogoUrl, appName, getAppOrigin, }) => {
19
- const fakeSignerRef = React.useRef('disabled');
13
+ const confirmationStateRef = React.useRef('enabled');
20
14
  const { modal: sendTransactionModal, open: openSendTransaction } = useConfirmationModal.useConfirmationModal({
21
15
  elementId: 'dynamic-send-transaction',
22
16
  });
23
17
  const { modal, open: openSignMessage } = useConfirmationModal.useConfirmationModal({
24
18
  elementId: 'dynamic-sign-message',
25
19
  });
20
+ const shouldConfirmAction = React.useCallback(() => {
21
+ if (confirmationStateRef.current === 'disabled') {
22
+ confirmationStateRef.current = 'enabled';
23
+ return false;
24
+ }
25
+ return true;
26
+ }, [confirmationStateRef]);
26
27
  const signMessage = React.useCallback(({ message, handler }) => {
27
- const jwt = getAuthToken.getAuthToken();
28
- if (!jwt && fakeSignerRef.current === 'enabled') {
29
- fakeSignerRef.current = 'disabled';
28
+ if (!shouldConfirmAction()) {
30
29
  return handler(message);
31
30
  }
32
31
  return openSignMessage((resolve, reject) => (jsxRuntime.jsx(SignMessageConfirmationModal.SignMessageConfirmationModal, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: getAppOrigin(), message: message, handler: handler, onSignMessage: resolve, onReject: reject })));
33
- }, [appLogoUrl, appName, getAppOrigin, openSignMessage]);
32
+ }, [appLogoUrl, appName, getAppOrigin, openSignMessage, shouldConfirmAction]);
34
33
  const sendTransaction = React.useCallback(({ transaction, handler, provider }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
35
- return openSendTransaction((resolve, reject) => (jsxRuntime.jsx(TransactionConfirmationModal.TransactionConfirmationModal, { title: 'Send Transaction', appLogoUrl: appLogoUrl, appName: appName, appOrigin: getAppOrigin(), transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
36
- }), [appLogoUrl, appName, getAppOrigin, openSendTransaction]);
37
- const enableInternalSign = React.useCallback(() => {
38
- fakeSignerRef.current = 'enabled';
34
+ if (!shouldConfirmAction()) {
35
+ return handler(transaction);
36
+ }
37
+ return openSendTransaction((resolve, reject) => (jsxRuntime.jsx(TransactionConfirmationModal.TransactionConfirmationModal, { title: 'Send Transaction', transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
38
+ }), [openSendTransaction, shouldConfirmAction]);
39
+ const disabledConfirmationOnce = React.useCallback(() => {
40
+ confirmationStateRef.current = 'disabled';
39
41
  }, []);
40
42
  const walletUiUtils = React.useMemo(() => ({
41
- enableInternalSign,
43
+ disabledConfirmationOnce,
42
44
  sendTransaction,
43
45
  signMessage,
44
- }), [signMessage, enableInternalSign, sendTransaction]);
46
+ }), [signMessage, disabledConfirmationOnce, sendTransaction]);
45
47
  return React.useMemo(() => [modal || sendTransactionModal, walletUiUtils], [modal, sendTransactionModal, walletUiUtils]);
46
48
  };
47
49
 
@@ -4,40 +4,42 @@ import { useRef, useCallback, useMemo } from 'react';
4
4
  import { SignMessageConfirmationModal } from '../../../modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js';
5
5
  import { TransactionConfirmationModal } from '../../../modals/TransactionConfirmationModal/TransactionConfirmationModal.js';
6
6
  import { useConfirmationModal } from '../useConfirmationModal/useConfirmationModal.js';
7
- import '../../constants/colors.js';
8
- import '@dynamic-labs/multi-wallet';
9
- import '@dynamic-labs/utils';
10
- import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
11
- import '@dynamic-labs/wallet-connector-core';
12
- import '@dynamic-labs/sdk-api';
13
7
 
14
8
  const useWalletUiUtils = ({ appLogoUrl, appName, getAppOrigin, }) => {
15
- const fakeSignerRef = useRef('disabled');
9
+ const confirmationStateRef = useRef('enabled');
16
10
  const { modal: sendTransactionModal, open: openSendTransaction } = useConfirmationModal({
17
11
  elementId: 'dynamic-send-transaction',
18
12
  });
19
13
  const { modal, open: openSignMessage } = useConfirmationModal({
20
14
  elementId: 'dynamic-sign-message',
21
15
  });
16
+ const shouldConfirmAction = useCallback(() => {
17
+ if (confirmationStateRef.current === 'disabled') {
18
+ confirmationStateRef.current = 'enabled';
19
+ return false;
20
+ }
21
+ return true;
22
+ }, [confirmationStateRef]);
22
23
  const signMessage = useCallback(({ message, handler }) => {
23
- const jwt = getAuthToken();
24
- if (!jwt && fakeSignerRef.current === 'enabled') {
25
- fakeSignerRef.current = 'disabled';
24
+ if (!shouldConfirmAction()) {
26
25
  return handler(message);
27
26
  }
28
27
  return openSignMessage((resolve, reject) => (jsx(SignMessageConfirmationModal, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: getAppOrigin(), message: message, handler: handler, onSignMessage: resolve, onReject: reject })));
29
- }, [appLogoUrl, appName, getAppOrigin, openSignMessage]);
28
+ }, [appLogoUrl, appName, getAppOrigin, openSignMessage, shouldConfirmAction]);
30
29
  const sendTransaction = useCallback(({ transaction, handler, provider }) => __awaiter(void 0, void 0, void 0, function* () {
31
- return openSendTransaction((resolve, reject) => (jsx(TransactionConfirmationModal, { title: 'Send Transaction', appLogoUrl: appLogoUrl, appName: appName, appOrigin: getAppOrigin(), transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
32
- }), [appLogoUrl, appName, getAppOrigin, openSendTransaction]);
33
- const enableInternalSign = useCallback(() => {
34
- fakeSignerRef.current = 'enabled';
30
+ if (!shouldConfirmAction()) {
31
+ return handler(transaction);
32
+ }
33
+ return openSendTransaction((resolve, reject) => (jsx(TransactionConfirmationModal, { title: 'Send Transaction', transaction: transaction, handler: handler, onTransactionResponseSuccess: resolve, onReject: reject, provider: provider })));
34
+ }), [openSendTransaction, shouldConfirmAction]);
35
+ const disabledConfirmationOnce = useCallback(() => {
36
+ confirmationStateRef.current = 'disabled';
35
37
  }, []);
36
38
  const walletUiUtils = useMemo(() => ({
37
- enableInternalSign,
39
+ disabledConfirmationOnce,
38
40
  sendTransaction,
39
41
  signMessage,
40
- }), [signMessage, enableInternalSign, sendTransaction]);
42
+ }), [signMessage, disabledConfirmationOnce, sendTransaction]);
41
43
  return useMemo(() => [modal || sendTransactionModal, walletUiUtils], [modal, sendTransactionModal, walletUiUtils]);
42
44
  };
43
45
 
@@ -2,50 +2,40 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _tslib = require('../../../../../_virtual/_tslib.cjs');
6
5
  var React = require('react');
7
6
  var data = require('../../../views/WalletList/data.cjs');
8
7
 
9
8
  const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }) => {
10
- const [wallets, setWallets] = React.useState([]);
11
- React.useEffect(() => {
12
- const getWalletList = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
13
- if (projectSettings) {
14
- const installedWallets = yield data.getInstalledWallets(projectSettings, {
15
- appLogoUrl,
16
- appName,
17
- customerApiProviders: projectSettings.providers || [],
18
- flowNetwork,
19
- networkConfigurations,
20
- skipMemo: true,
21
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
22
- walletUiUtils,
23
- });
24
- const notInstalledWallets = yield data.getNotInstalledWallets(projectSettings, {
25
- appLogoUrl,
26
- appName,
27
- customerApiProviders: projectSettings.providers || [],
28
- flowNetwork,
29
- networkConfigurations,
30
- skipMemo: true,
31
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
32
- walletUiUtils,
33
- });
34
- const unfilteredWallets = [
35
- ...installedWallets,
36
- ...notInstalledWallets,
37
- ];
38
- setWallets(unfilteredWallets);
39
- }
9
+ const wallets = React.useMemo(() => {
10
+ if (!projectSettings)
11
+ return [];
12
+ const installedWallets = data.getInstalledWallets(projectSettings, {
13
+ appLogoUrl,
14
+ appName,
15
+ customerApiProviders: projectSettings.providers || [],
16
+ flowNetwork,
17
+ networkConfigurations,
18
+ skipMemo: true,
19
+ walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
20
+ walletUiUtils,
40
21
  });
41
- getWalletList();
42
- },
43
- // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
44
- [
45
- projectSettings,
22
+ const notInstalledWallets = data.getNotInstalledWallets(projectSettings, {
23
+ appLogoUrl,
24
+ appName,
25
+ customerApiProviders: projectSettings.providers || [],
26
+ flowNetwork,
27
+ networkConfigurations,
28
+ skipMemo: true,
29
+ walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
30
+ walletUiUtils,
31
+ });
32
+ return [...installedWallets, ...notInstalledWallets];
33
+ // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
34
+ }, [
46
35
  appLogoUrl,
47
36
  appName,
48
37
  networkConfigurations,
38
+ projectSettings,
49
39
  walletConnectorsProp,
50
40
  flowNetwork,
51
41
  ]);
@@ -1,7 +1,6 @@
1
1
  import { ProjectSettings } from '@dynamic-labs/sdk-api';
2
2
  import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
3
3
  import { WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
4
- import { WalletOption } from '../../../shared';
5
4
  type Props = {
6
5
  appLogoUrl?: string;
7
6
  appName?: string;
@@ -12,6 +11,6 @@ type Props = {
12
11
  walletUiUtils: WalletUiUtils;
13
12
  };
14
13
  export declare const useWallets: ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }: Props) => {
15
- wallets: WalletOption[];
14
+ wallets: import("../../../shared").WalletOption[];
16
15
  };
17
16
  export {};
@@ -1,47 +1,37 @@
1
- import { __awaiter } from '../../../../../_virtual/_tslib.js';
2
- import { useState, useEffect } from 'react';
1
+ import { useMemo } from 'react';
3
2
  import { getInstalledWallets, getNotInstalledWallets } from '../../../views/WalletList/data.js';
4
3
 
5
4
  const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }) => {
6
- const [wallets, setWallets] = useState([]);
7
- useEffect(() => {
8
- const getWalletList = () => __awaiter(void 0, void 0, void 0, function* () {
9
- if (projectSettings) {
10
- const installedWallets = yield getInstalledWallets(projectSettings, {
11
- appLogoUrl,
12
- appName,
13
- customerApiProviders: projectSettings.providers || [],
14
- flowNetwork,
15
- networkConfigurations,
16
- skipMemo: true,
17
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
18
- walletUiUtils,
19
- });
20
- const notInstalledWallets = yield getNotInstalledWallets(projectSettings, {
21
- appLogoUrl,
22
- appName,
23
- customerApiProviders: projectSettings.providers || [],
24
- flowNetwork,
25
- networkConfigurations,
26
- skipMemo: true,
27
- walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
28
- walletUiUtils,
29
- });
30
- const unfilteredWallets = [
31
- ...installedWallets,
32
- ...notInstalledWallets,
33
- ];
34
- setWallets(unfilteredWallets);
35
- }
5
+ const wallets = useMemo(() => {
6
+ if (!projectSettings)
7
+ return [];
8
+ const installedWallets = getInstalledWallets(projectSettings, {
9
+ appLogoUrl,
10
+ appName,
11
+ customerApiProviders: projectSettings.providers || [],
12
+ flowNetwork,
13
+ networkConfigurations,
14
+ skipMemo: true,
15
+ walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
16
+ walletUiUtils,
36
17
  });
37
- getWalletList();
38
- },
39
- // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
40
- [
41
- projectSettings,
18
+ const notInstalledWallets = getNotInstalledWallets(projectSettings, {
19
+ appLogoUrl,
20
+ appName,
21
+ customerApiProviders: projectSettings.providers || [],
22
+ flowNetwork,
23
+ networkConfigurations,
24
+ skipMemo: true,
25
+ walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
26
+ walletUiUtils,
27
+ });
28
+ return [...installedWallets, ...notInstalledWallets];
29
+ // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
30
+ }, [
42
31
  appLogoUrl,
43
32
  appName,
44
33
  networkConfigurations,
34
+ projectSettings,
45
35
  walletConnectorsProp,
46
36
  flowNetwork,
47
37
  ]);
@@ -37,6 +37,8 @@ require('../../components/Alert/Alert.cjs');
37
37
  var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
38
38
  require('../../components/Popper/Popper/Popper.cjs');
39
39
  require('../../components/Popper/PopperContext/PopperContext.cjs');
40
+ require('@dynamic-labs/wallet-book');
41
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
40
42
  var Captcha = require('../../components/Captcha/Captcha.cjs');
41
43
 
42
44
  const CaptchaVerifyUser = () => {
@@ -33,6 +33,8 @@ import '../../components/Alert/Alert.js';
33
33
  import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
34
34
  import '../../components/Popper/Popper/Popper.js';
35
35
  import '../../components/Popper/PopperContext/PopperContext.js';
36
+ import '@dynamic-labs/wallet-book';
37
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
36
38
  import { Captcha } from '../../components/Captcha/Captcha.js';
37
39
 
38
40
  const CaptchaVerifyUser = () => {
@@ -39,6 +39,7 @@ require('../../components/Alert/Alert.cjs');
39
39
  var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
40
40
  require('../../components/Popper/Popper/Popper.cjs');
41
41
  require('../../components/Popper/PopperContext/PopperContext.cjs');
42
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
42
43
  var NetworkPicker = require('../../components/NetworkPicker/NetworkPicker.cjs');
43
44
  var UserAddress = require('../../components/UserAddress/UserAddress.cjs');
44
45
  var useFetchNameService = require('../../widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs');
@@ -35,6 +35,7 @@ import '../../components/Alert/Alert.js';
35
35
  import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
36
36
  import '../../components/Popper/Popper/Popper.js';
37
37
  import '../../components/Popper/PopperContext/PopperContext.js';
38
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
38
39
  import { NetworkPicker } from '../../components/NetworkPicker/NetworkPicker.js';
39
40
  import { UserAddress } from '../../components/UserAddress/UserAddress.js';
40
41
  import { useFetchNameService } from '../../widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js';
@@ -36,6 +36,8 @@ require('../../../components/IconButton/IconButton.cjs');
36
36
  require('../../../components/Alert/Alert.cjs');
37
37
  require('../../../components/Popper/Popper/Popper.cjs');
38
38
  require('../../../components/Popper/PopperContext/PopperContext.cjs');
39
+ require('@dynamic-labs/wallet-book');
40
+ require('../../../components/SendBalanceForm/SendBalanceForm.cjs');
39
41
  var index = require('../UserDataFields/index.cjs');
40
42
  var useUserDataForm = require('../../../utils/hooks/useUserDataForm/useUserDataForm.cjs');
41
43
 
@@ -32,6 +32,8 @@ import '../../../components/IconButton/IconButton.js';
32
32
  import '../../../components/Alert/Alert.js';
33
33
  import '../../../components/Popper/Popper/Popper.js';
34
34
  import '../../../components/Popper/PopperContext/PopperContext.js';
35
+ import '@dynamic-labs/wallet-book';
36
+ import '../../../components/SendBalanceForm/SendBalanceForm.js';
35
37
  import { UserDataFields } from '../UserDataFields/index.js';
36
38
  import { useUserDataForm } from '../../../utils/hooks/useUserDataForm/useUserDataForm.js';
37
39
 
@@ -38,6 +38,8 @@ require('../../../components/IconButton/IconButton.cjs');
38
38
  require('../../../components/Alert/Alert.cjs');
39
39
  require('../../../components/Popper/Popper/Popper.cjs');
40
40
  require('../../../components/Popper/PopperContext/PopperContext.cjs');
41
+ require('@dynamic-labs/wallet-book');
42
+ require('../../../components/SendBalanceForm/SendBalanceForm.cjs');
41
43
  var fieldsConfig = require('../fieldsConfig.cjs');
42
44
  var getDisplayErrorMessage = require('./utils/getDisplayErrorMessage/getDisplayErrorMessage.cjs');
43
45
 
@@ -34,6 +34,8 @@ import '../../../components/IconButton/IconButton.js';
34
34
  import '../../../components/Alert/Alert.js';
35
35
  import '../../../components/Popper/Popper/Popper.js';
36
36
  import '../../../components/Popper/PopperContext/PopperContext.js';
37
+ import '@dynamic-labs/wallet-book';
38
+ import '../../../components/SendBalanceForm/SendBalanceForm.js';
37
39
  import { fieldsConfig } from '../fieldsConfig.js';
38
40
  import { getDisplayErrorMessage } from './utils/getDisplayErrorMessage/getDisplayErrorMessage.js';
39
41