@dynamic-labs/sdk-react-core 0.17.0-RC.16 → 0.17.0-RC.18

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 (315) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +8 -8
  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 +6 -1
  15. package/src/lib/components/Divider/Divider.d.ts +6 -2
  16. package/src/lib/components/Divider/Divider.js +6 -1
  17. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
  18. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
  19. package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
  20. package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
  21. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
  22. package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
  23. package/src/lib/components/Input/Input.cjs +10 -6
  24. package/src/lib/components/Input/Input.js +10 -6
  25. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +2 -0
  26. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +2 -0
  27. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -0
  28. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -0
  29. package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
  30. package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
  31. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
  32. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
  33. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
  34. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
  35. package/src/lib/components/OverlayCard/OverlayCard.cjs +2 -0
  36. package/src/lib/components/OverlayCard/OverlayCard.js +2 -0
  37. package/src/lib/components/Portal/Portal.cjs +2 -0
  38. package/src/lib/components/Portal/Portal.js +2 -0
  39. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +24 -0
  40. package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +10 -0
  41. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +22 -0
  42. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +16 -0
  43. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +8 -0
  44. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/index.d.ts +1 -0
  45. package/src/lib/components/SendBalancePageLayout/components/index.d.ts +1 -0
  46. package/src/lib/components/SendBalancePageLayout/index.d.ts +2 -0
  47. package/src/lib/components/Tooltip/Tooltip.cjs +2 -0
  48. package/src/lib/components/Tooltip/Tooltip.js +2 -0
  49. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +40 -0
  50. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +17 -0
  51. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +36 -0
  52. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +11 -0
  53. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +12 -0
  54. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +7 -0
  55. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/index.d.ts +1 -0
  56. package/src/lib/components/TransactionConfirmationPageLayout/components/index.d.ts +1 -0
  57. package/src/lib/components/TransactionConfirmationPageLayout/index.d.ts +2 -0
  58. package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +11 -0
  59. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +11 -0
  60. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +2 -0
  61. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +2 -0
  62. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -0
  63. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
  64. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
  65. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
  66. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -0
  67. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -0
  68. package/src/lib/components/index.d.ts +2 -0
  69. package/src/lib/context/DynamicContext/DynamicContext.cjs +22 -9
  70. package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -0
  71. package/src/lib/context/DynamicContext/DynamicContext.js +22 -9
  72. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
  73. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
  74. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +2 -0
  75. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +2 -0
  76. package/src/lib/context/QrCodeContext/QrCodeContext.cjs +2 -0
  77. package/src/lib/context/QrCodeContext/QrCodeContext.js +2 -0
  78. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +5 -2
  79. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -2
  80. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
  81. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
  82. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +2 -0
  83. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +2 -0
  84. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +2 -0
  85. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +2 -0
  86. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
  87. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
  88. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +1 -0
  89. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +1 -0
  90. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
  91. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
  92. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -0
  93. package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -0
  94. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
  95. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
  96. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +25 -80
  97. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +27 -82
  98. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -4
  99. package/src/lib/shared/types/index.d.ts +1 -1
  100. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +2 -1
  101. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +2 -1
  102. package/src/lib/shared/utils/functions/index.d.ts +1 -0
  103. package/src/lib/shared/utils/functions/trimEnd/index.d.ts +1 -0
  104. package/src/lib/shared/utils/functions/trimEnd/trimEnd.cjs +13 -0
  105. package/src/lib/shared/utils/functions/trimEnd/trimEnd.d.ts +1 -0
  106. package/src/lib/shared/utils/functions/trimEnd/trimEnd.js +9 -0
  107. package/src/lib/shared/utils/hooks/index.d.ts +2 -0
  108. package/src/lib/shared/utils/hooks/useIsMounted/index.d.ts +1 -0
  109. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.cjs +18 -0
  110. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.d.ts +1 -0
  111. package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.js +14 -0
  112. package/src/lib/styles/index.shadow.cjs +1 -1
  113. package/src/lib/styles/index.shadow.js +1 -1
  114. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +12 -0
  115. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.d.ts +1 -0
  116. package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +8 -0
  117. package/src/lib/utils/functions/getAppOrigin/index.d.ts +1 -0
  118. package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.d.ts +7 -0
  119. package/src/lib/utils/functions/getReferencedAccount/index.d.ts +1 -0
  120. package/src/lib/utils/functions/index.d.ts +2 -0
  121. package/src/lib/utils/functions/isWalletLinked/index.d.ts +1 -0
  122. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +15 -0
  123. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.d.ts +2 -0
  124. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +11 -0
  125. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
  126. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
  127. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
  128. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
  129. package/src/lib/utils/hooks/multiWallet/index.d.ts +1 -0
  130. package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs +0 -2
  131. package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js +0 -2
  132. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +63 -7
  133. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +8 -1
  134. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +64 -8
  135. package/src/lib/utils/hooks/useConnectedAccountWallet/index.d.ts +1 -0
  136. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +30 -0
  137. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +2 -0
  138. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +26 -0
  139. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
  140. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
  141. package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +8 -0
  142. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +18 -6
  143. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +18 -6
  144. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +8 -8
  145. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +8 -8
  146. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +3 -2
  147. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +3 -2
  148. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +19 -17
  149. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +19 -17
  150. package/src/lib/utils/hooks/useWallets/useWallets.cjs +26 -36
  151. package/src/lib/utils/hooks/useWallets/useWallets.d.ts +1 -2
  152. package/src/lib/utils/hooks/useWallets/useWallets.js +27 -37
  153. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +2 -0
  154. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
  155. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -0
  156. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -0
  157. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -0
  158. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -0
  159. package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
  160. package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
  161. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
  162. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
  163. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
  164. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
  165. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
  166. package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
  167. package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
  168. package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
  169. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -0
  170. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
  171. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +2 -0
  172. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +2 -0
  173. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -0
  174. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -0
  175. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +2 -0
  176. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +2 -0
  177. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -0
  178. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -0
  179. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
  180. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
  181. package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
  182. package/src/lib/views/NoAccess/NoAccess.js +1 -0
  183. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
  184. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
  185. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
  186. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
  187. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
  188. package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
  189. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
  190. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
  191. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
  192. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
  193. package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
  194. package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
  195. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -0
  196. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -0
  197. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +92 -0
  198. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +13 -0
  199. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +88 -0
  200. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.cjs +6 -1
  201. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.d.ts +1 -0
  202. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.js +6 -1
  203. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.cjs +2 -0
  204. package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.js +2 -0
  205. package/src/lib/views/TransactionConfirmationView/index.d.ts +2 -0
  206. package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +2 -0
  207. package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +2 -0
  208. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
  209. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
  210. package/src/lib/views/WalletList/data.cjs +4 -5
  211. package/src/lib/views/WalletList/data.d.ts +2 -2
  212. package/src/lib/views/WalletList/data.js +4 -5
  213. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
  214. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
  215. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
  216. package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
  217. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
  218. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
  219. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -0
  220. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -0
  221. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -0
  222. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -0
  223. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
  224. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
  225. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
  226. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
  227. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -0
  228. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -0
  229. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -0
  230. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -0
  231. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -0
  232. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -0
  233. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +15 -5
  234. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +15 -5
  235. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +2 -0
  236. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +2 -0
  237. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +2 -0
  238. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +2 -0
  239. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
  240. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
  241. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
  242. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
  243. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
  244. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
  245. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
  246. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
  247. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
  248. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
  249. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -0
  250. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -0
  251. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +4 -1
  252. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +4 -1
  253. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
  254. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
  255. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +40 -6
  256. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +2 -1
  257. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +41 -7
  258. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
  259. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
  260. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
  261. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
  262. package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs → prompts/DefaultPromptModal/DefaultPromptModal.cjs} +8 -13
  263. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +13 -0
  264. package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js → prompts/DefaultPromptModal/DefaultPromptModal.js} +8 -13
  265. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
  266. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
  267. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +2 -1
  268. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +2 -1
  269. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +17 -42
  270. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +18 -43
  271. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +42 -0
  272. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.d.ts +7 -0
  273. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +38 -0
  274. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/index.d.ts +1 -0
  275. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +68 -0
  276. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.d.ts +8 -0
  277. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +64 -0
  278. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/index.d.ts +1 -0
  279. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +58 -0
  280. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +2 -0
  281. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +54 -0
  282. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/index.d.ts +1 -0
  283. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +45 -0
  284. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +2 -0
  285. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +41 -0
  286. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/index.d.ts +1 -0
  287. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +65 -0
  288. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +2 -0
  289. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +61 -0
  290. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +2 -33
  291. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +2 -33
  292. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +5 -6
  293. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +6 -7
  294. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +2 -1
  295. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +2 -1
  296. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
  297. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
  298. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
  299. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
  300. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +2 -0
  301. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +2 -0
  302. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
  303. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
  304. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
  305. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
  306. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +0 -2
  307. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.types.d.ts +0 -7
  308. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +0 -61
  309. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.d.ts +0 -7
  310. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +0 -57
  311. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/index.d.ts +0 -1
  312. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/index.d.ts +0 -0
  313. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/index.d.ts +0 -0
  314. /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.d.ts +0 -0
  315. /package/src/lib/widgets/DynamicWidget/{components → prompts/PendingSignModal}/DefaultPendingSignModalContent/index.d.ts +0 -0
