@dynamic-labs/sdk-react-core 0.17.0-RC.7 → 0.17.0-RC.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) 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 +7 -2
  6. package/src/index.d.ts +2 -2
  7. package/src/index.js +5 -1
  8. package/src/lib/Main.cjs +6 -3
  9. package/src/lib/Main.js +5 -2
  10. package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +5 -2
  11. package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +5 -2
  12. package/src/lib/components/Alert/Alert.cjs +29 -0
  13. package/src/lib/components/Alert/Alert.js +25 -0
  14. package/src/lib/components/Alert/Alert.types.d.ts +4 -1
  15. package/src/lib/components/AnimatePresence/AnimatePresence.cjs +5 -2
  16. package/src/lib/components/AnimatePresence/AnimatePresence.js +5 -2
  17. package/src/lib/components/Checkbox/Checkbox.cjs +3 -1
  18. package/src/lib/components/Checkbox/Checkbox.js +3 -1
  19. package/src/lib/components/Divider/Divider.cjs +5 -2
  20. package/src/lib/components/Divider/Divider.js +5 -2
  21. package/src/lib/components/ErrorContainer/ErrorContainer.cjs +3 -1
  22. package/src/lib/components/ErrorContainer/ErrorContainer.js +3 -1
  23. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +3 -0
  24. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +3 -0
  25. package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +4 -1
  26. package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +4 -1
  27. package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +3 -0
  28. package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +3 -0
  29. package/src/lib/components/IconWithStatus/IconWithStatus.cjs +3 -0
  30. package/src/lib/components/IconWithStatus/IconWithStatus.js +3 -0
  31. package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
  32. package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
  33. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +4 -2
  34. package/src/lib/components/NetworkPicker/NetworkPicker.js +4 -2
  35. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +5 -2
  36. package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +5 -2
  37. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +4 -2
  38. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +4 -2
  39. package/src/lib/components/NetworkPicker/components/Network/Network.cjs +5 -2
  40. package/src/lib/components/NetworkPicker/components/Network/Network.js +5 -2
  41. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +5 -2
  42. package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +5 -2
  43. package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.cjs +3 -1
  44. package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.js +3 -1
  45. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +5 -2
  46. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +5 -2
  47. package/src/lib/components/OverlayCard/OverlayCard.cjs +5 -2
  48. package/src/lib/components/OverlayCard/OverlayCard.js +5 -2
  49. package/src/lib/components/Portal/Portal.cjs +5 -2
  50. package/src/lib/components/Portal/Portal.js +5 -2
  51. package/src/lib/components/Select/Select.cjs +3 -1
  52. package/src/lib/components/Select/Select.js +3 -1
  53. package/src/lib/components/ShadowDOM/utils.cjs +3 -1
  54. package/src/lib/components/ShadowDOM/utils.js +3 -1
  55. package/src/lib/components/Spinner/spinner.cjs +3 -1
  56. package/src/lib/components/Spinner/spinner.js +3 -1
  57. package/src/lib/components/Toolkit/Toolkit.cjs +4 -1
  58. package/src/lib/components/Toolkit/Toolkit.js +4 -1
  59. package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +3 -1
  60. package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +3 -1
  61. package/src/lib/components/Tooltip/Tooltip.cjs +5 -2
  62. package/src/lib/components/Tooltip/Tooltip.js +5 -2
  63. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +5 -2
  64. package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +5 -2
  65. package/src/lib/components/UserAddress/UserAddress.cjs +3 -1
  66. package/src/lib/components/UserAddress/UserAddress.js +3 -1
  67. package/src/lib/components/UserProfile/UserProfile.cjs +16 -8
  68. package/src/lib/components/UserProfile/UserProfile.js +12 -4
  69. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +5 -2
  70. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -0
  71. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +5 -2
  72. package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +3 -1
  73. package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +3 -1
  74. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +5 -2
  75. package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +5 -2
  76. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +5 -2
  77. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +5 -2
  78. package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -16
  79. package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -6
  80. package/src/lib/context/DynamicContext/DynamicContext.js +9 -10
  81. package/src/lib/context/DynamicContext/helpers.cjs +3 -1
  82. package/src/lib/context/DynamicContext/helpers.js +3 -1
  83. package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +3 -1
  84. package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +3 -1
  85. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +3 -0
  86. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +3 -0
  87. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +3 -1
  88. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +3 -1
  89. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +5 -2
  90. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +5 -2
  91. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -1
  92. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -1
  93. package/src/lib/context/DynamicContext/validators.cjs +3 -1
  94. package/src/lib/context/DynamicContext/validators.js +3 -1
  95. package/src/lib/context/FundingContext/FundingContext.cjs +2 -2
  96. package/src/lib/context/FundingContext/FundingContext.js +1 -1
  97. package/src/lib/context/MockContext/MockContext.cjs +3 -1
  98. package/src/lib/context/MockContext/MockContext.js +3 -1
  99. package/src/lib/context/QrCodeContext/QrCodeContext.cjs +5 -2
  100. package/src/lib/context/QrCodeContext/QrCodeContext.js +5 -2
  101. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +6 -3
  102. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +1 -1
  103. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -2
  104. package/src/lib/context/ThemeContext/themesData.cjs +3 -1
  105. package/src/lib/context/ThemeContext/themesData.js +3 -1
  106. package/src/lib/data/api.cjs +19 -17
  107. package/src/lib/data/api.js +4 -2
  108. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +5 -2
  109. package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +5 -2
  110. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +5 -2
  111. package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +5 -2
  112. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +5 -2
  113. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +5 -2
  114. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +6 -3
  115. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +5 -2
  116. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +7 -4
  117. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +5 -2
  118. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +4 -1
  119. package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +4 -1
  120. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +5 -2
  121. package/src/lib/layout/DynamicAuthLayout/Header/header.js +5 -2
  122. package/src/lib/main.global.cjs +1 -1
  123. package/src/lib/main.global.js +1 -1
  124. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +5 -2
  125. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +5 -2
  126. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +27 -41
  127. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +27 -41
  128. package/src/lib/modals/TransactionConfirmationModal/hooks/index.d.ts +1 -0
  129. package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/index.d.ts +1 -0
  130. package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.cjs +85 -0
  131. package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.d.ts +18 -0
  132. package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.js +81 -0
  133. package/src/lib/shared/types/index.d.ts +1 -1
  134. package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +2 -2
  135. package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +1 -1
  136. package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +2 -2
  137. package/src/lib/shared/utils/functions/chain/getChainIcon.js +1 -1
  138. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +22 -0
  139. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.d.ts +2 -0
  140. package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +18 -0
  141. package/src/lib/shared/utils/functions/formatBigNumber/index.d.ts +1 -0
  142. package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +5 -10
  143. package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +3 -8
  144. package/src/lib/shared/utils/functions/index.d.ts +1 -0
  145. package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +3 -1
  146. package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +3 -1
  147. package/src/lib/styles/index.shadow.cjs +1 -1
  148. package/src/lib/styles/index.shadow.js +1 -1
  149. package/src/lib/utils/functions/generateMessages/index.cjs +4 -3
  150. package/src/lib/utils/functions/generateMessages/index.js +2 -1
  151. package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +3 -1
  152. package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +3 -1
  153. package/src/lib/utils/functions/getEnabledKYC/index.cjs +5 -0
  154. package/src/lib/utils/functions/getEnabledKYC/index.d.ts +5 -0
  155. package/src/lib/utils/functions/getEnabledKYC/index.js +5 -0
  156. package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.cjs +74 -0
  157. package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.d.ts +29 -0
  158. package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.js +68 -0
  159. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +2 -2
  160. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +1 -1
  161. package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +6 -3
  162. package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +4 -1
  163. package/src/lib/utils/functions/isSameWalletName/isSameWalletName.cjs +2 -2
  164. package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +1 -1
  165. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +3 -3
  166. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +1 -1
  167. package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +2 -2
  168. package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +1 -1
  169. package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.cjs +5 -3
  170. package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +3 -1
  171. package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs +2 -2
  172. package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js +1 -1
  173. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +6 -7
  174. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -2
  175. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +6 -4
  176. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +3 -1
  177. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
  178. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
  179. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +3 -0
  180. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +3 -0
  181. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +2 -2
  182. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -1
  183. package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +4 -1
  184. package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +4 -1
  185. package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +6 -3
  186. package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +4 -1
  187. package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
  188. package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +1 -1
  189. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +6 -3
  190. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -1
  191. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -1
  192. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +3 -1
  193. package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +3 -1
  194. package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +4 -1
  195. package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +4 -1
  196. package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +16 -20
  197. package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +1 -1
  198. package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +16 -20
  199. package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +4 -2
  200. package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +3 -1
  201. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +5 -2
  202. package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +4 -1
  203. package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.cjs +3 -1
  204. package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.js +3 -1
  205. package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +16 -6
  206. package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.d.ts +5 -0
  207. package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +16 -6
  208. package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +3 -1
  209. package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +3 -1
  210. package/src/lib/utils/hooks/useMutation/useMutation.cjs +4 -4
  211. package/src/lib/utils/hooks/useMutation/useMutation.js +1 -1
  212. package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +3 -1
  213. package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +3 -1
  214. package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +6 -4
  215. package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +5 -3
  216. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +11 -8
  217. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +7 -4
  218. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +6 -3
  219. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +4 -1
  220. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +9 -7
  221. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +3 -1
  222. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +6 -3
  223. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -1
  224. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -0
  225. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -1
  226. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -0
  227. package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -14
  228. package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -5
  229. package/src/lib/utils/hooks/useWallets/useWallets.js +4 -14
  230. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +5 -2
  231. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +5 -2
  232. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +5 -2
  233. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +5 -2
  234. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +10 -6
  235. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.d.ts +1 -1
  236. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +10 -6
  237. package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +7 -4
  238. package/src/lib/views/CollectUserDataView/UserDataFields/index.js +7 -4
  239. package/src/lib/views/CollectUserDataView/fieldsConfig.cjs +3 -1
  240. package/src/lib/views/CollectUserDataView/fieldsConfig.js +3 -1
  241. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +5 -2
  242. package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +5 -2
  243. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +6 -3
  244. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +5 -2
  245. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +5 -2
  246. package/src/lib/views/EmailUpdate/EmailUpdate.js +5 -2
  247. package/src/lib/views/EmailVerification/EmailVerification.cjs +6 -3
  248. package/src/lib/views/EmailVerification/EmailVerification.js +5 -2
  249. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +6 -3
  250. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +5 -2
  251. package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +4 -2
  252. package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +4 -2
  253. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +5 -2
  254. package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +5 -2
  255. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +6 -3
  256. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +5 -2
  257. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +12 -5
  258. package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +12 -5
  259. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +5 -2
  260. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +5 -2
  261. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -2
  262. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -2
  263. package/src/lib/views/NoAccess/NoAccess.cjs +5 -2
  264. package/src/lib/views/NoAccess/NoAccess.js +5 -2
  265. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +5 -2
  266. package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +5 -2
  267. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +5 -2
  268. package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +5 -2
  269. package/src/lib/views/PendingConnectView/PendingConnectView.cjs +6 -3
  270. package/src/lib/views/PendingConnectView/PendingConnectView.js +5 -2
  271. package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +4 -1
  272. package/src/lib/views/PendingSignatureView/PendingSignatureView.js +4 -1
  273. package/src/lib/views/QrCodeView/QRCode.cjs +2 -2
  274. package/src/lib/views/QrCodeView/QRCode.js +1 -1
  275. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +6 -3
  276. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +5 -2
  277. package/src/lib/views/QrCodeView/QrCodeView.cjs +5 -2
  278. package/src/lib/views/QrCodeView/QrCodeView.js +5 -2
  279. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -2
  280. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -2
  281. package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +5 -2
  282. package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +5 -2
  283. package/src/lib/views/WalletList/WalletList.cjs +3 -1
  284. package/src/lib/views/WalletList/WalletList.js +3 -1
  285. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +5 -2
  286. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +5 -2
  287. package/src/lib/views/WalletList/data.cjs +4 -1
  288. package/src/lib/views/WalletList/data.js +4 -1
  289. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +5 -2
  290. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +5 -2
  291. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +7 -4
  292. package/src/lib/views/WalletUsedView/WalletUsedView.js +5 -2
  293. package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +5 -2
  294. package/src/lib/widgets/DynamicWidget/DynamicWidget.js +5 -2
  295. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +5 -2
  296. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +5 -2
  297. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +5 -2
  298. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +5 -2
  299. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +6 -3
  300. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +5 -2
  301. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +5 -2
  302. package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +5 -2
  303. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +5 -2
  304. package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +5 -2
  305. package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +7 -4
  306. package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +5 -2
  307. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +6 -3
  308. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +5 -2
  309. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +5 -2
  310. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +5 -2
  311. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +5 -2
  312. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +5 -2
  313. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +5 -2
  314. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +5 -2
  315. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +5 -2
  316. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +5 -2
  317. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +5 -2
  318. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +5 -2
  319. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +5 -2
  320. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +5 -2
  321. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +5 -2
  322. package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +5 -2
  323. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +5 -2
  324. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +5 -2
  325. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +5 -2
  326. package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +5 -2
  327. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +5 -2
  328. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +5 -2
  329. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +5 -2
  330. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +5 -2
  331. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +3 -0
  332. package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +3 -0
  333. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +5 -2
  334. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +5 -2
  335. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +3 -0
  336. package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +3 -0
  337. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +2 -2
  338. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
  339. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +2 -2
  340. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +1 -1
  341. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +6 -3
  342. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +5 -2
  343. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +5 -2
  344. package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +5 -2
  345. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +5 -2
  346. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +5 -2
  347. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +5 -2
  348. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +5 -2
  349. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +6 -3
  350. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +4 -1
  351. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +5 -2
  352. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +5 -2
  353. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +7 -3
  354. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +7 -3
  355. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +5 -2
  356. package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +5 -2
  357. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +12 -6
  358. package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +10 -4
  359. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +5 -2
  360. package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +5 -2
  361. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +9 -7
  362. package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +9 -7
  363. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +5 -2
  364. package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +5 -2
