@dynamic-labs/sdk-react-core 0.17.0-RC.17 → 0.17.0-RC.19
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 +28 -0
- package/package.cjs +10 -10
- package/package.js +10 -10
- package/package.json +17 -17
- package/src/index.cjs +8 -0
- package/src/index.js +5 -0
- package/src/lib/Main.cjs +2 -0
- package/src/lib/Main.js +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.js +2 -0
- package/src/lib/components/AppOriginTile/AppOriginTile.types.d.ts +1 -1
- package/src/lib/components/Divider/Divider.cjs +2 -0
- package/src/lib/components/Divider/Divider.js +2 -0
- package/src/lib/components/ErrorContainer/ErrorContainer.cjs +2 -2
- package/src/lib/components/ErrorContainer/ErrorContainer.d.ts +3 -1
- package/src/lib/components/ErrorContainer/ErrorContainer.js +2 -2
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
- package/src/lib/components/Input/Input.cjs +13 -6
- package/src/lib/components/Input/Input.js +14 -7
- package/src/lib/components/Input/Input.types.d.ts +4 -0
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +2 -0
- package/src/lib/components/Portal/Portal.cjs +2 -0
- package/src/lib/components/Portal/Portal.js +2 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +24 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +10 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +22 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +16 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +8 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/components/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/index.d.ts +2 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +2 -0
- package/src/lib/components/Tooltip/Tooltip.js +2 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +1 -1
- package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +11 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +11 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +2 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -2
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +2 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.js +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +59 -20
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +3 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +60 -21
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +13 -3
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +13 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +22 -70
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +24 -72
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -3
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +2 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +2 -1
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.cjs +13 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.js +9 -0
- package/src/lib/shared/utils/hooks/index.d.ts +2 -0
- package/src/lib/shared/utils/hooks/useIsMounted/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.cjs +18 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.js +14 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +12 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.d.ts +1 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +8 -0
- package/src/lib/utils/functions/getAppOrigin/index.d.ts +1 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.cjs +29 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.d.ts +7 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.js +25 -0
- package/src/lib/utils/functions/getReferencedAccount/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +12 -3
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +12 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +37 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +33 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +7 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +8 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -3
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +19 -17
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +19 -17
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +26 -36
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +1 -2
- package/src/lib/utils/hooks/useWallets/useWallets.js +27 -37
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +2 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -1
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
- package/src/lib/views/NoAccess/NoAccess.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +5 -8
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +5 -8
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +58 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.d.ts +2 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +54 -0
- package/src/lib/views/SocialWrongAccountView/index.d.ts +1 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +92 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +13 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +88 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.cjs +6 -1
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.d.ts +1 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.js +6 -1
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.cjs +2 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.js +2 -0
- package/src/lib/views/TransactionConfirmationView/index.d.ts +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
- package/src/lib/views/WalletList/data.cjs +4 -5
- package/src/lib/views/WalletList/data.d.ts +2 -2
- package/src/lib/views/WalletList/data.js +4 -5
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +11 -5
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +11 -5
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/index.d.ts +0 -0
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/index.d.ts +0 -0
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { createContext, useContext, useState, useEffect } from 'react';
|
|
3
|
+
import { createContext, useContext, useState, useMemo, useEffect } from 'react';
|
|
4
4
|
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { useInternalDynamicContext } from '../DynamicContext/useInternalDynamicContext.js';
|
|
6
6
|
import { useViewContext } from '../ViewContext/ViewContext.js';
|
|
@@ -13,6 +13,7 @@ import '../../utils/constants/colors.js';
|
|
|
13
13
|
import 'ethers';
|
|
14
14
|
import '../../shared/consts/index.js';
|
|
15
15
|
import '@dynamic-labs/multi-wallet';
|
|
16
|
+
import { getReferencedAccount } from '../../utils/functions/getReferencedAccount/getReferencedAccount.js';
|
|
16
17
|
import '@dynamic-labs/rpc-providers';
|
|
17
18
|
import { useVerifyWallet } from '../../utils/hooks/useVerifyWallet/useVerifyWallet.js';
|
|
18
19
|
import 'react-dom';
|
|
@@ -26,6 +27,8 @@ import '../../components/IconButton/IconButton.js';
|
|
|
26
27
|
import '../../components/Alert/Alert.js';
|
|
27
28
|
import '../../components/Popper/Popper/Popper.js';
|
|
28
29
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
30
|
+
import '@dynamic-labs/wallet-book';
|
|
31
|
+
import '../../components/SendBalanceForm/SendBalanceForm.js';
|
|
29
32
|
import '../MockContext/MockContext.js';
|
|
30
33
|
import '../ErrorContext/ErrorContext.js';
|
|
31
34
|
import '../CaptchaContext/CaptchaContext.js';
|
|
@@ -34,7 +37,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
34
37
|
const SocialRedirectContext = createContext(undefined);
|
|
35
38
|
const SocialRedirectContextProvider = ({ children, }) => {
|
|
36
39
|
var _a, _b;
|
|
37
|
-
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displayTermsOfService, environmentId, projectSettings, setIsSingleWalletAccount, } = useInternalDynamicContext();
|
|
40
|
+
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displayTermsOfService, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, } = useInternalDynamicContext();
|
|
38
41
|
const { setView } = useViewContext();
|
|
39
42
|
const verifyWallet = useVerifyWallet({
|
|
40
43
|
consumeNonce,
|
|
@@ -52,12 +55,11 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
52
55
|
.find(isSocialWalletConnector);
|
|
53
56
|
const [redirectStatus, setRedirectStatus] = useState('idle');
|
|
54
57
|
const [socialProvider, setSocialProvider] = useState();
|
|
58
|
+
const wallet = secondaryWallets.find((wallet) => wallet.connector.key === (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.key));
|
|
59
|
+
const socialAccount = useMemo(() => (wallet ? getReferencedAccount(authToken, wallet.id) : undefined), [authToken, wallet]);
|
|
55
60
|
useEffect(() => {
|
|
56
61
|
var _a;
|
|
57
|
-
if (!projectSettings) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!socialWalletConnector) {
|
|
62
|
+
if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
65
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -67,42 +69,79 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
67
69
|
setRedirectStatus('loading');
|
|
68
70
|
setView('social-redirect-view');
|
|
69
71
|
setShowAuthFlow(true);
|
|
70
|
-
|
|
72
|
+
if (!isAuthenticated) {
|
|
73
|
+
setSelectedWalletConnector(socialWalletConnector);
|
|
74
|
+
}
|
|
71
75
|
(_a = socialWalletConnector
|
|
72
76
|
.getSession) === null || _a === void 0 ? void 0 : _a.call(socialWalletConnector).then((session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
/**
|
|
78
|
+
* If the user is already authenticated, that means that they are in the process
|
|
79
|
+
* of setting their social wallet as their primary wallet. At this point, they
|
|
80
|
+
* have successfully re-authenticated with the social provider. We can now finish
|
|
81
|
+
* the setPrimaryWallet flow
|
|
82
|
+
*/
|
|
83
|
+
if (isAuthenticated) {
|
|
84
|
+
if (!socialAccount) {
|
|
85
|
+
throw new Error('Social account not found');
|
|
86
|
+
}
|
|
87
|
+
if (socialAccount.oauthAccountId === session.oauthId) {
|
|
88
|
+
// justification: socialAccount is defined if and only if wallet is also defined
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
90
|
+
setPrimaryWalletId(wallet.id);
|
|
91
|
+
setShowAuthFlow(false);
|
|
92
|
+
setShowDynamicUserProfile(true);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
yield socialWalletConnector.endSession();
|
|
96
|
+
setView('social-wrong-account');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const address = yield socialWalletConnector.fetchPublicAddress();
|
|
101
|
+
walletUiUtils.disabledConfirmationOnce();
|
|
102
|
+
yield verifyWallet({
|
|
103
|
+
oauth: {
|
|
104
|
+
accessToken: session.accessToken,
|
|
105
|
+
didToken: session.didToken,
|
|
106
|
+
provider: providerFromParams,
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* justification: if the user just successfully authenticated their social,
|
|
110
|
+
* then the social connector must return an address
|
|
111
|
+
*/
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
113
|
+
publicWalletAddress: address,
|
|
114
|
+
walletConnector: socialWalletConnector,
|
|
115
|
+
});
|
|
76
116
|
}
|
|
77
|
-
walletUiUtils.enableInternalSign();
|
|
78
|
-
yield verifyWallet({
|
|
79
|
-
oauth: {
|
|
80
|
-
accessToken: session.accessToken,
|
|
81
|
-
didToken: session.didToken,
|
|
82
|
-
provider: providerFromParams,
|
|
83
|
-
},
|
|
84
|
-
publicWalletAddress: address,
|
|
85
|
-
walletConnector: socialWalletConnector,
|
|
86
|
-
});
|
|
87
117
|
setSocialProvider(undefined);
|
|
88
118
|
setRedirectStatus('success');
|
|
89
|
-
})).catch(() => {
|
|
119
|
+
})).catch((error) => {
|
|
90
120
|
setRedirectStatus('error');
|
|
91
121
|
});
|
|
92
122
|
}
|
|
93
123
|
}, [
|
|
124
|
+
socialAccount,
|
|
125
|
+
authToken,
|
|
126
|
+
isAuthenticated,
|
|
94
127
|
projectSettings,
|
|
128
|
+
sdkHasLoaded,
|
|
129
|
+
secondaryWallets,
|
|
130
|
+
setPrimaryWalletId,
|
|
95
131
|
setSelectedWalletConnector,
|
|
96
132
|
setShowAuthFlow,
|
|
133
|
+
setShowDynamicUserProfile,
|
|
97
134
|
setView,
|
|
98
135
|
socialWalletConnector,
|
|
99
136
|
verifyWallet,
|
|
100
137
|
walletUiUtils,
|
|
138
|
+
wallet,
|
|
101
139
|
]);
|
|
102
140
|
return (jsx(SocialRedirectContext.Provider, Object.assign({ value: {
|
|
103
141
|
enabledSocialProviders,
|
|
104
142
|
redirectStatus,
|
|
105
143
|
setSocialProvider,
|
|
144
|
+
socialAccount,
|
|
106
145
|
socialProvider,
|
|
107
146
|
socialWalletConnector,
|
|
108
147
|
} }, { children: children })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, SetStateAction, Dispatch } from 'react';
|
|
2
|
-
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'wallet-sign' | 'wallet-used' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view';
|
|
2
|
+
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'wallet-sign' | 'wallet-used' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'social-wrong-account';
|
|
3
3
|
export interface ViewContextProps {
|
|
4
4
|
setView: Dispatch<SetStateAction<ViewType>>;
|
|
5
5
|
view: ViewType;
|
|
@@ -39,6 +39,8 @@ require('../../components/Alert/Alert.cjs');
|
|
|
39
39
|
var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
|
|
40
40
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
41
41
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
42
|
+
require('@dynamic-labs/wallet-book');
|
|
43
|
+
require('../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
42
44
|
var isUserLinkingWallet = require('../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.cjs');
|
|
43
45
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
44
46
|
var OverlayCardTarget = require('../../components/OverlayCard/OverlayCardTarget.cjs');
|
|
@@ -35,6 +35,8 @@ import '../../components/Alert/Alert.js';
|
|
|
35
35
|
import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
|
|
36
36
|
import '../../components/Popper/Popper/Popper.js';
|
|
37
37
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
38
|
+
import '@dynamic-labs/wallet-book';
|
|
39
|
+
import '../../components/SendBalanceForm/SendBalanceForm.js';
|
|
38
40
|
import { isUserLinkingWallet } from '../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.js';
|
|
39
41
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
40
42
|
import { OverlayCardTarget } from '../../components/OverlayCard/OverlayCardTarget.js';
|
|
@@ -37,6 +37,8 @@ require('../../../components/IconButton/IconButton.cjs');
|
|
|
37
37
|
require('../../../components/Alert/Alert.cjs');
|
|
38
38
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
39
39
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
+
require('@dynamic-labs/wallet-book');
|
|
41
|
+
require('../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
40
42
|
|
|
41
43
|
const Footer = ({ heading, icon, projectSettings }) => {
|
|
42
44
|
const { theme } = ThemeContext.useThemeContext();
|
|
@@ -33,6 +33,8 @@ import '../../../components/IconButton/IconButton.js';
|
|
|
33
33
|
import '../../../components/Alert/Alert.js';
|
|
34
34
|
import '../../../components/Popper/Popper/Popper.js';
|
|
35
35
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
36
|
+
import '@dynamic-labs/wallet-book';
|
|
37
|
+
import '../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
36
38
|
|
|
37
39
|
const Footer = ({ heading, icon, projectSettings }) => {
|
|
38
40
|
const { theme } = useThemeContext();
|
package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs
CHANGED
|
@@ -33,6 +33,8 @@ require('../../../../../components/IconButton/IconButton.cjs');
|
|
|
33
33
|
require('../../../../../components/Alert/Alert.cjs');
|
|
34
34
|
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
35
35
|
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
36
|
+
require('@dynamic-labs/wallet-book');
|
|
37
|
+
require('../../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
36
38
|
|
|
37
39
|
const Item = ({ heading, StartIcon, EndIcon, message, url, }) => (jsxRuntime.jsxs("a", Object.assign({ className: 'footer-buttons-item', href: url, rel: 'noopener noreferrer', target: '_blank' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'footer-buttons-item__icon--left' }, { children: jsxRuntime.jsx(StartIcon, {}) })), jsxRuntime.jsxs("div", Object.assign({ className: 'footer-buttons-item__typography' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h2', weight: 'regular', color: 'primary', variant: 'body_normal' }, { children: heading })), message && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'p', weight: 'regular', color: 'secondary' }, { children: message })))] })), EndIcon && jsxRuntime.jsx(EndIcon, { style: { height: '1.5rem', width: '1.5rem' } })] })));
|
|
38
40
|
|
|
@@ -29,6 +29,8 @@ import '../../../../../components/IconButton/IconButton.js';
|
|
|
29
29
|
import '../../../../../components/Alert/Alert.js';
|
|
30
30
|
import '../../../../../components/Popper/Popper/Popper.js';
|
|
31
31
|
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
32
|
+
import '@dynamic-labs/wallet-book';
|
|
33
|
+
import '../../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
32
34
|
|
|
33
35
|
const Item = ({ heading, StartIcon, EndIcon, message, url, }) => (jsxs("a", Object.assign({ className: 'footer-buttons-item', href: url, rel: 'noopener noreferrer', target: '_blank' }, { children: [jsx("div", Object.assign({ className: 'footer-buttons-item__icon--left' }, { children: jsx(StartIcon, {}) })), jsxs("div", Object.assign({ className: 'footer-buttons-item__typography' }, { children: [jsx(Typography, Object.assign({ as: 'h2', weight: 'regular', color: 'primary', variant: 'body_normal' }, { children: heading })), message && (jsx(Typography, Object.assign({ as: 'p', weight: 'regular', color: 'secondary' }, { children: message })))] })), EndIcon && jsx(EndIcon, { style: { height: '1.5rem', width: '1.5rem' } })] })));
|
|
34
36
|
|
|
@@ -35,6 +35,8 @@ require('../../../../../components/IconButton/IconButton.cjs');
|
|
|
35
35
|
require('../../../../../components/Alert/Alert.cjs');
|
|
36
36
|
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
37
37
|
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
require('@dynamic-labs/wallet-book');
|
|
39
|
+
require('../../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
38
40
|
var NewToWeb3WalletItem = require('../NewToWeb3WalletItem/NewToWeb3WalletItem.cjs');
|
|
39
41
|
|
|
40
42
|
const WalletExtensionOrAppContinueButton = ({ wallet, selectedUrl, }) => {
|
|
@@ -31,6 +31,8 @@ import '../../../../../components/IconButton/IconButton.js';
|
|
|
31
31
|
import '../../../../../components/Alert/Alert.js';
|
|
32
32
|
import '../../../../../components/Popper/Popper/Popper.js';
|
|
33
33
|
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import '@dynamic-labs/wallet-book';
|
|
35
|
+
import '../../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
34
36
|
import { NewToWeb3WalletItem } from '../NewToWeb3WalletItem/NewToWeb3WalletItem.js';
|
|
35
37
|
|
|
36
38
|
const WalletExtensionOrAppContinueButton = ({ wallet, selectedUrl, }) => {
|
|
@@ -39,6 +39,7 @@ var EnterTileAnimation = require('../../../../components/EnterTileAnimation/Ente
|
|
|
39
39
|
require('../../../../components/Alert/Alert.cjs');
|
|
40
40
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
41
41
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
42
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
42
43
|
var NewToWeb3WalletItem = require('./NewToWeb3WalletItem/NewToWeb3WalletItem.cjs');
|
|
43
44
|
var Item = require('./Item/Item.cjs');
|
|
44
45
|
var WalletExtensionOrAppContinueButton = require('./WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs');
|
|
@@ -35,6 +35,7 @@ import { EnterTileAnimation } from '../../../../components/EnterTileAnimation/En
|
|
|
35
35
|
import '../../../../components/Alert/Alert.js';
|
|
36
36
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
37
37
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
38
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
38
39
|
import { NewToWeb3WalletItem } from './NewToWeb3WalletItem/NewToWeb3WalletItem.js';
|
|
39
40
|
import { Item } from './Item/Item.js';
|
|
40
41
|
import { WalletExtensionOrAppContinueButton } from './WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js';
|
|
@@ -39,6 +39,8 @@ require('../../../../components/Alert/Alert.cjs');
|
|
|
39
39
|
var PoweredByDynamic = require('../../../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
40
40
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
41
41
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
42
|
+
require('@dynamic-labs/wallet-book');
|
|
43
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
42
44
|
|
|
43
45
|
const WalletMoreInfoContent = ({ appName, variant, walletName, }) => {
|
|
44
46
|
const defaultSignContent = {
|
|
@@ -35,6 +35,8 @@ import '../../../../components/Alert/Alert.js';
|
|
|
35
35
|
import { PoweredByDynamic } from '../../../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
36
36
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
37
37
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
38
|
+
import '@dynamic-labs/wallet-book';
|
|
39
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
38
40
|
|
|
39
41
|
const WalletMoreInfoContent = ({ appName, variant, walletName, }) => {
|
|
40
42
|
const defaultSignContent = {
|
|
@@ -37,16 +37,26 @@ require('../../../components/Alert/Alert.cjs');
|
|
|
37
37
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
38
38
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
var Skeleton = require('../../../components/Skeleton/Skeleton.cjs');
|
|
40
|
+
require('@dynamic-labs/wallet-book');
|
|
41
|
+
require('../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
40
42
|
var QrCodeContext = require('../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
41
43
|
|
|
42
44
|
const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
43
|
-
const { clearStatesOnBackClick, loginWithEmail } = useInternalDynamicContext.useInternalDynamicContext();
|
|
45
|
+
const { clearStatesOnBackClick, loginWithEmail, selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
44
46
|
const { showQrCodeMessage, setShowQrCodeImage, showQrCodeImage } = QrCodeContext.useQrCodeContext();
|
|
45
47
|
const { view, setView } = ViewContext.useViewContext();
|
|
46
48
|
const handleBackClick = React.useCallback(() => {
|
|
47
|
-
clearStatesOnBackClick();
|
|
48
49
|
setView(loginWithEmail ? 'login-with-email-or-wallet' : 'wallet-list');
|
|
49
|
-
|
|
50
|
+
// on back button click in Coinbase wallet clearing state would kill connection and refresh the page
|
|
51
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name) !== 'Coinbase') {
|
|
52
|
+
clearStatesOnBackClick();
|
|
53
|
+
}
|
|
54
|
+
}, [
|
|
55
|
+
clearStatesOnBackClick,
|
|
56
|
+
loginWithEmail,
|
|
57
|
+
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
58
|
+
setView,
|
|
59
|
+
]);
|
|
50
60
|
const positionAbsolute = view === 'login-with-email-verification';
|
|
51
61
|
const showCloseButton = view !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
52
62
|
view !== 'login-with-email-verification';
|
|
@@ -33,16 +33,26 @@ import '../../../components/Alert/Alert.js';
|
|
|
33
33
|
import '../../../components/Popper/Popper/Popper.js';
|
|
34
34
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import { Skeleton } from '../../../components/Skeleton/Skeleton.js';
|
|
36
|
+
import '@dynamic-labs/wallet-book';
|
|
37
|
+
import '../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
36
38
|
import { useQrCodeContext } from '../../../context/QrCodeContext/QrCodeContext.js';
|
|
37
39
|
|
|
38
40
|
const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
39
|
-
const { clearStatesOnBackClick, loginWithEmail } = useInternalDynamicContext();
|
|
41
|
+
const { clearStatesOnBackClick, loginWithEmail, selectedWalletConnector } = useInternalDynamicContext();
|
|
40
42
|
const { showQrCodeMessage, setShowQrCodeImage, showQrCodeImage } = useQrCodeContext();
|
|
41
43
|
const { view, setView } = useViewContext();
|
|
42
44
|
const handleBackClick = useCallback(() => {
|
|
43
|
-
clearStatesOnBackClick();
|
|
44
45
|
setView(loginWithEmail ? 'login-with-email-or-wallet' : 'wallet-list');
|
|
45
|
-
|
|
46
|
+
// on back button click in Coinbase wallet clearing state would kill connection and refresh the page
|
|
47
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name) !== 'Coinbase') {
|
|
48
|
+
clearStatesOnBackClick();
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
clearStatesOnBackClick,
|
|
52
|
+
loginWithEmail,
|
|
53
|
+
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
54
|
+
setView,
|
|
55
|
+
]);
|
|
46
56
|
const positionAbsolute = view === 'login-with-email-verification';
|
|
47
57
|
const showCloseButton = view !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
48
58
|
view !== 'login-with-email-verification';
|
|
@@ -46,6 +46,8 @@ require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
|
46
46
|
var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
|
|
47
47
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
48
48
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
49
|
+
require('@dynamic-labs/wallet-book');
|
|
50
|
+
require('../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
49
51
|
|
|
50
52
|
const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message, handler, onReject, onSignMessage, }) => {
|
|
51
53
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
@@ -42,6 +42,8 @@ import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
|
42
42
|
import { VerticalDrawerTransition } from '../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
|
|
43
43
|
import '../../components/Popper/Popper/Popper.js';
|
|
44
44
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
45
|
+
import '@dynamic-labs/wallet-book';
|
|
46
|
+
import '../../components/SendBalanceForm/SendBalanceForm.js';
|
|
45
47
|
|
|
46
48
|
const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message, handler, onReject, onSignMessage, }) => {
|
|
47
49
|
usePreventPageScroll(true);
|
|
@@ -4,36 +4,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var ethers = require('ethers');
|
|
8
|
-
var utils = require('@dynamic-labs/utils');
|
|
9
7
|
require('@dynamic-labs/sdk-api');
|
|
10
8
|
require('../../shared/logger.cjs');
|
|
11
|
-
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
12
10
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
|
-
|
|
11
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
12
|
+
require('@dynamic-labs/utils');
|
|
14
13
|
require('../../utils/constants/colors.cjs');
|
|
15
|
-
|
|
14
|
+
require('ethers');
|
|
16
15
|
var usePreventPageScroll = require('../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
|
|
17
|
-
require('@dynamic-labs/iconic');
|
|
18
|
-
require('../../context/ViewContext/ViewContext.cjs');
|
|
19
16
|
var index = require('../../shared/consts/index.cjs');
|
|
20
|
-
|
|
17
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
21
18
|
require('@dynamic-labs/multi-wallet');
|
|
22
19
|
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
23
20
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
24
|
-
var Icon = require('../../components/Icon/Icon.cjs');
|
|
25
21
|
var Portal = require('../../components/Portal/Portal.cjs');
|
|
26
22
|
require('react-dom');
|
|
27
23
|
require('../../config/ApiEndpoint.cjs');
|
|
28
24
|
require('@dynamic-labs/rpc-providers');
|
|
29
25
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
|
-
var
|
|
31
|
-
var transactionErrorMessage = require('./helpers/transactionErrorMessage.cjs');
|
|
32
|
-
var useTransactionData = require('./hooks/useTransactionData/useTransactionData.cjs');
|
|
26
|
+
var TransactionConfirmationView = require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
33
27
|
require('../../context/MockContext/MockContext.cjs');
|
|
34
28
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
35
|
-
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
36
|
-
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
37
29
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
38
30
|
require('../../components/IconButton/IconButton.cjs');
|
|
39
31
|
require('../../components/Alert/Alert.cjs');
|
|
@@ -42,70 +34,30 @@ require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs
|
|
|
42
34
|
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
43
35
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
44
36
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
require('@dynamic-labs/wallet-book');
|
|
38
|
+
require('../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
47
39
|
|
|
48
|
-
const TransactionConfirmationModal = ({ title,
|
|
40
|
+
const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, }) => {
|
|
49
41
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
50
|
-
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
51
|
-
const didConfirmRef = React.useRef(false);
|
|
52
42
|
const [show, setShow] = React.useState(true);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const { data: balance } = usePromise.usePromise(() => primaryWallet.connector
|
|
57
|
-
.getBalance()
|
|
58
|
-
.then((balanceText) => balanceText ? ethers.ethers.utils.parseEther(balanceText) : undefined));
|
|
59
|
-
const [currencySymbol] = useFetchCurrency.useFetchCurrency(primaryWallet.connector);
|
|
60
|
-
const { isLoading, mutate: sendTransaction, data: transactionResponse, error: transactionError, } = useMutation.useMutation(() => handler(transaction), {
|
|
61
|
-
onSuccess: () => {
|
|
62
|
-
didConfirmRef.current = true;
|
|
63
|
-
setShow(false);
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
const { isLoading: isLoadingTransaction, isTransactionFromAddressLoading, isTransactionToAddressLoading, transactionFromAddress, transactionToAddress, isEffectiveValueLoading, transactionValue, gasEstimate, isGasPriceLoading, total, } = useTransactionData.useTransactionData({
|
|
67
|
-
provider,
|
|
68
|
-
transaction,
|
|
69
|
-
});
|
|
70
|
-
const hasInsufficientFunds = React.useMemo(() => {
|
|
71
|
-
if (balance === undefined || total === undefined)
|
|
72
|
-
return false;
|
|
73
|
-
return total.gt(balance);
|
|
74
|
-
}, [balance, total]);
|
|
75
|
-
const missingFunds = React.useMemo(() => {
|
|
76
|
-
if (balance === undefined || total === undefined)
|
|
77
|
-
return undefined;
|
|
78
|
-
return total.sub(balance);
|
|
79
|
-
}, [balance, total]);
|
|
80
|
-
const handleOnReject = React.useCallback(() => {
|
|
81
|
-
didConfirmRef.current = false;
|
|
43
|
+
const errorRef = React.useRef(null);
|
|
44
|
+
const transactionResponseRef = React.useRef(null);
|
|
45
|
+
const closeModal = React.useCallback(() => {
|
|
82
46
|
setShow(false);
|
|
83
47
|
}, [setShow]);
|
|
84
48
|
const handleOnModalUnmount = React.useCallback(() => {
|
|
85
|
-
if (
|
|
86
|
-
return onTransactionResponseSuccess(
|
|
49
|
+
if (transactionResponseRef.current) {
|
|
50
|
+
return onTransactionResponseSuccess(transactionResponseRef.current);
|
|
87
51
|
}
|
|
88
|
-
onReject(
|
|
89
|
-
}, [
|
|
90
|
-
|
|
91
|
-
transactionError,
|
|
92
|
-
onTransactionResponseSuccess,
|
|
93
|
-
onReject,
|
|
94
|
-
]);
|
|
95
|
-
const ChainIconComponent = getChainIcon.getChainIcon('evm');
|
|
96
|
-
const chainIcon = (jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: jsxRuntime.jsx(ChainIconComponent, {}) })));
|
|
97
|
-
const errorMessage = transactionError && transactionErrorMessage.transactionErrorMessage(transactionError);
|
|
98
|
-
const warningMessage = React.useMemo(() => {
|
|
99
|
-
const showInsufficientFundsWarningMessage = hasInsufficientFunds && missingFunds;
|
|
100
|
-
if (!showInsufficientFundsWarningMessage)
|
|
101
|
-
return;
|
|
102
|
-
const amountLeft = formatBigNumber.formatBigNumber(missingFunds, 5);
|
|
103
|
-
return `Insufficient funds due to gas price increase from estimate. Please add ${amountLeft} ${currencySymbol} to continue.`;
|
|
104
|
-
}, [currencySymbol, hasInsufficientFunds, missingFunds]);
|
|
105
|
-
return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
52
|
+
onReject(errorRef.current || new Error('user rejected transaction'));
|
|
53
|
+
}, [onTransactionResponseSuccess, onReject]);
|
|
54
|
+
return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: closeModal, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
106
55
|
onUnmount: handleOnModalUnmount,
|
|
107
|
-
} }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation' }, { children: jsxRuntime.
|
|
108
|
-
|
|
56
|
+
} }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation' }, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { provider: provider, transaction: transaction, title: title, mutation: () => handler(transaction), onClickClose: closeModal, onError: (error) => (errorRef.current = error), onSuccess: (transactionResponse) => {
|
|
57
|
+
errorRef.current = null;
|
|
58
|
+
transactionResponseRef.current = transactionResponse;
|
|
59
|
+
closeModal();
|
|
60
|
+
} }) })) })));
|
|
109
61
|
};
|
|
110
62
|
|
|
111
63
|
exports.TransactionConfirmationModal = TransactionConfirmationModal;
|