@@ -29,6 +29,8 @@ require('../../components/IconButton/IconButton.cjs');
29
29
  require('../../components/Alert/Alert.cjs');
30
30
  require('../../components/Popper/Popper/Popper.cjs');
31
31
  require('../../components/Popper/PopperContext/PopperContext.cjs');
32
+ require('@dynamic-labs/wallet-book');
33
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
32
34
  var useDefaultQrCode = require('../../utils/hooks/useDefaultQrCode/useDefaultQrCode.cjs');
33
35
  require('../MockContext/MockContext.cjs');
34
36
  require('../CaptchaContext/CaptchaContext.cjs');
@@ -25,6 +25,8 @@ import '../../components/IconButton/IconButton.js';
25
25
  import '../../components/Alert/Alert.js';
26
26
  import '../../components/Popper/Popper/Popper.js';
27
27
  import '../../components/Popper/PopperContext/PopperContext.js';
28
+ import '@dynamic-labs/wallet-book';
29
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
28
30
  import { useDefaultQrCode } from '../../utils/hooks/useDefaultQrCode/useDefaultQrCode.js';
29
31
  import '../MockContext/MockContext.js';
30
32
  import '../CaptchaContext/CaptchaContext.js';
@@ -30,6 +30,8 @@ require('../../components/IconButton/IconButton.cjs');
30
30
  require('../../components/Alert/Alert.cjs');
31
31
  require('../../components/Popper/Popper/Popper.cjs');
32
32
  require('../../components/Popper/PopperContext/PopperContext.cjs');