@@ -4,14 +4,17 @@ import { Typography } from '../../components/Typography/Typography.js';
4
4
  import '@dynamic-labs/sdk-api';
5
5
  import '../../shared/logger.js';
6
6
  import '@dynamic-labs/iconic';
7
- import '@dynamic-labs/multi-wallet';
7
+ import '@dynamic-labs/wallet-connector-core';
8
8
  import '../../context/ViewContext/ViewContext.js';
9
9
  import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
10
10
  import { ReactComponent as SvgSignCircle } from '../../shared/assets/sign-circle.js';
11
+ import '@dynamic-labs/utils';
11
12
  import '../../utils/constants/colors.js';
13
+ import 'ethers';
12
14
  import { usePreventPageScroll } from '../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js';
13
15
  import { authModalZIndex } from '../../shared/consts/index.js';
14
16
  import '../../context/DynamicContext/DynamicContext.js';
17
+ import '@dynamic-labs/multi-wallet';
15
18
  import '../../components/ShadowDOM/ShadowDOM.js';
16
19
  import '../../context/ThemeContext/ThemeContext.js';
17
20
  import { Icon } from '../../components/Icon/Icon.js';
@@ -20,7 +23,6 @@ import 'react-dom';
20
23
  import '../../config/ApiEndpoint.js';
