@dynamic-labs/sdk-react-core 0.17.0-RC.1 → 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 +114 -0
- package/package.cjs +5 -5
- package/package.js +5 -5
- package/package.json +11 -8
- package/src/index.cjs +11 -4
- package/src/index.d.ts +3 -2
- package/src/index.js +7 -2
- package/src/lib/Main.cjs +7 -3
- package/src/lib/Main.js +6 -2
- 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 +6 -2
- package/src/lib/components/AnimatePresence/AnimatePresence.js +6 -2
- 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/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/LogoutButton/LogoutButton.cjs +3 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
- 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 +6 -2
- package/src/lib/components/OverlayCard/OverlayCard.js +6 -2
- package/src/lib/components/Portal/Portal.cjs +6 -3
- package/src/lib/components/Portal/Portal.js +6 -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 -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 +6 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +6 -2
- 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/context/DynamicContext/DynamicContext.cjs +56 -26
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +8 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +50 -20
- 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 +13 -3
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +2 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +12 -2
- package/src/lib/context/ThemeContext/themesData.cjs +3 -1
- package/src/lib/context/ThemeContext/themesData.js +3 -1
- package/src/lib/data/api.cjs +36 -15
- package/src/lib/data/api.d.ts +8 -1
- package/src/lib/data/api.js +23 -3
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +6 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +6 -2
- 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 +6 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +6 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +28 -41
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +28 -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/types/index.d.ts +4 -2
- 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/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/walletListBuilder/walletListBuilder.cjs +6 -7
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -2
- 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 +6 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +4 -1
- 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 -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/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 +12 -10
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +8 -6
- 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 +6 -3
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -1
- 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 +10 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +10 -5
- 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 +8 -4
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +8 -4
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +7 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +6 -2
- 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 +11 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +11 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +7 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +6 -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 +6 -2
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +6 -2
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +10 -9
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +9 -8
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +16 -9
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +16 -9
- 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} +23 -7
- package/src/lib/views/NoAccess/NoAccess.d.ts +2 -0
- package/src/lib/views/{WalletNoAccess/WalletNoAccess.js → NoAccess/NoAccess.js} +25 -9
- 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 +7 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +6 -2
- 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 +6 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +6 -2
- 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 +3 -1
- package/src/lib/views/WalletList/WalletList.js +3 -1
- 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 +6 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +6 -2
- 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 +3 -3
- package/src/lib/views/viewToComponentMap.js +3 -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 +15 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +15 -8
- 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 +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +6 -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/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +6 -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 +6 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +6 -2
- 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 +6 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +6 -2
- 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 +8 -3
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +8 -3
- 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/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
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 };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EvmRpcProvider, SolanaRpcProvider } from '@dynamic-labs/rpc-providers';
|
|
3
3
|
import type { FetchPublicAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { WalletProviderEnum, ProjectSettings, UserFields, NameServiceData, JwtVerifiedCredential } from '@dynamic-labs/sdk-api';
|
|
5
|
+
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
5
6
|
export type BrowserName = 'brave' | 'chrome' | 'edge' | 'firefox' | 'safari';
|
|
6
7
|
export type Wallet = {
|
|
7
8
|
address: string;
|
|
@@ -26,7 +27,7 @@ export type UserProfile = UserFields & {
|
|
|
26
27
|
export type Icon = React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
|
|
27
28
|
title?: string | undefined;
|
|
28
29
|
}>;
|
|
29
|
-
export type WalletNamesUnion = 'Coinbase Wallet' | 'Coinbase Wallet (Solana)' | 'MetaMask' | 'Phantom' | 'Phantom (EVM)' | 'Phantom (Ledger)' | 'Venly' | 'Rainbow' | 'Solflare' | 'Glow' | 'Slope' | 'Blocto (Flow)' | 'Blocto (EVM)' | 'Blocto (App)' | 'Brave Wallet (EVM)' | 'Brave Wallet (Solana)' | 'Braavos' | 'Argent X' | 'Dapper' | 'Opera Wallet' | 'Injected Wallet' | 'Exodus Wallet (EVM)' | 'Exodus Wallet (Solana)' | '
|
|
30
|
+
export type WalletNamesUnion = 'Coinbase Wallet' | 'Coinbase Wallet (Solana)' | 'MetaMask' | 'Phantom' | 'Phantom (EVM)' | 'Phantom (Ledger)' | 'Venly' | 'Rainbow' | 'Solflare' | 'Glow' | 'Slope' | 'Blocto (Flow)' | 'Blocto (EVM)' | 'Blocto (App)' | 'Brave Wallet (EVM)' | 'Brave Wallet (Solana)' | 'Braavos' | 'Argent X' | 'Dapper' | 'Opera Wallet' | 'Injected Wallet' | 'Exodus Wallet (EVM)' | 'Exodus Wallet (Solana)' | 'ZenGo' | 'Lilico';
|
|
30
31
|
export type ChainNamesUnion = 'Solana' | 'Ethereum' | 'Flow' | 'EVM' | 'Algorand' | 'Starknet' | 'Cosmos' | 'Axelar' | 'Osmosis';
|
|
31
32
|
export interface WalletOption {
|
|
32
33
|
isInstalledOnBrowser: boolean;
|
|
@@ -99,6 +100,7 @@ export type LocalStorageNetworks = {
|
|
|
99
100
|
configurations: NetworkConfigurationMap;
|
|
100
101
|
environmentId?: string;
|
|
101
102
|
expiry: number;
|
|
103
|
+
version: number;
|
|
102
104
|
};
|
|
103
105
|
export type LocalStorageSettings = {
|
|
104
106
|
environmentId?: string;
|
|
@@ -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,23 +2,18 @@
|
|
|
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');
|
|
9
9
|
|
|
10
|
-
const comingSoonToMultiWalletMobile = [
|
|
11
|
-
|
|
12
|
-
'MyAlgo',
|
|
13
|
-
'Braavos',
|
|
14
|
-
'Fortmatic',
|
|
15
|
-
];
|
|
16
|
-
const comingSoonToMultiWalletDesktop = ['MyAlgo', 'Fortmatic'];
|
|
10
|
+
const comingSoonToMultiWalletMobile = ['Coinbase', 'MyAlgo', 'Braavos'];
|
|
11
|
+
const comingSoonToMultiWalletDesktop = ['MyAlgo'];
|
|
17
12
|
const getWalletListItemLabel = ({ walletName, usingMultiWallet, isInstalledOnBrowser, }) => {
|
|
18
13
|
let label;
|
|
19
14
|
const isComingSoon = usingMultiWallet &&
|
|
20
|
-
((
|
|
21
|
-
(!
|
|
15
|
+
((utils.isMobile() && comingSoonToMultiWalletMobile.includes(walletName)) ||
|
|
16
|
+
(!utils.isMobile() && comingSoonToMultiWalletDesktop.includes(walletName)));
|
|
22
17
|
const lastUsed = getFromLS.getFromLS(localStorage.LAST_USED_WALLET) === walletName;
|
|
23
18
|
if (isComingSoon) {
|
|
24
19
|
label = 'Coming soon';
|
|
@@ -1,15 +1,10 @@
|
|
|
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';
|
|
5
5
|
|
|
6
|
-
const comingSoonToMultiWalletMobile = [
|
|
7
|
-
|
|
8
|
-
'MyAlgo',
|
|
9
|
-
'Braavos',
|
|
10
|
-
'Fortmatic',
|
|
11
|
-
];
|
|
12
|
-
const comingSoonToMultiWalletDesktop = ['MyAlgo', 'Fortmatic'];
|
|
6
|
+
const comingSoonToMultiWalletMobile = ['Coinbase', 'MyAlgo', 'Braavos'];
|
|
7
|
+
const comingSoonToMultiWalletDesktop = ['MyAlgo'];
|
|
13
8
|
const getWalletListItemLabel = ({ walletName, usingMultiWallet, isInstalledOnBrowser, }) => {
|
|
14
9
|
let label;
|
|
15
10
|
const isComingSoon = usingMultiWallet &&
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useGlobalLoading } from './useGlobalLoading';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../functions/lastAuthenticatedAccount/index.cjs');
|
|
7
|
+
|
|
8
|
+
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const [sdkHasLoaded, setSdkHasLoaded] = React.useState(false);
|
|
11
|
+
const primaryWalletIsLoading = user &&
|
|
12
|
+
((_a = index.lastAuthenticatedAccount(user)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain' &&
|
|
13
|
+
!primaryWallet;
|
|
14
|
+
const connectOnlyUserIsLoading = authMode === 'connect-only' && connectedInfo && !connectedWallet;
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (projectSettings) {
|
|
17
|
+
if (primaryWalletIsLoading || connectOnlyUserIsLoading) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
setSdkHasLoaded(true);
|
|
21
|
+
}
|
|
22
|
+
}, [
|
|
23
|
+
projectSettings,
|
|
24
|
+
primaryWallet,
|
|
25
|
+
user,
|
|
26
|
+
primaryWalletIsLoading,
|
|
27
|
+
connectOnlyUserIsLoading,
|
|
28
|
+
]);
|
|
29
|
+
return {
|
|
30
|
+
sdkHasLoaded,
|
|
31
|
+
setSdkHasLoaded,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.useGlobalLoading = useGlobalLoading;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
3
|
+
import { UserProfile, Wallet } from '../../../types';
|
|
4
|
+
import { ConnectedWalletConnectorType } from '../../../../utils/hooks/useConnectWallet/useConnectWallet';
|
|
5
|
+
type Props = {
|
|
6
|
+
authMode: string;
|
|
7
|
+
connectedInfo: ConnectedWalletConnectorType | null;
|
|
8
|
+
connectedWallet: Wallet | null;
|
|
9
|
+
primaryWallet: Wallet | null;
|
|
10
|
+
projectSettings: ProjectSettings | undefined;
|
|
11
|
+
user: UserProfile | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const useGlobalLoading: ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }: Props) => {
|
|
14
|
+
sdkHasLoaded: boolean;
|
|
15
|
+
setSdkHasLoaded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { lastAuthenticatedAccount } from '../../functions/lastAuthenticatedAccount/index.js';
|
|
3
|
+
|
|
4
|
+
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const [sdkHasLoaded, setSdkHasLoaded] = useState(false);
|
|
7
|
+
const primaryWalletIsLoading = user &&
|
|
8
|
+
((_a = lastAuthenticatedAccount(user)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain' &&
|
|
9
|
+
!primaryWallet;
|
|
10
|
+
const connectOnlyUserIsLoading = authMode === 'connect-only' && connectedInfo && !connectedWallet;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (projectSettings) {
|
|
13
|
+
if (primaryWalletIsLoading || connectOnlyUserIsLoading) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setSdkHasLoaded(true);
|
|
17
|
+
}
|
|
18
|
+
}, [
|
|
19
|
+
projectSettings,
|
|
20
|
+
primaryWallet,
|
|
21
|
+
user,
|
|
22
|
+
primaryWalletIsLoading,
|
|
23
|
+
connectOnlyUserIsLoading,
|
|
24
|
+
]);
|
|
25
|
+
return {
|
|
26
|
+
sdkHasLoaded,
|
|
27
|
+
setSdkHasLoaded,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { useGlobalLoading };
|
|
@@ -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(() => {
|