33
+ require('@dynamic-labs/wallet-book');
34
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
33
35
  require('../MockContext/MockContext.cjs');
34
36
  require('../ErrorContext/ErrorContext.cjs');
35
37
  require('../CaptchaContext/CaptchaContext.cjs');
@@ -78,10 +80,11 @@ const SocialRedirectContextProvider = ({ children, }) => {
78
80
  if (!address) {
79
81
  return;
80
82
  }
81
- walletUiUtils.enableInternalSign();
83
+ walletUiUtils.disabledConfirmationOnce();
82
84
  yield verifyWallet({
83
85
  oauth: {
84
86
  accessToken: session.accessToken,
87
+ didToken: session.didToken,
85
88
  provider: providerFromParams,
86
89
  },
87
90
  publicWalletAddress: address,
@@ -89,7 +92,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
89
92
  });
90
93
  setSocialProvider(undefined);
91
94
  setRedirectStatus('success');
92
- })).catch(() => {
95
+ })).catch((error) => {
93
96
  setRedirectStatus('error');
94
97
  });
95
98
  }
@@ -26,6 +26,8 @@ import '../../components/IconButton/IconButton.js';
26
26
  import '../../components/Alert/Alert.js';
27
27
  import '../../components/Popper/Popper/Popper.js';
28
28
  import '../../components/Popper/PopperContext/PopperContext.js';
29
+ import '@dynamic-labs/wallet-book';
30
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
29
31
  import '../MockContext/MockContext.js';
30
32
  import '../ErrorContext/ErrorContext.js';
31
33
  import '../CaptchaContext/CaptchaContext.js';
@@ -74,10 +76,11 @@ const SocialRedirectContextProvider = ({ children, }) => {
74
76
  if (!address) {
75
77
  return;
76
78
  }
77
- walletUiUtils.enableInternalSign();
79
+ walletUiUtils.disabledConfirmationOnce();
78
80
  yield verifyWallet({
79
81
  oauth: {
80
82
  accessToken: session.accessToken,
83
+ didToken: session.didToken,
81
84
  provider: providerFromParams,
82
85
  },
83
86
  publicWalletAddress: address,
@@ -85,7 +88,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
85
88
  });
86
89
  setSocialProvider(undefined);
87
90
  setRedirectStatus('success');
88
- })).catch(() => {
91
+ })).catch((error) => {
89
92
  setRedirectStatus('error');
90
93
  });
91
94
  }
@@ -39,6 +39,8 @@ require('../../components/Alert/Alert.cjs');
39
39
  var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
40
40
  require('../../components/Popper/Popper/Popper.cjs');
41
41
  require('../../components/Popper/PopperContext/PopperContext.cjs');
42
+ require('@dynamic-labs/wallet-book');
43
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
42
44
  var isUserLinkingWallet = require('../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.cjs');
43
45
  require('../../components/OverlayCard/OverlayCard.context.cjs');
44
46
  var OverlayCardTarget = require('../../components/OverlayCard/OverlayCardTarget.cjs');
@@ -35,6 +35,8 @@ import '../../components/Alert/Alert.js';
35
35
  import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
36
36
  import '../../components/Popper/Popper/Popper.js';
37
37
  import '../../components/Popper/PopperContext/PopperContext.js';
38
+ import '@dynamic-labs/wallet-book';
39
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
38
40
  import { isUserLinkingWallet } from '../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.js';
39
41
  import '../../components/OverlayCard/OverlayCard.context.js';
40
42
  import { OverlayCardTarget } from '../../components/OverlayCard/OverlayCardTarget.js';
