@dynamic-labs/sdk-react-core 3.0.0-alpha.52 → 3.0.0-alpha.53
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 +39 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/index.cjs +7 -5
- package/src/index.d.ts +1 -1
- package/src/index.js +4 -3
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +17 -16
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +18 -17
- package/src/lib/components/Divider/Divider.cjs +2 -2
- package/src/lib/components/Divider/Divider.d.ts +2 -2
- package/src/lib/components/Divider/Divider.js +3 -3
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -1
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -1
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -1
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -1
- package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +5 -4
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +6 -5
- package/src/lib/components/QrCodeWrapper/QrCodeWrapper.cjs +1 -1
- package/src/lib/components/QrCodeWrapper/QrCodeWrapper.js +1 -1
- package/src/lib/components/SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.cjs +11 -10
- package/src/lib/components/SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.js +12 -11
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +6 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +6 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +0 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -12
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -12
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +2 -2
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +7 -0
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +4 -5
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.d.ts +2 -2
- package/src/lib/context/ReinitializeContext/ReinitializeContextProvider.cjs +1 -1
- package/src/lib/context/ReinitializeContext/ReinitializeContextProvider.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.d.ts +2 -2
- package/src/lib/context/UserWalletsContext/UserWalletsContext.d.ts +1 -1
- package/src/lib/context/WalletContext/WalletContext.cjs +1 -84
- package/src/lib/context/WalletContext/WalletContext.d.ts +1 -2
- package/src/lib/context/WalletContext/WalletContext.js +1 -84
- package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.cjs +1 -1
- package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.js +1 -1
- package/src/lib/data/api/api.cjs +1 -1
- package/src/lib/data/api/api.js +1 -1
- package/src/lib/locale/en/translation.cjs +39 -5
- package/src/lib/locale/en/translation.d.ts +39 -5
- package/src/lib/locale/en/translation.js +39 -5
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -1
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +10 -9
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +11 -10
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.cjs +4 -4
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.d.ts +1 -1
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.js +4 -4
- package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.types.d.ts +2 -0
- package/src/lib/shared/assets/arrow-circle-right.cjs +54 -0
- package/src/lib/shared/assets/arrow-circle-right.js +30 -0
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/types/wallets.d.ts +2 -2
- package/src/lib/shared/utils/functions/usingSessionKeys/usingSessionKeys.cjs +1 -1
- package/src/lib/shared/utils/functions/usingSessionKeys/usingSessionKeys.js +2 -2
- package/src/lib/shared/utils/functions/wallet/createWallet.d.ts +2 -2
- package/src/lib/store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.cjs +1 -1
- package/src/lib/store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/errors.cjs +0 -2
- package/src/lib/utils/constants/errors.js +1 -2
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.d.ts +2 -2
- package/src/lib/utils/{hooks/useWalletConnectors/utils/findWallet/findWallet.cjs → functions/findWalletOptionFor/findWalletOptionFor.cjs} +3 -3
- package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.d.ts +3 -0
- package/src/lib/utils/{hooks/useWalletConnectors/utils/findWallet/findWallet.js → functions/findWalletOptionFor/findWalletOptionFor.js} +3 -3
- package/src/lib/utils/functions/findWalletOptionFor/index.d.ts +1 -0
- package/src/lib/utils/functions/generateMessages/index.cjs +3 -2
- package/src/lib/utils/functions/generateMessages/index.js +3 -2
- package/src/lib/utils/functions/getEmbeddedWalletAuthHandler/getEmbeddedWalletAuthHandler.d.ts +2 -2
- package/src/lib/utils/functions/getEnabledEmbeddedWalletProviders/getEnabledEmbeddedWalletProviders.cjs +1 -1
- package/src/lib/utils/functions/getEnabledEmbeddedWalletProviders/getEnabledEmbeddedWalletProviders.js +1 -1
- package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.cjs +1 -1
- package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.js +1 -1
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -2
- package/src/lib/utils/functions/getWalletConnectorForWallet/getWalletConnectorForWallet.d.ts +2 -2
- package/src/lib/utils/functions/index.d.ts +0 -2
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.d.ts +1 -1
- package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs +1 -1
- package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js +1 -1
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.cjs +1 -1
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.js +1 -1
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.cjs +1 -1
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.d.ts +2 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.d.ts +2 -2
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/multiWallet/index.d.ts +0 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +8 -7
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +9 -8
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -4
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +3 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +4 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +5 -7
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +86 -61
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +87 -63
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +32 -30
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +33 -31
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.d.ts +1 -1
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +7 -6
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +7 -6
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +11 -9
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +12 -10
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +8 -12
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +8 -12
- package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.cjs +1 -1
- package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.js +1 -1
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +6 -5
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +6 -5
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +12 -11
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.d.ts +2 -2
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +12 -11
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +3 -3
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +3 -3
- package/src/lib/utils/hooks/useSmartWallets/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.cjs +159 -0
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.d.ts +18 -0
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.js +155 -0
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs +1 -4
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.js +1 -4
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +7 -87
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +8 -88
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +9 -79
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +4 -10
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +10 -80
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +5 -89
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.d.ts +2 -3
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +5 -89
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +4 -4
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +5 -5
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +26 -29
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +26 -29
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.d.ts +6 -6
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.types.d.ts +4 -4
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +16 -7
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +2 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +16 -7
- package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.cjs +1 -1
- package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.js +1 -1
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +2 -2
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +19 -18
- package/src/lib/views/EmailVerification/EmailVerification.js +20 -19
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +52 -52
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +53 -53
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +1 -1
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.cjs +35 -33
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.d.ts +1 -1
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.js +35 -33
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.cjs +1 -1
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.js +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +35 -33
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.d.ts +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +35 -33
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +33 -31
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +33 -31
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +7 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +7 -1
- package/src/lib/{utils/functions/getEOAWallet/getEOAWallet.cjs → views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.cjs} +57 -50
- package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.d.ts +9 -0
- package/src/lib/{utils/functions/getEOAWallet/getEOAWallet.js → views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.js} +57 -50
- package/src/lib/views/SyncWalletView/AutoReconnectingView/index.d.ts +1 -0
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.cjs +126 -0
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.d.ts +9 -0
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.js +122 -0
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/index.d.ts +1 -0
- package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.cjs +101 -0
- package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.d.ts +10 -0
- package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.js +97 -0
- package/src/lib/views/SyncWalletView/SwitchWalletView/index.d.ts +1 -0
- package/src/lib/views/SyncWalletView/SyncWalletView.cjs +74 -49
- package/src/lib/views/SyncWalletView/SyncWalletView.d.ts +2 -0
- package/src/lib/views/SyncWalletView/SyncWalletView.js +75 -50
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +2 -2
- package/src/lib/views/WalletGroupView/WalletGroupView.js +2 -2
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +6 -5
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +6 -5
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +7 -9
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +7 -9
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +46 -45
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +47 -46
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.cjs +0 -40
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.d.ts +0 -3
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.js +0 -36
- package/src/lib/utils/functions/createOwnerWallet/index.d.ts +0 -1
- package/src/lib/utils/functions/getEOAWallet/getEOAWallet.d.ts +0 -3
- package/src/lib/utils/functions/getEOAWallet/index.d.ts +0 -1
- package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.cjs +0 -8
- package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.js +0 -4
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +0 -14
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +0 -10
- package/src/lib/utils/hooks/events/useWindowEvent/useWindowEvent.cjs +0 -25
- package/src/lib/utils/hooks/events/useWindowEvent/useWindowEvent.js +0 -21
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/index.d.ts +0 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +0 -209
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +0 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +0 -205
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.d.ts +0 -3
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/index.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +0 -184
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +0 -12
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +0 -180
|
@@ -101,7 +101,7 @@ const QrCodeWrapper = ({ uri, desktopUri, icon, accentColor, showCopyToClipboard
|
|
|
101
101
|
* disabled if url is empty
|
|
102
102
|
*/
|
|
103
103
|
useTimeout.useTimeout(() => setShowQrCodeMessage(true), uri.length ? 5000 : null);
|
|
104
|
-
return (jsxRuntime.jsxs("div", { "data-testid": 'qr-code-wrapper', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, { style: { width: '100%' } }), children: showQrCodeMessage && !showQrCodeImage && (jsxRuntime.jsxs("div", { className: 'qr-code-wrapper__scan-issue-message', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsxRuntime.jsx("button", { "data-testid": 'qr-code-wrapper__scan-issue-button', className: 'qr-code-wrapper__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] })) }), jsxRuntime.jsx(QrCodeContainer.QrCodeContainer, { showQrCodeMessage: showQrCodeMessage, desktopUri: desktopUri, accentColor: accentColor, walletConnector: walletConnector, qrcodeValue: uri, Icon: icon, showCopyToClipboardButton: showCopyToClipboardButton, showQrCodeImage: showQrCodeImage })] }));
|
|
104
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'qr-code-wrapper', className: 'qr-code-wrapper', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, { style: { width: '100%' } }), children: showQrCodeMessage && !showQrCodeImage && (jsxRuntime.jsxs("div", { className: 'qr-code-wrapper__scan-issue-message', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsxRuntime.jsx("button", { "data-testid": 'qr-code-wrapper__scan-issue-button', className: 'qr-code-wrapper__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] })) }), jsxRuntime.jsx(QrCodeContainer.QrCodeContainer, { showQrCodeMessage: showQrCodeMessage, desktopUri: desktopUri, accentColor: accentColor, walletConnector: walletConnector, qrcodeValue: uri, Icon: icon, showCopyToClipboardButton: showCopyToClipboardButton, showQrCodeImage: showQrCodeImage })] }));
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
exports.QrCodeWrapper = QrCodeWrapper;
|
|
@@ -97,7 +97,7 @@ const QrCodeWrapper = ({ uri, desktopUri, icon, accentColor, showCopyToClipboard
|
|
|
97
97
|
* disabled if url is empty
|
|
98
98
|
*/
|
|
99
99
|
useTimeout(() => setShowQrCodeMessage(true), uri.length ? 5000 : null);
|
|
100
|
-
return (jsxs("div", { "data-testid": 'qr-code-wrapper', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, { style: { width: '100%' } }), children: showQrCodeMessage && !showQrCodeImage && (jsxs("div", { className: 'qr-code-wrapper__scan-issue-message', children: [jsx(Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsx("button", { "data-testid": 'qr-code-wrapper__scan-issue-button', className: 'qr-code-wrapper__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] })) }), jsx(QrCodeContainer, { showQrCodeMessage: showQrCodeMessage, desktopUri: desktopUri, accentColor: accentColor, walletConnector: walletConnector, qrcodeValue: uri, Icon: icon, showCopyToClipboardButton: showCopyToClipboardButton, showQrCodeImage: showQrCodeImage })] }));
|
|
100
|
+
return (jsxs("div", { "data-testid": 'qr-code-wrapper', className: 'qr-code-wrapper', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, { style: { width: '100%' } }), children: showQrCodeMessage && !showQrCodeImage && (jsxs("div", { className: 'qr-code-wrapper__scan-issue-message', children: [jsx(Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsx("button", { "data-testid": 'qr-code-wrapper__scan-issue-button', className: 'qr-code-wrapper__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] })) }), jsx(QrCodeContainer, { showQrCodeMessage: showQrCodeMessage, desktopUri: desktopUri, accentColor: accentColor, walletConnector: walletConnector, qrcodeValue: uri, Icon: icon, showCopyToClipboardButton: showCopyToClipboardButton, showQrCodeImage: showQrCodeImage })] }));
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
export { QrCodeWrapper };
|
|
@@ -6,12 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
|
-
var PasskeyContext = require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
10
|
-
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
11
9
|
require('react');
|
|
12
|
-
require('../../events/dynamicEvents.cjs');
|
|
13
|
-
require('../../../../_virtual/_tslib.cjs');
|
|
14
|
-
require('@dynamic-labs/utils');
|
|
15
10
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
16
11
|
require('@dynamic-labs/sdk-api-core');
|
|
17
12
|
require('../../shared/logger.cjs');
|
|
@@ -23,8 +18,10 @@ require('../../utils/constants/colors.cjs');
|
|
|
23
18
|
require('../../utils/constants/values.cjs');
|
|
24
19
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
25
20
|
require('../../shared/utils/classes/storage/sessionStorage.cjs');
|
|
21
|
+
require('@dynamic-labs/utils');
|
|
26
22
|
require('../../shared/consts/index.cjs');
|
|
27
|
-
|
|
23
|
+
require('../../events/dynamicEvents.cjs');
|
|
24
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
28
25
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
29
26
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
27
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -38,6 +35,7 @@ require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
|
38
35
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
39
36
|
require('react-dom');
|
|
40
37
|
require('../../context/WalletContext/WalletContext.cjs');
|
|
38
|
+
var useSmartWallets = require('../../utils/hooks/useSmartWallets/useSmartWallets.cjs');
|
|
41
39
|
var usePasskeyRecovery = require('../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
42
40
|
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
43
41
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -50,6 +48,7 @@ require('../../views/CollectUserDataView/useFields.cjs');
|
|
|
50
48
|
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
51
49
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
52
50
|
require('@dynamic-labs/rpc-providers');
|
|
51
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
53
52
|
require('../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
54
53
|
require('../Alert/Alert.cjs');
|
|
55
54
|
var Typography = require('../Typography/Typography.cjs');
|
|
@@ -77,6 +76,7 @@ require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
77
76
|
require('../../context/FooterAnimationContext/index.cjs');
|
|
78
77
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
79
78
|
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
79
|
+
var PasskeyContext = require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
80
80
|
require('@dynamic-labs/ethereum-core');
|
|
81
81
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
82
82
|
require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
@@ -92,16 +92,17 @@ require('../../context/SendBalanceContext/SendBalanceContext.cjs');
|
|
|
92
92
|
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
93
93
|
require('../../context/ConnectWithOtpContext/constants.cjs');
|
|
94
94
|
require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
95
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
95
96
|
|
|
96
97
|
const SecureEmbeddedWalletCard = ({ className }) => {
|
|
97
98
|
const { t } = reactI18next.useTranslation();
|
|
98
99
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
|
-
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
100
100
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
101
101
|
const { showSecureAccountBanner, setShowSecureAccountBanner } = PasskeyContext.usePasskeyContext();
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
103
|
+
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
104
|
+
const isSessionKeyCompatible = (primaryWallet && walletConnectorCore.isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
105
|
+
(eoaWallet && walletConnectorCore.isSessionKeyCompatibleWallet(eoaWallet));
|
|
105
106
|
if (!showSecureAccountBanner || isSessionKeyCompatible)
|
|
106
107
|
return null;
|
|
107
108
|
return (jsxRuntime.jsxs("div", { className: classNames.classNames('secure-embedded-wallet-card', className), children: [jsxRuntime.jsxs("div", { className: 'secure-embedded-wallet-card__text-content', "data-testid": 'secure-wallet-button', onClick: () => initPasskeyRecoveryProcess(), children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_secure_pregenerated_wallet.description', children: t('dyn_secure_pregenerated_wallet.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'brand-primary', copykey: 'dyn_secure_pregenerated_wallet.action', className: 'secure-embedded-wallet-card__link', children: t('dyn_secure_pregenerated_wallet.action') })] }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(IconButton.IconButton, { color: 'text-secondary', onClick: () => setShowSecureAccountBanner(false), children: jsxRuntime.jsx(close.ReactComponent, { width: 16, height: 16 }) }) })] }));
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
5
|
-
import { usePasskeyContext } from '../../context/PasskeyContext/PasskeyContext.js';
|
|
6
|
-
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
4
|
+
import { isSessionKeyCompatibleWallet } from '@dynamic-labs/wallet-connector-core';
|
|
7
5
|
import 'react';
|
|
8
|
-
import '../../events/dynamicEvents.js';
|
|
9
|
-
import '../../../../_virtual/_tslib.js';
|
|
10
|
-
import '@dynamic-labs/utils';
|
|
11
6
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
12
7
|
import '@dynamic-labs/sdk-api-core';
|
|
13
8
|
import '../../shared/logger.js';
|
|
@@ -19,8 +14,10 @@ import '../../utils/constants/colors.js';
|
|
|
19
14
|
import '../../utils/constants/values.js';
|
|
20
15
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
21
16
|
import '../../shared/utils/classes/storage/sessionStorage.js';
|
|
17
|
+
import '@dynamic-labs/utils';
|
|
22
18
|
import '../../shared/consts/index.js';
|
|
23
|
-
import
|
|
19
|
+
import '../../events/dynamicEvents.js';
|
|
20
|
+
import '../../../../_virtual/_tslib.js';
|
|
24
21
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
25
22
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
26
23
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -34,6 +31,7 @@ import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
|
34
31
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
35
32
|
import 'react-dom';
|
|
36
33
|
import '../../context/WalletContext/WalletContext.js';
|
|
34
|
+
import { useSmartWallets } from '../../utils/hooks/useSmartWallets/useSmartWallets.js';
|
|
37
35
|
import { usePasskeyRecovery } from '../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
38
36
|
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
39
37
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
@@ -46,6 +44,7 @@ import '../../views/CollectUserDataView/useFields.js';
|
|
|
46
44
|
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
47
45
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
48
46
|
import '@dynamic-labs/rpc-providers';
|
|
47
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
49
48
|
import '../Accordion/components/AccordionItem/AccordionItem.js';
|
|
50
49
|
import '../Alert/Alert.js';
|
|
51
50
|
import { Typography } from '../Typography/Typography.js';
|
|
@@ -73,6 +72,7 @@ import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
73
72
|
import '../../context/FooterAnimationContext/index.js';
|
|
74
73
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
75
74
|
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
75
|
+
import { usePasskeyContext } from '../../context/PasskeyContext/PasskeyContext.js';
|
|
76
76
|
import '@dynamic-labs/ethereum-core';
|
|
77
77
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
78
78
|
import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
@@ -88,16 +88,17 @@ import '../../context/SendBalanceContext/SendBalanceContext.js';
|
|
|
88
88
|
import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
89
89
|
import '../../context/ConnectWithOtpContext/constants.js';
|
|
90
90
|
import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
91
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
91
92
|
|
|
92
93
|
const SecureEmbeddedWalletCard = ({ className }) => {
|
|
93
94
|
const { t } = useTranslation();
|
|
94
95
|
const { primaryWallet } = useInternalDynamicContext();
|
|
95
|
-
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
96
96
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
97
97
|
const { showSecureAccountBanner, setShowSecureAccountBanner } = usePasskeyContext();
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const { getEOAWallet } = useSmartWallets();
|
|
99
|
+
const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
|
|
100
|
+
const isSessionKeyCompatible = (primaryWallet && isSessionKeyCompatibleWallet(primaryWallet)) ||
|
|
101
|
+
(eoaWallet && isSessionKeyCompatibleWallet(eoaWallet));
|
|
101
102
|
if (!showSecureAccountBanner || isSessionKeyCompatible)
|
|
102
103
|
return null;
|
|
103
104
|
return (jsxs("div", { className: classNames('secure-embedded-wallet-card', className), children: [jsxs("div", { className: 'secure-embedded-wallet-card__text-content', "data-testid": 'secure-wallet-button', onClick: () => initPasskeyRecoveryProcess(), children: [jsx(Typography, { variant: 'body_small', color: 'primary', copykey: 'dyn_secure_pregenerated_wallet.description', children: t('dyn_secure_pregenerated_wallet.description') }), jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'brand-primary', copykey: 'dyn_secure_pregenerated_wallet.action', className: 'secure-embedded-wallet-card__link', children: t('dyn_secure_pregenerated_wallet.action') })] }), jsx("div", { children: jsx(IconButton, { color: 'text-secondary', onClick: () => setShowSecureAccountBanner(false), children: jsx(SvgClose, { width: 16, height: 16 }) }) })] }));
|
|
@@ -111,7 +111,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
111
111
|
React.useEffect(() => {
|
|
112
112
|
const getNativeTokenAndFetchBalance = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
113
113
|
const token = Object.assign(Object.assign({}, utils.getNativeTokenInfo(chainName.toLowerCase())), { address: chainName === 'Solana' ? constants.nativeSolanaAddress : constants.zeroAddress, balance: 0, decimals: chainName === 'Solana' ? 9 : 18, rawBalance: 0 });
|
|
114
|
-
const tokenBalance = yield (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.
|
|
114
|
+
const tokenBalance = yield (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.getBalance());
|
|
115
115
|
if (tokenBalance) {
|
|
116
116
|
token.balance = Number(tokenBalance);
|
|
117
117
|
token.rawBalance = Number(tokenBalance) / Math.pow(10, token.decimals);
|
|
@@ -107,7 +107,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
107
107
|
useEffect(() => {
|
|
108
108
|
const getNativeTokenAndFetchBalance = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
109
|
const token = Object.assign(Object.assign({}, getNativeTokenInfo(chainName.toLowerCase())), { address: chainName === 'Solana' ? nativeSolanaAddress : zeroAddress, balance: 0, decimals: chainName === 'Solana' ? 9 : 18, rawBalance: 0 });
|
|
110
|
-
const tokenBalance = yield (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.
|
|
110
|
+
const tokenBalance = yield (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.getBalance());
|
|
111
111
|
if (tokenBalance) {
|
|
112
112
|
token.balance = Number(tokenBalance);
|
|
113
113
|
token.rawBalance = Number(tokenBalance) / Math.pow(10, token.decimals);
|
|
@@ -104,7 +104,12 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
104
104
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
105
105
|
const anchorRef = React.useRef(null);
|
|
106
106
|
const fetchTokenData = (selectedToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
-
|
|
107
|
+
if (!primaryWallet ||
|
|
108
|
+
!('getPublicClient' in primaryWallet) ||
|
|
109
|
+
typeof primaryWallet.getPublicClient !== 'function') {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const publicClient = yield primaryWallet.getPublicClient();
|
|
108
113
|
if (!publicClient)
|
|
109
114
|
return;
|
|
110
115
|
const erc20Contract = {
|
|
@@ -100,7 +100,12 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
100
100
|
const { primaryWallet } = useInternalDynamicContext();
|
|
101
101
|
const anchorRef = useRef(null);
|
|
102
102
|
const fetchTokenData = (selectedToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
-
|
|
103
|
+
if (!primaryWallet ||
|
|
104
|
+
!('getPublicClient' in primaryWallet) ||
|
|
105
|
+
typeof primaryWallet.getPublicClient !== 'function') {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const publicClient = yield primaryWallet.getPublicClient();
|
|
104
109
|
if (!publicClient)
|
|
105
110
|
return;
|
|
106
111
|
const erc20Contract = {
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -106,7 +106,7 @@ require('../../context/ConnectWithOtpContext/constants.cjs');
|
|
|
106
106
|
require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
107
107
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
108
108
|
|
|
109
|
-
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue,
|
|
109
|
+
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, chainName, isNativeToken, nativePrice, walletKey, }) => {
|
|
110
110
|
var _a;
|
|
111
111
|
const { t } = reactI18next.useTranslation();
|
|
112
112
|
const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -102,7 +102,7 @@ import '../../context/ConnectWithOtpContext/constants.js';
|
|
|
102
102
|
import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
103
103
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
104
104
|
|
|
105
|
-
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue,
|
|
105
|
+
const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, chainName, isNativeToken, nativePrice, walletKey, }) => {
|
|
106
106
|
var _a;
|
|
107
107
|
const { t } = useTranslation();
|
|
108
108
|
const { isTurnkeyWallet } = useIsTurnkeyWallet();
|
|
@@ -146,7 +146,7 @@ const DynamicContext = React.createContext(undefined);
|
|
|
146
146
|
/** The context provider itself we only use internally */
|
|
147
147
|
const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, }) => {
|
|
148
148
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
149
|
-
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings$1;
|
|
149
|
+
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, detectNewWalletsForLinking = false, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings$1;
|
|
150
150
|
localStorage.LocalStorage.setSuffix(settings$1.localStorageSuffix);
|
|
151
151
|
/**
|
|
152
152
|
* initialize global store
|
|
@@ -221,8 +221,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
221
221
|
showFiatOverride: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.showFiat,
|
|
222
222
|
showFiatSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.showFiat,
|
|
223
223
|
});
|
|
224
|
-
// ensures that when user comes back to site and primary wallet is out of sync, we don't show widget popup
|
|
225
|
-
const [showWidgetStatePopup, setShowWidgetStatePopup] = React.useState(!multiWallet);
|
|
226
224
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
227
225
|
const [legacyIsVerifying, setLegacyIsVerifying] = React.useState(false);
|
|
228
226
|
const walletBook$1 = walletBook.useWalletBookCdn();
|
|
@@ -294,18 +292,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
294
292
|
const [selectedWalletWithAction, setSelectedWalletWithAction] = React.useState(null);
|
|
295
293
|
useSetWalletConnectorVerifiedCredentials.useSetWalletConnectorVerifiedCredentials(user !== null && user !== void 0 ? user : userWithMissingInfo, walletConnectorOptions);
|
|
296
294
|
useSetWalletConnectorFetchers.useSetWalletConnectorFetchers(walletConnectorOptions, environmentId);
|
|
297
|
-
const {
|
|
295
|
+
const { primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, wallets: linkedOrConnectedWallets, } = useWalletConnectors.useWalletConnectors({
|
|
298
296
|
authMode,
|
|
299
297
|
canHaveMultipleWalletsConnected: multiWallet,
|
|
300
298
|
connectedWallets,
|
|
301
|
-
multiWalletWidgetState,
|
|
302
299
|
primaryWalletId,
|
|
303
|
-
setDesktopUri,
|
|
304
300
|
setMultiWalletWidgetState,
|
|
305
301
|
setPrimaryWalletId,
|
|
306
|
-
setQrcodeUri,
|
|
307
302
|
user: user || userWithMissingInfo,
|
|
308
|
-
walletBook: walletBook$1,
|
|
309
303
|
walletConnectorOptions,
|
|
310
304
|
});
|
|
311
305
|
React.useEffect(() => {
|
|
@@ -387,6 +381,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
387
381
|
const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork.useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
388
382
|
useWalletEventListeners.useWalletEventListeners({
|
|
389
383
|
authMode,
|
|
384
|
+
detectNewWalletsForLinking,
|
|
390
385
|
disconnectWallet,
|
|
391
386
|
handleLogOut,
|
|
392
387
|
multiWallet,
|
|
@@ -480,6 +475,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
480
475
|
defaultNumberOfWalletsToShow,
|
|
481
476
|
defaultPhoneInputIso2,
|
|
482
477
|
desktopUri,
|
|
478
|
+
detectNewWalletsForLinking,
|
|
483
479
|
disconnectWallet,
|
|
484
480
|
displaySiweStatement,
|
|
485
481
|
enableConnectOnlyFallback,
|
|
@@ -552,7 +548,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
552
548
|
setShowBridgeWidget,
|
|
553
549
|
setShowDynamicUserProfile,
|
|
554
550
|
setShowQrcodeModal,
|
|
555
|
-
setShowWidgetStatePopup,
|
|
556
551
|
setUser: userActions.setUser,
|
|
557
552
|
shadowDOMEnabled,
|
|
558
553
|
showAuthFlow,
|
|
@@ -561,7 +556,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
561
556
|
showFiat,
|
|
562
557
|
showLockedWalletView,
|
|
563
558
|
showQrcodeModal,
|
|
564
|
-
showWidgetStatePopup,
|
|
565
559
|
signWithEmailWalletName,
|
|
566
560
|
siweStatement,
|
|
567
561
|
socialMediaIconUrl: ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) || socialMediaIconUrl,
|
|
@@ -602,6 +596,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
602
596
|
defaultNumberOfWalletsToShow,
|
|
603
597
|
defaultPhoneInputIso2,
|
|
604
598
|
desktopUri,
|
|
599
|
+
detectNewWalletsForLinking,
|
|
605
600
|
disconnectWallet,
|
|
606
601
|
displaySiweStatement,
|
|
607
602
|
enableConnectOnlyFallback,
|
|
@@ -672,7 +667,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
672
667
|
showFiat,
|
|
673
668
|
showLockedWalletView,
|
|
674
669
|
showQrcodeModal,
|
|
675
|
-
showWidgetStatePopup,
|
|
676
670
|
signWithEmailWalletName,
|
|
677
671
|
siweStatement,
|
|
678
672
|
socialMediaIconUrl,
|
|
@@ -724,7 +718,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
724
718
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
725
719
|
isBridgeFlow,
|
|
726
720
|
isMultiWalletEnabled: multiWallet,
|
|
727
|
-
}), children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, {
|
|
721
|
+
}), children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
728
722
|
};
|
|
729
723
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
730
724
|
const DynamicContextProvider = (props) => {
|
|
@@ -142,7 +142,7 @@ const DynamicContext = createContext(undefined);
|
|
|
142
142
|
/** The context provider itself we only use internally */
|
|
143
143
|
const InnerDynamicContextProvider = ({ children, theme, settings, locale, enableInstrumentation = false, }) => {
|
|
144
144
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
145
|
-
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings;
|
|
145
|
+
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, detectNewWalletsForLinking = false, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings;
|
|
146
146
|
LocalStorage.setSuffix(settings.localStorageSuffix);
|
|
147
147
|
/**
|
|
148
148
|
* initialize global store
|
|
@@ -217,8 +217,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
217
217
|
showFiatOverride: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.showFiat,
|
|
218
218
|
showFiatSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.showFiat,
|
|
219
219
|
});
|
|
220
|
-
// ensures that when user comes back to site and primary wallet is out of sync, we don't show widget popup
|
|
221
|
-
const [showWidgetStatePopup, setShowWidgetStatePopup] = useState(!multiWallet);
|
|
222
220
|
// Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
|
|
223
221
|
const [legacyIsVerifying, setLegacyIsVerifying] = useState(false);
|
|
224
222
|
const walletBook = useWalletBookCdn();
|
|
@@ -290,18 +288,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
290
288
|
const [selectedWalletWithAction, setSelectedWalletWithAction] = useState(null);
|
|
291
289
|
useSetWalletConnectorVerifiedCredentials(user !== null && user !== void 0 ? user : userWithMissingInfo, walletConnectorOptions);
|
|
292
290
|
useSetWalletConnectorFetchers(walletConnectorOptions, environmentId);
|
|
293
|
-
const {
|
|
291
|
+
const { primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, wallets: linkedOrConnectedWallets, } = useWalletConnectors({
|
|
294
292
|
authMode,
|
|
295
293
|
canHaveMultipleWalletsConnected: multiWallet,
|
|
296
294
|
connectedWallets,
|
|
297
|
-
multiWalletWidgetState,
|
|
298
295
|
primaryWalletId,
|
|
299
|
-
setDesktopUri,
|
|
300
296
|
setMultiWalletWidgetState,
|
|
301
297
|
setPrimaryWalletId,
|
|
302
|
-
setQrcodeUri,
|
|
303
298
|
user: user || userWithMissingInfo,
|
|
304
|
-
walletBook,
|
|
305
299
|
walletConnectorOptions,
|
|
306
300
|
});
|
|
307
301
|
useEffect(() => {
|
|
@@ -383,6 +377,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
383
377
|
const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
384
378
|
useWalletEventListeners({
|
|
385
379
|
authMode,
|
|
380
|
+
detectNewWalletsForLinking,
|
|
386
381
|
disconnectWallet,
|
|
387
382
|
handleLogOut,
|
|
388
383
|
multiWallet,
|
|
@@ -476,6 +471,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
476
471
|
defaultNumberOfWalletsToShow,
|
|
477
472
|
defaultPhoneInputIso2,
|
|
478
473
|
desktopUri,
|
|
474
|
+
detectNewWalletsForLinking,
|
|
479
475
|
disconnectWallet,
|
|
480
476
|
displaySiweStatement,
|
|
481
477
|
enableConnectOnlyFallback,
|
|
@@ -548,7 +544,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
548
544
|
setShowBridgeWidget,
|
|
549
545
|
setShowDynamicUserProfile,
|
|
550
546
|
setShowQrcodeModal,
|
|
551
|
-
setShowWidgetStatePopup,
|
|
552
547
|
setUser,
|
|
553
548
|
shadowDOMEnabled,
|
|
554
549
|
showAuthFlow,
|
|
@@ -557,7 +552,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
557
552
|
showFiat,
|
|
558
553
|
showLockedWalletView,
|
|
559
554
|
showQrcodeModal,
|
|
560
|
-
showWidgetStatePopup,
|
|
561
555
|
signWithEmailWalletName,
|
|
562
556
|
siweStatement,
|
|
563
557
|
socialMediaIconUrl: ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) || socialMediaIconUrl,
|
|
@@ -598,6 +592,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
598
592
|
defaultNumberOfWalletsToShow,
|
|
599
593
|
defaultPhoneInputIso2,
|
|
600
594
|
desktopUri,
|
|
595
|
+
detectNewWalletsForLinking,
|
|
601
596
|
disconnectWallet,
|
|
602
597
|
displaySiweStatement,
|
|
603
598
|
enableConnectOnlyFallback,
|
|
@@ -668,7 +663,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
668
663
|
showFiat,
|
|
669
664
|
showLockedWalletView,
|
|
670
665
|
showQrcodeModal,
|
|
671
|
-
showWidgetStatePopup,
|
|
672
666
|
signWithEmailWalletName,
|
|
673
667
|
siweStatement,
|
|
674
668
|
socialMediaIconUrl,
|
|
@@ -720,7 +714,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
720
714
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
721
715
|
isBridgeFlow,
|
|
722
716
|
isMultiWalletEnabled: multiWallet,
|
|
723
|
-
}), children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, {
|
|
717
|
+
}), children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncAuthFlow, {}), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
724
718
|
};
|
|
725
719
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
726
720
|
const DynamicContextProvider = (props) => {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var React = require('react');
|
|
7
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
8
7
|
require('@dynamic-labs/sdk-api-core');
|
|
9
8
|
require('../../../../utils/constants/values.cjs');
|
|
10
9
|
require('@dynamic-labs/utils');
|
|
@@ -12,6 +11,7 @@ require('../../../../../../_virtual/_tslib.cjs');
|
|
|
12
11
|
require('@dynamic-labs/multi-wallet');
|
|
13
12
|
require('../../../../shared/logger.cjs');
|
|
14
13
|
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('react/jsx-runtime');
|
|
16
16
|
require('../../../ViewContext/ViewContext.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-book');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useState, useMemo } from 'react';
|
|
3
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
import '@dynamic-labs/sdk-api-core';
|
|
5
4
|
import '../../../../utils/constants/values.js';
|
|
6
5
|
import '@dynamic-labs/utils';
|
|
@@ -8,6 +7,7 @@ import '../../../../../../_virtual/_tslib.js';
|
|
|
8
7
|
import '@dynamic-labs/multi-wallet';
|
|
9
8
|
import '../../../../shared/logger.js';
|
|
10
9
|
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import 'react/jsx-runtime';
|
|
12
12
|
import '../../../ViewContext/ViewContext.js';
|
|
13
13
|
import '@dynamic-labs/wallet-book';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { UserProfile } from '@dynamic-labs/types';
|
|
3
|
-
import {
|
|
3
|
+
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { AuthModeType, DynamicEventsCallbacks, Wallet } from '../../../../shared';
|
|
5
5
|
import { MultiWalletWidgetStateSetter } from '../../../../utils/hooks/multiWallet';
|
|
6
6
|
import { ChainsToConnect } from '../../types';
|
|
@@ -13,7 +13,7 @@ export type UseHandleLogoutParams = {
|
|
|
13
13
|
setShowBridgeWidget: Dispatch<SetStateAction<boolean>>;
|
|
14
14
|
user: UserProfile | undefined;
|
|
15
15
|
environmentId: string;
|
|
16
|
-
walletConnectors:
|
|
16
|
+
walletConnectors: WalletConnector[];
|
|
17
17
|
connectedWallets: Wallet[];
|
|
18
18
|
setLegacyIsVerifying: Dispatch<SetStateAction<boolean>>;
|
|
19
19
|
setAuthMode: (value: AuthModeType | ((val: AuthModeType) => AuthModeType)) => void;
|
|
@@ -25,6 +25,13 @@ export interface DynamicContextProps {
|
|
|
25
25
|
cssOverrides?: string | JSX.Element;
|
|
26
26
|
customPrivacyPolicy?: ReactNode;
|
|
27
27
|
defaultPhoneInputIso2?: CountryIso2;
|
|
28
|
+
/**
|
|
29
|
+
* If true, users will see a prompt to link the wallet
|
|
30
|
+
* when an account change is detected in the wallet connector
|
|
31
|
+
* and the newly selected wallet is not linked yet
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
detectNewWalletsForLinking?: boolean;
|
|
28
35
|
customTermsOfServices?: ReactNode;
|
|
29
36
|
debugError?: boolean;
|
|
30
37
|
/**
|
|
@@ -3,7 +3,7 @@ import { changeLanguage } from 'i18next';
|
|
|
3
3
|
import { CountryIso2 } from 'react-international-phone';
|
|
4
4
|
import { NameServiceData, ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
5
5
|
import { MobileExperience, NetworkConfigurationMap, SocialProviderFilter, UserProfile, WalletUiUtils } from '@dynamic-labs/types';
|
|
6
|
-
import { Chain, GetAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
+
import { Chain, GetAddressOpts, InternalWalletConnector, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import { PasskeySuccessEnum } from '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner';
|
|
8
8
|
import { AccessDeniedCustomButton, AccountSwitchState, AuthModeType, AwaitingSignatureState, ChainToWalletMap, DynamicEventsCallbacks, MultiWalletWidgetState, RecommendedWallet, Wallet, WalletOption, WalletWithAction } from '../../../shared';
|
|
9
9
|
import { DynamicHandlers } from '../../../shared/types/dynamicHandlers';
|
|
@@ -50,6 +50,7 @@ export interface IDynamicContext {
|
|
|
50
50
|
debugError: boolean;
|
|
51
51
|
defaultNumberOfWalletsToShow: number;
|
|
52
52
|
desktopUri: string;
|
|
53
|
+
detectNewWalletsForLinking: boolean;
|
|
53
54
|
disconnectWallet: (walletId: string) => void;
|
|
54
55
|
displaySiweStatement: boolean;
|
|
55
56
|
enableConnectOnlyFallback?: boolean;
|
|
@@ -107,7 +108,7 @@ export interface IDynamicContext {
|
|
|
107
108
|
removeConnectedWalletsInfo: () => void;
|
|
108
109
|
sdkHasLoaded: boolean;
|
|
109
110
|
secondaryWallets: Wallet[];
|
|
110
|
-
selectedWalletConnector:
|
|
111
|
+
selectedWalletConnector: InternalWalletConnector | null;
|
|
111
112
|
selectedWalletWithAction: WalletWithAction | null;
|
|
112
113
|
sendWagmiSettings: (settings: {
|
|
113
114
|
dynamicWagmiSettings?: object;
|
|
@@ -138,7 +139,6 @@ export interface IDynamicContext {
|
|
|
138
139
|
setShowBridgeWidget: Dispatch<SetStateAction<boolean>>;
|
|
139
140
|
setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
|
|
140
141
|
setShowQrcodeModal: Dispatch<SetStateAction<boolean>>;
|
|
141
|
-
setShowWidgetStatePopup: Dispatch<SetStateAction<boolean>>;
|
|
142
142
|
setUser: SetUserAction;
|
|
143
143
|
shadowDOMEnabled: boolean;
|
|
144
144
|
showAuthFlow: boolean;
|
|
@@ -150,7 +150,6 @@ export interface IDynamicContext {
|
|
|
150
150
|
showFiat: boolean;
|
|
151
151
|
showLockedWalletView?: boolean;
|
|
152
152
|
showQrcodeModal: boolean;
|
|
153
|
-
showWidgetStatePopup: boolean;
|
|
154
153
|
signWithEmailWalletName?: string;
|
|
155
154
|
siweStatement?: string;
|
|
156
155
|
socialMediaIconUrl?: Record<string, string> | Record<SocialNetworkIconType, string>;
|
|
@@ -163,6 +162,6 @@ export interface IDynamicContext {
|
|
|
163
162
|
user: UserProfile | undefined;
|
|
164
163
|
userWithMissingInfo: UserProfile | undefined;
|
|
165
164
|
walletConnectorOptions: WalletOption[];
|
|
166
|
-
walletUiUtils: WalletUiUtils<
|
|
165
|
+
walletUiUtils: WalletUiUtils<InternalWalletConnector>;
|
|
167
166
|
walletsFilter?: (options: WalletOption[]) => WalletOption[];
|
|
168
167
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
export type PhantomContextReturnType = {
|
|
4
|
-
phantomRedirectConnector:
|
|
4
|
+
phantomRedirectConnector: InternalWalletConnector | undefined;
|
|
5
5
|
};
|
|
6
6
|
export declare const PhantomRedirectContext: import("react").Context<PhantomContextReturnType | undefined>;
|
|
7
7
|
export declare const PhantomRedirectContextProvider: ({ children, }: {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
9
8
|
require('@dynamic-labs/sdk-api-core');
|
|
10
9
|
require('../../utils/constants/values.cjs');
|
|
11
10
|
require('@dynamic-labs/utils');
|
|
@@ -13,6 +12,7 @@ require('../../../../_virtual/_tslib.cjs');
|
|
|
13
12
|
require('@dynamic-labs/multi-wallet');
|
|
14
13
|
require('../../shared/logger.cjs');
|
|
15
14
|
require('@dynamic-labs/iconic');
|
|
15
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
16
16
|
require('../ViewContext/ViewContext.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-book');
|
|
18
18
|
require('../../utils/constants/colors.cjs');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, useContext, useState, useRef, useCallback, cloneElement } from 'react';
|
|
4
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
5
4
|
import '@dynamic-labs/sdk-api-core';
|
|
6
5
|
import '../../utils/constants/values.js';
|
|
7
6
|
import '@dynamic-labs/utils';
|
|
@@ -9,6 +8,7 @@ import '../../../../_virtual/_tslib.js';
|
|
|
9
8
|
import '@dynamic-labs/multi-wallet';
|
|
10
9
|
import '../../shared/logger.js';
|
|
11
10
|
import '@dynamic-labs/iconic';
|
|
11
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
12
12
|
import '../ViewContext/ViewContext.js';
|
|
13
13
|
import '@dynamic-labs/wallet-book';
|
|
14
14
|
import '../../utils/constants/colors.js';
|