@dynamic-labs/sdk-react-core 0.17.0-RC.8 → 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.
- package/CHANGELOG.md +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/index.cjs +6 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +4 -2
- package/src/lib/Main.cjs +6 -5
- package/src/lib/Main.js +5 -4
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +4 -3
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +4 -3
- package/src/lib/components/Alert/Alert.cjs +29 -0
- package/src/lib/components/Alert/Alert.js +25 -0
- package/src/lib/components/Alert/Alert.types.d.ts +4 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +4 -3
- package/src/lib/components/AnimatePresence/AnimatePresence.js +4 -3
- package/src/lib/components/Checkbox/Checkbox.cjs +3 -1
- package/src/lib/components/Checkbox/Checkbox.js +3 -1
- package/src/lib/components/Divider/Divider.cjs +5 -4
- package/src/lib/components/Divider/Divider.js +5 -4
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +3 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +3 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +2 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +2 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +4 -2
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +4 -2
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +2 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +2 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +2 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +2 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +3 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +3 -1
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +4 -3
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +4 -3
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +4 -3
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +4 -3
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +5 -4
- package/src/lib/components/NetworkPicker/components/Network/Network.js +5 -4
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +5 -4
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +5 -4
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/UnsupportedNetwork/UnsupportedNetwork.js +3 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +5 -4
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +5 -4
- package/src/lib/components/OverlayCard/OverlayCard.cjs +4 -3
- package/src/lib/components/OverlayCard/OverlayCard.js +4 -3
- package/src/lib/components/Portal/Portal.cjs +4 -3
- package/src/lib/components/Portal/Portal.js +4 -3
- package/src/lib/components/Select/Select.cjs +3 -1
- package/src/lib/components/Select/Select.js +3 -1
- package/src/lib/components/ShadowDOM/utils.cjs +3 -1
- package/src/lib/components/ShadowDOM/utils.js +3 -1
- package/src/lib/components/Spinner/spinner.cjs +3 -1
- package/src/lib/components/Spinner/spinner.js +3 -1
- package/src/lib/components/Toolkit/Toolkit.cjs +4 -2
- package/src/lib/components/Toolkit/Toolkit.js +4 -2
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +3 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +3 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +5 -4
- package/src/lib/components/Tooltip/Tooltip.js +5 -4
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +4 -3
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +4 -3
- package/src/lib/components/UserAddress/UserAddress.cjs +3 -1
- package/src/lib/components/UserAddress/UserAddress.js +3 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +16 -9
- package/src/lib/components/UserProfile/UserProfile.js +12 -5
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +5 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +5 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +3 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +3 -1
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +5 -4
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +5 -4
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +5 -4
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +5 -4
- package/src/lib/context/DynamicContext/DynamicContext.cjs +4 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +4 -2
- package/src/lib/context/DynamicContext/helpers.cjs +3 -1
- package/src/lib/context/DynamicContext/helpers.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +3 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +3 -1
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +2 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +2 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +3 -1
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +3 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +4 -3
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +4 -3
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -2
- package/src/lib/context/DynamicContext/validators.cjs +3 -1
- package/src/lib/context/DynamicContext/validators.js +3 -1
- package/src/lib/context/FundingContext/FundingContext.cjs +2 -2
- package/src/lib/context/FundingContext/FundingContext.js +1 -1
- package/src/lib/context/MockContext/MockContext.cjs +3 -1
- package/src/lib/context/MockContext/MockContext.js +3 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +4 -3
- package/src/lib/context/QrCodeContext/QrCodeContext.js +4 -3
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +5 -4
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +4 -3
- package/src/lib/context/ThemeContext/themesData.cjs +3 -1
- package/src/lib/context/ThemeContext/themesData.js +3 -1
- package/src/lib/data/api.cjs +3 -2
- package/src/lib/data/api.js +3 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +5 -4
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +5 -4
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +5 -4
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +5 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +5 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +5 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +6 -5
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +5 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +7 -6
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +5 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +4 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +4 -3
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +5 -4
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +5 -4
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +5 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +5 -3
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +25 -40
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +26 -41
- package/src/lib/modals/TransactionConfirmationModal/hooks/index.d.ts +1 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/index.d.ts +1 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.cjs +85 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.d.ts +18 -0
- package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.js +81 -0
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +1 -1
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +2 -2
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +1 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +22 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.d.ts +2 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +18 -0
- package/src/lib/shared/utils/functions/formatBigNumber/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +3 -3
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +1 -1
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +3 -1
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +3 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +3 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +3 -1
- package/src/lib/utils/functions/getEnabledKYC/index.cjs +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.d.ts +5 -0
- package/src/lib/utils/functions/getEnabledKYC/index.js +5 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.cjs +74 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.d.ts +29 -0
- package/src/lib/utils/functions/getEnabledUserProfileFields/getEnabledUserProfileFields.js +68 -0
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +2 -2
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +3 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +3 -1
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.cjs +2 -2
- package/src/lib/utils/functions/isSameWalletName/isSameWalletName.js +1 -1
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +3 -3
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +1 -1
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +2 -2
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +1 -1
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.cjs +5 -3
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +3 -1
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.cjs +2 -2
- package/src/lib/utils/functions/requiresTwoStepAuthentication/requiresTwoStepAuthentication.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +6 -6
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +6 -4
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +2 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +2 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +4 -2
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +4 -2
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +3 -1
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +3 -1
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +6 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -2
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +3 -1
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +3 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +4 -2
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +4 -2
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +2 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +2 -1
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +2 -1
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +2 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +3 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +3 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.cjs +3 -1
- package/src/lib/utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.js +3 -1
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +16 -6
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.d.ts +5 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +16 -6
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs +3 -1
- package/src/lib/utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js +3 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +3 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +3 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +2 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +2 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +4 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +3 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +9 -7
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +3 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +6 -4
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +5 -4
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +5 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +5 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +5 -4
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +5 -4
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +5 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +7 -6
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +7 -6
- package/src/lib/views/CollectUserDataView/fieldsConfig.cjs +3 -1
- package/src/lib/views/CollectUserDataView/fieldsConfig.js +3 -1
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +5 -4
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +5 -4
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +6 -5
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +5 -4
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +5 -4
- package/src/lib/views/EmailUpdate/EmailUpdate.js +5 -4
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +5 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +4 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +4 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +4 -2
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +5 -4
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +5 -4
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +5 -4
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +4 -3
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +12 -6
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +12 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +5 -4
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +5 -4
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -4
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -4
- package/src/lib/views/NoAccess/NoAccess.cjs +5 -4
- package/src/lib/views/NoAccess/NoAccess.js +5 -4
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +5 -4
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +5 -4
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +5 -4
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +5 -4
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +6 -5
- package/src/lib/views/PendingConnectView/PendingConnectView.js +5 -4
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +4 -3
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +4 -3
- package/src/lib/views/QrCodeView/QRCode.cjs +2 -2
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +6 -5
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +5 -4
- package/src/lib/views/QrCodeView/QrCodeView.cjs +5 -4
- package/src/lib/views/QrCodeView/QrCodeView.js +5 -4
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -4
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -4
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +5 -4
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +5 -4
- package/src/lib/views/WalletList/WalletList.cjs +3 -1
- package/src/lib/views/WalletList/WalletList.js +3 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +4 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +4 -3
- package/src/lib/views/WalletList/data.cjs +4 -1
- package/src/lib/views/WalletList/data.js +4 -1
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +5 -4
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +5 -4
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +4 -3
- package/src/lib/views/WalletUsedView/WalletUsedView.js +4 -3
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +6 -5
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +7 -6
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +6 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +4 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +4 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +4 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +4 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +5 -3
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +5 -3
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +5 -4
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +4 -3
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +4 -3
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +6 -5
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +4 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +6 -5
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +5 -4
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +10 -6
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +5 -4
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +5 -4
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +9 -9
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +9 -9
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +5 -4
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +5 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useRef, useState,
|
|
2
|
+
import { useRef, useState, useMemo, useCallback } from 'react';
|
|
4
3
|
import { ethers } from 'ethers';
|
|
5
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';
|
|
10
|
-
import '@dynamic-labs/
|
|
9
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
10
|
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
12
11
|
import '../../utils/constants/colors.js';
|
|
12
|
+
import { formatBigNumber } from '../../shared/utils/functions/formatBigNumber/formatBigNumber.js';
|
|
13
13
|
import { usePreventPageScroll } from '../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js';
|
|
14
14
|
import '@dynamic-labs/iconic';
|
|
15
15
|
import '../../context/ViewContext/ViewContext.js';
|
|
@@ -17,6 +17,7 @@ import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
|
17
17
|
import { ReactComponent as SvgSignCircle } from '../../shared/assets/sign-circle.js';
|
|
18
18
|
import { authModalZIndex } from '../../shared/consts/index.js';
|
|
19
19
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
20
|
+
import '@dynamic-labs/multi-wallet';
|
|
20
21
|
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
21
22
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
22
23
|
import { Icon } from '../../components/Icon/Icon.js';
|
|
@@ -27,6 +28,7 @@ import '@dynamic-labs/rpc-providers';
|
|
|
27
28
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
28
29
|
import { useFetchCurrency } from '../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js';
|
|
29
30
|
import { transactionErrorMessage } from './helpers/transactionErrorMessage.js';
|
|
31
|
+
import { useTransactionData } from './hooks/useTransactionData/useTransactionData.js';
|
|
30
32
|
import '../../context/MockContext/MockContext.js';
|
|
31
33
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
32
34
|
import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
@@ -35,26 +37,27 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
35
37
|
import { Button } from '../../components/Button/Button.js';
|
|
36
38
|
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
37
39
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
40
|
+
import { Alert } from '../../components/Alert/Alert.js';
|
|
38
41
|
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
39
42
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
40
43
|
import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
|
|
41
44
|
import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
|
|
42
|
-
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
43
45
|
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
44
46
|
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
45
47
|
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
46
48
|
import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
|
|
47
49
|
|
|
48
|
-
const digitsLimitSub = 1e8;
|
|
49
50
|
const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
|
|
50
51
|
usePreventPageScroll(true);
|
|
51
52
|
const { primaryWallet } = useInternalDynamicContext();
|
|
52
53
|
const didConfirmRef = useRef(false);
|
|
53
54
|
const [show, setShow] = useState(true);
|
|
54
|
-
const { from, to, value } = transaction;
|
|
55
55
|
if (!primaryWallet) {
|
|
56
56
|
throw new DynamicError('Primary wallet is not available, transaction cannot be displayed');
|
|
57
57
|
}
|
|
58
|
+
const { data: balance } = usePromise(() => primaryWallet.connector
|
|
59
|
+
.getBalance()
|
|
60
|
+
.then((balanceText) => balanceText ? ethers.utils.parseEther(balanceText) : undefined));
|
|
58
61
|
const [currencySymbol] = useFetchCurrency(primaryWallet.connector);
|
|
59
62
|
const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation(() => handler(transaction), {
|
|
60
63
|
onSuccess: () => {
|
|
@@ -62,6 +65,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
62
65
|
setShow(false);
|
|
63
66
|
},
|
|
64
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]);
|
|
65
82
|
const handleOnReject = useCallback(() => {
|
|
66
83
|
didConfirmRef.current = false;
|
|
67
84
|
setShow(false);
|
|
@@ -77,45 +94,13 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
77
94
|
onTransactionResponseSuccess,
|
|
78
95
|
onReject,
|
|
79
96
|
]);
|
|
80
|
-
const { data: effectiveValue, isLoading: isEffectiveValueLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
const val = yield value;
|
|
82
|
-
return val ? ethers.BigNumber.from(val) : undefined;
|
|
83
|
-
}));
|
|
84
|
-
const { data: effectiveGasPrice, isLoading: isEffectiveGasPriceLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
const gasPrice = yield provider.getGasPrice();
|
|
86
|
-
const estimatedGas = yield provider.estimateGas(transaction);
|
|
87
|
-
return gasPrice && estimatedGas
|
|
88
|
-
? ethers.BigNumber.from(gasPrice).mul(estimatedGas)
|
|
89
|
-
: undefined;
|
|
90
|
-
}));
|
|
91
|
-
const { data: effectiveToAddress, isLoading: isEffectiveToAddressLoading } = usePromise(() => to);
|
|
92
|
-
const { data: effectiveFromAddress, isLoading: isEffectiveFromAddressLoading, } = usePromise(() => from);
|
|
93
|
-
const total = useMemo(() => {
|
|
94
|
-
if (effectiveGasPrice !== undefined && effectiveValue !== undefined) {
|
|
95
|
-
return effectiveGasPrice.add(effectiveValue);
|
|
96
|
-
}
|
|
97
|
-
return effectiveValue || effectiveGasPrice;
|
|
98
|
-
}, [effectiveGasPrice, effectiveValue]);
|
|
99
|
-
const isLoadingTransaction = useMemo(() => isEffectiveValueLoading ||
|
|
100
|
-
isEffectiveGasPriceLoading ||
|
|
101
|
-
isEffectiveToAddressLoading ||
|
|
102
|
-
isEffectiveFromAddressLoading, [
|
|
103
|
-
isEffectiveValueLoading,
|
|
104
|
-
isEffectiveGasPriceLoading,
|
|
105
|
-
isEffectiveToAddressLoading,
|
|
106
|
-
isEffectiveFromAddressLoading,
|
|
107
|
-
]);
|
|
108
97
|
const ChainIcon = getChainIcon('evm');
|
|
109
|
-
const formatValue = (value, sub) => {
|
|
110
|
-
if (!sub) {
|
|
111
|
-
return ethers.utils.formatEther(value);
|
|
112
|
-
}
|
|
113
|
-
return ethers.utils.formatEther(value.sub(value.mod(sub)));
|
|
114
|
-
};
|
|
115
98
|
const closeButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
|
|
116
99
|
return (jsx(Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
117
100
|
onUnmount: handleOnModalUnmount,
|
|
118
|
-
} }, { 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(
|
|
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, {})] }))] })) })));
|
|
119
104
|
};
|
|
120
105
|
const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
|
|
121
106
|
alignItems: 'center',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useTransactionData';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTransactionData } from './useTransactionData';
|
package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.cjs
ADDED
|
@@ -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;
|
package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.d.ts
ADDED
|
@@ -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 {};
|
package/src/lib/modals/TransactionConfirmationModal/hooks/useTransactionData/useTransactionData.js
ADDED
|
@@ -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 };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
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 =
|
|
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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var iconic = require('@dynamic-labs/iconic');
|
|
6
|
-
var
|
|
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 =
|
|
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/
|
|
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';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ethers = require('ethers');
|
|
6
|
+
|
|
7
|
+
const formatBigNumber = (value, decimals) => {
|
|
8
|
+
const formatted = ethers.ethers.utils.formatEther(value);
|
|
9
|
+
if (!decimals) {
|
|
10
|
+
return formatted;
|
|
11
|
+
}
|
|
12
|
+
const toFloat = parseFloat(formatted);
|
|
13
|
+
const power = Math.pow(10, decimals);
|
|
14
|
+
const roundedNumber = Math.round(toFloat * power) / power;
|
|
15
|
+
const hasDecimals = roundedNumber.toString().split('.').length !== 1;
|
|
16
|
+
if (hasDecimals) {
|
|
17
|
+
return roundedNumber.toString();
|
|
18
|
+
}
|
|
19
|
+
return roundedNumber.toFixed(1);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.formatBigNumber = formatBigNumber;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
|
|
3
|
+
const formatBigNumber = (value, decimals) => {
|
|
4
|
+
const formatted = ethers.utils.formatEther(value);
|
|
5
|
+
if (!decimals) {
|
|
6
|
+
return formatted;
|
|
7
|
+
}
|
|
8
|
+
const toFloat = parseFloat(formatted);
|
|
9
|
+
const power = Math.pow(10, decimals);
|
|
10
|
+
const roundedNumber = Math.round(toFloat * power) / power;
|
|
11
|
+
const hasDecimals = roundedNumber.toString().split('.').length !== 1;
|
|
12
|
+
if (hasDecimals) {
|
|
13
|
+
return roundedNumber.toString();
|
|
14
|
+
}
|
|
15
|
+
return roundedNumber.toFixed(1);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { formatBigNumber };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { formatBigNumber } from './formatBigNumber';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var utils = require('@dynamic-labs/utils');
|
|
6
6
|
var localStorage = require('../../../../utils/constants/localStorage.cjs');
|
|
7
7
|
require('../../../../utils/constants/colors.cjs');
|
|
8
8
|
var getFromLS = require('../storage/getFromLS.cjs');
|
|
@@ -12,8 +12,8 @@ const comingSoonToMultiWalletDesktop = ['MyAlgo'];
|
|
|
12
12
|
const getWalletListItemLabel = ({ walletName, usingMultiWallet, isInstalledOnBrowser, }) => {
|
|
13
13
|
let label;
|
|
14
14
|
const isComingSoon = usingMultiWallet &&
|
|
15
|
-
((
|
|
16
|
-
(!
|
|
15
|
+
((utils.isMobile() && comingSoonToMultiWalletMobile.includes(walletName)) ||
|
|
16
|
+
(!utils.isMobile() && comingSoonToMultiWalletDesktop.includes(walletName)));
|
|
17
17
|
const lastUsed = getFromLS.getFromLS(localStorage.LAST_USED_WALLET) === walletName;
|
|
18
18
|
if (isComingSoon) {
|
|
19
19
|
label = 'Coming soon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isMobile } from '@dynamic-labs/
|
|
1
|
+
import { isMobile } from '@dynamic-labs/utils';
|
|
2
2
|
import { LAST_USED_WALLET } from '../../../../utils/constants/localStorage.js';
|
|
3
3
|
import '../../../../utils/constants/colors.js';
|
|
4
4
|
import { getFromLS } from '../storage/getFromLS.js';
|
|
@@ -8,10 +8,12 @@ require('@dynamic-labs/sdk-api');
|
|
|
8
8
|
var getFromLS = require('../../functions/storage/getFromLS.cjs');
|
|
9
9
|
var setToLS = require('../../functions/storage/setToLS.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
|
-
require('@dynamic-labs/
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
12
|
require('react/jsx-runtime');
|
|
13
13
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
14
15
|
require('../../../../utils/constants/colors.cjs');
|
|
16
|
+
require('ethers');
|
|
15
17
|
|
|
16
18
|
const useLocalStorage = (key, initialValue, valueValidator, otherKeysToRemove) => {
|
|
17
19
|
const [storedValue, setStoredValue] = React.useState(() => {
|
|
@@ -4,10 +4,12 @@ import '@dynamic-labs/sdk-api';
|
|
|
4
4
|
import { getFromLS } from '../../functions/storage/getFromLS.js';
|
|
5
5
|
import { setToLS } from '../../functions/storage/setToLS.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
|
-
import '@dynamic-labs/
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
9
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
10
11
|
import '../../../../utils/constants/colors.js';
|
|
12
|
+
import 'ethers';
|
|
11
13
|
|
|
12
14
|
const useLocalStorage = (key, initialValue, valueValidator, otherKeysToRemove) => {
|
|
13
15
|
const [storedValue, setStoredValue] = useState(() => {
|