@@ -37,6 +37,8 @@ require('../../../components/IconButton/IconButton.cjs');
37
37
  require('../../../components/Alert/Alert.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
 
41
43
  const Footer = ({ heading, icon, projectSettings }) => {
42
44
  const { theme } = ThemeContext.useThemeContext();
@@ -33,6 +33,8 @@ import '../../../components/IconButton/IconButton.js';
33
33
  import '../../../components/Alert/Alert.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
 
37
39
  const Footer = ({ heading, icon, projectSettings }) => {
38
40
  const { theme } = useThemeContext();
@@ -33,6 +33,8 @@ require('../../../../../components/IconButton/IconButton.cjs');
33
33
  require('../../../../../components/Alert/Alert.cjs');
34
34
  require('../../../../../components/Popper/Popper/Popper.cjs');
35
35
  require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
36
+ require('@dynamic-labs/wallet-book');
37
+ require('../../../../../components/SendBalanceForm/SendBalanceForm.cjs');
36
38
 
37
39
  const Item = ({ heading, StartIcon, EndIcon, message, url, }) => (jsxRuntime.jsxs("a", Object.assign({ className: 'footer-buttons-item', href: url, rel: 'noopener noreferrer', target: '_blank' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'footer-buttons-item__icon--left' }, { children: jsxRuntime.jsx(StartIcon, {}) })), jsxRuntime.jsxs("div", Object.assign({ className: 'footer-buttons-item__typography' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h2', weight: 'regular', color: 'primary', variant: 'body_normal' }, { children: heading })), message && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'p', weight: 'regular', color: 'secondary' }, { children: message })))] })), EndIcon && jsxRuntime.jsx(EndIcon, { style: { height: '1.5rem', width: '1.5rem' } })] })));
38
40
 
@@ -29,6 +29,8 @@ import '../../../../../components/IconButton/IconButton.js';
29
29
  import '../../../../../components/Alert/Alert.js';
30
30
  import '../../../../../components/Popper/Popper/Popper.js';
31
31
  import '../../../../../components/Popper/PopperContext/PopperContext.js';
32
+ import '@dynamic-labs/wallet-book';
33
+ import '../../../../../components/SendBalanceForm/SendBalanceForm.js';
32
34
 
33
35
  const Item = ({ heading, StartIcon, EndIcon, message, url, }) => (jsxs("a", Object.assign({ className: 'footer-buttons-item', href: url, rel: 'noopener noreferrer', target: '_blank' }, { children: [jsx("div", Object.assign({ className: 'footer-buttons-item__icon--left' }, { children: jsx(StartIcon, {}) })), jsxs("div", Object.assign({ className: 'footer-buttons-item__typography' }, { children: [jsx(Typography, Object.assign({ as: 'h2', weight: 'regular', color: 'primary', variant: 'body_normal' }, { children: heading })), message && (jsx(Typography, Object.assign({ as: 'p', weight: 'regular', color: 'secondary' }, { children: message })))] })), EndIcon && jsx(EndIcon, { style: { height: '1.5rem', width: '1.5rem' } })] })));
34
36
 
@@ -35,6 +35,8 @@ require('../../../../../components/IconButton/IconButton.cjs');
35
35
  require('../../../../../components/Alert/Alert.cjs');
36
36
  require('../../../../../components/Popper/Popper/Popper.cjs');
37
37
  require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
38
+ require('@dynamic-labs/wallet-book');
39
+ require('../../../../../components/SendBalanceForm/SendBalanceForm.cjs');
38
40
  var NewToWeb3WalletItem = require('../NewToWeb3WalletItem/NewToWeb3WalletItem.cjs');
39
41
 
40
42
  const WalletExtensionOrAppContinueButton = ({ wallet, selectedUrl, }) => {
@@ -31,6 +31,8 @@ import '../../../../../components/IconButton/IconButton.js';
31
31
  import '../../../../../components/Alert/Alert.js';
32
32
  import '../../../../../components/Popper/Popper/Popper.js';
33
33
  import '../../../../../components/Popper/PopperContext/PopperContext.js';
34
+ import '@dynamic-labs/wallet-book';
35
+ import '../../../../../components/SendBalanceForm/SendBalanceForm.js';
34
36
  import { NewToWeb3WalletItem } from '../NewToWeb3WalletItem/NewToWeb3WalletItem.js';
35
37
 
36
38
  const WalletExtensionOrAppContinueButton = ({ wallet, selectedUrl, }) => {
@@ -39,6 +39,7 @@ var EnterTileAnimation = require('../../../../components/EnterTileAnimation/Ente
39
39
  require('../../../../components/Alert/Alert.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 NewToWeb3WalletItem = require('./NewToWeb3WalletItem/NewToWeb3WalletItem.cjs');
43
44
  var Item = require('./Item/Item.cjs');
44
45
  var WalletExtensionOrAppContinueButton = require('./WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs');
@@ -35,6 +35,7 @@ import { EnterTileAnimation } from '../../../../components/EnterTileAnimation/En
35
35
  import '../../../../components/Alert/Alert.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 { NewToWeb3WalletItem } from './NewToWeb3WalletItem/NewToWeb3WalletItem.js';
39
40
  import { Item } from './Item/Item.js';
40
41
  import { WalletExtensionOrAppContinueButton } from './WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js';
@@ -39,6 +39,8 @@ require('../../../../components/Alert/Alert.cjs');
39
39
  var PoweredByDynamic = require('../../../../components/PoweredByDynamic/PoweredByDynamic.cjs');
40
40
  require('../../../../components/Popper/Popper/Popper.cjs');
41
41
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
42
+ require('@dynamic-labs/wallet-book');
43
+ require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
42
44
 
43
45
  const WalletMoreInfoContent = ({ appName, variant, walletName, }) => {
44
46
  const defaultSignContent = {
@@ -35,6 +35,8 @@ import '../../../../components/Alert/Alert.js';
35
35
  import { PoweredByDynamic } from '../../../../components/PoweredByDynamic/PoweredByDynamic.js';
36
36
  import '../../../../components/Popper/Popper/Popper.js';
37
37
  import '../../../../components/Popper/PopperContext/PopperContext.js';
38
+ import '@dynamic-labs/wallet-book';
39
+ import '../../../../components/SendBalanceForm/SendBalanceForm.js';
38
40
 
39
41
  const WalletMoreInfoContent = ({ appName, variant, walletName, }) => {
40
42
  const defaultSignContent = {
@@ -37,6 +37,8 @@ require('../../../components/Alert/Alert.cjs');
37
37
  require('../../../components/Popper/Popper/Popper.cjs');
38
38
  require('../../../components/Popper/PopperContext/PopperContext.cjs');
39
39
  var Skeleton = require('../../../components/Skeleton/Skeleton.cjs');
40
+ require('@dynamic-labs/wallet-book');
41
+ require('../../../components/SendBalanceForm/SendBalanceForm.cjs');
40
42
  var QrCodeContext = require('../../../context/QrCodeContext/QrCodeContext.cjs');
41
43
 
42
44
  const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
@@ -33,6 +33,8 @@ import '../../../components/Alert/Alert.js';
33
33
  import '../../../components/Popper/Popper/Popper.js';
34
34
  import '../../../components/Popper/PopperContext/PopperContext.js';
35
35
  import { Skeleton } from '../../../components/Skeleton/Skeleton.js';
36
+ import '@dynamic-labs/wallet-book';
37
+ import '../../../components/SendBalanceForm/SendBalanceForm.js';
36
38
  import { useQrCodeContext } from '../../../context/QrCodeContext/QrCodeContext.js';
37
39
 
38
40
  const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
@@ -46,6 +46,8 @@ require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
46
46
  var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
47
47
  require('../../components/Popper/Popper/Popper.cjs');
48
48
  require('../../components/Popper/PopperContext/PopperContext.cjs');
49
+ require('@dynamic-labs/wallet-book');
50
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
49
51
 
50
52
  const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message, handler, onReject, onSignMessage, }) => {
51
53
  usePreventPageScroll.usePreventPageScroll(true);
@@ -42,6 +42,8 @@ import '../../components/Transition/OpacityTransition/OpacityTransition.js';
42
42
  import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
43
43
  import '../../components/Popper/Popper/Popper.js';
44
44
  import '../../components/Popper/PopperContext/PopperContext.js';
45
+ import '@dynamic-labs/wallet-book';
46
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
45
47
 
46
48
  const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message, handler, onReject, onSignMessage, }) => {
47
49
  usePreventPageScroll(true);
@@ -4,115 +4,60 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
- var ethers = require('ethers');
8
- var utils = require('@dynamic-labs/utils');
9
- var Typography = require('../../components/Typography/Typography.cjs');
10
7
  require('@dynamic-labs/sdk-api');
11
8
  require('../../shared/logger.cjs');
12
- var getChainIcon = require('../../shared/utils/functions/chain/getChainIcon.cjs');
9
+ require('@dynamic-labs/iconic');
13
10
  require('@dynamic-labs/wallet-connector-core');
14
- var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
11
+ require('../../context/ViewContext/ViewContext.cjs');
12
+ require('@dynamic-labs/utils');
15
13
  require('../../utils/constants/colors.cjs');
16
- var formatBigNumber = require('../../shared/utils/functions/formatBigNumber/formatBigNumber.cjs');
14
+ require('ethers');
17
15
  var usePreventPageScroll = require('../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
18
- require('@dynamic-labs/iconic');
19
- require('../../context/ViewContext/ViewContext.cjs');
20
- var close = require('../../shared/assets/close.cjs');
21
- var signCircle = require('../../shared/assets/sign-circle.cjs');
22
16
  var index = require('../../shared/consts/index.cjs');
23
- var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
17
+ require('../../context/DynamicContext/DynamicContext.cjs');
24
18
  require('@dynamic-labs/multi-wallet');
25
19
  require('../../components/ShadowDOM/ShadowDOM.cjs');
26
20
  require('../../context/ThemeContext/ThemeContext.cjs');
27
- var Icon = require('../../components/Icon/Icon.cjs');
28
21
  var Portal = require('../../components/Portal/Portal.cjs');
29
22
  require('react-dom');
30
23
  require('../../config/ApiEndpoint.cjs');
31
24
  require('@dynamic-labs/rpc-providers');
32
25
  require('../../context/ErrorContext/ErrorContext.cjs');
33
- var useFetchCurrency = require('../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs');
34
- var transactionErrorMessage = require('./helpers/transactionErrorMessage.cjs');
35
- var useTransactionData = require('./hooks/useTransactionData/useTransactionData.cjs');
26
+ var TransactionConfirmationView = require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
36
27
  require('../../context/MockContext/MockContext.cjs');
37
28
  require('../../context/CaptchaContext/CaptchaContext.cjs');
38
- var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
39
- var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
40
29
  require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
41
- var Button = require('../../components/Button/Button.cjs');
42
- var IconButton = require('../../components/IconButton/IconButton.cjs');
43
- var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
44
- var Alert = require('../../components/Alert/Alert.cjs');
45
- var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
46
- var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
47
- var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
48
- var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
30
+ require('../../components/IconButton/IconButton.cjs');
31
+ require('../../components/Alert/Alert.cjs');
49
32
  require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
50
33
  require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
51
34
  require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
52
- var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
53
35
  require('../../components/Popper/Popper/Popper.cjs');
54
36
  require('../../components/Popper/PopperContext/PopperContext.cjs');
37
+ require('@dynamic-labs/wallet-book');
38
+ require('../../components/SendBalanceForm/SendBalanceForm.cjs');
55
39
 
56
- const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
40
+ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, }) => {
57
41
  usePreventPageScroll.usePreventPageScroll(true);
58
- const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
59
- const didConfirmRef = React.useRef(false);
60
42
  const [show, setShow] = React.useState(true);
61
- if (!primaryWallet) {
62
- throw new utils.DynamicError('Primary wallet is not available, transaction cannot be displayed');
63
- }
64
- const { data: balance } = usePromise.usePromise(() => primaryWallet.connector
65
- .getBalance()
66
- .then((balanceText) => balanceText ? ethers.ethers.utils.parseEther(balanceText) : undefined));
67
- const [currencySymbol] = useFetchCurrency.useFetchCurrency(primaryWallet.connector);
68
- const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation.useMutation(() => handler(transaction), {
69
- onSuccess: () => {
70
- didConfirmRef.current = true;
71
- setShow(false);
72
- },
73
- });
74
- const { isLoading: isLoadingTransaction, isTransactionFromAddressLoading, isTransactionToAddressLoading, transactionFromAddress, transactionToAddress, isEffectiveValueLoading, transactionValue, gasEstimate, isGasPriceLoading, total, } = useTransactionData.useTransactionData({
75
- provider,
76
- transaction,
77
- });
78
- const hasInsufficientFunds = React.useMemo(() => {
79
- if (balance === undefined || total === undefined)
80
- return false;
81
- return total.gt(balance);
82
- }, [balance, total]);
83
- const missingFunds = React.useMemo(() => {
84
- if (balance === undefined || total === undefined)
85
- return undefined;
86
- return total.sub(balance);
87
- }, [balance, total]);
88
- const handleOnReject = React.useCallback(() => {
89
- didConfirmRef.current = false;
43
+ const errorRef = React.useRef(null);
44
+ const transactionResponseRef = React.useRef(null);
45
+ const closeModal = React.useCallback(() => {
90
46
  setShow(false);
91
47
  }, [setShow]);
92
48
  const handleOnModalUnmount = React.useCallback(() => {
93
- if (transactionResponse) {
94
- return onTransactionResponseSuccess(transactionResponse);
49
+ if (transactionResponseRef.current) {
50
+ return onTransactionResponseSuccess(transactionResponseRef.current);
95
51
  }
96
- onReject(transactionError || new Error('user rejected transaction'));
97
- }, [
98
- transactionResponse,
99
- transactionError,
100
- onTransactionResponseSuccess,
101
- onReject,
102
- ]);
103
- const ChainIcon = getChainIcon.getChainIcon('evm');
104
- const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
105
- return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
52
+ onReject(errorRef.current || new Error('user rejected transaction'));
53
+ }, [onTransactionResponseSuccess, onReject]);
54
+ return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: closeModal, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
106
55
  onUnmount: handleOnModalUnmount,
107
- } }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'brand-primary' }, { children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) }))), iconSize: 64, isSpinning: true }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__body' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'transaction-confirmation__title' }, { children: title })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: transactionError && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__error' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: transactionErrorMessage.transactionErrorMessage(transactionError) })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__content' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__app-origin-tile' }, { children: jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-info' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "From (You)" })), isTransactionFromAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isTransactionFromAddressLoading &&
108
- transactionFromAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(transactionFromAddress, 4, 4) })), !isTransactionFromAddressLoading &&
109
- !transactionFromAddress && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "To" })), isTransactionToAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isTransactionToAddressLoading && !transactionToAddress && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isTransactionToAddressLoading && transactionToAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(transactionToAddress, 4, 4) }))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Amount" })), isEffectiveValueLoading && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}) }, { children: "--" }))), !isEffectiveValueLoading && transactionValue && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-amount', title: formatBigNumber.formatBigNumber(transactionValue) }, { children: formatBigNumber.formatBigNumber(transactionValue, 10) }))), !isEffectiveValueLoading && !transactionValue && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular', symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}) }, { children: "0" })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Gas (estimated)" })), isGasPriceLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isGasPriceLoading && !gasEstimate && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isGasPriceLoading && gasEstimate && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-gas-free', title: formatBigNumber.formatBigNumber(gasEstimate) }, { children: formatBigNumber.formatBigNumber(gasEstimate, 10) })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Total" })), total && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-total', title: formatBigNumber.formatBigNumber(total) }, { children: formatBigNumber.formatBigNumber(total, 10) }))), !total && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] }))] }))] })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: hasInsufficientFunds && missingFunds && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__warning' }, { children: jsxRuntime.jsxs(Alert.Alert, Object.assign({ icon: 'error', variant: 'warning', contentDataTestId: 'warning_content' }, { children: ["Insufficient funds due to gas price increase from estimate. Please add ", formatBigNumber.formatBigNumber(missingFunds, 5), ' ', currencySymbol, " to continue."] })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__actions' }, { children: [jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', buttonRounded: 'default', disabled: isLoading }, { children: "Cancel" })), jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', onClick: () => sendTransaction(), expanded: true, buttonRounded: 'default', loading: isLoading, disabled: isLoadingTransaction || hasInsufficientFunds }, { children: buttonText }))] })), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })) })));
110
- };
111
- const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxRuntime.jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
112
- alignItems: 'center',
113
- display: 'flex',
114
- gap: '0.25rem',
115
- minWidth: 0,
116
- } }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ title: title, color: color, variant: 'body_normal', weight: weight, truncate: true }, { children: children })), symbol && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', color: 'secondary', weight: 'regular' }, { children: symbol }))), icon && jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: icon }))] })));
56
+ } }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation' }, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { provider: provider, transaction: transaction, title: title, mutation: () => handler(transaction), onClickClose: closeModal, onError: (error) => (errorRef.current = error), onSuccess: (transactionResponse) => {
57
+ errorRef.current = null;
58
+ transactionResponseRef.current = transactionResponse;
59
+ closeModal();
60
+ } }) })) })));
61
+ };
117
62
 