21
24
  import '@dynamic-labs/rpc-providers';
22
25
  import '../../context/ErrorContext/ErrorContext.js';
23
- import 'ethers';
24
26
  import '../../context/MockContext/MockContext.js';
25
27
  import '../../context/CaptchaContext/CaptchaContext.js';
26
28
  import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
@@ -28,6 +30,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
28
30
  import { Button } from '../../components/Button/Button.js';
29
31
  import { IconButton } from '../../components/IconButton/IconButton.js';
30
32
  import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
33
+ import '../../components/Alert/Alert.js';
31
34
  import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
32
35
  import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
33
36
  import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
@@ -2,17 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _tslib = require('../../../../_virtual/_tslib.cjs');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6
  var React = require('react');
8
7
  var ethers = require('ethers');
9
- var multiWallet = require('@dynamic-labs/multi-wallet');
8
+ var utils = require('@dynamic-labs/utils');
10
9
  var Typography = require('../../components/Typography/Typography.cjs');
11
10
  require('@dynamic-labs/sdk-api');
12
11
  require('../../shared/logger.cjs');
13
12
  var getChainIcon = require('../../shared/utils/functions/chain/getChainIcon.cjs');
13
+ require('@dynamic-labs/wallet-connector-core');
14
14
  var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
15
15
  require('../../utils/constants/colors.cjs');
