@web3auth/modal 10.16.0 → 11.0.0-beta.1
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/dist/lib.cjs/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
- package/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +473 -17
- package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +4 -2
- package/dist/lib.cjs/packages/modal/src/react/context/WalletServicesInnerContext.js +3 -56
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +15 -152
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +1 -22
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthConnect.js +30 -43
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthInner.js +8 -4
- package/dist/lib.cjs/packages/modal/src/react/index.js +61 -28
- package/dist/lib.cjs/packages/modal/src/react/solana/index.js +21 -8
- package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +34 -17
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +15 -18
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +11 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +6 -6
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +132 -44
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +20 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +22 -24
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.css.js +6 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +30 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +12 -12
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +77 -29
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +20 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +41 -33
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +13 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +13 -7
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Embed/Embed.js +12 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/Login.js +95 -80
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +12 -12
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +14 -14
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +250 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +185 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +110 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +158 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/RootContext.js +64 -21
- package/dist/lib.cjs/packages/modal/src/ui/context/WidgetContext.js +52 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +28 -1
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +186 -46
- package/dist/lib.cjs/packages/modal/src/vue/WalletServicesInnerProvider.js +2 -50
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +7 -170
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthConnect.js +31 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthInner.js +2 -5
- package/dist/lib.cjs/packages/modal/src/vue/index.js +61 -28
- package/dist/lib.cjs/packages/modal/src/vue/solana/index.js +29 -8
- package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +37 -23
- package/dist/lib.cjs/packages/modal/src/x402/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/x402/react.js +26 -0
- package/dist/lib.cjs/packages/modal/src/x402/vue.js +18 -0
- package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
- package/dist/lib.cjs/types/interface.d.ts +2 -2
- package/dist/lib.cjs/types/modalManager.d.ts +46 -4
- package/dist/lib.cjs/types/react/context/WalletServicesInnerContext.d.ts +12 -5
- package/dist/lib.cjs/types/react/context/Web3AuthInnerContext.d.ts +4 -3
- package/dist/lib.cjs/types/react/hooks/index.d.ts +16 -14
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/react/hooks/useWeb3Auth.d.ts +1 -2
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthConnect.d.ts +3 -3
- package/dist/lib.cjs/types/react/interfaces.d.ts +3 -2
- package/dist/lib.cjs/types/react/solana/hooks/index.d.ts +5 -4
- package/dist/lib.cjs/types/react/solana/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/solana/provider.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +4 -3
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +7 -5
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.type.d.ts +2 -1
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/SpinnerLoader.d.ts +4 -0
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/SpinnerLoader.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/constants.d.ts +7 -4
- package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWallet.type.d.ts +7 -0
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.type.d.ts +0 -2
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.type.d.ts +3 -9
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.type.d.ts +0 -2
- package/dist/lib.cjs/types/ui/containers/Login/Login.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/{components → containers}/Root/Root.d.ts +1 -1
- package/dist/lib.cjs/types/ui/containers/Root/Root.type.d.ts +3 -0
- package/dist/lib.cjs/types/ui/containers/Root/RootBodySheets/RootBodySheets.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/Widget/Widget.type.d.ts +5 -0
- package/dist/lib.cjs/types/ui/context/ModalStateContext.d.ts +28 -0
- package/dist/lib.cjs/types/ui/context/RootContext.d.ts +19 -7
- package/dist/lib.cjs/types/ui/context/WidgetContext.d.ts +45 -0
- package/dist/lib.cjs/types/ui/interfaces.d.ts +53 -15
- package/dist/lib.cjs/types/ui/loginModal.d.ts +31 -4
- package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
- package/dist/lib.cjs/types/vue/composables/index.d.ts +3 -14
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/vue/composables/useWeb3Auth.d.ts +1 -2
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthConnect.d.ts +3 -3
- package/dist/lib.cjs/types/vue/interfaces.d.ts +3 -17
- package/dist/lib.cjs/types/vue/solana/composables/index.d.ts +3 -4
- package/dist/lib.cjs/types/vue/solana/composables/useSolanaClient.d.ts +1 -0
- package/dist/lib.cjs/types/vue/solana/constants.d.ts +1 -0
- package/dist/lib.cjs/types/vue/solana/index.d.ts +2 -0
- package/dist/lib.cjs/types/vue/solana/provider.d.ts +1 -0
- package/dist/lib.cjs/types/x402/index.d.ts +1 -0
- package/dist/lib.cjs/types/x402/react.d.ts +2 -0
- package/dist/lib.cjs/types/x402/vue.d.ts +2 -0
- package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +478 -19
- package/dist/lib.esm/packages/modal/src/react/Web3AuthProvider.js +4 -2
- package/dist/lib.esm/packages/modal/src/react/context/WalletServicesInnerContext.js +4 -57
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +12 -151
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3Auth.js +1 -22
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthConnect.js +28 -41
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthInner.js +7 -3
- package/dist/lib.esm/packages/modal/src/react/index.js +1 -14
- package/dist/lib.esm/packages/modal/src/react/solana/index.js +1 -4
- package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +34 -17
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +15 -18
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +12 -13
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +133 -45
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +20 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +22 -24
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.css.js +4 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +28 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +14 -14
- package/dist/lib.esm/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +81 -32
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +20 -11
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +41 -33
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +15 -13
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +13 -7
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Embed/Embed.js +12 -11
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/Login.js +99 -83
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +12 -12
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +14 -14
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +253 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +183 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +108 -0
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +161 -0
- package/dist/lib.esm/packages/modal/src/ui/context/RootContext.js +60 -22
- package/dist/lib.esm/packages/modal/src/ui/context/WidgetContext.js +49 -0
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +26 -2
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +188 -48
- package/dist/lib.esm/packages/modal/src/vue/WalletServicesInnerProvider.js +5 -54
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +9 -176
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthConnect.js +28 -30
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthInner.js +2 -5
- package/dist/lib.esm/packages/modal/src/vue/index.js +1 -14
- package/dist/lib.esm/packages/modal/src/vue/solana/index.js +1 -4
- package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +33 -19
- package/dist/lib.esm/packages/modal/src/x402/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/x402/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/x402/vue.js +1 -0
- package/package.json +94 -47
- package/dist/lib.cjs/packages/modal/src/providers/ethereum-mpc-provider/index.js +0 -12
- package/dist/lib.cjs/packages/modal/src/react/hooks/useChain.js +0 -16
- package/dist/lib.cjs/packages/modal/src/react/hooks/useCheckout.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useEnableMFA.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useFunding.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useIdentityToken.js +0 -46
- package/dist/lib.cjs/packages/modal/src/react/hooks/useManageMFA.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useReceive.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useSwap.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useSwitchChain.js +0 -32
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletConnectScanner.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletServicesPlugin.js +0 -13
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletUI.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthDisconnect.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthUser.js +0 -50
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignAndSendTransaction.js +0 -36
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignMessage.js +0 -37
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignTransaction.js +0 -36
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSolanaWallet.js +0 -68
- package/dist/lib.cjs/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +0 -88
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +0 -513
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +0 -251
- package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +0 -9
- package/dist/lib.cjs/packages/modal/src/vue/composables/useChain.js +0 -13
- package/dist/lib.cjs/packages/modal/src/vue/composables/useCheckout.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useEnableMFA.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useFunding.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useIdentityToken.js +0 -51
- package/dist/lib.cjs/packages/modal/src/vue/composables/useManageMFA.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useReceive.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwap.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwitchChain.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletConnectScanner.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletServicesPlugin.js +0 -13
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletUI.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthUser.js +0 -54
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +0 -37
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignMessage.js +0 -39
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignTransaction.js +0 -37
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSolanaWallet.js +0 -67
- package/dist/lib.cjs/types/providers/ethereum-mpc-provider/index.d.ts +0 -1
- package/dist/lib.cjs/types/react/hooks/useChain.d.ts +0 -6
- package/dist/lib.cjs/types/react/hooks/useCheckout.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useEnableMFA.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useFunding.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useIdentityToken.d.ts +0 -13
- package/dist/lib.cjs/types/react/hooks/useManageMFA.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useReceive.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useSwap.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useSwitchChain.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useWalletConnectScanner.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useWalletServicesPlugin.d.ts +0 -2
- package/dist/lib.cjs/types/react/hooks/useWalletUI.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthDisconnect.d.ts +0 -9
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthUser.d.ts +0 -9
- package/dist/lib.cjs/types/react/solana/hooks/useSignAndSendTransaction.d.ts +0 -8
- package/dist/lib.cjs/types/react/solana/hooks/useSignMessage.d.ts +0 -8
- package/dist/lib.cjs/types/react/solana/hooks/useSignTransaction.d.ts +0 -13
- package/dist/lib.cjs/types/react/solana/hooks/useSolanaWallet.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.d.ts +0 -3
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.type.d.ts +0 -19
- package/dist/lib.cjs/types/ui/components/CircularLoader/index.d.ts +0 -2
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.type.d.ts +0 -27
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +0 -35
- package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +0 -36
- package/dist/lib.cjs/types/ui/components/Widget/Widget.type.d.ts +0 -24
- package/dist/lib.cjs/types/ui/context/ThemeContext.d.ts +0 -3
- package/dist/lib.cjs/types/vue/composables/useChain.d.ts +0 -7
- package/dist/lib.cjs/types/vue/composables/useCheckout.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useEnableMFA.d.ts +0 -8
- package/dist/lib.cjs/types/vue/composables/useFunding.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useIdentityToken.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useManageMFA.d.ts +0 -8
- package/dist/lib.cjs/types/vue/composables/useReceive.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useSwap.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useSwitchChain.d.ts +0 -10
- package/dist/lib.cjs/types/vue/composables/useWalletConnectScanner.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useWalletServicesPlugin.d.ts +0 -2
- package/dist/lib.cjs/types/vue/composables/useWalletUI.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthDisconnect.d.ts +0 -10
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthUser.d.ts +0 -10
- package/dist/lib.cjs/types/vue/solana/composables/useSignAndSendTransaction.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSignMessage.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSignTransaction.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSolanaWallet.d.ts +0 -9
- package/dist/lib.esm/packages/modal/src/providers/ethereum-mpc-provider/index.js +0 -1
- package/dist/lib.esm/packages/modal/src/react/hooks/useChain.js +0 -14
- package/dist/lib.esm/packages/modal/src/react/hooks/useCheckout.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useEnableMFA.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useFunding.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useIdentityToken.js +0 -44
- package/dist/lib.esm/packages/modal/src/react/hooks/useManageMFA.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useReceive.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useSwap.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useSwitchChain.js +0 -30
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletConnectScanner.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletServicesPlugin.js +0 -11
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletUI.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthDisconnect.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthUser.js +0 -48
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignAndSendTransaction.js +0 -34
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignMessage.js +0 -35
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignTransaction.js +0 -34
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSolanaWallet.js +0 -64
- package/dist/lib.esm/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +0 -86
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +0 -524
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +0 -253
- package/dist/lib.esm/packages/modal/src/ui/context/ThemeContext.js +0 -7
- package/dist/lib.esm/packages/modal/src/vue/composables/useChain.js +0 -11
- package/dist/lib.esm/packages/modal/src/vue/composables/useCheckout.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useEnableMFA.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useFunding.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useIdentityToken.js +0 -49
- package/dist/lib.esm/packages/modal/src/vue/composables/useManageMFA.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useReceive.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwap.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwitchChain.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletConnectScanner.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletServicesPlugin.js +0 -11
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletUI.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthUser.js +0 -52
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +0 -35
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignMessage.js +0 -37
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignTransaction.js +0 -35
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSolanaWallet.js +0 -65
- package/dist/modal.umd.min.js +0 -2
- package/dist/modal.umd.min.js.LICENSE.txt +0 -102
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWallet.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/Embed.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/Embed.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/Login.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/LoginOtp.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/LoginOtp.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Root/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Widget/Widget.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Widget/index.d.ts +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import { BUILD_ENV, WEB3AUTH_NETWORK, AUTH_CONNECTION } from '@web3auth/auth';
|
|
3
|
-
import { WIDGET_TYPE, CONNECTOR_INITIAL_AUTHENTICATION_MODE, log, cloneDeep, WALLET_CONNECTORS, CONNECTOR_NAMES } from '@web3auth/no-modal';
|
|
4
|
-
import deepmerge from 'deepmerge';
|
|
5
|
-
import { useMemo, useState, useEffect } from 'react';
|
|
6
|
-
import { PAGES } from '../../constants.js';
|
|
7
|
-
import { MODAL_STATUS } from '../../interfaces.js';
|
|
8
|
-
import Embed from '../Embed/Embed.js';
|
|
9
|
-
import Modal from '../Modal/Modal.js';
|
|
10
|
-
import Root from '../Root/Root.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function Widget(props) {
|
|
14
|
-
const {
|
|
15
|
-
stateListener,
|
|
16
|
-
handleSocialLoginClick,
|
|
17
|
-
handleExternalWalletClick,
|
|
18
|
-
handleMobileVerifyConnect,
|
|
19
|
-
handleShowExternalWallets,
|
|
20
|
-
closeModal,
|
|
21
|
-
appLogo,
|
|
22
|
-
appName,
|
|
23
|
-
chainNamespaces,
|
|
24
|
-
walletRegistry,
|
|
25
|
-
uiConfig,
|
|
26
|
-
deviceDetails,
|
|
27
|
-
initialAuthenticationMode
|
|
28
|
-
} = props;
|
|
29
|
-
const {
|
|
30
|
-
widgetType
|
|
31
|
-
} = uiConfig;
|
|
32
|
-
const visible = useMemo(() => widgetType === WIDGET_TYPE.EMBED, [widgetType]);
|
|
33
|
-
const [modalState, setModalState] = useState({
|
|
34
|
-
externalWalletsVisibility: false,
|
|
35
|
-
status: MODAL_STATUS.INITIALIZED,
|
|
36
|
-
hasExternalWallets: false,
|
|
37
|
-
externalWalletsInitialized: false,
|
|
38
|
-
modalVisibility: false,
|
|
39
|
-
modalVisibilityDelayed: false,
|
|
40
|
-
postLoadingMessage: "",
|
|
41
|
-
walletConnectUri: "",
|
|
42
|
-
metamaskConnectUri: "",
|
|
43
|
-
socialLoginsConfig: {
|
|
44
|
-
loginMethods: {},
|
|
45
|
-
loginMethodsOrder: [],
|
|
46
|
-
connector: "",
|
|
47
|
-
uiConfig: {}
|
|
48
|
-
},
|
|
49
|
-
externalWalletsConfig: {},
|
|
50
|
-
showExternalWalletsOnly: false,
|
|
51
|
-
currentPage: PAGES.LOGIN,
|
|
52
|
-
detailedLoaderConnector: "",
|
|
53
|
-
detailedLoaderConnectorName: "",
|
|
54
|
-
web3authClientId: "",
|
|
55
|
-
web3authNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
|
|
56
|
-
authBuildEnv: BUILD_ENV.PRODUCTION
|
|
57
|
-
});
|
|
58
|
-
const isConnectAndSignAuthenticationMode = useMemo(() => initialAuthenticationMode === CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN, [initialAuthenticationMode]);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
setModalState(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
61
|
-
modalVisibility: visible
|
|
62
|
-
}));
|
|
63
|
-
}, [visible]);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
stateListener.on("STATE_UPDATED", newModalState => {
|
|
66
|
-
log.debug("state updated", newModalState);
|
|
67
|
-
setModalState(prevState => {
|
|
68
|
-
const mergedState = cloneDeep(deepmerge(prevState, newModalState, {
|
|
69
|
-
arrayMerge: (_prevState, newState) => newState
|
|
70
|
-
}));
|
|
71
|
-
return mergedState;
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
stateListener.emit("MOUNTED");
|
|
75
|
-
}, [stateListener]);
|
|
76
|
-
const preHandleExternalWalletClick = params => {
|
|
77
|
-
const {
|
|
78
|
-
connector
|
|
79
|
-
} = params;
|
|
80
|
-
setModalState(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
81
|
-
detailedLoaderConnector: connector,
|
|
82
|
-
detailedLoaderConnectorName: CONNECTOR_NAMES[connector]
|
|
83
|
-
}));
|
|
84
|
-
|
|
85
|
-
// Call the passed-in handler with the params
|
|
86
|
-
if (handleExternalWalletClick) handleExternalWalletClick(params);
|
|
87
|
-
};
|
|
88
|
-
const preHandleSocialWalletClick = params => {
|
|
89
|
-
const {
|
|
90
|
-
loginParams
|
|
91
|
-
} = params;
|
|
92
|
-
setModalState(prevState => {
|
|
93
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
94
|
-
detailedLoaderConnector: loginParams.authConnection,
|
|
95
|
-
detailedLoaderConnectorName: loginParams.name
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
handleSocialLoginClick(params);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// Memo for checking if social logins are visible
|
|
102
|
-
const areSocialLoginsVisible = useMemo(() => {
|
|
103
|
-
var _modalState$socialLog, _modalState$socialLog2;
|
|
104
|
-
if (modalState.showExternalWalletsOnly) return false;
|
|
105
|
-
if (Object.keys(((_modalState$socialLog = modalState.socialLoginsConfig) === null || _modalState$socialLog === void 0 ? void 0 : _modalState$socialLog.loginMethods) || {}).length === 0) return false;
|
|
106
|
-
const isAnySocialLoginVisible = Object.entries(((_modalState$socialLog2 = modalState.socialLoginsConfig) === null || _modalState$socialLog2 === void 0 ? void 0 : _modalState$socialLog2.loginMethods) || {}).some(([k, v]) => ![AUTH_CONNECTION.EMAIL_PASSWORDLESS, AUTH_CONNECTION.SMS_PASSWORDLESS].includes(k) && v.showOnModal !== false);
|
|
107
|
-
return isAnySocialLoginVisible;
|
|
108
|
-
}, [modalState]);
|
|
109
|
-
|
|
110
|
-
// Memo for checking if email passwordless login is visible
|
|
111
|
-
const isEmailPasswordLessLoginVisible = useMemo(() => {
|
|
112
|
-
var _modalState$socialLog3;
|
|
113
|
-
return (_modalState$socialLog3 = modalState.socialLoginsConfig) === null || _modalState$socialLog3 === void 0 || (_modalState$socialLog3 = _modalState$socialLog3.loginMethods[AUTH_CONNECTION.EMAIL_PASSWORDLESS]) === null || _modalState$socialLog3 === void 0 ? void 0 : _modalState$socialLog3.showOnModal;
|
|
114
|
-
}, [modalState.socialLoginsConfig]);
|
|
115
|
-
|
|
116
|
-
// Memo for checking if SMS passwordless login is visible
|
|
117
|
-
const isSmsPasswordLessLoginVisible = useMemo(() => {
|
|
118
|
-
var _modalState$socialLog4;
|
|
119
|
-
return (_modalState$socialLog4 = modalState.socialLoginsConfig) === null || _modalState$socialLog4 === void 0 || (_modalState$socialLog4 = _modalState$socialLog4.loginMethods[AUTH_CONNECTION.SMS_PASSWORDLESS]) === null || _modalState$socialLog4 === void 0 ? void 0 : _modalState$socialLog4.showOnModal;
|
|
120
|
-
}, [modalState.socialLoginsConfig]);
|
|
121
|
-
const isEmailPrimary = useMemo(() => {
|
|
122
|
-
var _modalState$socialLog5;
|
|
123
|
-
return ((_modalState$socialLog5 = modalState.socialLoginsConfig) === null || _modalState$socialLog5 === void 0 || (_modalState$socialLog5 = _modalState$socialLog5.uiConfig) === null || _modalState$socialLog5 === void 0 ? void 0 : _modalState$socialLog5.primaryButton) === "emailLogin";
|
|
124
|
-
}, [modalState.socialLoginsConfig]);
|
|
125
|
-
const isExternalPrimary = useMemo(() => {
|
|
126
|
-
var _modalState$socialLog6;
|
|
127
|
-
return ((_modalState$socialLog6 = modalState.socialLoginsConfig) === null || _modalState$socialLog6 === void 0 || (_modalState$socialLog6 = _modalState$socialLog6.uiConfig) === null || _modalState$socialLog6 === void 0 ? void 0 : _modalState$socialLog6.primaryButton) === "externalLogin";
|
|
128
|
-
}, [modalState.socialLoginsConfig]);
|
|
129
|
-
const showPasswordLessInput = useMemo(() => isEmailPasswordLessLoginVisible || isSmsPasswordLessLoginVisible, [isEmailPasswordLessLoginVisible, isSmsPasswordLessLoginVisible]);
|
|
130
|
-
const showExternalWalletButton = useMemo(() => modalState.hasExternalWallets || !!modalState.externalWalletsConfig[WALLET_CONNECTORS.METAMASK], [modalState]);
|
|
131
|
-
const showExternalWalletPage = useMemo(() => (areSocialLoginsVisible || showPasswordLessInput || !!modalState.externalWalletsConfig[WALLET_CONNECTORS.METAMASK]) && !modalState.externalWalletsVisibility, [areSocialLoginsVisible, showPasswordLessInput, modalState]);
|
|
132
|
-
const handleExternalWalletBtnClick = flag => {
|
|
133
|
-
setModalState(prevState => {
|
|
134
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
135
|
-
externalWalletsVisibility: flag
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
if (flag && handleShowExternalWallets) handleShowExternalWallets(modalState.externalWalletsInitialized);
|
|
139
|
-
};
|
|
140
|
-
const onCloseModal = () => {
|
|
141
|
-
setModalState(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
142
|
-
externalWalletsVisibility: false,
|
|
143
|
-
modalVisibility: false,
|
|
144
|
-
currentPage: PAGES.LOGIN
|
|
145
|
-
}));
|
|
146
|
-
closeModal();
|
|
147
|
-
};
|
|
148
|
-
const onCloseLoader = () => {
|
|
149
|
-
if (!isConnectAndSignAuthenticationMode && modalState.status === MODAL_STATUS.CONNECTED) {
|
|
150
|
-
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
151
|
-
modalVisibility: false,
|
|
152
|
-
externalWalletsVisibility: false
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
if (isConnectAndSignAuthenticationMode && modalState.status === MODAL_STATUS.AUTHORIZED) {
|
|
156
|
-
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
157
|
-
modalVisibility: false,
|
|
158
|
-
externalWalletsVisibility: false
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
if (modalState.status === MODAL_STATUS.ERRORED) {
|
|
162
|
-
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
163
|
-
modalVisibility: true,
|
|
164
|
-
status: MODAL_STATUS.INITIALIZED
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const showCloseIcon = useMemo(() => {
|
|
169
|
-
return modalState.status === MODAL_STATUS.INITIALIZED || modalState.status === MODAL_STATUS.CONNECTED || modalState.status === MODAL_STATUS.ERRORED || modalState.status === MODAL_STATUS.AUTHORIZED;
|
|
170
|
-
}, [modalState.status]);
|
|
171
|
-
useEffect(() => {
|
|
172
|
-
// TODO: maybe move this inside root
|
|
173
|
-
if (!modalState.modalVisibility) return;
|
|
174
|
-
if (typeof modalState.externalWalletsConfig === "object") {
|
|
175
|
-
var _modalState$externalW;
|
|
176
|
-
// auto connect to WC if not injected to generate QR code URI for mobile connection
|
|
177
|
-
const wcAvailable = (((_modalState$externalW = modalState.externalWalletsConfig[WALLET_CONNECTORS.WALLET_CONNECT_V2]) === null || _modalState$externalW === void 0 ? void 0 : _modalState$externalW.showOnModal) || false) !== false;
|
|
178
|
-
if (wcAvailable && !modalState.walletConnectUri && typeof handleExternalWalletClick === "function") {
|
|
179
|
-
handleExternalWalletClick({
|
|
180
|
-
connector: WALLET_CONNECTORS.WALLET_CONNECT_V2
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}, [modalState, handleExternalWalletClick]);
|
|
185
|
-
if (widgetType === WIDGET_TYPE.MODAL) {
|
|
186
|
-
return /*#__PURE__*/jsx(Modal, {
|
|
187
|
-
open: modalState.modalVisibility,
|
|
188
|
-
placement: "center",
|
|
189
|
-
padding: false,
|
|
190
|
-
showCloseIcon: showCloseIcon,
|
|
191
|
-
onClose: onCloseModal,
|
|
192
|
-
borderRadius: uiConfig.borderRadiusType,
|
|
193
|
-
children: modalState.modalVisibility && /*#__PURE__*/jsx(Root, {
|
|
194
|
-
appLogo: appLogo,
|
|
195
|
-
appName: appName,
|
|
196
|
-
chainNamespaces: chainNamespaces,
|
|
197
|
-
walletRegistry: walletRegistry,
|
|
198
|
-
showPasswordLessInput: showPasswordLessInput,
|
|
199
|
-
showExternalWalletButton: showExternalWalletButton,
|
|
200
|
-
handleSocialLoginClick: params => preHandleSocialWalletClick(params),
|
|
201
|
-
socialLoginsConfig: modalState.socialLoginsConfig,
|
|
202
|
-
areSocialLoginsVisible: areSocialLoginsVisible,
|
|
203
|
-
isEmailPrimary: isEmailPrimary,
|
|
204
|
-
isExternalPrimary: isExternalPrimary,
|
|
205
|
-
showExternalWalletPage: showExternalWalletPage,
|
|
206
|
-
handleExternalWalletBtnClick: handleExternalWalletBtnClick,
|
|
207
|
-
modalState: modalState,
|
|
208
|
-
preHandleExternalWalletClick: preHandleExternalWalletClick,
|
|
209
|
-
setModalState: setModalState,
|
|
210
|
-
onCloseLoader: onCloseLoader,
|
|
211
|
-
isEmailPasswordLessLoginVisible: isEmailPasswordLessLoginVisible,
|
|
212
|
-
isSmsPasswordLessLoginVisible: isSmsPasswordLessLoginVisible,
|
|
213
|
-
uiConfig: uiConfig,
|
|
214
|
-
deviceDetails: deviceDetails,
|
|
215
|
-
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
216
|
-
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
217
|
-
})
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
return /*#__PURE__*/jsx(Embed, {
|
|
221
|
-
open: modalState.modalVisibility,
|
|
222
|
-
padding: false,
|
|
223
|
-
onClose: onCloseModal,
|
|
224
|
-
borderRadius: uiConfig.borderRadiusType,
|
|
225
|
-
children: modalState.modalVisibility && /*#__PURE__*/jsx(Root, {
|
|
226
|
-
chainNamespaces: chainNamespaces,
|
|
227
|
-
walletRegistry: walletRegistry,
|
|
228
|
-
appLogo: appLogo,
|
|
229
|
-
appName: appName,
|
|
230
|
-
showPasswordLessInput: showPasswordLessInput,
|
|
231
|
-
showExternalWalletButton: showExternalWalletButton,
|
|
232
|
-
handleSocialLoginClick: params => preHandleSocialWalletClick(params),
|
|
233
|
-
socialLoginsConfig: modalState.socialLoginsConfig,
|
|
234
|
-
areSocialLoginsVisible: areSocialLoginsVisible,
|
|
235
|
-
isEmailPrimary: isEmailPrimary,
|
|
236
|
-
isExternalPrimary: isExternalPrimary,
|
|
237
|
-
showExternalWalletPage: showExternalWalletPage,
|
|
238
|
-
handleExternalWalletBtnClick: handleExternalWalletBtnClick,
|
|
239
|
-
modalState: modalState,
|
|
240
|
-
preHandleExternalWalletClick: preHandleExternalWalletClick,
|
|
241
|
-
setModalState: setModalState,
|
|
242
|
-
onCloseLoader: onCloseLoader,
|
|
243
|
-
isEmailPasswordLessLoginVisible: isEmailPasswordLessLoginVisible,
|
|
244
|
-
isSmsPasswordLessLoginVisible: isSmsPasswordLessLoginVisible,
|
|
245
|
-
uiConfig: uiConfig,
|
|
246
|
-
deviceDetails: deviceDetails,
|
|
247
|
-
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
248
|
-
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export { Widget as default };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useCheckout = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showCheckout = async showCheckoutParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showCheckout(showCheckoutParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing checkout", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showCheckout
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useCheckout };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
|
-
|
|
5
|
-
const useEnableMFA = () => {
|
|
6
|
-
const {
|
|
7
|
-
web3Auth
|
|
8
|
-
} = useWeb3AuthInner();
|
|
9
|
-
const loading = ref(false);
|
|
10
|
-
const error = ref(null);
|
|
11
|
-
const enableMFA = async () => {
|
|
12
|
-
try {
|
|
13
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
14
|
-
error.value = null;
|
|
15
|
-
loading.value = true;
|
|
16
|
-
await web3Auth.value.enableMFA();
|
|
17
|
-
} catch (err) {
|
|
18
|
-
log.error("Error enabling MFA", err);
|
|
19
|
-
error.value = err;
|
|
20
|
-
} finally {
|
|
21
|
-
loading.value = false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
loading,
|
|
26
|
-
error,
|
|
27
|
-
enableMFA
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { useEnableMFA };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useFunding = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showFunding = async showFundingParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showFunding(showFundingParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing funding", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showFunding
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useFunding };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref, watch } from 'vue';
|
|
3
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
|
-
|
|
5
|
-
const useIdentityToken = () => {
|
|
6
|
-
const {
|
|
7
|
-
web3Auth,
|
|
8
|
-
isAuthorized
|
|
9
|
-
} = useWeb3AuthInner();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const token = ref(null);
|
|
13
|
-
const getIdentityToken = async () => {
|
|
14
|
-
try {
|
|
15
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
16
|
-
error.value = null;
|
|
17
|
-
loading.value = true;
|
|
18
|
-
const result = await web3Auth.value.getIdentityToken();
|
|
19
|
-
if (result !== null && result !== void 0 && result.idToken) {
|
|
20
|
-
token.value = result.idToken;
|
|
21
|
-
}
|
|
22
|
-
return result === null || result === void 0 ? void 0 : result.idToken;
|
|
23
|
-
} catch (err) {
|
|
24
|
-
log.error("Error getting identity token", err);
|
|
25
|
-
error.value = err;
|
|
26
|
-
} finally {
|
|
27
|
-
loading.value = false;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
watch(isAuthorized, newIsAuthorized => {
|
|
31
|
-
if (!web3Auth.value) return;
|
|
32
|
-
if (!newIsAuthorized && token.value) {
|
|
33
|
-
token.value = null;
|
|
34
|
-
}
|
|
35
|
-
if (newIsAuthorized && !token.value) {
|
|
36
|
-
token.value = web3Auth.value.idToken;
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
immediate: true
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
loading,
|
|
43
|
-
error,
|
|
44
|
-
token,
|
|
45
|
-
getIdentityToken
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export { useIdentityToken };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
|
-
|
|
5
|
-
const useManageMFA = () => {
|
|
6
|
-
const {
|
|
7
|
-
web3Auth
|
|
8
|
-
} = useWeb3AuthInner();
|
|
9
|
-
const loading = ref(false);
|
|
10
|
-
const error = ref(null);
|
|
11
|
-
const manageMFA = async () => {
|
|
12
|
-
try {
|
|
13
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
14
|
-
error.value = null;
|
|
15
|
-
loading.value = true;
|
|
16
|
-
await web3Auth.value.manageMFA();
|
|
17
|
-
} catch (err) {
|
|
18
|
-
log.error("Error managing MFA", err);
|
|
19
|
-
error.value = err;
|
|
20
|
-
} finally {
|
|
21
|
-
loading.value = false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
loading,
|
|
26
|
-
error,
|
|
27
|
-
manageMFA
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { useManageMFA };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useReceive = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showReceive = async showReceiveParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showReceive(showReceiveParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing receive", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showReceive
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useReceive };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useSwap = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showSwap = async showSwapParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showSwap(showSwapParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing swap", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showSwap
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useSwap };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
|
-
|
|
5
|
-
const useSwitchChain = () => {
|
|
6
|
-
const {
|
|
7
|
-
web3Auth
|
|
8
|
-
} = useWeb3AuthInner();
|
|
9
|
-
const loading = ref(false);
|
|
10
|
-
const error = ref(null);
|
|
11
|
-
const switchChain = async chainParams => {
|
|
12
|
-
try {
|
|
13
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
14
|
-
error.value = null;
|
|
15
|
-
loading.value = true;
|
|
16
|
-
await web3Auth.value.switchChain(chainParams);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
log.error("Error switching chain", err);
|
|
19
|
-
error.value = err;
|
|
20
|
-
} finally {
|
|
21
|
-
loading.value = false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
loading,
|
|
26
|
-
error,
|
|
27
|
-
switchChain
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { useSwitchChain };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useWalletConnectScanner = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showWalletConnectScanner = async showWalletConnectScannerParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showWalletConnectScanner(showWalletConnectScannerParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing wallet connect scanner", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showWalletConnectScanner
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useWalletConnectScanner };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError } from '@web3auth/no-modal';
|
|
2
|
-
import { WalletServicesContextKey } from '@web3auth/no-modal/vue';
|
|
3
|
-
import { inject } from 'vue';
|
|
4
|
-
|
|
5
|
-
const useWalletServicesPlugin = () => {
|
|
6
|
-
const context = inject(WalletServicesContextKey);
|
|
7
|
-
if (!context) throw WalletInitializationError.fromCode(1000, "usage of useWalletServicesPlugin not wrapped in `WalletServicesContextProvider`.");
|
|
8
|
-
return context;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { useWalletServicesPlugin };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useWalletUI = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const loading = ref(false);
|
|
11
|
-
const error = ref(null);
|
|
12
|
-
const showWalletUI = async showWalletUiParams => {
|
|
13
|
-
loading.value = true;
|
|
14
|
-
error.value = null;
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.value.showWalletUi(showWalletUiParams);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
log.error("Error showing wallet UI", err);
|
|
21
|
-
error.value = err;
|
|
22
|
-
} finally {
|
|
23
|
-
loading.value = false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
showWalletUI
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useWalletUI };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
-
import { ref } from 'vue';
|
|
3
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
|
-
|
|
5
|
-
const useWeb3AuthDisconnect = () => {
|
|
6
|
-
const {
|
|
7
|
-
web3Auth
|
|
8
|
-
} = useWeb3AuthInner();
|
|
9
|
-
const loading = ref(false);
|
|
10
|
-
const error = ref(null);
|
|
11
|
-
const disconnect = async options => {
|
|
12
|
-
try {
|
|
13
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
14
|
-
error.value = null;
|
|
15
|
-
loading.value = true;
|
|
16
|
-
await web3Auth.value.logout(options);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
log.error("Error disconnecting", err);
|
|
19
|
-
error.value = err;
|
|
20
|
-
} finally {
|
|
21
|
-
loading.value = false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
loading,
|
|
26
|
-
error,
|
|
27
|
-
disconnect
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { useWeb3AuthDisconnect };
|