@dynamic-labs/sdk-react-core 0.17.0-RC.0 → 0.17.0-RC.10
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 +137 -0
- package/package.cjs +5 -5
- package/package.js +5 -5
- package/package.json +11 -8
- package/src/index.cjs +34 -24
- package/src/index.d.ts +5 -4
- package/src/index.js +10 -4
- package/src/lib/Main.cjs +14 -6
- package/src/lib/Main.js +13 -5
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +6 -2
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +6 -2
- 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 +12 -8
- package/src/lib/components/AnimatePresence/AnimatePresence.js +12 -8
- package/src/lib/components/AnimatePresence/AnimatePresence.types.d.ts +2 -4
- package/src/lib/components/AnimatePresence/index.d.ts +0 -1
- 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 +6 -2
- package/src/lib/components/Divider/Divider.js +6 -2
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +3 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +3 -1
- package/src/lib/components/IconListTile/IconListTile.cjs +15 -0
- package/src/lib/components/IconListTile/IconListTile.d.ts +2 -0
- package/src/lib/components/IconListTile/IconListTile.js +11 -0
- package/src/lib/components/IconListTile/index.d.ts +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +4 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +4 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +4 -1
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +4 -1
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +3 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +3 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +3 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +3 -0
- package/src/lib/components/ListTile/ListTile.cjs +1 -1
- package/src/lib/components/ListTile/ListTile.js +1 -1
- package/src/lib/components/ListTile/index.d.ts +1 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.cjs +5 -2
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.js +5 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +6 -3
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +3 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +6 -3
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +6 -2
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +6 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +10 -6
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +10 -6
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +6 -2
- package/src/lib/components/NetworkPicker/components/Network/Network.js +6 -2
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.d.ts +4 -4
- package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.d.ts +2 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +6 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +6 -2
- 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 +6 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +6 -2
- package/src/lib/components/OverlayCard/OverlayCard.cjs +49 -0
- package/src/lib/components/OverlayCard/OverlayCard.context.cjs +9 -0
- package/src/lib/components/OverlayCard/OverlayCard.context.d.ts +6 -0
- package/src/lib/components/OverlayCard/OverlayCard.context.js +5 -0
- package/src/lib/components/OverlayCard/OverlayCard.d.ts +8 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +44 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget.cjs +17 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget.d.ts +2 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget.js +13 -0
- package/src/lib/components/OverlayCard/index.d.ts +2 -0
- package/src/lib/components/Portal/Portal.cjs +21 -2
- package/src/lib/components/Portal/Portal.js +21 -2
- 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 -1
- package/src/lib/components/Toolkit/Toolkit.js +4 -1
- 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 +6 -2
- package/src/lib/components/Tooltip/Tooltip.js +6 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +54 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.d.ts +4 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +50 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.types.d.ts +6 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/index.d.ts +1 -0
- package/src/lib/components/Transition/index.d.ts +1 -0
- package/src/lib/components/Transition/transition.type.d.ts +2 -4
- package/src/lib/components/UserAddress/UserAddress.cjs +7 -7
- package/src/lib/components/UserAddress/UserAddress.js +8 -8
- package/src/lib/components/UserProfile/UserProfile.cjs +16 -8
- package/src/lib/components/UserProfile/UserProfile.js +12 -4
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +6 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +6 -2
- 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 +6 -2
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +6 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +6 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +6 -2
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +58 -29
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +8 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +52 -23
- 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 +3 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +3 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +84 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.d.ts +11 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +80 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.types.d.ts +4 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +6 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +6 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -1
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +3 -1
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +3 -1
- 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 +69 -0
- package/src/lib/context/FundingContext/FundingContext.d.ts +14 -0
- package/src/lib/context/FundingContext/FundingContext.js +63 -0
- package/src/lib/context/FundingContext/index.d.ts +1 -0
- 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 +6 -2
- package/src/lib/context/QrCodeContext/QrCodeContext.js +6 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +117 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +17 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +111 -0
- package/src/lib/context/SocialRedirectContext/index.d.ts +1 -0
- package/src/lib/context/ThemeContext/themesData.cjs +3 -1
- package/src/lib/context/ThemeContext/themesData.js +3 -1
- package/src/lib/context/ViewContext/ViewContext.cjs +4 -1
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/context/ViewContext/ViewContext.js +4 -1
- package/src/lib/data/api.cjs +40 -21
- package/src/lib/data/api.d.ts +8 -1
- package/src/lib/data/api.js +28 -10
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +10 -4
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +10 -4
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +6 -2
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +6 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +6 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +6 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +7 -3
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +6 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +8 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +6 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +8 -4
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +8 -4
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +6 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +6 -2
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +11 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +11 -4
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +32 -42
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +32 -42
- 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/assets/dots-horizontal.cjs +54 -0
- package/src/lib/shared/assets/dots-horizontal.js +30 -0
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/types/index.d.ts +4 -6
- 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 +5 -10
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +3 -8
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +35 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.d.ts +17 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js +31 -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/constants/localStorage.cjs +3 -1
- package/src/lib/utils/constants/localStorage.d.ts +1 -0
- package/src/lib/utils/constants/localStorage.js +3 -2
- package/src/lib/utils/functions/generateMessages/index.cjs +4 -3
- package/src/lib/utils/functions/generateMessages/index.js +2 -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/getNetwork/getNetwork.cjs +1 -6
- package/src/lib/utils/functions/getNetwork/getNetwork.d.ts +1 -1
- package/src/lib/utils/functions/getNetwork/getNetwork.js +1 -6
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.cjs +22 -0
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.d.ts +3 -0
- package/src/lib/utils/functions/getSocialIcon/getSocialIcon.js +18 -0
- package/src/lib/utils/functions/getSocialIcon/index.d.ts +1 -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/getWalletVerifiedCredential/getWalletVerifiedCredential.cjs +1 -1
- package/src/lib/utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.d.ts +1 -2
- package/src/lib/utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.js +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +6 -3
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +4 -1
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.cjs +16 -1
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.d.ts +6 -0
- package/src/lib/utils/functions/isProgrammableNetworkSwitchSupported/isProgrammableNetworkSwitchSupported.js +16 -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/isSupportedNetwork/isSupportedNetwork.cjs +6 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.d.ts +1 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.js +6 -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 +6 -3
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.d.ts +2 -0
- package/src/lib/utils/functions/parseWalletLinks/parseWalletLinks.js +4 -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/walletFilters/index.cjs +2 -0
- package/src/lib/utils/functions/walletFilters/index.d.ts +2 -0
- package/src/lib/utils/functions/walletFilters/index.js +2 -1
- package/src/lib/utils/functions/walletListBuilder/index.d.ts +1 -19
- package/src/lib/utils/functions/walletListBuilder/{index.cjs → walletListBuilder.cjs} +8 -6
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.d.ts +19 -0
- package/src/lib/utils/functions/walletListBuilder/{index.js → walletListBuilder.js} +5 -3
- 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 +3 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +3 -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 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +4 -1
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +6 -3
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +4 -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 +34 -35
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +33 -34
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +3 -2
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +3 -2
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +4 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +4 -1
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +53 -31
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts +5 -5
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +53 -31
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +4 -2
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +3 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +5 -2
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +4 -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/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +1 -2
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +1 -2
- 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/useMutation/useMutation.cjs +4 -4
- package/src/lib/utils/hooks/useMutation/useMutation.js +1 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +8 -5
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +2 -2
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +10 -7
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs +7 -0
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.d.ts +7 -0
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js +7 -0
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +6 -4
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +5 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +14 -12
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +10 -8
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +6 -3
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +4 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +9 -7
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +3 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +15 -6
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +13 -4
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -0
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -16
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -4
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -16
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +6 -2
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +6 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +11 -6
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +11 -6
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.cjs → OnboardingUserDataForm/OnboardingUserDataForm.cjs} +15 -9
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.d.ts → OnboardingUserDataForm/OnboardingUserDataForm.d.ts} +1 -1
- package/src/lib/views/CollectUserDataView/{UserDataForm/UserDataForm.js → OnboardingUserDataForm/OnboardingUserDataForm.js} +15 -9
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/index.d.ts +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +8 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +8 -4
- 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 +9 -5
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +9 -5
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +8 -5
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +7 -4
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +6 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +6 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +12 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +12 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +8 -4
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +7 -3
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +6 -4
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +5 -3
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +6 -2
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +6 -2
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +12 -4
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +12 -4
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +68 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.d.ts +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +64 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/index.d.ts +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +15 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +15 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +8 -3
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +8 -3
- package/src/lib/views/{WalletNoAccess/WalletNoAccess.cjs → NoAccess/NoAccess.cjs} +24 -9
- package/src/lib/views/NoAccess/NoAccess.d.ts +2 -0
- package/src/lib/views/{WalletNoAccess/WalletNoAccess.js → NoAccess/NoAccess.js} +26 -11
- package/src/lib/views/NoAccess/index.d.ts +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +6 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +6 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +6 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +6 -2
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +7 -3
- package/src/lib/views/PendingConnectView/PendingConnectView.js +6 -2
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +7 -3
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +7 -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 +10 -6
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +9 -5
- package/src/lib/views/QrCodeView/QrCodeView.cjs +6 -2
- package/src/lib/views/QrCodeView/QrCodeView.js +6 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +55 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.d.ts +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +51 -0
- package/src/lib/views/SocialRedirectView/index.d.ts +1 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +6 -2
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +6 -2
- package/src/lib/views/WalletList/WalletList.cjs +5 -3
- package/src/lib/views/WalletList/WalletList.js +4 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +6 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +6 -2
- package/src/lib/views/WalletList/data.cjs +6 -8
- package/src/lib/views/WalletList/data.d.ts +1 -2
- package/src/lib/views/WalletList/data.js +7 -8
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +7 -4
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +7 -4
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +8 -4
- package/src/lib/views/WalletUsedView/WalletUsedView.js +6 -2
- package/src/lib/views/index.d.ts +1 -1
- package/src/lib/views/viewToComponentMap.cjs +5 -3
- package/src/lib/views/viewToComponentMap.js +5 -3
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +9 -6
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +9 -6
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +7 -3
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.cjs +8 -4
- package/src/lib/widgets/DynamicWidget/components/DotsMenuWrapper/DotsMenuWrapper.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +7 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +17 -10
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +17 -10
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +3 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +3 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +24 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +24 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +9 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +9 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +7 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +7 -3
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.types.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +7 -4
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +7 -4
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +3 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +6 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +3 -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.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +22 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +18 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +7 -3
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +55 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +51 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +9 -5
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +4 -1
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +11 -6
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +11 -6
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +6 -2
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +13 -6
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +11 -4
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +6 -2
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +10 -7
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +10 -7
- package/src/lib/widgets/FundingWidget/FundingWidget.cjs +10 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.d.ts +2 -0
- package/src/lib/widgets/FundingWidget/FundingWidget.js +6 -0
- package/src/lib/widgets/FundingWidget/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +57 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.d.ts +5 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +52 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/index.d.ts +1 -0
- package/src/lib/widgets/index.d.ts +1 -0
- package/src/lib/components/AnimatePresence/animations/VerticalDrawerAnimation/VerticalDrawerAnimation.cjs +0 -57
- package/src/lib/components/AnimatePresence/animations/VerticalDrawerAnimation/VerticalDrawerAnimation.d.ts +0 -4
- package/src/lib/components/AnimatePresence/animations/VerticalDrawerAnimation/VerticalDrawerAnimation.js +0 -51
- package/src/lib/components/AnimatePresence/animations/VerticalDrawerAnimation/VerticalDrawerAnimation.types.d.ts +0 -8
- package/src/lib/components/AnimatePresence/animations/VerticalDrawerAnimation/index.d.ts +0 -1
- package/src/lib/components/AnimatePresence/animations/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.cjs +0 -12
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.d.ts +0 -2
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/getMagicLinkApiKeyFromProviders.js +0 -8
- package/src/lib/utils/hooks/useWallets/utils/getMagicLinkApiKeyFromProviders/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWallets/utils/index.d.ts +0 -1
- package/src/lib/views/CollectUserDataView/UserDataForm/index.d.ts +0 -1
- package/src/lib/views/WalletNoAccess/WalletNoAccess.d.ts +0 -2
- package/src/lib/views/WalletNoAccess/index.d.ts +0 -1
|
@@ -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
|
|
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,15 +21,18 @@ 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');
|
|
26
28
|
var Portal = require('../../components/Portal/Portal.cjs');
|
|
27
29
|
require('react-dom');
|
|
28
30
|
require('../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('@dynamic-labs/rpc-providers');
|
|
29
32
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
33
|
var useFetchCurrency = require('../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs');
|
|
31
34
|
var transactionErrorMessage = require('./helpers/transactionErrorMessage.cjs');
|
|
35
|
+
var useTransactionData = require('./hooks/useTransactionData/useTransactionData.cjs');
|
|
32
36
|
require('../../context/MockContext/MockContext.cjs');
|
|
33
37
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
34
38
|
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
@@ -37,23 +41,27 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
|
37
41
|
var Button = require('../../components/Button/Button.cjs');
|
|
38
42
|
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
39
43
|
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
44
|
+
var Alert = require('../../components/Alert/Alert.cjs');
|
|
40
45
|
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
41
46
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
42
47
|
var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
|
|
43
48
|
var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
50
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
51
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
52
|
+
var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
|
|
46
53
|
|
|
47
|
-
const digitsLimitSub = 1e8;
|
|
48
54
|
const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
|
|
49
55
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
50
56
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
51
57
|
const didConfirmRef = React.useRef(false);
|
|
52
58
|
const [show, setShow] = React.useState(true);
|
|
53
|
-
const { from, to, value } = transaction;
|
|
54
59
|
if (!primaryWallet) {
|
|
55
|
-
throw new
|
|
60
|
+
throw new utils.DynamicError('Primary wallet is not available, transaction cannot be displayed');
|
|
56
61
|
}
|
|
62
|
+
const { data: balance } = usePromise.usePromise(() => primaryWallet.connector
|
|
63
|
+
.getBalance()
|
|
64
|
+
.then((balanceText) => balanceText ? ethers.ethers.utils.parseEther(balanceText) : undefined));
|
|
57
65
|
const [currencySymbol] = useFetchCurrency.useFetchCurrency(primaryWallet.connector);
|
|
58
66
|
const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation.useMutation(() => handler(transaction), {
|
|
59
67
|
onSuccess: () => {
|
|
@@ -61,6 +69,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
61
69
|
setShow(false);
|
|
62
70
|
},
|
|
63
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]);
|
|
64
86
|
const handleOnReject = React.useCallback(() => {
|
|
65
87
|
didConfirmRef.current = false;
|
|
66
88
|
setShow(false);
|
|
@@ -76,45 +98,13 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
76
98
|
onTransactionResponseSuccess,
|
|
77
99
|
onReject,
|
|
78
100
|
]);
|
|
79
|
-
const { data: effectiveValue, isLoading: isEffectiveValueLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
const val = yield value;
|
|
81
|
-
return val ? ethers.ethers.BigNumber.from(val) : undefined;
|
|
82
|
-
}));
|
|
83
|
-
const { data: effectiveGasPrice, isLoading: isEffectiveGasPriceLoading } = usePromise.usePromise(() => _tslib.__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.ethers.BigNumber.from(gasPrice).mul(estimatedGas)
|
|
88
|
-
: undefined;
|
|
89
|
-
}));
|
|
90
|
-
const { data: effectiveToAddress, isLoading: isEffectiveToAddressLoading } = usePromise.usePromise(() => to);
|
|
91
|
-
const { data: effectiveFromAddress, isLoading: isEffectiveFromAddressLoading, } = usePromise.usePromise(() => from);
|
|
92
|
-
const total = React.useMemo(() => {
|
|
93
|
-
if (effectiveGasPrice !== undefined && effectiveValue !== undefined) {
|
|
94
|
-
return effectiveGasPrice.add(effectiveValue);
|
|
95
|
-
}
|
|
96
|
-
return effectiveValue || effectiveGasPrice;
|
|
97
|
-
}, [effectiveGasPrice, effectiveValue]);
|
|
98
|
-
const isLoadingTransaction = React.useMemo(() => isEffectiveValueLoading ||
|
|
99
|
-
isEffectiveGasPriceLoading ||
|
|
100
|
-
isEffectiveToAddressLoading ||
|
|
101
|
-
isEffectiveFromAddressLoading, [
|
|
102
|
-
isEffectiveValueLoading,
|
|
103
|
-
isEffectiveGasPriceLoading,
|
|
104
|
-
isEffectiveToAddressLoading,
|
|
105
|
-
isEffectiveFromAddressLoading,
|
|
106
|
-
]);
|
|
107
101
|
const ChainIcon = getChainIcon.getChainIcon('evm');
|
|
108
|
-
const formatValue = (value, sub) => {
|
|
109
|
-
if (!sub) {
|
|
110
|
-
return ethers.ethers.utils.formatEther(value);
|
|
111
|
-
}
|
|
112
|
-
return ethers.ethers.utils.formatEther(value.sub(value.mod(sub)));
|
|
113
|
-
};
|
|
114
102
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
|
|
115
103
|
return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
116
104
|
onUnmount: handleOnModalUnmount,
|
|
117
|
-
} }, { 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(
|
|
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, {})] }))] })) })));
|
|
118
108
|
};
|
|
119
109
|
const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxRuntime.jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
|
|
120
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,
|
|
2
|
+
import { useRef, useState, useMemo, useCallback } from 'react';
|
|
4
3
|
import { ethers } from 'ethers';
|
|
5
|
-
import { DynamicError } from '@dynamic-labs/
|
|
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,15 +17,18 @@ 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';
|
|
22
24
|
import { Portal } from '../../components/Portal/Portal.js';
|
|
23
25
|
import 'react-dom';
|
|
24
26
|
import '../../config/ApiEndpoint.js';
|
|
27
|
+
import '@dynamic-labs/rpc-providers';
|
|
25
28
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
26
29
|
import { useFetchCurrency } from '../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js';
|
|
27
30
|
import { transactionErrorMessage } from './helpers/transactionErrorMessage.js';
|
|
31
|
+
import { useTransactionData } from './hooks/useTransactionData/useTransactionData.js';
|
|
28
32
|
import '../../context/MockContext/MockContext.js';
|
|
29
33
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
30
34
|
import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
@@ -33,23 +37,27 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
33
37
|
import { Button } from '../../components/Button/Button.js';
|
|
34
38
|
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
35
39
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
40
|
+
import { Alert } from '../../components/Alert/Alert.js';
|
|
36
41
|
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
37
42
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
38
43
|
import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
|
|
39
44
|
import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
|
|
40
|
-
import
|
|
41
|
-
import
|
|
45
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
46
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
47
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
48
|
+
import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
|
|
42
49
|
|
|
43
|
-
const digitsLimitSub = 1e8;
|
|
44
50
|
const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
|
|
45
51
|
usePreventPageScroll(true);
|
|
46
52
|
const { primaryWallet } = useInternalDynamicContext();
|
|
47
53
|
const didConfirmRef = useRef(false);
|
|
48
54
|
const [show, setShow] = useState(true);
|
|
49
|
-
const { from, to, value } = transaction;
|
|
50
55
|
if (!primaryWallet) {
|
|
51
56
|
throw new DynamicError('Primary wallet is not available, transaction cannot be displayed');
|
|
52
57
|
}
|
|
58
|
+
const { data: balance } = usePromise(() => primaryWallet.connector
|
|
59
|
+
.getBalance()
|
|
60
|
+
.then((balanceText) => balanceText ? ethers.utils.parseEther(balanceText) : undefined));
|
|
53
61
|
const [currencySymbol] = useFetchCurrency(primaryWallet.connector);
|
|
54
62
|
const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation(() => handler(transaction), {
|
|
55
63
|
onSuccess: () => {
|
|
@@ -57,6 +65,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
57
65
|
setShow(false);
|
|
58
66
|
},
|
|
59
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]);
|
|
60
82
|
const handleOnReject = useCallback(() => {
|
|
61
83
|
didConfirmRef.current = false;
|
|
62
84
|
setShow(false);
|
|
@@ -72,45 +94,13 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
|
|
|
72
94
|
onTransactionResponseSuccess,
|
|
73
95
|
onReject,
|
|
74
96
|
]);
|
|
75
|
-
const { data: effectiveValue, isLoading: isEffectiveValueLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
-
const val = yield value;
|
|
77
|
-
return val ? ethers.BigNumber.from(val) : undefined;
|
|
78
|
-
}));
|
|
79
|
-
const { data: effectiveGasPrice, isLoading: isEffectiveGasPriceLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
const gasPrice = yield provider.getGasPrice();
|
|
81
|
-
const estimatedGas = yield provider.estimateGas(transaction);
|
|
82
|
-
return gasPrice && estimatedGas
|
|
83
|
-
? ethers.BigNumber.from(gasPrice).mul(estimatedGas)
|
|
84
|
-
: undefined;
|
|
85
|
-
}));
|
|
86
|
-
const { data: effectiveToAddress, isLoading: isEffectiveToAddressLoading } = usePromise(() => to);
|
|
87
|
-
const { data: effectiveFromAddress, isLoading: isEffectiveFromAddressLoading, } = usePromise(() => from);
|
|
88
|
-
const total = useMemo(() => {
|
|
89
|
-
if (effectiveGasPrice !== undefined && effectiveValue !== undefined) {
|
|
90
|
-
return effectiveGasPrice.add(effectiveValue);
|
|
91
|
-
}
|
|
92
|
-
return effectiveValue || effectiveGasPrice;
|
|
93
|
-
}, [effectiveGasPrice, effectiveValue]);
|
|
94
|
-
const isLoadingTransaction = useMemo(() => isEffectiveValueLoading ||
|
|
95
|
-
isEffectiveGasPriceLoading ||
|
|
96
|
-
isEffectiveToAddressLoading ||
|
|
97
|
-
isEffectiveFromAddressLoading, [
|
|
98
|
-
isEffectiveValueLoading,
|
|
99
|
-
isEffectiveGasPriceLoading,
|
|
100
|
-
isEffectiveToAddressLoading,
|
|
101
|
-
isEffectiveFromAddressLoading,
|
|
102
|
-
]);
|
|
103
97
|
const ChainIcon = getChainIcon('evm');
|
|
104
|
-
const formatValue = (value, sub) => {
|
|
105
|
-
if (!sub) {
|
|
106
|
-
return ethers.utils.formatEther(value);
|
|
107
|
-
}
|
|
108
|
-
return ethers.utils.formatEther(value.sub(value.mod(sub)));
|
|
109
|
-
};
|
|
110
98
|
const closeButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
|
|
111
99
|
return (jsx(Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
112
100
|
onUnmount: handleOnModalUnmount,
|
|
113
|
-
} }, { 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(
|
|
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, {})] }))] })) })));
|
|
114
104
|
};
|
|
115
105
|
const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
|
|
116
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 };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var _path;
|
|
28
|
+
var _excluded = ["title", "titleId"];
|
|
29
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
var SvgDotsHorizontal = function SvgDotsHorizontal(_ref) {
|
|
33
|
+
var title = _ref.title,
|
|
34
|
+
titleId = _ref.titleId,
|
|
35
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
37
|
+
width: 21,
|
|
38
|
+
height: 20,
|
|
39
|
+
viewBox: "0 0 21 20",
|
|
40
|
+
fill: "none",
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
"aria-labelledby": titleId
|
|
43
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
44
|
+
id: titleId
|
|
45
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
46
|
+
fillRule: "evenodd",
|
|
47
|
+
clipRule: "evenodd",
|
|
48
|
+
d: "M2.7 10a1.667 1.667 0 1 1 3.333 0A1.667 1.667 0 0 1 2.7 10Zm5.833 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Zm5.834 0a1.667 1.667 0 1 1 3.333 0 1.667 1.667 0 0 1-3.333 0Z",
|
|
49
|
+
fill: "currentColor",
|
|
50
|
+
fillOpacity: 0.4
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.ReactComponent = SvgDotsHorizontal;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
var _excluded = ["title", "titleId"];
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
var SvgDotsHorizontal = function SvgDotsHorizontal(_ref) {
|
|
9
|
+
var title = _ref.title,
|
|
10
|
+
titleId = _ref.titleId,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
width: 21,
|
|
14
|
+
height: 20,
|
|
15
|
+
viewBox: "0 0 21 20",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
"aria-labelledby": titleId
|
|
19
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
20
|
+
id: titleId
|
|
21
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d: "M2.7 10a1.667 1.667 0 1 1 3.333 0A1.667 1.667 0 0 1 2.7 10Zm5.833 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Zm5.834 0a1.667 1.667 0 1 1 3.333 0 1.667 1.667 0 0 1-3.333 0Z",
|
|
25
|
+
fill: "currentColor",
|
|
26
|
+
fillOpacity: 0.4
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { SvgDotsHorizontal as ReactComponent };
|
|
@@ -30,3 +30,4 @@ export { ReactComponent as PencilAltIcon } from './pencil-alt-icon.svg';
|
|
|
30
30
|
export { ReactComponent as PencilIcon } from './pencil.svg';
|
|
31
31
|
export { ReactComponent as TooltipArrow } from './tooltip-arrow.svg';
|
|
32
32
|
export { ReactComponent as SwitchHorizontalIcon } from './switch-horizontal.svg';
|
|
33
|
+
export { ReactComponent as DotsHorizontalIcon } from './dots-horizontal.svg';
|