118
63
  exports.TransactionConfirmationModal = TransactionConfirmationModal;
@@ -1,114 +1,59 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useRef, useState, useMemo, useCallback } from 'react';
3
- import { ethers } from 'ethers';
4
- import { DynamicError } from '@dynamic-labs/utils';
5
- import { Typography } from '../../components/Typography/Typography.js';
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useCallback } from 'react';
6
3
  import '@dynamic-labs/sdk-api';
7
4
  import '../../shared/logger.js';
8
- import { getChainIcon } from '../../shared/utils/functions/chain/getChainIcon.js';
5
+ import '@dynamic-labs/iconic';
9
6
  import '@dynamic-labs/wallet-connector-core';
10
- import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
7
+ import '../../context/ViewContext/ViewContext.js';
8
+ import '@dynamic-labs/utils';
11
9
  import '../../utils/constants/colors.js';
12
- import { formatBigNumber } from '../../shared/utils/functions/formatBigNumber/formatBigNumber.js';
10
+ import 'ethers';
13
11
  import { usePreventPageScroll } from '../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js';
14
- import '@dynamic-labs/iconic';
15
- import '../../context/ViewContext/ViewContext.js';
16
- import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
17
- import { ReactComponent as SvgSignCircle } from '../../shared/assets/sign-circle.js';
18
12
  import { authModalZIndex } from '../../shared/consts/index.js';