16
+ var formatBigNumber = require('../../shared/utils/functions/formatBigNumber/formatBigNumber.cjs');
16
17
  var usePreventPageScroll = require('../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
17
18
  require('@dynamic-labs/iconic');
18
19
  require('../../context/ViewContext/ViewContext.cjs');
@@ -20,6 +21,7 @@ var close = require('../../shared/assets/close.cjs');
20
21
  var signCircle = require('../../shared/assets/sign-circle.cjs');
21
22
  var index = require('../../shared/consts/index.cjs');
22
23
  var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
24
+ require('@dynamic-labs/multi-wallet');
23
25
  require('../../components/ShadowDOM/ShadowDOM.cjs');
24
26
  require('../../context/ThemeContext/ThemeContext.cjs');
25
27
  var Icon = require('../../components/Icon/Icon.cjs');
@@ -30,6 +32,7 @@ require('@dynamic-labs/rpc-providers');
30
32
  require('../../context/ErrorContext/ErrorContext.cjs');
31
33
  var useFetchCurrency = require('../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs');
32
34
  var transactionErrorMessage = require('./helpers/transactionErrorMessage.cjs');
35
+ var useTransactionData = require('./hooks/useTransactionData/useTransactionData.cjs');
33
36
  require('../../context/MockContext/MockContext.cjs');
34
37
  require('../../context/CaptchaContext/CaptchaContext.cjs');
35
38
  var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
@@ -38,26 +41,27 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
38
41
  var Button = require('../../components/Button/Button.cjs');
39
42
  var IconButton = require('../../components/IconButton/IconButton.cjs');
40
43
  var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
44
+ var Alert = require('../../components/Alert/Alert.cjs');
41
45
  var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
42
46
  var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
43
47
  var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
44
48
  var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
45
- var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
46
49
  require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
47
50
  require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
48
51
  require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
49
52
  var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
50
53
 
51
- const digitsLimitSub = 1e8;
52
54
  const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
53
55
  usePreventPageScroll.usePreventPageScroll(true);
54
56
  const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
55
57
  const didConfirmRef = React.useRef(false);
56
58
  const [show, setShow] = React.useState(true);
57
- const { from, to, value } = transaction;
58
59
  if (!primaryWallet) {
59
- throw new multiWallet.DynamicError('Primary wallet is not available, transaction cannot be displayed');
60
+ throw new utils.DynamicError('Primary wallet is not available, transaction cannot be displayed');
60
61
  }
62
+ const { data: balance } = usePromise.usePromise(() => primaryWallet.connector
63
+ .getBalance()
64
+ .then((balanceText) => balanceText ? ethers.ethers.utils.parseEther(balanceText) : undefined));
61
65
  const [currencySymbol] = useFetchCurrency.useFetchCurrency(primaryWallet.connector);
62
66
  const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation.useMutation(() => handler(transaction), {
63
67
  onSuccess: () => {
@@ -65,6 +69,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
65
69
  setShow(false);
66
70
  },
67
71
  });
72
+ const { isLoading: isLoadingTransaction, isTransactionFromAddressLoading, isTransactionToAddressLoading, transactionFromAddress, transactionToAddress, isEffectiveValueLoading, transactionValue, gasEstimate, isGasPriceLoading, total, } = useTransactionData.useTransactionData({
73
+ provider,
74
+ transaction,
75
+ });
76
+ const hasInsufficientFunds = React.useMemo(() => {
77
+ if (balance === undefined || total === undefined)
78
+ return false;
79
+ return total.gt(balance);
80
+ }, [balance, total]);
81
+ const missingFunds = React.useMemo(() => {
82
+ if (balance === undefined || total === undefined)
83
+ return undefined;
84
+ return total.sub(balance);
85
+ }, [balance, total]);
68
86
  const handleOnReject = React.useCallback(() => {
69
87
  didConfirmRef.current = false;
70
88
  setShow(false);
@@ -80,45 +98,13 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
80
98
  onTransactionResponseSuccess,
81
99
  onReject,
82
100
  ]);
83
- const { data: effectiveValue, isLoading: isEffectiveValueLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
84
- const val = yield value;
85
- return val ? ethers.ethers.BigNumber.from(val) : undefined;
86
- }));
87
- const { data: effectiveGasPrice, isLoading: isEffectiveGasPriceLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
88
- const gasPrice = yield provider.getGasPrice();
89
- const estimatedGas = yield provider.estimateGas(transaction);
90
- return gasPrice && estimatedGas
91
- ? ethers.ethers.BigNumber.from(gasPrice).mul(estimatedGas)
92
- : undefined;
93
- }));
94
- const { data: effectiveToAddress, isLoading: isEffectiveToAddressLoading } = usePromise.usePromise(() => to);
95
- const { data: effectiveFromAddress, isLoading: isEffectiveFromAddressLoading, } = usePromise.usePromise(() => from);
96
- const total = React.useMemo(() => {
97
- if (effectiveGasPrice !== undefined && effectiveValue !== undefined) {
98
- return effectiveGasPrice.add(effectiveValue);
99
- }
100
- return effectiveValue || effectiveGasPrice;
101
- }, [effectiveGasPrice, effectiveValue]);
102
- const isLoadingTransaction = React.useMemo(() => isEffectiveValueLoading ||
103
- isEffectiveGasPriceLoading ||
104
- isEffectiveToAddressLoading ||
105
- isEffectiveFromAddressLoading, [
106
- isEffectiveValueLoading,
107
- isEffectiveGasPriceLoading,
108
- isEffectiveToAddressLoading,
109
- isEffectiveFromAddressLoading,
110
- ]);
111
101
  const ChainIcon = getChainIcon.getChainIcon('evm');
112
- const formatValue = (value, sub) => {
113
- if (!sub) {
114
- return ethers.ethers.utils.formatEther(value);
115
- }
116
- return ethers.ethers.utils.formatEther(value.sub(value.mod(sub)));
117
- };
118
102
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
119
103
  return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
120
104
  onUnmount: handleOnModalUnmount,
