@web3auth/modal 10.14.1 → 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 -3
- 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 +2 -4
- 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 +14 -5
- 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 +2 -2
- 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 -3
- 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 -106
- /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,9 +0,0 @@
|
|
|
1
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export interface IUseIdentityToken {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
token: Ref<string | null>;
|
|
7
|
-
getIdentityToken: () => Promise<string | null>;
|
|
8
|
-
}
|
|
9
|
-
export declare const useIdentityToken: () => IUseIdentityToken;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export interface IUseManageMFA {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
manageMFA<T>(params?: T): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export declare const useManageMFA: () => IUseManageMFA;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseEmbedControllerState } from "@toruslabs/base-controllers";
|
|
2
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
3
|
-
import { Ref } from "vue";
|
|
4
|
-
export interface IUseReceive {
|
|
5
|
-
loading: Ref<boolean>;
|
|
6
|
-
error: Ref<Web3AuthError | null>;
|
|
7
|
-
showReceive: (showReceiveParams?: BaseEmbedControllerState["showReceive"]) => Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare const useReceive: () => IUseReceive;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseEmbedControllerState } from "@toruslabs/base-controllers";
|
|
2
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
3
|
-
import { Ref } from "vue";
|
|
4
|
-
export interface IUseSwap {
|
|
5
|
-
loading: Ref<boolean>;
|
|
6
|
-
error: Ref<Web3AuthError | null>;
|
|
7
|
-
showSwap: (showSwapParams?: BaseEmbedControllerState["showSwap"]) => Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare const useSwap: () => IUseSwap;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export interface IUseSwitchChain {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
switchChain: (chainParams: {
|
|
7
|
-
chainId: string;
|
|
8
|
-
}) => Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare const useSwitchChain: () => IUseSwitchChain;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseEmbedControllerState } from "@toruslabs/base-controllers";
|
|
2
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
3
|
-
import { Ref } from "vue";
|
|
4
|
-
export interface IUseWalletConnectScanner {
|
|
5
|
-
loading: Ref<boolean>;
|
|
6
|
-
error: Ref<Web3AuthError | null>;
|
|
7
|
-
showWalletConnectScanner: (showWalletConnectScannerParams?: BaseEmbedControllerState["showWalletConnect"]) => Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare const useWalletConnectScanner: () => IUseWalletConnectScanner;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseEmbedControllerState } from "@toruslabs/base-controllers";
|
|
2
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
3
|
-
import { Ref } from "vue";
|
|
4
|
-
export interface IUseWalletUI {
|
|
5
|
-
loading: Ref<boolean>;
|
|
6
|
-
error: Ref<Web3AuthError | null>;
|
|
7
|
-
showWalletUI: (showWalletUiParams?: BaseEmbedControllerState["showWalletUi"]) => Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare const useWalletUI: () => IUseWalletUI;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export interface IUseWeb3AuthDisconnect {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
disconnect(options?: {
|
|
7
|
-
cleanup: boolean;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare const useWeb3AuthDisconnect: () => IUseWeb3AuthDisconnect;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type UserInfo, Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export interface IUseWeb3AuthUser {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
userInfo: Ref<Partial<UserInfo> | null>;
|
|
7
|
-
isMFAEnabled: Ref<boolean>;
|
|
8
|
-
getUserInfo: () => Promise<Partial<UserInfo> | null>;
|
|
9
|
-
}
|
|
10
|
-
export declare const useWeb3AuthUser: () => IUseWeb3AuthUser;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TransactionOrVersionedTransaction, Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export type IUseSignAndSendTransaction = {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
data: Ref<string | null>;
|
|
7
|
-
signAndSendTransaction: (transaction: TransactionOrVersionedTransaction) => Promise<string>;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSignAndSendTransaction: () => IUseSignAndSendTransaction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export type IUseSignMessage = {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
data: Ref<string | null>;
|
|
7
|
-
signMessage: (message: string, from?: string) => Promise<string>;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSignMessage: () => IUseSignMessage;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TransactionOrVersionedTransaction, Web3AuthError } from "@web3auth/no-modal";
|
|
2
|
-
import { Ref } from "vue";
|
|
3
|
-
export type IUseSignTransaction = {
|
|
4
|
-
loading: Ref<boolean>;
|
|
5
|
-
error: Ref<Web3AuthError | null>;
|
|
6
|
-
data: Ref<string | null>;
|
|
7
|
-
signTransaction: (transaction: TransactionOrVersionedTransaction) => Promise<string>;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSignTransaction: () => IUseSignTransaction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Connection } from "@solana/web3.js";
|
|
2
|
-
import { SolanaWallet } from "@web3auth/no-modal";
|
|
3
|
-
import { Ref, ShallowRef } from "vue";
|
|
4
|
-
export type IUseSolanaWallet = {
|
|
5
|
-
accounts: Ref<string[] | null>;
|
|
6
|
-
solanaWallet: ShallowRef<SolanaWallet | null>;
|
|
7
|
-
connection: ShallowRef<Connection | null>;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSolanaWallet: () => IUseSolanaWallet;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@web3auth/no-modal/providers/ethereum-mpc-provider';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useCheckout = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showCheckout = useCallback(async showCheckoutParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showCheckout(showCheckoutParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showCheckout
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useCheckout };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useEnableMFA = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth
|
|
7
|
-
} = useWeb3AuthInner();
|
|
8
|
-
const [loading, setLoading] = useState(false);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
const enableMFA = useCallback(async params => {
|
|
11
|
-
setLoading(true);
|
|
12
|
-
setError(null);
|
|
13
|
-
try {
|
|
14
|
-
await web3Auth.enableMFA(params);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
setError(error);
|
|
17
|
-
} finally {
|
|
18
|
-
setLoading(false);
|
|
19
|
-
}
|
|
20
|
-
}, [web3Auth]);
|
|
21
|
-
return {
|
|
22
|
-
loading,
|
|
23
|
-
error,
|
|
24
|
-
enableMFA
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { useEnableMFA };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useFunding = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showFunding = useCallback(async showFundingParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showFunding(showFundingParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showFunding
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useFunding };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useIdentityToken = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth,
|
|
7
|
-
isAuthorized
|
|
8
|
-
} = useWeb3AuthInner();
|
|
9
|
-
const [loading, setLoading] = useState(false);
|
|
10
|
-
const [error, setError] = useState(null);
|
|
11
|
-
const [token, setToken] = useState(null);
|
|
12
|
-
const getIdentityToken = useCallback(async () => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
const userAuthInfo = await web3Auth.getIdentityToken();
|
|
17
|
-
if (userAuthInfo !== null && userAuthInfo !== void 0 && userAuthInfo.idToken) {
|
|
18
|
-
setToken(userAuthInfo.idToken);
|
|
19
|
-
}
|
|
20
|
-
return userAuthInfo === null || userAuthInfo === void 0 ? void 0 : userAuthInfo.idToken;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [web3Auth]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (!web3Auth) return;
|
|
29
|
-
if (!isAuthorized && token) {
|
|
30
|
-
setToken(null);
|
|
31
|
-
}
|
|
32
|
-
if (isAuthorized && !token) {
|
|
33
|
-
setToken(web3Auth.idToken);
|
|
34
|
-
}
|
|
35
|
-
}, [isAuthorized, token, web3Auth]);
|
|
36
|
-
return {
|
|
37
|
-
loading,
|
|
38
|
-
error,
|
|
39
|
-
token,
|
|
40
|
-
getIdentityToken
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export { useIdentityToken };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useManageMFA = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth
|
|
7
|
-
} = useWeb3AuthInner();
|
|
8
|
-
const [loading, setLoading] = useState(false);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
const manageMFA = useCallback(async params => {
|
|
11
|
-
setLoading(true);
|
|
12
|
-
setError(null);
|
|
13
|
-
try {
|
|
14
|
-
await web3Auth.manageMFA(params);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
setError(error);
|
|
17
|
-
} finally {
|
|
18
|
-
setLoading(false);
|
|
19
|
-
}
|
|
20
|
-
}, [web3Auth]);
|
|
21
|
-
return {
|
|
22
|
-
loading,
|
|
23
|
-
error,
|
|
24
|
-
manageMFA
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { useManageMFA };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useReceive = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showReceive = useCallback(async showReceiveParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showReceive(showReceiveParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showReceive
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useReceive };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useSwap = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showSwap = useCallback(async showSwapParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showSwap(showSwapParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showSwap
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useSwap };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useSwitchChain = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth
|
|
7
|
-
} = useWeb3AuthInner();
|
|
8
|
-
const [loading, setLoading] = useState(false);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
const switchChain = useCallback(async chainId => {
|
|
11
|
-
setLoading(true);
|
|
12
|
-
setError(null);
|
|
13
|
-
try {
|
|
14
|
-
await web3Auth.switchChain({
|
|
15
|
-
chainId
|
|
16
|
-
});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
setError(error);
|
|
19
|
-
} finally {
|
|
20
|
-
setLoading(false);
|
|
21
|
-
}
|
|
22
|
-
}, [web3Auth]);
|
|
23
|
-
return {
|
|
24
|
-
loading,
|
|
25
|
-
error,
|
|
26
|
-
switchChain
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { useSwitchChain };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useWalletConnectScanner = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showWalletConnectScanner = useCallback(async showWalletConnectScannerParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showWalletConnectScanner(showWalletConnectScannerParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showWalletConnectScanner
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useWalletConnectScanner };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError } from '@web3auth/no-modal';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
import { WalletServicesContext } from '../context/WalletServicesInnerContext.js';
|
|
4
|
-
|
|
5
|
-
const useWalletServicesPlugin = () => {
|
|
6
|
-
const context = useContext(WalletServicesContext);
|
|
7
|
-
if (!context) throw WalletInitializationError.fromCode(1000, "usage of useWalletServicesPlugin not wrapped in `WalletServicesContextProvider`.");
|
|
8
|
-
return context;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { useWalletServicesPlugin };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { WalletServicesPluginError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useWalletServicesPlugin } from './useWalletServicesPlugin.js';
|
|
4
|
-
|
|
5
|
-
const useWalletUI = () => {
|
|
6
|
-
const {
|
|
7
|
-
plugin,
|
|
8
|
-
ready
|
|
9
|
-
} = useWalletServicesPlugin();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const showWalletUI = useCallback(async showWalletUiParams => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!plugin) throw WalletServicesPluginError.notInitialized();
|
|
17
|
-
if (!ready) throw WalletServicesPluginError.walletPluginNotConnected();
|
|
18
|
-
await plugin.showWalletUi(showWalletUiParams);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [plugin, ready]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
showWalletUI
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useWalletUI };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useWeb3AuthDisconnect = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth
|
|
7
|
-
} = useWeb3AuthInner();
|
|
8
|
-
const [loading, setLoading] = useState(false);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
const disconnect = useCallback(async options => {
|
|
11
|
-
setLoading(true);
|
|
12
|
-
setError(null);
|
|
13
|
-
try {
|
|
14
|
-
await web3Auth.logout(options);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
setError(error);
|
|
17
|
-
} finally {
|
|
18
|
-
setLoading(false);
|
|
19
|
-
}
|
|
20
|
-
}, [web3Auth]);
|
|
21
|
-
return {
|
|
22
|
-
loading,
|
|
23
|
-
error,
|
|
24
|
-
disconnect
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { useWeb3AuthDisconnect };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import { useWeb3AuthInner } from './useWeb3AuthInner.js';
|
|
3
|
-
|
|
4
|
-
const useWeb3AuthUser = () => {
|
|
5
|
-
const {
|
|
6
|
-
web3Auth,
|
|
7
|
-
isConnected,
|
|
8
|
-
isMFAEnabled,
|
|
9
|
-
setIsMFAEnabled
|
|
10
|
-
} = useWeb3AuthInner();
|
|
11
|
-
const [userInfo, setUserInfo] = useState(null);
|
|
12
|
-
const [loading, setLoading] = useState(false);
|
|
13
|
-
const [error, setError] = useState(null);
|
|
14
|
-
const getUserInfo = useCallback(async () => {
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
try {
|
|
18
|
-
const userInfo = await web3Auth.getUserInfo();
|
|
19
|
-
setUserInfo(userInfo);
|
|
20
|
-
return userInfo;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [web3Auth]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const saveUserInfo = async () => {
|
|
29
|
-
const userInfo = await getUserInfo();
|
|
30
|
-
setUserInfo(userInfo);
|
|
31
|
-
setIsMFAEnabled((userInfo === null || userInfo === void 0 ? void 0 : userInfo.isMfaEnabled) || false);
|
|
32
|
-
};
|
|
33
|
-
if (isConnected && !userInfo) saveUserInfo();
|
|
34
|
-
if (!isConnected && userInfo) {
|
|
35
|
-
setUserInfo(null);
|
|
36
|
-
setIsMFAEnabled(false);
|
|
37
|
-
}
|
|
38
|
-
}, [isConnected, userInfo, getUserInfo, setIsMFAEnabled]);
|
|
39
|
-
return {
|
|
40
|
-
loading,
|
|
41
|
-
error,
|
|
42
|
-
userInfo,
|
|
43
|
-
isMFAEnabled,
|
|
44
|
-
getUserInfo
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { useWeb3AuthUser };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useSolanaWallet } from './useSolanaWallet.js';
|
|
4
|
-
|
|
5
|
-
const useSignAndSendTransaction = () => {
|
|
6
|
-
const {
|
|
7
|
-
solanaWallet
|
|
8
|
-
} = useSolanaWallet();
|
|
9
|
-
const [loading, setLoading] = useState(false);
|
|
10
|
-
const [error, setError] = useState(null);
|
|
11
|
-
const [data, setData] = useState(null);
|
|
12
|
-
const signAndSendTransaction = useCallback(async transaction => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
if (!solanaWallet) throw WalletInitializationError.notReady();
|
|
17
|
-
const signature = await solanaWallet.signAndSendTransaction(transaction);
|
|
18
|
-
setData(signature);
|
|
19
|
-
return signature;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
setError(error);
|
|
22
|
-
} finally {
|
|
23
|
-
setLoading(false);
|
|
24
|
-
}
|
|
25
|
-
}, [solanaWallet]);
|
|
26
|
-
return {
|
|
27
|
-
loading,
|
|
28
|
-
error,
|
|
29
|
-
data,
|
|
30
|
-
signAndSendTransaction
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { useSignAndSendTransaction };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { WalletInitializationError } from '@web3auth/no-modal';
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
3
|
-
import { useSolanaWallet } from './useSolanaWallet.js';
|
|
4
|
-
|
|
5
|
-
const useSignMessage = () => {
|
|
6
|
-
const {
|
|
7
|
-
solanaWallet,
|
|
8
|
-
accounts
|
|
9
|
-
} = useSolanaWallet();
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
const [data, setData] = useState(null);
|
|
13
|
-
const signMessage = useCallback(async (message, from) => {
|
|
14
|
-
setLoading(true);
|
|
15
|
-
setError(null);
|
|
16
|
-
try {
|
|
17
|
-
if (!solanaWallet) throw WalletInitializationError.notReady();
|
|
18
|
-
const signature = await solanaWallet.signMessage(message, from !== null && from !== void 0 ? from : accounts === null || accounts === void 0 ? void 0 : accounts[0]);
|
|
19
|
-
setData(signature);
|
|
20
|
-
return signature;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [solanaWallet, accounts]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
data,
|
|
31
|
-
signMessage
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export { useSignMessage };
|