19
- import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
13
+ import '../../context/DynamicContext/DynamicContext.js';
20
14
  import '@dynamic-labs/multi-wallet';
21
15
  import '../../components/ShadowDOM/ShadowDOM.js';
22
16
  import '../../context/ThemeContext/ThemeContext.js';
23
- import { Icon } from '../../components/Icon/Icon.js';
24
17
  import { Portal } from '../../components/Portal/Portal.js';
25
18
  import 'react-dom';
26
19
  import '../../config/ApiEndpoint.js';
27
20
  import '@dynamic-labs/rpc-providers';
28
21
  import '../../context/ErrorContext/ErrorContext.js';
29
- import { useFetchCurrency } from '../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js';
30
- import { transactionErrorMessage } from './helpers/transactionErrorMessage.js';
31
- import { useTransactionData } from './hooks/useTransactionData/useTransactionData.js';
22
+ import { TransactionConfirmationView } from '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
32
23
  import '../../context/MockContext/MockContext.js';
33
24
  import '../../context/CaptchaContext/CaptchaContext.js';
34
- import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
35
- import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
36
25
  import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
37
- import { Button } from '../../components/Button/Button.js';
38
- import { IconButton } from '../../components/IconButton/IconButton.js';
39
- import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
40
- import { Alert } from '../../components/Alert/Alert.js';
41
- import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
42
- import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
43
- import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
44
- import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
26
+ import '../../components/IconButton/IconButton.js';
27
+ import '../../components/Alert/Alert.js';
45
28
  import '../../components/Transition/ZoomTransition/ZoomTransition.js';