121
- } }, { 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(ErrorContainer.ErrorContainer, { 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)" })), isEffectiveFromAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isEffectiveFromAddressLoading && effectiveFromAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(effectiveFromAddress, 4, 4) })), !isEffectiveFromAddressLoading && !effectiveFromAddress && (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" })), isEffectiveToAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isEffectiveToAddressLoading && !effectiveToAddress && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isEffectiveToAddressLoading && effectiveToAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(effectiveToAddress, 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 && effectiveValue && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-amount', title: formatValue(effectiveValue) }, { children: formatValue(effectiveValue, digitsLimitSub) }))), !isEffectiveValueLoading && !effectiveValue && (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: "Gas (estimated)" })), isEffectiveGasPriceLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isEffectiveGasPriceLoading && !effectiveGasPrice && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isEffectiveGasPriceLoading && effectiveGasPrice && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-gas-free', title: formatValue(effectiveGasPrice) }, { children: formatValue(effectiveGasPrice, digitsLimitSub) })))] })), 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: formatValue(total) }, { children: formatValue(total, digitsLimitSub) }))), !total && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] }))] }))] })), 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 }, { children: buttonText }))] })), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })) })));
105
+ } }, { 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 &&
106
+ transactionFromAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(transactionFromAddress, 4, 4) })), !isTransactionFromAddressLoading &&
107
+ !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, {})] }))] })) })));
122
108
  };
123
109
  const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxRuntime.jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
124
110
  alignItems: 'center',
@@ -1,14 +1,15 @@
1
- import { __awaiter } from '../../../../_virtual/_tslib.js';
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useRef, useState, useCallback, useMemo } from 'react';
2
+ import { useRef, useState, useMemo, useCallback } from 'react';
4
3
  import { ethers } from 'ethers';
5
- import { DynamicError } from '@dynamic-labs/multi-wallet';
4
+ import { DynamicError } from '@dynamic-labs/utils';
6
5
  import { Typography } from '../../components/Typography/Typography.js';
7
6
  import '@dynamic-labs/sdk-api';
8
7
  import '../../shared/logger.js';
9
8
  import { getChainIcon } from '../../shared/utils/functions/chain/getChainIcon.js';
9
+ import '@dynamic-labs/wallet-connector-core';
10
10
  import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
11
11
  import '../../utils/constants/colors.js';
12
+ import { formatBigNumber } from '../../shared/utils/functions/formatBigNumber/formatBigNumber.js';
12
13
  import { usePreventPageScroll } from '../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js';
13
14
  import '@dynamic-labs/iconic';
14
15
  import '../../context/ViewContext/ViewContext.js';
@@ -16,6 +17,7 @@ import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
16
17
  import { ReactComponent as SvgSignCircle } from '../../shared/assets/sign-circle.js';
17
18
  import { authModalZIndex } from '../../shared/consts/index.js';
18
19
  import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
20
+ import '@dynamic-labs/multi-wallet';
19
21
  import '../../components/ShadowDOM/ShadowDOM.js';
20
22
  import '../../context/ThemeContext/ThemeContext.js';
21
23
  import { Icon } from '../../components/Icon/Icon.js';
@@ -26,6 +28,7 @@ import '@dynamic-labs/rpc-providers';
26
28
  import '../../context/ErrorContext/ErrorContext.js';
27
29
  import { useFetchCurrency } from '../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js';
28
30
  import { transactionErrorMessage } from './helpers/transactionErrorMessage.js';
31
+ import { useTransactionData } from './hooks/useTransactionData/useTransactionData.js';
29
32
  import '../../context/MockContext/MockContext.js';
30
33
  import '../../context/CaptchaContext/CaptchaContext.js';
31
34
  import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
@@ -34,26 +37,27 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
34
37
  import { Button } from '../../components/Button/Button.js';
35
38
  import { IconButton } from '../../components/IconButton/IconButton.js';
36
39
  import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
40
+ import { Alert } from '../../components/Alert/Alert.js';
37
41
  import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
38
42
  import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
39
43
  import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
40
44
  import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
41
- import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
42
45
  import '../../components/Transition/ZoomTransition/ZoomTransition.js';
43
46
  import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
44
47
  import '../../components/Transition/OpacityTransition/OpacityTransition.js';
45
48
  import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
46
49
 
47
- const digitsLimitSub = 1e8;
48
50
  const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
49
51
  usePreventPageScroll(true);
50
52
  const { primaryWallet } = useInternalDynamicContext();
51
53
  const didConfirmRef = useRef(false);
52
54
  const [show, setShow] = useState(true);
53
- const { from, to, value } = transaction;
54
55
  if (!primaryWallet) {
55
56
  throw new DynamicError('Primary wallet is not available, transaction cannot be displayed');
56
57
  }
58
+ const { data: balance } = usePromise(() => primaryWallet.connector
59
+ .getBalance()
60
+ .then((balanceText) => balanceText ? ethers.utils.parseEther(balanceText) : undefined));
57
61
  const [currencySymbol] = useFetchCurrency(primaryWallet.connector);
58
62
  const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation(() => handler(transaction), {
59
63
  onSuccess: () => {
@@ -61,6 +65,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
61
65
  setShow(false);
62
66
  },
63
67
  });
68
+ const { isLoading: isLoadingTransaction, isTransactionFromAddressLoading, isTransactionToAddressLoading, transactionFromAddress, transactionToAddress, isEffectiveValueLoading, transactionValue, gasEstimate, isGasPriceLoading, total, } = useTransactionData({
69
+ provider,
70
+ transaction,
71
+ });
72
+ const hasInsufficientFunds = useMemo(() => {
73
+ if (balance === undefined || total === undefined)
74
+ return false;
75
+ return total.gt(balance);
76
+ }, [balance, total]);
77
+ const missingFunds = useMemo(() => {
78
+ if (balance === undefined || total === undefined)
79
+ return undefined;
80
+ return total.sub(balance);
81
+ }, [balance, total]);
64
82
  const handleOnReject = useCallback(() => {
65
83
  didConfirmRef.current = false;
66
84
  setShow(false);
@@ -76,45 +94,13 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
76
94
  onTransactionResponseSuccess,
77
95
  onReject,
78
96
  ]);
