@dynamic-labs/sdk-react-core 1.1.0-alpha.1 → 1.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +13 -12
- package/src/index.cjs +27 -5
- package/src/index.d.ts +2 -1
- package/src/index.js +16 -4
- package/src/lib/Main.cjs +4 -5
- package/src/lib/Main.js +4 -5
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
- package/src/lib/components/ChainCard/ChainCard.d.ts +2 -2
- package/src/lib/components/CopyButton/CopyButton.d.ts +2 -1
- package/src/lib/components/Divider/Divider.cjs +2 -2
- package/src/lib/components/Divider/Divider.js +2 -2
- package/src/lib/components/DynamicBaseWidget/DynamicBaseWidget.cjs +13 -0
- package/src/lib/components/DynamicBaseWidget/DynamicBaseWidget.d.ts +7 -0
- package/src/lib/components/DynamicBaseWidget/DynamicBaseWidget.js +9 -0
- package/src/lib/components/DynamicBaseWidget/index.d.ts +1 -0
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/Modal/Modal.cjs +1 -1
- package/src/lib/components/Modal/Modal.d.ts +1 -2
- package/src/lib/components/Modal/Modal.js +1 -1
- package/src/lib/components/Modal/index.d.ts +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -2
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -2
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -2
- package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -2
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -1
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +1 -1
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +1 -1
- package/src/lib/components/Portal/Portal.js +1 -1
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.cjs +5 -1
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.js +5 -1
- package/src/lib/components/ShadowDOM/index.d.ts +1 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +1 -1
- package/src/lib/components/Toggle/Toggle.cjs +14 -0
- package/src/lib/components/Toggle/Toggle.d.ts +7 -0
- package/src/lib/components/Toggle/Toggle.js +10 -0
- package/src/lib/components/Toggle/index.d.ts +1 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -1
- package/src/lib/components/Tooltip/Tooltip.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +1 -1
- package/src/lib/components/UserAddress/UserAddress.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -2
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/ConnectWithEmailOtpContext/ConnectWithEmailOtpProvider.cjs +122 -0
- package/src/lib/context/ConnectWithEmailOtpContext/ConnectWithEmailOtpProvider.d.ts +2 -0
- package/src/lib/context/ConnectWithEmailOtpContext/ConnectWithEmailOtpProvider.js +118 -0
- package/src/lib/context/ConnectWithEmailOtpContext/connectWithEmailOtpContext.cjs +9 -0
- package/src/lib/context/ConnectWithEmailOtpContext/connectWithEmailOtpContext.d.ts +3 -0
- package/src/lib/context/ConnectWithEmailOtpContext/connectWithEmailOtpContext.js +5 -0
- package/src/lib/context/ConnectWithEmailOtpContext/constants.cjs +15 -0
- package/src/lib/context/ConnectWithEmailOtpContext/constants.d.ts +4 -0
- package/src/lib/context/ConnectWithEmailOtpContext/constants.js +10 -0
- package/src/lib/context/ConnectWithEmailOtpContext/index.d.ts +2 -0
- package/src/lib/context/ConnectWithEmailOtpContext/types.d.ts +13 -0
- package/src/lib/context/ConnectWithEmailOtpContext/useConnectWithEmailOtp.cjs +19 -0
- package/src/lib/context/ConnectWithEmailOtpContext/useConnectWithEmailOtp.d.ts +6 -0
- package/src/lib/context/ConnectWithEmailOtpContext/useConnectWithEmailOtp.js +15 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createEmailHandler.cjs +27 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createEmailHandler.d.ts +2 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createEmailHandler.js +23 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createMagicHandler.cjs +21 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createMagicHandler.d.ts +3 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/createMagicHandler.js +17 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/findEmailProvider.cjs +20 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/findEmailProvider.d.ts +2 -0
- package/src/lib/context/ConnectWithEmailOtpContext/utils/findEmailProvider.js +16 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +46 -35
- package/src/lib/context/DynamicContext/DynamicContext.js +47 -36
- package/src/lib/context/DynamicContext/hooks/index.d.ts +1 -1
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +16 -16
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +17 -17
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.cjs +48 -0
- package/src/lib/context/DynamicContext/hooks/{useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.d.ts → useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.d.ts} +4 -7
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.js +44 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.cjs +59 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.d.ts +37 -0
- package/src/lib/context/DynamicContext/hooks/useShowAuthFlow/useShowAuthFlow.js +55 -0
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +2 -1
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +2 -1
- package/src/lib/context/DynamicContext/types/index.d.ts +11 -7
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +9 -2
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +4 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +9 -2
- package/src/lib/context/FundingContext/FundingContext.cjs +4 -1
- package/src/lib/context/FundingContext/FundingContext.js +4 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -2
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +1 -1
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +1 -1
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/data/api.cjs +15 -13
- package/src/lib/data/api.d.ts +7 -2
- package/src/lib/data/api.js +15 -13
- package/src/lib/events/dynamicEvents.d.ts +5 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +4 -4
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +4 -4
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +7 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +7 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +2 -2
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +2 -2
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +2 -2
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +2 -2
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +2 -2
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +2 -2
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +2 -2
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +2 -2
- package/src/lib/locale/en/translation.cjs +242 -3
- package/src/lib/locale/en/translation.d.ts +241 -2
- package/src/lib/locale/en/translation.js +242 -3
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.cjs +4 -4
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.js +4 -4
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +4 -4
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +4 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +4 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +4 -4
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +4 -4
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +4 -4
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +4 -4
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +4 -4
- package/src/lib/shared/assets/alt-embedded-wallet.cjs +54 -0
- package/src/lib/shared/assets/alt-embedded-wallet.js +30 -0
- package/src/lib/shared/assets/alt-key.cjs +54 -0
- package/src/lib/shared/assets/alt-key.js +30 -0
- package/src/lib/shared/assets/export-embedded-hero.cjs +90 -0
- package/src/lib/shared/assets/export-embedded-hero.js +66 -0
- package/src/lib/shared/assets/eye-off-icon.cjs +53 -0
- package/src/lib/shared/assets/eye-off-icon.js +29 -0
- package/src/lib/shared/assets/face-id.cjs +53 -0
- package/src/lib/shared/assets/face-id.js +29 -0
- package/src/lib/shared/assets/index.d.ts +7 -0
- package/src/lib/shared/assets/lock.cjs +54 -0
- package/src/lib/shared/assets/lock.js +30 -0
- package/src/lib/shared/assets/wallet-v2.cjs +53 -0
- package/src/lib/shared/assets/wallet-v2.js +29 -0
- package/src/lib/shared/consts/index.cjs +1 -0
- package/src/lib/shared/consts/index.js +1 -0
- package/src/lib/shared/types/index.d.ts +5 -1
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
- package/src/lib/shared/utils/hooks/useOnClickOutside/index.cjs +4 -2
- package/src/lib/shared/utils/hooks/useOnClickOutside/index.js +5 -3
- package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs +32 -16
- package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js +32 -16
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.d.ts +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.cjs +8 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.js +4 -0
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.cjs +9 -1
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.js +9 -1
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +2 -4
- package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +2 -4
- package/src/lib/utils/functions/walletListBuilder/utils/filterConnectedWallets/filterConnectedWallets.cjs +13 -2
- package/src/lib/utils/functions/walletListBuilder/utils/filterConnectedWallets/filterConnectedWallets.js +13 -2
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +3 -3
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +4 -4
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +16 -9
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +16 -9
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +28 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +28 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +3 -2
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +6 -1
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +3 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -1
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +3 -3
- package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +3 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +3 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +3 -5
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +2 -2
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +2 -2
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +3 -3
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +70 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.d.ts +4 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +66 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +12 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +12 -6
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +5 -3
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +5 -3
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -27
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -27
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +6 -8
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +6 -8
- package/src/lib/utils/hooks/useProcessNetworkConfigurations/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs → useProcessNetworkConfigurations/useProcessNetworkConfigurations.cjs} +53 -67
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.d.ts → useProcessNetworkConfigurations/useProcessNetworkConfigurations.d.ts} +3 -2
- package/src/lib/utils/hooks/{useFetchNetworkConfigurations/useFetchNetworkConfigurations.js → useProcessNetworkConfigurations/useProcessNetworkConfigurations.js} +53 -67
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +20 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +20 -14
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +26 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +26 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +8 -5
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +8 -5
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
- package/src/lib/utils/hooks/useWalletConnectorNetwork/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +42 -0
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.d.ts +18 -0
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +38 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +5 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +5 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +2 -2
- package/src/lib/views/AccountExistsView/AccountExistsView.js +2 -2
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +1 -1
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +5 -4
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +5 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -2
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -2
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +5 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +5 -4
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -2
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -2
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +36 -25
- package/src/lib/views/EmailVerification/EmailVerification.js +36 -25
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +160 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +156 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/constants.cjs +9 -0
- package/src/lib/views/EmbeddedReveal/constants.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/constants.js +4 -0
- package/src/lib/views/EmbeddedReveal/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +139 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +21 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +132 -0
- package/src/lib/views/LoginView/LoginView.cjs +60 -7
- package/src/lib/views/LoginView/LoginView.js +60 -7
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +7 -9
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.d.ts +0 -1
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +8 -9
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +2 -2
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +2 -2
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +2 -2
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +2 -2
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +2 -2
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +4 -4
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +4 -4
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +5 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +5 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -8
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -8
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
- package/src/lib/views/NoAccess/NoAccess.js +2 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +8 -4
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +8 -4
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +12 -7
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +12 -7
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.js +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +5 -5
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +5 -5
- package/src/lib/views/Passkey/utils/findEmailOtpWalletConnector/findEmailOtpWalletConnector.cjs +17 -0
- package/src/lib/views/Passkey/utils/findEmailOtpWalletConnector/findEmailOtpWalletConnector.d.ts +3 -0
- package/src/lib/views/Passkey/utils/findEmailOtpWalletConnector/findEmailOtpWalletConnector.js +13 -0
- package/src/lib/views/Passkey/utils/findEmailOtpWalletConnector/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +9 -6
- package/src/lib/views/PendingConnectView/PendingConnectView.js +9 -6
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +10 -7
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +10 -7
- package/src/lib/views/QrCodeView/QRCode.cjs +2 -3
- package/src/lib/views/QrCodeView/QRCode.js +2 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +12 -9
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +12 -9
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -2
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +6 -5
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +6 -5
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +2 -2
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +2 -2
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +2 -2
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +72 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.js +73 -2
- package/src/lib/views/WalletGroupView/components/HardwareWalletToggle/HardwareWalletToggle.cjs +74 -0
- package/src/lib/views/WalletGroupView/components/HardwareWalletToggle/HardwareWalletToggle.d.ts +7 -0
- package/src/lib/views/WalletGroupView/components/HardwareWalletToggle/HardwareWalletToggle.js +70 -0
- package/src/lib/views/WalletGroupView/components/HardwareWalletToggle/index.d.ts +1 -0
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +2 -4
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.d.ts +2 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +2 -4
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +2 -2
- package/src/lib/views/WalletList/WalletList.cjs +5 -8
- package/src/lib/views/WalletList/WalletList.js +5 -8
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +5 -4
- package/src/lib/views/WalletLockedView/WalletLockedView.js +5 -4
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +6 -5
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +6 -5
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +7 -7
- package/src/lib/views/WalletUsedView/WalletUsedView.js +7 -7
- package/src/lib/views/viewToComponentMap.cjs +3 -0
- package/src/lib/views/viewToComponentMap.js +3 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +6 -3
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +6 -3
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +3 -3
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +3 -3
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.cjs +33 -0
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.d.ts +2 -0
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.js +29 -0
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +76 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +72 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +67 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +63 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +13 -12
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +13 -12
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +6 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +17 -40
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +23 -46
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.cjs +71 -0
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.js +67 -0
- package/src/lib/widgets/DynamicWidget/components/PromptModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +66 -21
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +67 -22
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/useMultiWalletPromptState.cjs +40 -0
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/useMultiWalletPromptState.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/useMultiWalletPromptState.js +36 -0
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/AwaitingConnectionModal.cjs +51 -0
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/AwaitingConnectionModal.d.ts +3 -0
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/AwaitingConnectionModal.js +46 -0
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +7 -6
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +13 -6
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +13 -7
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +7 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +8 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +8 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +9 -5
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +9 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +22 -8
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +22 -9
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/index.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +8 -3
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +10 -6
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +3 -3
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +38 -13
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.d.ts +2 -5
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +37 -13
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/index.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +9 -5
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +6 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +6 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +95 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +91 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -2
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -2
- package/src/lib/widgets/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/index.d.ts +0 -1
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.cjs +0 -33
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.js +0 -29
- package/src/lib/utils/hooks/useFetchNetworkConfigurations/index.d.ts +0 -1
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.cjs +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.d.ts +0 -0
- /package/src/lib/utils/hooks/{useFetchNetworkConfigurations → useProcessNetworkConfigurations}/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.js +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
9
|
+
var utils = require('@dynamic-labs/utils');
|
|
10
|
+
var getProperErrorMessage = require('../../../modals/SignMessageConfirmationModal/getProperErrorMessage.cjs');
|
|
11
|
+
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
12
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
14
|
+
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
15
|
+
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
16
|
+
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
18
|
+
require('@dynamic-labs/iconic');
|
|
19
|
+
var close = require('../../../shared/assets/close.cjs');
|
|
20
|
+
var eyeOffIcon = require('../../../shared/assets/eye-off-icon.cjs');
|
|
21
|
+
var exportEmbeddedHero = require('../../../shared/assets/export-embedded-hero.cjs');
|
|
22
|
+
var walletV2 = require('../../../shared/assets/wallet-v2.cjs');
|
|
23
|
+
var logger = require('../../../shared/logger.cjs');
|
|
24
|
+
require('@dynamic-labs/wallet-book');
|
|
25
|
+
require('../../../utils/constants/colors.cjs');
|
|
26
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
27
|
+
require('viem');
|
|
28
|
+
require('../../../shared/consts/index.cjs');
|
|
29
|
+
require('@dynamic-labs/multi-wallet');
|
|
30
|
+
require('@dynamic-labs/sdk-api');
|
|
31
|
+
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
32
|
+
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
34
|
+
require('../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
35
|
+
require('react-dom');
|
|
36
|
+
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
37
|
+
var useMutation = require('../../../utils/hooks/useMutation/useMutation.cjs');
|
|
38
|
+
require('@dynamic-labs/types');
|
|
39
|
+
require('yup');
|
|
40
|
+
require('../../../context/MockContext/MockContext.cjs');
|
|
41
|
+
require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
42
|
+
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
43
|
+
require('@dynamic-labs/rpc-providers');
|
|
44
|
+
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
45
|
+
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
46
|
+
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
47
|
+
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
48
|
+
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
49
|
+
require('../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
50
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
51
|
+
require('../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
52
|
+
var Typography = require('../../../components/Typography/Typography.cjs');
|
|
53
|
+
var Badge = require('../../../components/Badge/Badge.cjs');
|
|
54
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
55
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
56
|
+
require('react-focus-lock');
|
|
57
|
+
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
58
|
+
require('qrcode');
|
|
59
|
+
require('i18next');
|
|
60
|
+
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
61
|
+
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
62
|
+
require('../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
63
|
+
require('formik');
|
|
64
|
+
var Button = require('../../../components/Button/Button.cjs');
|
|
65
|
+
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
66
|
+
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
67
|
+
require('../../../components/Alert/Alert.cjs');
|
|
68
|
+
require('@dynamic-labs/viem-utils');
|
|
69
|
+
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
70
|
+
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
|
|
71
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
72
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
73
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
74
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
75
|
+
var turnkeyExport = require('../utils/turnkeyExport/turnkeyExport.cjs');
|
|
76
|
+
var constants = require('../constants.cjs');
|
|
77
|
+
|
|
78
|
+
const EmbeddedRevealView = () => {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const { authToken, primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
81
|
+
const { view } = ViewContext.useViewContext();
|
|
82
|
+
const [acknowledgement1, setAcknowledgement1] = React.useState(false);
|
|
83
|
+
const iframeContainerRef = React.useRef(null);
|
|
84
|
+
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
85
|
+
const walletProperties = (_b = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
86
|
+
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
87
|
+
const exportPrivateKey = view === null || view === void 0 ? void 0 : view.includes('account');
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
var _a;
|
|
90
|
+
const iframeContainerElement = iframeContainerRef.current;
|
|
91
|
+
if (!iframeContainerElement ||
|
|
92
|
+
((_a = iframeContainerElement === null || iframeContainerElement === void 0 ? void 0 : iframeContainerElement.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
turnkeyExport.initExport({
|
|
96
|
+
iframeContainer: iframeContainerElement,
|
|
97
|
+
iframeElementId: constants.iframeElementId,
|
|
98
|
+
wallet: primaryWallet,
|
|
99
|
+
});
|
|
100
|
+
return () => {
|
|
101
|
+
turnkeyExport.cleanupExport({
|
|
102
|
+
wallet: primaryWallet,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
// only run once on mount
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
+
}, []);
|
|
108
|
+
const { mutate: handleExportWallet, isLoading, error, data, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
+
return turnkeyExport.exportCredential({
|
|
110
|
+
address: exportPrivateKey ? primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address : undefined,
|
|
111
|
+
authToken,
|
|
112
|
+
environmentId,
|
|
113
|
+
userEmail: user === null || user === void 0 ? void 0 : user.email,
|
|
114
|
+
wallet: primaryWallet,
|
|
115
|
+
});
|
|
116
|
+
}), {
|
|
117
|
+
onFailure: (err) => {
|
|
118
|
+
logger.logger.error('Failed to export', err);
|
|
119
|
+
dynamicEvents.dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
const errorText = React.useMemo(() => {
|
|
123
|
+
if (!error) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
if (error instanceof utils.DynamicError) {
|
|
127
|
+
return error.message;
|
|
128
|
+
}
|
|
129
|
+
return getProperErrorMessage.getProperErrorMessage(error);
|
|
130
|
+
}, [error]);
|
|
131
|
+
const { t } = reactI18next.useTranslation();
|
|
132
|
+
const contentHeader = (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__description', children: !isLoading && data && !error ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', children: t('dyn_embedded_reveal.reveal_description') })) : (jsxRuntime.jsx("div", { className: 'embedded-reveal-view__header', children: jsxRuntime.jsx(exportEmbeddedHero.ReactComponent, {}) })) }));
|
|
133
|
+
React.useEffect(() => {
|
|
134
|
+
var _a;
|
|
135
|
+
if (((_a = iframeContainerRef === null || iframeContainerRef === void 0 ? void 0 : iframeContainerRef.current) === null || _a === void 0 ? void 0 : _a.children) && data) {
|
|
136
|
+
// eslint-disable-next-line prefer-destructuring
|
|
137
|
+
const iframeElement = iframeContainerRef.current.children[0];
|
|
138
|
+
iframeElement === null || iframeElement === void 0 ? void 0 : iframeElement.setAttribute('style', !isTurnkeyHDWallet || exportPrivateKey
|
|
139
|
+
? 'height: 60px'
|
|
140
|
+
: 'height: 100px');
|
|
141
|
+
}
|
|
142
|
+
}, [iframeContainerRef, data, isTurnkeyHDWallet, exportPrivateKey]);
|
|
143
|
+
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => setShowAuthFlow(false, { emitCancelAuth: true }), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
144
|
+
const hasInjectedCredential = !isLoading && data && !error;
|
|
145
|
+
const credentialTitle = !isTurnkeyHDWallet || exportPrivateKey
|
|
146
|
+
? t('dyn_embedded_reveal.private_key_title')
|
|
147
|
+
: t('dyn_embedded_reveal.recovery_phrase_title');
|
|
148
|
+
const title = hasInjectedCredential
|
|
149
|
+
? credentialTitle
|
|
150
|
+
: t('dyn_embedded_reveal.agreement_title');
|
|
151
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsxRuntime.jsx("div", { className: 'embedded-reveal-view', children: jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body', children: [contentHeader, jsxRuntime.jsx("div", { id: constants.iframeContainerId, style: { display: data ? 'block' : 'none' }, ref: iframeContainerRef }), hasInjectedCredential ? (jsxRuntime.jsx(Button.Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', onClick: () => setShowAuthFlow(false), loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
152
|
+
color: 'inherit',
|
|
153
|
+
}, children: t('dyn_embedded_reveal.done_button_label') })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__description', children: jsxRuntime.jsx(Badge.Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(walletV2.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.statement_1.title', children: t('dyn_embedded_reveal.statement_1.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsxRuntime.jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsxRuntime.jsx(eyeOffIcon.ReactComponent, {}) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_embedded_reveal.statement_2.description', children: t('dyn_embedded_reveal.statement_2.description', {
|
|
154
|
+
credential_type: credentialTitle === null || credentialTitle === void 0 ? void 0 : credentialTitle.toLowerCase(),
|
|
155
|
+
}) })] })] })] }), jsxRuntime.jsxs("div", { className: 'embedded-reveal-view__body__confirm_card', children: [jsxRuntime.jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setAcknowledgement1(!acknowledgement1), children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: acknowledgement1, onChange: () => setAcknowledgement1(!acknowledgement1), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'embedded-reveal-checkbox-1' }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }), jsxRuntime.jsx(Button.Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
|
|
156
|
+
color: 'inherit',
|
|
157
|
+
}, onClick: () => handleExportWallet(), disabled: !acknowledgement1, loading: isLoading, dataTestId: 'embedded-reveal-button', copykey: 'dyn_embedded_reveal.reveal_button_label', children: t('dyn_embedded_reveal.reveal_button_label') })] })] }))] }) })] }));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
exports.EmbeddedRevealView = EmbeddedRevealView;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
6
|
+
import { getProperErrorMessage } from '../../../modals/SignMessageConfirmationModal/getProperErrorMessage.js';
|
|
7
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
8
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
10
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
11
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
12
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
13
|
+
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
14
|
+
import '@dynamic-labs/iconic';
|
|
15
|
+
import { ReactComponent as SvgClose } from '../../../shared/assets/close.js';
|
|
16
|
+
import { ReactComponent as SvgEyeOffIcon } from '../../../shared/assets/eye-off-icon.js';
|
|
17
|
+
import { ReactComponent as SvgExportEmbeddedHero } from '../../../shared/assets/export-embedded-hero.js';
|
|
18
|
+
import { ReactComponent as SvgWalletV2 } from '../../../shared/assets/wallet-v2.js';
|
|
19
|
+
import { logger } from '../../../shared/logger.js';
|
|
20
|
+
import '@dynamic-labs/wallet-book';
|
|
21
|
+
import '../../../utils/constants/colors.js';
|
|
22
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
23
|
+
import 'viem';
|
|
24
|
+
import '../../../shared/consts/index.js';
|
|
25
|
+
import '@dynamic-labs/multi-wallet';
|
|
26
|
+
import '@dynamic-labs/sdk-api';
|
|
27
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
28
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
|
+
import '../../../config/ApiEndpoint.js';
|
|
30
|
+
import '../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
31
|
+
import 'react-dom';
|
|
32
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
33
|
+
import { useMutation } from '../../../utils/hooks/useMutation/useMutation.js';
|
|
34
|
+
import '@dynamic-labs/types';
|
|
35
|
+
import 'yup';
|
|
36
|
+
import '../../../context/MockContext/MockContext.js';
|
|
37
|
+
import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
38
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
39
|
+
import '@dynamic-labs/rpc-providers';
|
|
40
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
41
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
42
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
43
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
44
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
45
|
+
import '../../../components/OverlayCard/OverlayCard.context.js';
|
|
46
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
47
|
+
import '../../../context/QrCodeContext/QrCodeContext.js';
|
|
48
|
+
import { Typography } from '../../../components/Typography/Typography.js';
|
|
49
|
+
import { Badge } from '../../../components/Badge/Badge.js';
|
|
50
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
51
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
52
|
+
import 'react-focus-lock';
|
|
53
|
+
import '../../../context/LoadingContext/LoadingContext.js';
|
|
54
|
+
import 'qrcode';
|
|
55
|
+
import 'i18next';
|
|
56
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
57
|
+
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
58
|
+
import '../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
59
|
+
import 'formik';
|
|
60
|
+
import { Button } from '../../../components/Button/Button.js';
|
|
61
|
+
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
62
|
+
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
63
|
+
import '../../../components/Alert/Alert.js';
|
|
64
|
+
import '@dynamic-labs/viem-utils';
|
|
65
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
66
|
+
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
67
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
68
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
69
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
70
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
71
|
+
import { initExport, cleanupExport, exportCredential } from '../utils/turnkeyExport/turnkeyExport.js';
|
|
72
|
+
import { iframeContainerId, iframeElementId } from '../constants.js';
|
|
73
|
+
|
|
74
|
+
const EmbeddedRevealView = () => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const { authToken, primaryWallet, user, setShowAuthFlow, environmentId } = useInternalDynamicContext();
|
|
77
|
+
const { view } = useViewContext();
|
|
78
|
+
const [acknowledgement1, setAcknowledgement1] = useState(false);
|
|
79
|
+
const iframeContainerRef = useRef(null);
|
|
80
|
+
const decodedJwt = decodeJwt(authToken);
|
|
81
|
+
const walletProperties = (_b = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
82
|
+
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
83
|
+
const exportPrivateKey = view === null || view === void 0 ? void 0 : view.includes('account');
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
var _a;
|
|
86
|
+
const iframeContainerElement = iframeContainerRef.current;
|
|
87
|
+
if (!iframeContainerElement ||
|
|
88
|
+
((_a = iframeContainerElement === null || iframeContainerElement === void 0 ? void 0 : iframeContainerElement.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
initExport({
|
|
92
|
+
iframeContainer: iframeContainerElement,
|
|
93
|
+
iframeElementId,
|
|
94
|
+
wallet: primaryWallet,
|
|
95
|
+
});
|
|
96
|
+
return () => {
|
|
97
|
+
cleanupExport({
|
|
98
|
+
wallet: primaryWallet,
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
// only run once on mount
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
}, []);
|
|
104
|
+
const { mutate: handleExportWallet, isLoading, error, data, } = useMutation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
|
+
return exportCredential({
|
|
106
|
+
address: exportPrivateKey ? primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address : undefined,
|
|
107
|
+
authToken,
|
|
108
|
+
environmentId,
|
|
109
|
+
userEmail: user === null || user === void 0 ? void 0 : user.email,
|
|
110
|
+
wallet: primaryWallet,
|
|
111
|
+
});
|
|
112
|
+
}), {
|
|
113
|
+
onFailure: (err) => {
|
|
114
|
+
logger.error('Failed to export', err);
|
|
115
|
+
dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
const errorText = useMemo(() => {
|
|
119
|
+
if (!error) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
if (error instanceof DynamicError) {
|
|
123
|
+
return error.message;
|
|
124
|
+
}
|
|
125
|
+
return getProperErrorMessage(error);
|
|
126
|
+
}, [error]);
|
|
127
|
+
const { t } = useTranslation();
|
|
128
|
+
const contentHeader = (jsx("div", { className: 'embedded-reveal-view__body__description', children: !isLoading && data && !error ? (jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', children: t('dyn_embedded_reveal.reveal_description') })) : (jsx("div", { className: 'embedded-reveal-view__header', children: jsx(SvgExportEmbeddedHero, {}) })) }));
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
var _a;
|
|
131
|
+
if (((_a = iframeContainerRef === null || iframeContainerRef === void 0 ? void 0 : iframeContainerRef.current) === null || _a === void 0 ? void 0 : _a.children) && data) {
|
|
132
|
+
// eslint-disable-next-line prefer-destructuring
|
|
133
|
+
const iframeElement = iframeContainerRef.current.children[0];
|
|
134
|
+
iframeElement === null || iframeElement === void 0 ? void 0 : iframeElement.setAttribute('style', !isTurnkeyHDWallet || exportPrivateKey
|
|
135
|
+
? 'height: 60px'
|
|
136
|
+
: 'height: 100px');
|
|
137
|
+
}
|
|
138
|
+
}, [iframeContainerRef, data, isTurnkeyHDWallet, exportPrivateKey]);
|
|
139
|
+
const closeButton = (jsx(IconButton, { onClick: () => setShowAuthFlow(false, { emitCancelAuth: true }), type: 'button', children: jsx(SvgClose, {}) }));
|
|
140
|
+
const hasInjectedCredential = !isLoading && data && !error;
|
|
141
|
+
const credentialTitle = !isTurnkeyHDWallet || exportPrivateKey
|
|
142
|
+
? t('dyn_embedded_reveal.private_key_title')
|
|
143
|
+
: t('dyn_embedded_reveal.recovery_phrase_title');
|
|
144
|
+
const title = hasInjectedCredential
|
|
145
|
+
? credentialTitle
|
|
146
|
+
: t('dyn_embedded_reveal.agreement_title');
|
|
147
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: title }) }), jsx("div", { className: 'embedded-reveal-view', children: jsxs("div", { className: 'embedded-reveal-view__body', children: [contentHeader, jsx("div", { id: iframeContainerId, style: { display: data ? 'block' : 'none' }, ref: iframeContainerRef }), hasInjectedCredential ? (jsx(Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', onClick: () => setShowAuthFlow(false), loading: isLoading, copykey: 'dyn_embedded_reveal.done_button_label', typographyProps: {
|
|
148
|
+
color: 'inherit',
|
|
149
|
+
}, children: t('dyn_embedded_reveal.done_button_label') })) : (jsxs(Fragment, { children: [jsx("div", { className: 'embedded-reveal-view__body__description', children: jsx(Badge, { text: t('dyn_embedded_reveal.badge_label'), className: 'embedded-reveal-view__body__badge' }) }), errorText && jsx(ErrorContainer, { children: errorText }), jsxs("div", { className: 'embedded-reveal-view__body__card', children: [jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgWalletV2, {}) }), jsxs("div", { children: [jsx(Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.statement_1.title', children: t('dyn_embedded_reveal.statement_1.title') }), jsx(Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_embedded_reveal.statement_1.description', children: t('dyn_embedded_reveal.statement_1.description') })] })] }), jsxs("div", { className: 'embedded-reveal-view__body__card__statement', children: [jsx("div", { className: 'embedded-reveal-view__body__card__icon', children: jsx(SvgEyeOffIcon, {}) }), jsxs("div", { children: [jsx(Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.statement_2.title', children: t('dyn_embedded_reveal.statement_2.title') }), jsx(Typography, { variant: 'body_small', color: 'secondary', weight: 'regular', copykey: 'dyn_embedded_reveal.statement_2.description', children: t('dyn_embedded_reveal.statement_2.description', {
|
|
150
|
+
credential_type: credentialTitle === null || credentialTitle === void 0 ? void 0 : credentialTitle.toLowerCase(),
|
|
151
|
+
}) })] })] })] }), jsxs("div", { className: 'embedded-reveal-view__body__confirm_card', children: [jsxs("button", { className: 'embedded-reveal-view__body__card__acknowledgement', onClick: () => setAcknowledgement1(!acknowledgement1), children: [jsx("div", { children: jsx(Checkbox, { checked: acknowledgement1, onChange: () => setAcknowledgement1(!acknowledgement1), className: 'embedded-reveal-view__body__card__statement__checkbox', id: 'embedded-reveal-checkbox-1' }) }), jsx("div", { children: jsx(Typography, { variant: 'body_normal', color: 'primary', style: { letterSpacing: '-0.15px' }, copykey: 'dyn_embedded_reveal.checkbox_label', children: t('dyn_embedded_reveal.checkbox_label') }) })] }), jsx(Button, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
|
|
152
|
+
color: 'inherit',
|
|
153
|
+
}, onClick: () => handleExportWallet(), disabled: !acknowledgement1, loading: isLoading, dataTestId: 'embedded-reveal-button', copykey: 'dyn_embedded_reveal.reveal_button_label', children: t('dyn_embedded_reveal.reveal_button_label') })] })] }))] }) })] }));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export { EmbeddedRevealView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmbeddedRevealView } from './EmbeddedRevealView';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const iframeContainerId = 'dyn-turnkey-export-container-id';
|
|
6
|
+
const iframeElementId = 'dyn-turnkey-export-element-id';
|
|
7
|
+
|
|
8
|
+
exports.iframeContainerId = iframeContainerId;
|
|
9
|
+
exports.iframeElementId = iframeElementId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmbeddedRevealView';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './turnkeyExport';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
|
+
var decodeJwt = require('../../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('react/jsx-runtime');
|
|
11
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
+
require('react');
|
|
13
|
+
require('../../../../shared/logger.cjs');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('viem');
|
|
18
|
+
require('../../../../shared/consts/index.cjs');
|
|
19
|
+
var api = require('../../../../data/api.cjs');
|
|
20
|
+
|
|
21
|
+
const initExport = ({ iframeContainer, iframeElementId, wallet, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
var _a;
|
|
23
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.connector) ||
|
|
24
|
+
!(wallet === null || wallet === void 0 ? void 0 : wallet.id) ||
|
|
25
|
+
!walletConnectorCore.isPasskeyWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
|
|
26
|
+
throw new utils.DynamicError('PasskeyWalletConnector not found');
|
|
27
|
+
}
|
|
28
|
+
const turnkeyExportHandler = (_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.getExportHandler();
|
|
29
|
+
const publicKey = yield turnkeyExportHandler.initExport(iframeContainer, iframeElementId);
|
|
30
|
+
if (!publicKey) {
|
|
31
|
+
throw new utils.DynamicError('Something went wrong');
|
|
32
|
+
}
|
|
33
|
+
return turnkeyExportHandler;
|
|
34
|
+
});
|
|
35
|
+
const handleExportInitCheck = ({ authToken, userEmail, wallet, }) => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
if (!authToken) {
|
|
38
|
+
throw new utils.DynamicError('User must be logged in');
|
|
39
|
+
}
|
|
40
|
+
const decodedJwt = decodeJwt.decodeJwt(authToken);
|
|
41
|
+
if (!decodedJwt) {
|
|
42
|
+
throw new utils.DynamicError('User must be logged in with a valid token');
|
|
43
|
+
}
|
|
44
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.connector) ||
|
|
45
|
+
!(wallet === null || wallet === void 0 ? void 0 : wallet.id) ||
|
|
46
|
+
!walletConnectorCore.isPasskeyWalletConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
|
|
47
|
+
throw new utils.DynamicError('PasskeyWalletConnector not found');
|
|
48
|
+
}
|
|
49
|
+
const connector = wallet.connector;
|
|
50
|
+
connector.setEmail(userEmail);
|
|
51
|
+
const walletProperties = (_b = (_a = decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
52
|
+
const turnkeyHDWalletId = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
53
|
+
const privateKeyId = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyPrivateKeyId;
|
|
54
|
+
const organizationId = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeySubOrganizationId;
|
|
55
|
+
if (!organizationId ||
|
|
56
|
+
(turnkeyHDWalletId === undefined && privateKeyId === undefined)) {
|
|
57
|
+
throw new utils.DynamicError('Invalid token!');
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
connector,
|
|
61
|
+
organizationId,
|
|
62
|
+
privateKeyId,
|
|
63
|
+
turnkeyHDWalletId,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const extractExportBundle = ({ address, privateKeyId, activity, }) => {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
const exportWalletResult = address
|
|
69
|
+
? (_a = activity.result) === null || _a === void 0 ? void 0 : _a.exportWalletAccountResult
|
|
70
|
+
: (_b = activity.result) === null || _b === void 0 ? void 0 : _b.exportWalletResult;
|
|
71
|
+
const result = privateKeyId
|
|
72
|
+
? (_c = activity.result) === null || _c === void 0 ? void 0 : _c.exportPrivateKeyResult
|
|
73
|
+
: exportWalletResult;
|
|
74
|
+
return result === null || result === void 0 ? void 0 : result.exportBundle;
|
|
75
|
+
};
|
|
76
|
+
const exportCredential = ({ authToken, userEmail, wallet, environmentId, address, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
+
const { connector, turnkeyHDWalletId, privateKeyId, organizationId } = handleExportInitCheck({
|
|
78
|
+
authToken,
|
|
79
|
+
userEmail,
|
|
80
|
+
wallet,
|
|
81
|
+
});
|
|
82
|
+
const turnkeyExportHandler = connector.getExportHandler();
|
|
83
|
+
const targetPublicKey = turnkeyExportHandler.publicKey;
|
|
84
|
+
if (!targetPublicKey) {
|
|
85
|
+
throw new utils.DynamicError('Must initialize export first');
|
|
86
|
+
}
|
|
87
|
+
// calls turnkey export api
|
|
88
|
+
let newActivity;
|
|
89
|
+
if (turnkeyHDWalletId) {
|
|
90
|
+
newActivity = yield turnkeyExportHandler.exportWallet({
|
|
91
|
+
address,
|
|
92
|
+
organizationId,
|
|
93
|
+
walletId: turnkeyHDWalletId,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
else if (privateKeyId) {
|
|
97
|
+
newActivity = yield turnkeyExportHandler.exportPrivateKey({
|
|
98
|
+
organizationId,
|
|
99
|
+
privateKeyId,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const activityId = newActivity.id;
|
|
103
|
+
const activityStatus = newActivity.status;
|
|
104
|
+
let exportBundle;
|
|
105
|
+
if (activityStatus === 'ACTIVITY_STATUS_COMPLETED') {
|
|
106
|
+
exportBundle = extractExportBundle({
|
|
107
|
+
activity: newActivity,
|
|
108
|
+
address,
|
|
109
|
+
privateKeyId,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const res = yield api.exportEmbeddedWallet({
|
|
114
|
+
activityId,
|
|
115
|
+
environmentId,
|
|
116
|
+
userJwt: authToken || '',
|
|
117
|
+
walletId: (wallet === null || wallet === void 0 ? void 0 : wallet.id) || '',
|
|
118
|
+
});
|
|
119
|
+
exportBundle = res === null || res === void 0 ? void 0 : res.exportBundle;
|
|
120
|
+
}
|
|
121
|
+
if (!exportBundle) {
|
|
122
|
+
throw new utils.DynamicError('Invalid export response');
|
|
123
|
+
}
|
|
124
|
+
if (address || privateKeyId) {
|
|
125
|
+
return turnkeyExportHandler.verifyExportPrivateKey(exportBundle);
|
|
126
|
+
}
|
|
127
|
+
return turnkeyExportHandler.verifyExportWallet(exportBundle);
|
|
128
|
+
});
|
|
129
|
+
const cleanupExport = ({ wallet }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
+
var _b;
|
|
131
|
+
const connector = wallet === null || wallet === void 0 ? void 0 : wallet.connector;
|
|
132
|
+
// clear iframeStamper and its reference
|
|
133
|
+
(_b = connector === null || connector === void 0 ? void 0 : connector.getExportHandler()) === null || _b === void 0 ? void 0 : _b.clear();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
exports.cleanupExport = cleanupExport;
|
|
137
|
+
exports.exportCredential = exportCredential;
|
|
138
|
+
exports.extractExportBundle = extractExportBundle;
|
|
139
|
+
exports.initExport = initExport;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Wallet } from '../../../../shared';
|
|
2
|
+
export declare const initExport: ({ iframeContainer, iframeElementId, wallet, }: {
|
|
3
|
+
iframeContainer: HTMLElement;
|
|
4
|
+
iframeElementId: string;
|
|
5
|
+
wallet: Wallet | null;
|
|
6
|
+
}) => Promise<import("@dynamic-labs/wallet-connector-core").ExportHandler>;
|
|
7
|
+
export declare const extractExportBundle: ({ address, privateKeyId, activity, }: {
|
|
8
|
+
address?: string | undefined;
|
|
9
|
+
privateKeyId?: string | undefined;
|
|
10
|
+
activity: any;
|
|
11
|
+
}) => any;
|
|
12
|
+
export declare const exportCredential: ({ authToken, userEmail, wallet, environmentId, address, }: {
|
|
13
|
+
authToken: string | undefined;
|
|
14
|
+
userEmail: string | undefined;
|
|
15
|
+
wallet: Wallet | null;
|
|
16
|
+
environmentId: string;
|
|
17
|
+
address?: string | undefined;
|
|
18
|
+
}) => Promise<unknown>;
|
|
19
|
+
export declare const cleanupExport: ({ wallet }: {
|
|
20
|
+
wallet: Wallet | null;
|
|
21
|
+
}) => Promise<void>;
|