46
29
  import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
47
30
  import '../../components/Transition/OpacityTransition/OpacityTransition.js';
48
- import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
49
31
  import '../../components/Popper/Popper/Popper.js';
50
32
  import '../../components/Popper/PopperContext/PopperContext.js';
33
+ import '@dynamic-labs/wallet-book';
34
+ import '../../components/SendBalanceForm/SendBalanceForm.js';
51
35
 
52
- const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
36
+ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, }) => {
53
37
  usePreventPageScroll(true);
54
- const { primaryWallet } = useInternalDynamicContext();
55
- const didConfirmRef = useRef(false);
56
38
  const [show, setShow] = useState(true);
57
- if (!primaryWallet) {
58
- throw new DynamicError('Primary wallet is not available, transaction cannot be displayed');
59
- }
60
- const { data: balance } = usePromise(() => primaryWallet.connector
61
- .getBalance()
62
- .then((balanceText) => balanceText ? ethers.utils.parseEther(balanceText) : undefined));
63
- const [currencySymbol] = useFetchCurrency(primaryWallet.connector);
64
- const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation(() => handler(transaction), {
65
- onSuccess: () => {
66
- didConfirmRef.current = true;
67
- setShow(false);
68
- },
69
- });
70
- const { isLoading: isLoadingTransaction, isTransactionFromAddressLoading, isTransactionToAddressLoading, transactionFromAddress, transactionToAddress, isEffectiveValueLoading, transactionValue, gasEstimate, isGasPriceLoading, total, } = useTransactionData({
71
- provider,
72
- transaction,
73
- });
74
- const hasInsufficientFunds = useMemo(() => {
75
- if (balance === undefined || total === undefined)
76
- return false;
77
- return total.gt(balance);
78
- }, [balance, total]);
79
- const missingFunds = useMemo(() => {
80
- if (balance === undefined || total === undefined)
81
- return undefined;
82
- return total.sub(balance);
83
- }, [balance, total]);
84
- const handleOnReject = useCallback(() => {
85
- didConfirmRef.current = false;
39
+ const errorRef = useRef(null);
40
+ const transactionResponseRef = useRef(null);
41
+ const closeModal = useCallback(() => {
86
42
  setShow(false);
87
43
  }, [setShow]);
88
44
  const handleOnModalUnmount = useCallback(() => {
89
- if (transactionResponse) {
90
- return onTransactionResponseSuccess(transactionResponse);
45
+ if (transactionResponseRef.current) {
46
+ return onTransactionResponseSuccess(transactionResponseRef.current);
91
47
  }
92
- onReject(transactionError || new Error('user rejected transaction'));
93
- }, [
94
- transactionResponse,
95
- transactionError,
96
- onTransactionResponseSuccess,
97
- onReject,
98
- ]);
99
- const ChainIcon = getChainIcon('evm');
100
- const closeButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
101
- return (jsx(Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
48
+ onReject(errorRef.current || new Error('user rejected transaction'));
49
+ }, [onTransactionResponseSuccess, onReject]);
50
+ return (jsx(Portal, Object.assign({ handleClose: closeModal, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
102
51
  onUnmount: handleOnModalUnmount,
103
- } }, { children: jsxs("div", Object.assign({ className: 'transaction-confirmation' }, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, Object.assign({ color: 'brand-primary' }, { children: jsx(SvgSignCircle, Object.assign({}, props)) }))), iconSize: 64, isSpinning: true }) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__body' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'transaction-confirmation__title' }, { children: title })), jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: transactionError && (jsx("div", Object.assign({ className: 'transaction-confirmation__error' }, { children: jsx(Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: transactionErrorMessage(transactionError) })) }))) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__content' }, { children: [jsx("div", Object.assign({ className: 'transaction-confirmation__app-origin-tile' }, { children: jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-info' }, { children: [jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "From (You)" })), isTransactionFromAddressLoading && jsx(CoinCell, { children: "--" }), !isTransactionFromAddressLoading &&
104
- transactionFromAddress && (jsx(CoinCell, { children: shortenWalletAddress(transactionFromAddress, 4, 4) })), !isTransactionFromAddressLoading &&
105
- !transactionFromAddress && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] })), jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "To" })), isTransactionToAddressLoading && jsx(CoinCell, { children: "--" }), !isTransactionToAddressLoading && !transactionToAddress && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isTransactionToAddressLoading && transactionToAddress && (jsx(CoinCell, { children: shortenWalletAddress(transactionToAddress, 4, 4) }))] })), jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Amount" })), isEffectiveValueLoading && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}) }, { children: "--" }))), !isEffectiveValueLoading && transactionValue && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}), dataTestId: 'transaction-amount', title: formatBigNumber(transactionValue) }, { children: formatBigNumber(transactionValue, 10) }))), !isEffectiveValueLoading && !transactionValue && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular', symbol: currencySymbol, icon: jsx(ChainIcon, {}) }, { children: "0" })))] })), jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Gas (estimated)" })), isGasPriceLoading && jsx(CoinCell, { children: "--" }), !isGasPriceLoading && !gasEstimate && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isGasPriceLoading && gasEstimate && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}), dataTestId: 'transaction-gas-free', title: formatBigNumber(gasEstimate) }, { children: formatBigNumber(gasEstimate, 10) })))] })), jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Total" })), total && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}), dataTestId: 'transaction-total', title: formatBigNumber(total) }, { children: formatBigNumber(total, 10) }))), !total && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] }))] }))] })), jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: hasInsufficientFunds && missingFunds && (jsx("div", Object.assign({ className: 'transaction-confirmation__warning' }, { children: jsxs(Alert, Object.assign({ icon: 'error', variant: 'warning', contentDataTestId: 'warning_content' }, { children: ["Insufficient funds due to gas price increase from estimate. Please add ", formatBigNumber(missingFunds, 5), ' ', currencySymbol, " to continue."] })) }))) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__actions' }, { children: [jsx(Button, Object.assign({ buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', buttonRounded: 'default', disabled: isLoading }, { children: "Cancel" })), jsx(Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', onClick: () => sendTransaction(), expanded: true, buttonRounded: 'default', loading: isLoading, disabled: isLoadingTransaction || hasInsufficientFunds }, { children: buttonText }))] })), jsx(PoweredByDynamic, {})] }))] })) })));
106
- };
107
- const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
108
- alignItems: 'center',
109
- display: 'flex',
110
- gap: '0.25rem',
111
- minWidth: 0,
112
- } }, { children: [jsx(Typography, Object.assign({ title: title, color: color, variant: 'body_normal', weight: weight, truncate: true }, { children: children })), symbol && (jsx(Typography, Object.assign({ as: 'span', color: 'secondary', weight: 'regular' }, { children: symbol }))), icon && jsx(Icon, Object.assign({ size: 'small' }, { children: icon }))] })));
52
+ } }, { children: jsx("div", Object.assign({ className: 'transaction-confirmation' }, { children: jsx(TransactionConfirmationView, { provider: provider, transaction: transaction, title: title, mutation: () => handler(transaction), onClickClose: closeModal, onError: (error) => (errorRef.current = error), onSuccess: (transactionResponse) => {
53
+ errorRef.current = null;
54
+ transactionResponseRef.current = transactionResponse;
55
+ closeModal();
56
+ } }) })) })));
57
+ };
113
58
 