79
- const { data: effectiveValue, isLoading: isEffectiveValueLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
80
- const val = yield value;
81
- return val ? ethers.BigNumber.from(val) : undefined;
82
- }));
83
- const { data: effectiveGasPrice, isLoading: isEffectiveGasPriceLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
84
- const gasPrice = yield provider.getGasPrice();
85
- const estimatedGas = yield provider.estimateGas(transaction);
86
- return gasPrice && estimatedGas
87
- ? ethers.BigNumber.from(gasPrice).mul(estimatedGas)
88
- : undefined;
89
- }));
90
- const { data: effectiveToAddress, isLoading: isEffectiveToAddressLoading } = usePromise(() => to);
91
- const { data: effectiveFromAddress, isLoading: isEffectiveFromAddressLoading, } = usePromise(() => from);
92
- const total = useMemo(() => {
93
- if (effectiveGasPrice !== undefined && effectiveValue !== undefined) {
94
- return effectiveGasPrice.add(effectiveValue);
95
- }
96
- return effectiveValue || effectiveGasPrice;
97
- }, [effectiveGasPrice, effectiveValue]);
98
- const isLoadingTransaction = useMemo(() => isEffectiveValueLoading ||
99
- isEffectiveGasPriceLoading ||
100
- isEffectiveToAddressLoading ||
101
- isEffectiveFromAddressLoading, [
102
- isEffectiveValueLoading,
103
- isEffectiveGasPriceLoading,
104
- isEffectiveToAddressLoading,
105
- isEffectiveFromAddressLoading,
106
- ]);
107
97
  const ChainIcon = getChainIcon('evm');
108
- const formatValue = (value, sub) => {
109
- if (!sub) {
110
- return ethers.utils.formatEther(value);
111
- }
112
- return ethers.utils.formatEther(value.sub(value.mod(sub)));
113
- };
114
98
  const closeButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
115
99
  return (jsx(Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
116
100
  onUnmount: handleOnModalUnmount,
117
- } }, { 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(ErrorContainer, { 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)" })), isEffectiveFromAddressLoading && jsx(CoinCell, { children: "--" }), !isEffectiveFromAddressLoading && effectiveFromAddress && (jsx(CoinCell, { children: shortenWalletAddress(effectiveFromAddress, 4, 4) })), !isEffectiveFromAddressLoading && !effectiveFromAddress && (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" })), isEffectiveToAddressLoading && jsx(CoinCell, { children: "--" }), !isEffectiveToAddressLoading && !effectiveToAddress && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isEffectiveToAddressLoading && effectiveToAddress && (jsx(CoinCell, { children: shortenWalletAddress(effectiveToAddress, 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 && effectiveValue && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}), dataTestId: 'transaction-amount', title: formatValue(effectiveValue) }, { children: formatValue(effectiveValue, digitsLimitSub) }))), !isEffectiveValueLoading && !effectiveValue && (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: "Gas (estimated)" })), isEffectiveGasPriceLoading && jsx(CoinCell, { children: "--" }), !isEffectiveGasPriceLoading && !effectiveGasPrice && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isEffectiveGasPriceLoading && effectiveGasPrice && (jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsx(ChainIcon, {}), dataTestId: 'transaction-gas-free', title: formatValue(effectiveGasPrice) }, { children: formatValue(effectiveGasPrice, digitsLimitSub) })))] })), 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: formatValue(total) }, { children: formatValue(total, digitsLimitSub) }))), !total && (jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] }))] }))] })), 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 }, { children: buttonText }))] })), jsx(PoweredByDynamic, {})] }))] })) })));
101
+ } }, { 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 &&
102
+ transactionFromAddress && (jsx(CoinCell, { children: shortenWalletAddress(transactionFromAddress, 4, 4) })), !isTransactionFromAddressLoading &&
103
+ !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, {})] }))] })) })));
118
104
  };
119
105
  const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
120
106
  alignItems: 'center',
