@web3auth/modal 10.15.0 → 11.0.0-beta.0
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/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +71 -35
- 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 +57 -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 +13 -11
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +2 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +1 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +117 -29
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +1 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +1 -3
- 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 +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +63 -26
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +13 -4
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +25 -17
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +5 -3
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +8 -2
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Embed/Embed.js +1 -0
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/Login.js +50 -39
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +235 -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 +106 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +157 -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/interfaces.js +2 -1
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +76 -45
- 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 +57 -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 +15 -14
- 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/interface.d.ts +2 -2
- package/dist/lib.cjs/types/modalManager.d.ts +7 -3
- 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 +15 -14
- 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/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/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/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 +18 -15
- package/dist/lib.cjs/types/ui/loginModal.d.ts +6 -4
- package/dist/lib.cjs/types/vue/composables/index.d.ts +2 -14
- 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/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +72 -36
- 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 +12 -10
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +2 -5
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +2 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +118 -30
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +1 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +1 -3
- 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 +3 -3
- package/dist/lib.esm/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +67 -29
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +13 -4
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +25 -17
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +7 -5
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +8 -2
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Embed/Embed.js +1 -0
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/Login.js +53 -41
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +238 -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 +104 -0
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +160 -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/interfaces.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +76 -45
- 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 +10 -9
- 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 +68 -44
- 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 -104
- /package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +0 -0
- /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/ConnectWalletHeader.type.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/Root.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
- /package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Web3AuthContextKey } from '@web3auth/no-modal';
|
|
2
|
+
import { useWeb3AuthInnerContextValue } from '@web3auth/no-modal/vue';
|
|
3
|
+
import { defineComponent, h, shallowRef, provide } from 'vue';
|
|
3
4
|
import { Web3Auth } from '../modalManager.js';
|
|
4
5
|
import { WalletServicesInnerProvider } from './WalletServicesInnerProvider.js';
|
|
5
6
|
|
|
@@ -12,181 +13,13 @@ const Web3AuthProvider = defineComponent({
|
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
setup(props) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const chainId = ref(null);
|
|
21
|
-
const chainNamespace = ref(null);
|
|
22
|
-
const isInitializing = ref(false);
|
|
23
|
-
const initError = ref(null);
|
|
24
|
-
const isInitialized = ref(false);
|
|
25
|
-
const isConnected = ref(false);
|
|
26
|
-
const getPlugin = name => {
|
|
27
|
-
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
28
|
-
return web3Auth.value.getPlugin(name);
|
|
29
|
-
};
|
|
30
|
-
const setIsMFAEnabled = isMfaEnabled => {
|
|
31
|
-
isMFAEnabled.value = isMfaEnabled;
|
|
32
|
-
};
|
|
33
|
-
watch(() => props.config, (newConfig, _, onInvalidate) => {
|
|
34
|
-
const resetHookState = () => {
|
|
35
|
-
provider.value = null;
|
|
36
|
-
isMFAEnabled.value = false;
|
|
37
|
-
isConnected.value = false;
|
|
38
|
-
isAuthorized.value = false;
|
|
39
|
-
status.value = null;
|
|
40
|
-
chainId.value = null;
|
|
41
|
-
chainNamespace.value = null;
|
|
42
|
-
};
|
|
43
|
-
onInvalidate(() => {
|
|
44
|
-
if (web3Auth.value) {
|
|
45
|
-
web3Auth.value.cleanup();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
resetHookState();
|
|
49
|
-
const {
|
|
50
|
-
web3AuthOptions
|
|
51
|
-
} = newConfig;
|
|
52
|
-
const web3AuthInstance = new Web3Auth(web3AuthOptions);
|
|
53
|
-
web3AuthInstance.setAnalyticsProperties({
|
|
54
|
-
integration_type: ANALYTICS_INTEGRATION_TYPE.VUE_COMPOSABLES
|
|
55
|
-
});
|
|
56
|
-
web3Auth.value = web3AuthInstance;
|
|
57
|
-
}, {
|
|
58
|
-
immediate: true
|
|
59
|
-
});
|
|
60
|
-
watch(web3Auth, async (newWeb3Auth, _, onInvalidate) => {
|
|
61
|
-
const controller = new AbortController();
|
|
62
|
-
|
|
63
|
-
// Invalidate the controller here before calling any async methods.
|
|
64
|
-
onInvalidate(() => {
|
|
65
|
-
controller.abort();
|
|
66
|
-
});
|
|
67
|
-
if (newWeb3Auth) {
|
|
68
|
-
try {
|
|
69
|
-
initError.value = null;
|
|
70
|
-
isInitializing.value = true;
|
|
71
|
-
await newWeb3Auth.init({
|
|
72
|
-
signal: controller.signal
|
|
73
|
-
});
|
|
74
|
-
} catch (error) {
|
|
75
|
-
log.error("Error initializing web3auth", error);
|
|
76
|
-
initError.value = error;
|
|
77
|
-
} finally {
|
|
78
|
-
isInitializing.value = false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}, {
|
|
82
|
-
immediate: true
|
|
83
|
-
});
|
|
84
|
-
watch(web3Auth, (newWeb3Auth, prevWeb3Auth) => {
|
|
85
|
-
const notReadyListener = () => {
|
|
86
|
-
status.value = web3Auth.value.status;
|
|
87
|
-
};
|
|
88
|
-
const readyListener = () => {
|
|
89
|
-
status.value = web3Auth.value.status;
|
|
90
|
-
isInitialized.value = true;
|
|
91
|
-
};
|
|
92
|
-
const connectedListener = () => {
|
|
93
|
-
status.value = web3Auth.value.status;
|
|
94
|
-
// we do this because of rehydration issues. status connected is fired first but web3auth sdk is not ready yet.
|
|
95
|
-
if (web3Auth.value.status === CONNECTOR_STATUS.CONNECTED) {
|
|
96
|
-
var _currentChain$chainNa, _currentChain;
|
|
97
|
-
if (!isInitialized.value) isInitialized.value = true;
|
|
98
|
-
isConnected.value = true;
|
|
99
|
-
provider.value = newWeb3Auth.provider;
|
|
100
|
-
chainId.value = web3Auth.value.currentChainId;
|
|
101
|
-
chainNamespace.value = (_currentChain$chainNa = (_currentChain = web3Auth.value.currentChain) === null || _currentChain === void 0 ? void 0 : _currentChain.chainNamespace) !== null && _currentChain$chainNa !== void 0 ? _currentChain$chainNa : null;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const disconnectedListener = () => {
|
|
105
|
-
status.value = web3Auth.value.status;
|
|
106
|
-
isConnected.value = false;
|
|
107
|
-
provider.value = null;
|
|
108
|
-
isMFAEnabled.value = false;
|
|
109
|
-
isAuthorized.value = false;
|
|
110
|
-
};
|
|
111
|
-
const connectingListener = () => {
|
|
112
|
-
status.value = web3Auth.value.status;
|
|
113
|
-
};
|
|
114
|
-
const errorListener = () => {
|
|
115
|
-
status.value = web3Auth.value.status;
|
|
116
|
-
};
|
|
117
|
-
const authorizedListener = () => {
|
|
118
|
-
status.value = web3Auth.value.status;
|
|
119
|
-
if (web3Auth.value.status === CONNECTOR_STATUS.AUTHORIZED) {
|
|
120
|
-
isConnected.value = true;
|
|
121
|
-
isAuthorized.value = true;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const mfaEnabledListener = () => {
|
|
125
|
-
isMFAEnabled.value = true;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
// unregister previous listeners
|
|
129
|
-
if (prevWeb3Auth && newWeb3Auth !== prevWeb3Auth) {
|
|
130
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.NOT_READY, notReadyListener);
|
|
131
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.READY, readyListener);
|
|
132
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.CONNECTED, connectedListener);
|
|
133
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.AUTHORIZED, authorizedListener);
|
|
134
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
135
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
136
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
137
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.REHYDRATION_ERROR, errorListener);
|
|
138
|
-
prevWeb3Auth.removeListener(CONNECTOR_EVENTS.MFA_ENABLED, mfaEnabledListener);
|
|
139
|
-
}
|
|
140
|
-
if (newWeb3Auth && newWeb3Auth !== prevWeb3Auth) {
|
|
141
|
-
status.value = newWeb3Auth.status;
|
|
142
|
-
// web3Auth is initialized here.
|
|
143
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.NOT_READY, notReadyListener);
|
|
144
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.READY, readyListener);
|
|
145
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.CONNECTED, connectedListener);
|
|
146
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.AUTHORIZED, authorizedListener);
|
|
147
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
148
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
149
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
150
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.REHYDRATION_ERROR, errorListener);
|
|
151
|
-
newWeb3Auth.on(CONNECTOR_EVENTS.MFA_ENABLED, mfaEnabledListener);
|
|
152
|
-
}
|
|
153
|
-
}, {
|
|
154
|
-
immediate: true
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// Listen for chain changes on the provider
|
|
158
|
-
watch(provider, (newProvider, prevProvider) => {
|
|
159
|
-
const handleChainChange = newChainId => {
|
|
160
|
-
var _web3Auth$value$curre, _web3Auth$value;
|
|
161
|
-
chainId.value = newChainId;
|
|
162
|
-
chainNamespace.value = (_web3Auth$value$curre = (_web3Auth$value = web3Auth.value) === null || _web3Auth$value === void 0 || (_web3Auth$value = _web3Auth$value.currentChain) === null || _web3Auth$value === void 0 ? void 0 : _web3Auth$value.chainNamespace) !== null && _web3Auth$value$curre !== void 0 ? _web3Auth$value$curre : null;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
// unregister previous listener
|
|
166
|
-
if (prevProvider && newProvider !== prevProvider) {
|
|
167
|
-
prevProvider.removeListener("chainChanged", handleChainChange);
|
|
168
|
-
}
|
|
169
|
-
if (newProvider && newProvider !== prevProvider) {
|
|
170
|
-
newProvider.on("chainChanged", handleChainChange);
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
immediate: true
|
|
174
|
-
});
|
|
175
|
-
provide(Web3AuthContextKey, {
|
|
176
|
-
web3Auth,
|
|
177
|
-
isConnected,
|
|
178
|
-
isAuthorized,
|
|
179
|
-
isInitialized,
|
|
180
|
-
provider,
|
|
181
|
-
status,
|
|
182
|
-
isInitializing,
|
|
183
|
-
initError,
|
|
184
|
-
isMFAEnabled,
|
|
185
|
-
chainId,
|
|
186
|
-
chainNamespace,
|
|
187
|
-
getPlugin,
|
|
188
|
-
setIsMFAEnabled
|
|
16
|
+
const value = useWeb3AuthInnerContextValue({
|
|
17
|
+
Web3AuthConstructor: Web3Auth,
|
|
18
|
+
watchSource: () => props.config,
|
|
19
|
+
getWeb3AuthOptions: config => config.web3AuthOptions,
|
|
20
|
+
createConnectionRef: () => shallowRef(null)
|
|
189
21
|
});
|
|
22
|
+
provide(Web3AuthContextKey, value);
|
|
190
23
|
},
|
|
191
24
|
render() {
|
|
192
25
|
var _this$$slots$default;
|
|
@@ -1,57 +1,55 @@
|
|
|
1
1
|
import { WalletInitializationError, log } from '@web3auth/no-modal';
|
|
2
|
+
import { useWeb3AuthConnect as useWeb3AuthConnect$1 } from '@web3auth/no-modal/vue';
|
|
2
3
|
import { ref, watch } from 'vue';
|
|
3
4
|
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
4
5
|
|
|
5
6
|
const useWeb3AuthConnect = () => {
|
|
6
7
|
const {
|
|
7
|
-
web3Auth
|
|
8
|
-
isConnected
|
|
8
|
+
web3Auth
|
|
9
9
|
} = useWeb3AuthInner();
|
|
10
|
+
// Web3AuthModal extends the NoModal class, so we can use the same composable
|
|
11
|
+
const {
|
|
12
|
+
isConnected,
|
|
13
|
+
loading: sharedLoading,
|
|
14
|
+
error: sharedError,
|
|
15
|
+
connectorName,
|
|
16
|
+
connect: sharedConnectTo
|
|
17
|
+
} = useWeb3AuthConnect$1();
|
|
10
18
|
const loading = ref(false);
|
|
11
19
|
const error = ref(null);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const connectLoading = ref(false);
|
|
21
|
+
const connectError = ref(null);
|
|
22
|
+
const activeFlow = ref(null);
|
|
23
|
+
watch([connectLoading, sharedLoading], ([newConnectLoading, newSharedLoading]) => {
|
|
24
|
+
loading.value = newConnectLoading || newSharedLoading;
|
|
25
|
+
}, {
|
|
26
|
+
immediate: true
|
|
27
|
+
});
|
|
28
|
+
watch([activeFlow, connectError, sharedError], ([newActiveFlow, newConnectError, newSharedError]) => {
|
|
29
|
+
error.value = newActiveFlow === "connect" ? newConnectError : newSharedError;
|
|
21
30
|
}, {
|
|
22
31
|
immediate: true
|
|
23
32
|
});
|
|
24
33
|
const connect = async () => {
|
|
25
34
|
try {
|
|
35
|
+
activeFlow.value = "connect";
|
|
26
36
|
if (!web3Auth.value) throw WalletInitializationError.notReady();
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
connectError.value = null;
|
|
38
|
+
connectLoading.value = true;
|
|
29
39
|
const localProvider = await web3Auth.value.connect();
|
|
30
|
-
connectorName.value = web3Auth.value.connectedConnectorName;
|
|
31
40
|
return localProvider;
|
|
32
41
|
} catch (err) {
|
|
33
42
|
log.error("Error connecting", err);
|
|
34
|
-
|
|
43
|
+
connectError.value = err;
|
|
35
44
|
return null;
|
|
36
45
|
} finally {
|
|
37
|
-
|
|
46
|
+
connectLoading.value = false;
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
const connectTo = async (connectorType, loginParams) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
loading.value = true;
|
|
45
|
-
const localProvider = await web3Auth.value.connectTo(connectorType, loginParams);
|
|
46
|
-
connectorName.value = web3Auth.value.connectedConnectorName;
|
|
47
|
-
return localProvider;
|
|
48
|
-
} catch (err) {
|
|
49
|
-
log.error("Error connecting to", err);
|
|
50
|
-
error.value = err;
|
|
51
|
-
return null;
|
|
52
|
-
} finally {
|
|
53
|
-
loading.value = false;
|
|
54
|
-
}
|
|
50
|
+
activeFlow.value = "connectTo";
|
|
51
|
+
connectError.value = null;
|
|
52
|
+
return sharedConnectTo(connectorType, loginParams);
|
|
55
53
|
};
|
|
56
54
|
return {
|
|
57
55
|
isConnected,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { inject } from 'vue';
|
|
1
|
+
import { useInjectedWeb3AuthInnerContext } from '@web3auth/no-modal/vue';
|
|
3
2
|
|
|
4
3
|
const useWeb3AuthInner = () => {
|
|
5
|
-
|
|
6
|
-
if (!context) throw WalletInitializationError.fromCode(1000, "usage of `useWeb3Auth` not wrapped in `Web3AuthProvider`.");
|
|
7
|
-
return context;
|
|
4
|
+
return useInjectedWeb3AuthInnerContext();
|
|
8
5
|
};
|
|
9
6
|
|
|
10
7
|
export { useWeb3AuthInner };
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
export { useChain } from './composables/useChain.js';
|
|
2
|
-
export { useCheckout } from './composables/useCheckout.js';
|
|
3
|
-
export { useEnableMFA } from './composables/useEnableMFA.js';
|
|
4
|
-
export { useFunding } from './composables/useFunding.js';
|
|
5
|
-
export { useIdentityToken } from './composables/useIdentityToken.js';
|
|
6
|
-
export { useManageMFA } from './composables/useManageMFA.js';
|
|
7
|
-
export { useReceive } from './composables/useReceive.js';
|
|
8
|
-
export { useSwap } from './composables/useSwap.js';
|
|
9
|
-
export { useSwitchChain } from './composables/useSwitchChain.js';
|
|
10
|
-
export { useWalletConnectScanner } from './composables/useWalletConnectScanner.js';
|
|
11
|
-
export { useWalletServicesPlugin } from './composables/useWalletServicesPlugin.js';
|
|
12
|
-
export { useWalletUI } from './composables/useWalletUI.js';
|
|
13
1
|
export { useWeb3Auth } from './composables/useWeb3Auth.js';
|
|
14
2
|
export { useWeb3AuthConnect } from './composables/useWeb3AuthConnect.js';
|
|
15
|
-
export { useWeb3AuthDisconnect } from '
|
|
16
|
-
export { useWeb3AuthUser } from './composables/useWeb3AuthUser.js';
|
|
3
|
+
export { useAuthTokenInfo, useChain, useCheckout, useEnableMFA, useFunding, useManageMFA, useReceive, useSwap, useSwitchChain, useWalletConnectScanner, useWalletServicesPlugin, useWalletUI, useWeb3AuthDisconnect, useWeb3AuthUser } from '@web3auth/no-modal/vue';
|
|
17
4
|
export { Web3AuthProvider } from './Web3AuthProvider.js';
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export { useSignAndSendTransaction } from '
|
|
2
|
-
export { useSignMessage } from './composables/useSignMessage.js';
|
|
3
|
-
export { useSignTransaction } from './composables/useSignTransaction.js';
|
|
4
|
-
export { useSolanaWallet } from './composables/useSolanaWallet.js';
|
|
1
|
+
export { SOLANA_CLIENT_KEY, SolanaProvider, useSignAndSendTransaction, useSignMessage, useSignTransaction, useSolanaClient, useSolanaWallet } from '@web3auth/no-modal/vue/solana';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import { hydrate } from '@wagmi/core';
|
|
3
|
-
import { useConfig, useReconnect,
|
|
3
|
+
import { useConfig, useReconnect, useConnectionEffect, configKey, createConfig } from '@wagmi/vue';
|
|
4
4
|
import { injected } from '@wagmi/vue/connectors';
|
|
5
5
|
import { randomId } from '@web3auth/auth';
|
|
6
6
|
import { log, CHAIN_NAMESPACES, WalletInitializationError } from '@web3auth/no-modal';
|
|
7
7
|
import { defineChain, webSocket, http, fallback } from 'viem';
|
|
8
8
|
import { defineComponent, h, watch, provide, shallowRef, ref } from 'vue';
|
|
9
|
-
import '@web3auth/no-modal/vue';
|
|
10
9
|
import { useWeb3Auth } from '../composables/useWeb3Auth.js';
|
|
11
|
-
import { useWeb3AuthDisconnect } from '
|
|
10
|
+
import { useWeb3AuthDisconnect } from '@web3auth/no-modal/vue';
|
|
12
11
|
import { defaultWagmiConfig } from './constants.js';
|
|
13
12
|
|
|
14
13
|
const WEB3AUTH_CONNECTOR_ID = "web3auth";
|
|
@@ -77,16 +76,16 @@ const Web3AuthWagmiProvider = defineComponent({
|
|
|
77
76
|
setup() {
|
|
78
77
|
const {
|
|
79
78
|
isConnected,
|
|
80
|
-
|
|
79
|
+
connection
|
|
81
80
|
} = useWeb3Auth();
|
|
82
81
|
const {
|
|
83
82
|
disconnect
|
|
84
83
|
} = useWeb3AuthDisconnect();
|
|
85
84
|
const wagmiConfig = useConfig();
|
|
86
85
|
const {
|
|
87
|
-
reconnect
|
|
86
|
+
mutate: reconnect
|
|
88
87
|
} = useReconnect();
|
|
89
|
-
|
|
88
|
+
useConnectionEffect({
|
|
90
89
|
onDisconnect: async () => {
|
|
91
90
|
log.info("Disconnected from wagmi");
|
|
92
91
|
if (isConnected.value) await disconnect();
|
|
@@ -98,9 +97,11 @@ const Web3AuthWagmiProvider = defineComponent({
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
});
|
|
101
|
-
watch(isConnected, async
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
watch([isConnected, connection], async () => {
|
|
101
|
+
var _connection$value;
|
|
102
|
+
const newIsConnected = isConnected.value;
|
|
103
|
+
if (newIsConnected && (_connection$value = connection.value) !== null && _connection$value !== void 0 && _connection$value.ethereumProvider) {
|
|
104
|
+
const connector = await setupConnector(connection.value.ethereumProvider, wagmiConfig);
|
|
104
105
|
if (!connector) {
|
|
105
106
|
log.error("Failed to setup vue wagmi connector");
|
|
106
107
|
throw new Error("Failed to setup connector");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@web3auth/no-modal/x402';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createEvmX402Fetch, createProviderBackedEvmSigner, createSolanaX402Fetch, getEvmAddress, useX402Fetch } from '@web3auth/no-modal/x402/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createEvmX402Fetch, createSolanaX402Fetch, useX402Fetch } from '@web3auth/no-modal/x402/vue';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-beta.0",
|
|
4
4
|
"description": "Multi chain wallet aggregator for web3Auth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web3Auth/ui",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "dist/lib.cjs/packages/modal/src/index.js",
|
|
14
14
|
"module": "dist/lib.esm/packages/modal/src/index.js",
|
|
15
|
-
"unpkg": "dist/modal.
|
|
16
|
-
"jsdelivr": "dist/modal.
|
|
15
|
+
"unpkg": "dist/lib.esm/packages/modal/src/index.js",
|
|
16
|
+
"jsdelivr": "dist/lib.esm/packages/modal/src/index.js",
|
|
17
17
|
"types": "dist/lib.cjs/types/index.d.ts",
|
|
18
18
|
"author": "Torus Labs",
|
|
19
19
|
"bugs": {
|
|
@@ -23,11 +23,10 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"test": "
|
|
27
|
-
"test-debugger": "mocha --config ../../.mocharc.json --inspect-brk test/**.ts",
|
|
26
|
+
"test": "vitest run --config test/configs/browsers.config.mts --coverage",
|
|
28
27
|
"dev": "torus-scripts start",
|
|
29
28
|
"build": "torus-scripts build",
|
|
30
|
-
"lint": "
|
|
29
|
+
"lint": "torus-scripts lint --fix",
|
|
31
30
|
"prepack": "npm run build",
|
|
32
31
|
"pre-commit": "lint-staged --cwd ."
|
|
33
32
|
},
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
"@coinbase/wallet-sdk": {
|
|
36
35
|
"optional": true
|
|
37
36
|
},
|
|
38
|
-
"
|
|
37
|
+
"@solana/react-hooks": {
|
|
39
38
|
"optional": true
|
|
40
39
|
},
|
|
41
40
|
"vue": {
|
|
@@ -45,10 +44,12 @@
|
|
|
45
44
|
"peerDependencies": {
|
|
46
45
|
"@babel/runtime": "^7.x",
|
|
47
46
|
"@coinbase/wallet-sdk": "^4.3.x",
|
|
48
|
-
"@solana/
|
|
47
|
+
"@solana/client": "^1.7.0",
|
|
48
|
+
"@solana/kit": ">=6.5.0",
|
|
49
|
+
"@solana/react-hooks": "^1.4.0",
|
|
49
50
|
"react": ">=18",
|
|
50
51
|
"react-dom": ">=18",
|
|
51
|
-
"viem": ">=2.
|
|
52
|
+
"viem": ">=2.45",
|
|
52
53
|
"vue": ">=3.x"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
@@ -58,50 +59,53 @@
|
|
|
58
59
|
"@rollup/plugin-json": "^6.1.0",
|
|
59
60
|
"@rollup/plugin-replace": "^6.0.3",
|
|
60
61
|
"@rollup/plugin-url": "^8.0.2",
|
|
61
|
-
"@solana/
|
|
62
|
+
"@solana/client": "^1.7.0",
|
|
63
|
+
"@solana/kit": "^6.5.0",
|
|
62
64
|
"@svgr/rollup": "^8.1.0",
|
|
63
65
|
"@svgr/webpack": "^8.1.0",
|
|
64
|
-
"@toruslabs/eslint-config-react": "^
|
|
65
|
-
"@toruslabs/eslint-config-vue": "^
|
|
66
|
+
"@toruslabs/eslint-config-react": "^5.0.1",
|
|
67
|
+
"@toruslabs/eslint-config-vue": "^5.0.1",
|
|
66
68
|
"@toruslabs/isomorphic-style-loader": "^5.4.0",
|
|
67
69
|
"@toruslabs/vue-components": "^8.1.2",
|
|
68
|
-
"@types/react": "^19.2.
|
|
70
|
+
"@types/react": "^19.2.14",
|
|
69
71
|
"@types/react-dom": "^19.2.3",
|
|
70
|
-
"@wagmi/core": "^
|
|
71
|
-
"@wagmi/vue": "^0.
|
|
72
|
-
"autoprefixer": "^10.4.
|
|
73
|
-
"css-loader": "^7.1.
|
|
72
|
+
"@wagmi/core": "^3.4.1",
|
|
73
|
+
"@wagmi/vue": "^0.5.1",
|
|
74
|
+
"autoprefixer": "^10.4.27",
|
|
75
|
+
"css-loader": "^7.1.4",
|
|
74
76
|
"live-server": "^1.2.2",
|
|
75
|
-
"postcss": "^8.5.
|
|
76
|
-
"postcss-loader": "^8.2.
|
|
77
|
+
"postcss": "^8.5.8",
|
|
78
|
+
"postcss-loader": "^8.2.1",
|
|
77
79
|
"postcss-prefix-selector": "^2.1.1",
|
|
78
|
-
"react": "^19.2.
|
|
79
|
-
"react-dom": "^19.2.
|
|
80
|
+
"react": "^19.2.4",
|
|
81
|
+
"react-dom": "^19.2.4",
|
|
80
82
|
"rollup-plugin-postcss": "^4.0.2",
|
|
81
83
|
"rollup-preserve-directives": "^1.1.3",
|
|
82
84
|
"style-loader": "^4.0.0",
|
|
83
85
|
"tailwindcss": "^3.4.17",
|
|
84
86
|
"url-loader": "^4.1.1",
|
|
85
|
-
"viem": "^2.
|
|
86
|
-
"vue": "^3.5.
|
|
87
|
-
"wagmi": "^
|
|
87
|
+
"viem": "^2.47.6",
|
|
88
|
+
"vue": "^3.5.31",
|
|
89
|
+
"wagmi": "^3.6.0"
|
|
88
90
|
},
|
|
89
91
|
"dependencies": {
|
|
90
|
-
"@hcaptcha/react-hcaptcha": "^2.0.
|
|
91
|
-
"@toruslabs/base-controllers": "^
|
|
92
|
-
"@toruslabs/http-helpers": "^
|
|
93
|
-
"@web3auth/auth": "^
|
|
94
|
-
"@web3auth/no-modal": "^
|
|
95
|
-
"
|
|
92
|
+
"@hcaptcha/react-hcaptcha": "^2.0.2",
|
|
93
|
+
"@toruslabs/base-controllers": "^9.5.0",
|
|
94
|
+
"@toruslabs/http-helpers": "^9.0.0",
|
|
95
|
+
"@web3auth/auth": "^11.6.0",
|
|
96
|
+
"@web3auth/no-modal": "^11.0.0-beta.0",
|
|
97
|
+
"@web3auth/ws-embed": "^6.0.0",
|
|
98
|
+
"bowser": "^2.14.1",
|
|
96
99
|
"classnames": "^2.5.1",
|
|
97
100
|
"clsx": "^2.1.1",
|
|
98
101
|
"color": "^5.0.3",
|
|
99
102
|
"copy-to-clipboard": "^3.3.3",
|
|
100
103
|
"deepmerge": "^4.3.1",
|
|
101
|
-
"i18next": "^25.
|
|
102
|
-
"react-i18next": "^16.
|
|
104
|
+
"i18next": "^25.10.9",
|
|
105
|
+
"react-i18next": "^16.6.6",
|
|
103
106
|
"react-qrcode-logo": "^4.0.0",
|
|
104
|
-
"tailwind-merge": "^3.
|
|
107
|
+
"tailwind-merge": "^3.5.0",
|
|
108
|
+
"vitest": "^4.1.2"
|
|
105
109
|
},
|
|
106
110
|
"exports": {
|
|
107
111
|
".": {
|
|
@@ -109,6 +113,21 @@
|
|
|
109
113
|
"require": "./dist/lib.cjs/packages/modal/src/index.js",
|
|
110
114
|
"types": "./dist/lib.cjs/types/index.d.ts"
|
|
111
115
|
},
|
|
116
|
+
"./x402": {
|
|
117
|
+
"import": "./dist/lib.esm/packages/modal/src/x402/index.js",
|
|
118
|
+
"require": "./dist/lib.cjs/packages/modal/src/x402/index.js",
|
|
119
|
+
"types": "./dist/lib.cjs/types/x402/index.d.ts"
|
|
120
|
+
},
|
|
121
|
+
"./x402/react": {
|
|
122
|
+
"import": "./dist/lib.esm/packages/modal/src/x402/react.js",
|
|
123
|
+
"require": "./dist/lib.cjs/packages/modal/src/x402/react.js",
|
|
124
|
+
"types": "./dist/lib.cjs/types/x402/react.d.ts"
|
|
125
|
+
},
|
|
126
|
+
"./x402/vue": {
|
|
127
|
+
"import": "./dist/lib.esm/packages/modal/src/x402/vue.js",
|
|
128
|
+
"require": "./dist/lib.cjs/packages/modal/src/x402/vue.js",
|
|
129
|
+
"types": "./dist/lib.cjs/types/x402/vue.d.ts"
|
|
130
|
+
},
|
|
112
131
|
"./react": {
|
|
113
132
|
"import": "./dist/lib.esm/packages/modal/src/react/index.js",
|
|
114
133
|
"require": "./dist/lib.cjs/packages/modal/src/react/index.js",
|
|
@@ -148,15 +167,19 @@
|
|
|
148
167
|
"import": "./dist/lib.esm/packages/modal/src/providers/xrpl-provider/index.js",
|
|
149
168
|
"require": "./dist/lib.cjs/packages/modal/src/providers/xrpl-provider/index.js",
|
|
150
169
|
"types": "./dist/lib.cjs/types/providers/xrpl-provider/index.d.ts"
|
|
151
|
-
},
|
|
152
|
-
"./providers/ethereum-mpc-provider": {
|
|
153
|
-
"import": "./dist/lib.esm/packages/modal/src/providers/ethereum-mpc-provider/index.js",
|
|
154
|
-
"require": "./dist/lib.cjs/packages/modal/src/providers/ethereum-mpc-provider/index.js",
|
|
155
|
-
"types": "./dist/lib.cjs/types/providers/ethereum-mpc-provider/index.d.ts"
|
|
156
170
|
}
|
|
157
171
|
},
|
|
158
172
|
"typesVersions": {
|
|
159
173
|
"*": {
|
|
174
|
+
"x402": [
|
|
175
|
+
"./dist/lib.cjs/types/x402/index.d.ts"
|
|
176
|
+
],
|
|
177
|
+
"x402/react": [
|
|
178
|
+
"./dist/lib.cjs/types/x402/react.d.ts"
|
|
179
|
+
],
|
|
180
|
+
"x402/vue": [
|
|
181
|
+
"./dist/lib.cjs/types/x402/vue.d.ts"
|
|
182
|
+
],
|
|
160
183
|
"react": [
|
|
161
184
|
"./dist/lib.cjs/types/react/index.d.ts"
|
|
162
185
|
],
|
|
@@ -180,20 +203,21 @@
|
|
|
180
203
|
],
|
|
181
204
|
"providers/xrpl-provider": [
|
|
182
205
|
"./dist/lib.cjs/types/providers/xrpl-provider/index.d.ts"
|
|
183
|
-
],
|
|
184
|
-
"providers/ethereum-mpc-provider": [
|
|
185
|
-
"./dist/lib.cjs/types/providers/ethereum-mpc-provider/index.d.ts"
|
|
186
206
|
]
|
|
187
207
|
}
|
|
188
208
|
},
|
|
189
209
|
"engines": {
|
|
190
|
-
"node": ">=
|
|
191
|
-
"npm": ">=
|
|
210
|
+
"node": ">=22.x",
|
|
211
|
+
"npm": ">=10.x"
|
|
192
212
|
},
|
|
193
213
|
"lint-staged": {
|
|
194
214
|
"!(*d).ts": [
|
|
195
215
|
"eslint --cache --fix",
|
|
196
216
|
"prettier --write"
|
|
217
|
+
],
|
|
218
|
+
"!(*d).tsx": [
|
|
219
|
+
"eslint --cache --fix",
|
|
220
|
+
"prettier --write"
|
|
197
221
|
]
|
|
198
222
|
},
|
|
199
223
|
"publishConfig": {
|
|
@@ -203,5 +227,5 @@
|
|
|
203
227
|
"type": "git",
|
|
204
228
|
"url": "git+https://github.com/Web3Auth/Web3Auth.git"
|
|
205
229
|
},
|
|
206
|
-
"gitHead": "
|
|
230
|
+
"gitHead": "992aabbd96cd8f19e6cdab1bebf498bb15157024"
|
|
207
231
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var ethereumMpcProvider = require('@web3auth/no-modal/providers/ethereum-mpc-provider');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(ethereumMpcProvider).forEach(function (k) {
|
|
8
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return ethereumMpcProvider[k]; }
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
4
|
-
|
|
5
|
-
const useChain = () => {
|
|
6
|
-
const {
|
|
7
|
-
chainId,
|
|
8
|
-
chainNamespace
|
|
9
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
10
|
-
return {
|
|
11
|
-
chainId,
|
|
12
|
-
chainNamespace
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.useChain = useChain;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var noModal = require('@web3auth/no-modal');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var useWalletServicesPlugin = require('./useWalletServicesPlugin.js');
|
|
6
|
-
|
|
7
|
-
const useCheckout = () => {
|
|
8
|
-
const {
|
|
9
|
-
plugin,
|
|
10
|
-
ready
|
|
11
|
-
} = useWalletServicesPlugin.useWalletServicesPlugin();
|
|
12
|
-
const [loading, setLoading] = react.useState(false);
|
|
13
|
-
const [error, setError] = react.useState(null);
|
|
14
|
-
const showCheckout = react.useCallback(async showCheckoutParams => {
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
try {
|
|
18
|
-
if (!plugin) throw noModal.WalletServicesPluginError.notInitialized();
|
|
19
|
-
if (!ready) throw noModal.WalletServicesPluginError.walletPluginNotConnected();
|
|
20
|
-
await plugin.showCheckout(showCheckoutParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showCheckout
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useCheckout = useCheckout;
|