114
59
  export { TransactionConfirmationModal };
@@ -1,10 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { ethers } from 'ethers';
3
3
  export type TransactionConfirmationModalProps = {
4
- appLogoUrl?: string;
5
- appName?: string;
6
- appOrigin: string;
7
- buttonText?: ReactNode;
8
4
  handler: (transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>) => Promise<ethers.providers.TransactionResponse>;
9
5
  onReject: (error: unknown) => void;
10
6
  onTransactionResponseSuccess: (transactionResponse: ethers.providers.TransactionResponse) => void;
@@ -96,7 +96,7 @@ export type OnConnectSuccess = (params: {
96
96
  walletConnector: WalletConnector | undefined;
97
97
  }) => void;
98
98
  export type OnUserProfileUpdate = (user: UserProfile) => void;
99
- export type MultiWalletWidgetState = 'idle' | 'awaiting_account_switch' | 'awaiting_connection' | 'awaiting_signature' | 'detected_known_secondary_wallet' | 'detected_new_wallet';
99
+ export type MultiWalletWidgetState = 'idle' | 'awaiting_account_switch' | 'awaiting_connection' | 'awaiting_signature' | 'detected_new_wallet';
100
100
  export type AccountSwitchState = 'idle' | 'linking_new_wallet' | 'switching_primary' | 'primary_not_connected';
101
101
  export type AwaitingSignatureState = 'idle' | 'linking_new_wallet' | 'transferring_wallet';
102
102
  export type LocalStorageNonce = {