@@ -0,0 +1 @@
1
+ export * from './useTransactionData';
@@ -0,0 +1 @@
1
+ export { useTransactionData } from './useTransactionData';
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../../../_virtual/_tslib.cjs');
6
+ var React = require('react');
7
+ var ethers = require('ethers');
8
+ require('@dynamic-labs/utils');
9
+ require('@dynamic-labs/sdk-api');
10
+ require('../../../../config/ApiEndpoint.cjs');
11
+ require('../../../../shared/logger.cjs');
12
+ require('@dynamic-labs/iconic');
13
+ require('@dynamic-labs/wallet-connector-core');
14
+ require('react/jsx-runtime');
15
+ require('../../../../context/ViewContext/ViewContext.cjs');
16
+ require('../../../../utils/constants/colors.cjs');
17
+ require('../../../../shared/consts/index.cjs');
18
+ require('@dynamic-labs/multi-wallet');
19
+ require('@dynamic-labs/rpc-providers');
20
+ require('../../../../context/DynamicContext/DynamicContext.cjs');
21
+ require('../../../../context/ErrorContext/ErrorContext.cjs');
22
+ require('react-dom');
23
+ require('../../../../components/ShadowDOM/ShadowDOM.cjs');
24
+ require('../../../../context/ThemeContext/ThemeContext.cjs');
25
+ require('react-focus-lock');
26
+ require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
27
+ require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
28
+ require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
29
+ require('../../../../components/IconButton/IconButton.cjs');
30
+ require('../../../../components/Alert/Alert.cjs');
31
+ require('../../../../context/MockContext/MockContext.cjs');
32
+ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
33
+ var usePromise = require('../../../../utils/hooks/usePromise/usePromise.cjs');
34
+ require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
35
+
36
+ const useTransactionData = ({ provider, transaction, }) => {
37
+ const { data: transactionValue, isLoading: isEffectiveValueLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
38
+ const val = yield transaction.value;
39
+ return val ? ethers.ethers.BigNumber.from(val) : undefined;
40
+ }));
41
+ const { data: estimatedGas, isLoading: isEstimatedGasLoading } = usePromise.usePromise(() => {
42
+ // To safely run estimateGas using alchemy, we need to remove the from address
43
+ // because alchemy checks the origin address funds and can return an error if
44
+ // origin wallet has no funds for the transaction
45
+ // https://docs.alchemy.com/reference/eth-estimategas
46
+ const { from } = transaction, transactionWithNoOrigin = _tslib.__rest(transaction, ["from"]);
47
+ return provider.estimateGas(transactionWithNoOrigin);
48
+ });
49
+ const { data: gasPrice, isLoading: isFeeDataLoading } = usePromise.usePromise(() => provider.getGasPrice());
50
+ const isGasPriceLoading = isEstimatedGasLoading || isFeeDataLoading;
51
+ const gasEstimate = React.useMemo(() => gasPrice && estimatedGas
52
+ ? ethers.ethers.BigNumber.from(gasPrice).mul(estimatedGas)
53
+ : undefined, [gasPrice, estimatedGas]);
54
+ const { data: transactionToAddress, isLoading: isTransactionToAddressLoading, } = usePromise.usePromise(() => transaction.to);
55
+ const { data: transactionFromAddress, isLoading: isTransactionFromAddressLoading, } = usePromise.usePromise(() => transaction.from);
56
+ const total = React.useMemo(() => {
57
+ if (gasEstimate !== undefined && transactionValue !== undefined) {
58
+ return gasEstimate.add(transactionValue);
59
+ }
60
+ return transactionValue || gasEstimate;
61
+ }, [gasEstimate, transactionValue]);
62
+ const isLoading = React.useMemo(() => isEffectiveValueLoading ||
63
+ isGasPriceLoading ||
64
+ isTransactionToAddressLoading ||
65
+ isTransactionFromAddressLoading, [
66
+ isEffectiveValueLoading,
67
+ isGasPriceLoading,
68
+ isTransactionToAddressLoading,
69
+ isTransactionFromAddressLoading,
70
+ ]);
71
+ return {
72
+ gasEstimate,
73
+ isEffectiveValueLoading,
74
+ isGasPriceLoading,
75
+ isLoading,
76
+ isTransactionFromAddressLoading,
77
+ isTransactionToAddressLoading,
78
+ total,
79
+ transactionFromAddress,
80
+ transactionToAddress,
81
+ transactionValue,
82
+ };
83
+ };
84
+
85
+ exports.useTransactionData = useTransactionData;
@@ -0,0 +1,18 @@
1
+ import { ethers } from 'ethers';
2
+ type TransactionDataHookProps = {
3
+ provider: ethers.providers.Web3Provider;
4
+ transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>;
5
+ };
6
+ export declare const useTransactionData: ({ provider, transaction, }: TransactionDataHookProps) => {
7
+ gasEstimate: ethers.BigNumber | undefined;
8
+ isEffectiveValueLoading: boolean;
9
+ isGasPriceLoading: boolean;
10
+ isLoading: boolean;
11
+ isTransactionFromAddressLoading: boolean;
12
+ isTransactionToAddressLoading: boolean;
13
+ total: ethers.BigNumber | undefined;
14
+ transactionFromAddress: string | undefined;
15
+ transactionToAddress: string | undefined;
16
+ transactionValue: ethers.BigNumber | undefined;
17
+ };
18
+ export {};
@@ -0,0 +1,81 @@
1
+ import { __awaiter, __rest } from '../../../../../../_virtual/_tslib.js';
2
+ import { useMemo } from 'react';
3
+ import { ethers } from 'ethers';
4
+ import '@dynamic-labs/utils';
5
+ import '@dynamic-labs/sdk-api';
6
+ import '../../../../config/ApiEndpoint.js';
7
+ import '../../../../shared/logger.js';
8
+ import '@dynamic-labs/iconic';
9
+ import '@dynamic-labs/wallet-connector-core';
10
+ import 'react/jsx-runtime';
11
+ import '../../../../context/ViewContext/ViewContext.js';
12
+ import '../../../../utils/constants/colors.js';
13
+ import '../../../../shared/consts/index.js';
14
+ import '@dynamic-labs/multi-wallet';
15
+ import '@dynamic-labs/rpc-providers';
16
+ import '../../../../context/DynamicContext/DynamicContext.js';
17
+ import '../../../../context/ErrorContext/ErrorContext.js';
18
+ import 'react-dom';
19
+ import '../../../../components/ShadowDOM/ShadowDOM.js';
20
+ import '../../../../context/ThemeContext/ThemeContext.js';
21
+ import 'react-focus-lock';
22
+ import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
23
+ import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
24
+ import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
25
+ import '../../../../components/IconButton/IconButton.js';
26
+ import '../../../../components/Alert/Alert.js';
27
+ import '../../../../context/MockContext/MockContext.js';
28
+ import '../../../../context/CaptchaContext/CaptchaContext.js';
29
+ import { usePromise } from '../../../../utils/hooks/usePromise/usePromise.js';
30
+ import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
31
+
32
+ const useTransactionData = ({ provider, transaction, }) => {
33
+ const { data: transactionValue, isLoading: isEffectiveValueLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
34
+ const val = yield transaction.value;
35
+ return val ? ethers.BigNumber.from(val) : undefined;
36
+ }));
37
+ const { data: estimatedGas, isLoading: isEstimatedGasLoading } = usePromise(() => {
38
+ // To safely run estimateGas using alchemy, we need to remove the from address
39
+ // because alchemy checks the origin address funds and can return an error if
40
+ // origin wallet has no funds for the transaction
41
+ // https://docs.alchemy.com/reference/eth-estimategas
42
+ const { from } = transaction, transactionWithNoOrigin = __rest(transaction, ["from"]);
43
+ return provider.estimateGas(transactionWithNoOrigin);
44
+ });
45
+ const { data: gasPrice, isLoading: isFeeDataLoading } = usePromise(() => provider.getGasPrice());
46
+ const isGasPriceLoading = isEstimatedGasLoading || isFeeDataLoading;
47
+ const gasEstimate = useMemo(() => gasPrice && estimatedGas
48
+ ? ethers.BigNumber.from(gasPrice).mul(estimatedGas)
49
+ : undefined, [gasPrice, estimatedGas]);
50
+ const { data: transactionToAddress, isLoading: isTransactionToAddressLoading, } = usePromise(() => transaction.to);
51
+ const { data: transactionFromAddress, isLoading: isTransactionFromAddressLoading, } = usePromise(() => transaction.from);
52
+ const total = useMemo(() => {
53
+ if (gasEstimate !== undefined && transactionValue !== undefined) {
54
+ return gasEstimate.add(transactionValue);
55
+ }
56
+ return transactionValue || gasEstimate;
57
+ }, [gasEstimate, transactionValue]);
58
+ const isLoading = useMemo(() => isEffectiveValueLoading ||
59
+ isGasPriceLoading ||
60
+ isTransactionToAddressLoading ||
61
+ isTransactionFromAddressLoading, [
62
+ isEffectiveValueLoading,
63
+ isGasPriceLoading,
64
+ isTransactionToAddressLoading,
65
+ isTransactionFromAddressLoading,
66
+ ]);
67
+ return {
68
+ gasEstimate,
69
+ isEffectiveValueLoading,
70
+ isGasPriceLoading,
71
+ isLoading,
72
+ isTransactionFromAddressLoading,
73
+ isTransactionToAddressLoading,
74
+ total,
75
+ transactionFromAddress,
76
+ transactionToAddress,
77
+ transactionValue,
78
+ };
79
+ };
80
+
81
+ export { useTransactionData };
@@ -27,7 +27,7 @@ export type UserProfile = UserFields & {
27
27
  export type Icon = React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
28
28
  title?: string | undefined;
29
29
  }>;
30
- export type WalletNamesUnion = 'Coinbase Wallet' | 'Coinbase Wallet (Solana)' | 'MetaMask' | 'Phantom' | 'Phantom (EVM)' | 'Phantom (Ledger)' | 'Venly' | 'Rainbow' | 'Solflare' | 'Glow' | 'Slope' | 'Blocto (Flow)' | 'Blocto (EVM)' | 'Blocto (App)' | 'Brave Wallet (EVM)' | 'Brave Wallet (Solana)' | 'Braavos' | 'Argent X' | 'Dapper' | 'Opera Wallet' | 'Injected Wallet' | 'Exodus Wallet (EVM)' | 'Exodus Wallet (Solana)' | 'Fortmatic' | 'ZenGo' | 'Lilico';
30
+ export type WalletNamesUnion = 'Coinbase Wallet' | 'Coinbase Wallet (Solana)' | 'MetaMask' | 'Phantom' | 'Phantom (EVM)' | 'Phantom (Ledger)' | 'Venly' | 'Rainbow' | 'Solflare' | 'Glow' | 'Slope' | 'Blocto (Flow)' | 'Blocto (EVM)' | 'Blocto (App)' | 'Brave Wallet (EVM)' | 'Brave Wallet (Solana)' | 'Braavos' | 'Argent X' | 'Dapper' | 'Opera Wallet' | 'Injected Wallet' | 'Exodus Wallet (EVM)' | 'Exodus Wallet (Solana)' | 'ZenGo' | 'Lilico';
31
31
  export type ChainNamesUnion = 'Solana' | 'Ethereum' | 'Flow' | 'EVM' | 'Algorand' | 'Starknet' | 'Cosmos' | 'Axelar' | 'Osmosis';
32
32
  export interface WalletOption {
33
33
  isInstalledOnBrowser: boolean;
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var multiWallet = require('@dynamic-labs/multi-wallet');
5
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
6
6
  var logger = require('../../../logger.cjs');
7
7
 
8
8
  const getChainDisplayName = (chain) => {
9
9
  var _a;
10
- const displayName = (_a = multiWallet.getChainInfo(chain)) === null || _a === void 0 ? void 0 : _a.displayName;
10
+ const displayName = (_a = walletConnectorCore.getChainInfo(chain)) === null || _a === void 0 ? void 0 : _a.displayName;
11
11
  if (!displayName) {
12
12
  logger.logger.error(`Chain name for "${chain}" not supported`);
13
13
  return chain;
@@ -1,4 +1,4 @@
1
- import { getChainInfo } from '@dynamic-labs/multi-wallet';
1
+ import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
2
2
  import { logger } from '../../../logger.js';
3
3
 
4
4
  const getChainDisplayName = (chain) => {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var iconic = require('@dynamic-labs/iconic');
6
- var multiWallet = require('@dynamic-labs/multi-wallet');
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
7
  require('react/jsx-runtime');
8
8
  require('../../../../context/ViewContext/ViewContext.cjs');
9
9
  require('react');
@@ -19,7 +19,7 @@ const chainIconMap = {
19
19
  };
20
20
  const getChainIcon = (chain) => {
21
21
  var _a, _b, _c;
22
- const chainName = (_b = (_a = multiWallet.getChainInfo(chain)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
22
+ const chainName = (_b = (_a = walletConnectorCore.getChainInfo(chain)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
23
23
  return (_c = chainIconMap[chainName]) !== null && _c !== void 0 ? _c : error.ReactComponent;
24
24
  };
25
25
 
@@ -1,5 +1,5 @@
1
1
  import { AlgorandIcon, CosmosIcon, EthereumIcon, FlowIcon, SolanaIcon, StarknetIcon } from '@dynamic-labs/iconic';
2
- import { getChainInfo } from '@dynamic-labs/multi-wallet';
2
+ import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
3
3
  import 'react/jsx-runtime';
4
4
  import '../../../../context/ViewContext/ViewContext.js';
5
5
  import 'react';