@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,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useEnableMFA = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth
|
|
9
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
10
|
-
const [loading, setLoading] = react.useState(false);
|
|
11
|
-
const [error, setError] = react.useState(null);
|
|
12
|
-
const enableMFA = react.useCallback(async params => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
await web3Auth.enableMFA(params);
|
|
17
|
-
} catch (error) {
|
|
18
|
-
setError(error);
|
|
19
|
-
} finally {
|
|
20
|
-
setLoading(false);
|
|
21
|
-
}
|
|
22
|
-
}, [web3Auth]);
|
|
23
|
-
return {
|
|
24
|
-
loading,
|
|
25
|
-
error,
|
|
26
|
-
enableMFA
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.useEnableMFA = useEnableMFA;
|
|
@@ -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 useFunding = () => {
|
|
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 showFunding = react.useCallback(async showFundingParams => {
|
|
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.showFunding(showFundingParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showFunding
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useFunding = useFunding;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useIdentityToken = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth,
|
|
9
|
-
isAuthorized
|
|
10
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
11
|
-
const [loading, setLoading] = react.useState(false);
|
|
12
|
-
const [error, setError] = react.useState(null);
|
|
13
|
-
const [token, setToken] = react.useState(null);
|
|
14
|
-
const getIdentityToken = react.useCallback(async () => {
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
try {
|
|
18
|
-
const userAuthInfo = await web3Auth.getIdentityToken();
|
|
19
|
-
if (userAuthInfo !== null && userAuthInfo !== void 0 && userAuthInfo.idToken) {
|
|
20
|
-
setToken(userAuthInfo.idToken);
|
|
21
|
-
}
|
|
22
|
-
return userAuthInfo === null || userAuthInfo === void 0 ? void 0 : userAuthInfo.idToken;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
setError(error);
|
|
25
|
-
} finally {
|
|
26
|
-
setLoading(false);
|
|
27
|
-
}
|
|
28
|
-
}, [web3Auth]);
|
|
29
|
-
react.useEffect(() => {
|
|
30
|
-
if (!web3Auth) return;
|
|
31
|
-
if (!isAuthorized && token) {
|
|
32
|
-
setToken(null);
|
|
33
|
-
}
|
|
34
|
-
if (isAuthorized && !token) {
|
|
35
|
-
setToken(web3Auth.idToken);
|
|
36
|
-
}
|
|
37
|
-
}, [isAuthorized, token, web3Auth]);
|
|
38
|
-
return {
|
|
39
|
-
loading,
|
|
40
|
-
error,
|
|
41
|
-
token,
|
|
42
|
-
getIdentityToken
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
exports.useIdentityToken = useIdentityToken;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useManageMFA = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth
|
|
9
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
10
|
-
const [loading, setLoading] = react.useState(false);
|
|
11
|
-
const [error, setError] = react.useState(null);
|
|
12
|
-
const manageMFA = react.useCallback(async params => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
await web3Auth.manageMFA(params);
|
|
17
|
-
} catch (error) {
|
|
18
|
-
setError(error);
|
|
19
|
-
} finally {
|
|
20
|
-
setLoading(false);
|
|
21
|
-
}
|
|
22
|
-
}, [web3Auth]);
|
|
23
|
-
return {
|
|
24
|
-
loading,
|
|
25
|
-
error,
|
|
26
|
-
manageMFA
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.useManageMFA = useManageMFA;
|
|
@@ -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 useReceive = () => {
|
|
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 showReceive = react.useCallback(async showReceiveParams => {
|
|
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.showReceive(showReceiveParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showReceive
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useReceive = useReceive;
|
|
@@ -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 useSwap = () => {
|
|
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 showSwap = react.useCallback(async showSwapParams => {
|
|
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.showSwap(showSwapParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showSwap
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useSwap = useSwap;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useSwitchChain = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth
|
|
9
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
10
|
-
const [loading, setLoading] = react.useState(false);
|
|
11
|
-
const [error, setError] = react.useState(null);
|
|
12
|
-
const switchChain = react.useCallback(async chainId => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
await web3Auth.switchChain({
|
|
17
|
-
chainId
|
|
18
|
-
});
|
|
19
|
-
} catch (error) {
|
|
20
|
-
setError(error);
|
|
21
|
-
} finally {
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
}, [web3Auth]);
|
|
25
|
-
return {
|
|
26
|
-
loading,
|
|
27
|
-
error,
|
|
28
|
-
switchChain
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.useSwitchChain = useSwitchChain;
|
|
@@ -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 useWalletConnectScanner = () => {
|
|
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 showWalletConnectScanner = react.useCallback(async showWalletConnectScannerParams => {
|
|
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.showWalletConnectScanner(showWalletConnectScannerParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showWalletConnectScanner
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useWalletConnectScanner = useWalletConnectScanner;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var noModal = require('@web3auth/no-modal');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var WalletServicesInnerContext = require('../context/WalletServicesInnerContext.js');
|
|
6
|
-
|
|
7
|
-
const useWalletServicesPlugin = () => {
|
|
8
|
-
const context = react.useContext(WalletServicesInnerContext.WalletServicesContext);
|
|
9
|
-
if (!context) throw noModal.WalletInitializationError.fromCode(1000, "usage of useWalletServicesPlugin not wrapped in `WalletServicesContextProvider`.");
|
|
10
|
-
return context;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
exports.useWalletServicesPlugin = useWalletServicesPlugin;
|
|
@@ -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 useWalletUI = () => {
|
|
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 showWalletUI = react.useCallback(async showWalletUiParams => {
|
|
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.showWalletUi(showWalletUiParams);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
setError(error);
|
|
23
|
-
} finally {
|
|
24
|
-
setLoading(false);
|
|
25
|
-
}
|
|
26
|
-
}, [plugin, ready]);
|
|
27
|
-
return {
|
|
28
|
-
loading,
|
|
29
|
-
error,
|
|
30
|
-
showWalletUI
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useWalletUI = useWalletUI;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useWeb3AuthDisconnect = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth
|
|
9
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
10
|
-
const [loading, setLoading] = react.useState(false);
|
|
11
|
-
const [error, setError] = react.useState(null);
|
|
12
|
-
const disconnect = react.useCallback(async options => {
|
|
13
|
-
setLoading(true);
|
|
14
|
-
setError(null);
|
|
15
|
-
try {
|
|
16
|
-
await web3Auth.logout(options);
|
|
17
|
-
} catch (error) {
|
|
18
|
-
setError(error);
|
|
19
|
-
} finally {
|
|
20
|
-
setLoading(false);
|
|
21
|
-
}
|
|
22
|
-
}, [web3Auth]);
|
|
23
|
-
return {
|
|
24
|
-
loading,
|
|
25
|
-
error,
|
|
26
|
-
disconnect
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.useWeb3AuthDisconnect = useWeb3AuthDisconnect;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
5
|
-
|
|
6
|
-
const useWeb3AuthUser = () => {
|
|
7
|
-
const {
|
|
8
|
-
web3Auth,
|
|
9
|
-
isConnected,
|
|
10
|
-
isMFAEnabled,
|
|
11
|
-
setIsMFAEnabled
|
|
12
|
-
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
13
|
-
const [userInfo, setUserInfo] = react.useState(null);
|
|
14
|
-
const [loading, setLoading] = react.useState(false);
|
|
15
|
-
const [error, setError] = react.useState(null);
|
|
16
|
-
const getUserInfo = react.useCallback(async () => {
|
|
17
|
-
setLoading(true);
|
|
18
|
-
setError(null);
|
|
19
|
-
try {
|
|
20
|
-
const userInfo = await web3Auth.getUserInfo();
|
|
21
|
-
setUserInfo(userInfo);
|
|
22
|
-
return userInfo;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
setError(error);
|
|
25
|
-
} finally {
|
|
26
|
-
setLoading(false);
|
|
27
|
-
}
|
|
28
|
-
}, [web3Auth]);
|
|
29
|
-
react.useEffect(() => {
|
|
30
|
-
const saveUserInfo = async () => {
|
|
31
|
-
const userInfo = await getUserInfo();
|
|
32
|
-
setUserInfo(userInfo);
|
|
33
|
-
setIsMFAEnabled((userInfo === null || userInfo === void 0 ? void 0 : userInfo.isMfaEnabled) || false);
|
|
34
|
-
};
|
|
35
|
-
if (isConnected && !userInfo) saveUserInfo();
|
|
36
|
-
if (!isConnected && userInfo) {
|
|
37
|
-
setUserInfo(null);
|
|
38
|
-
setIsMFAEnabled(false);
|
|
39
|
-
}
|
|
40
|
-
}, [isConnected, userInfo, getUserInfo, setIsMFAEnabled]);
|
|
41
|
-
return {
|
|
42
|
-
loading,
|
|
43
|
-
error,
|
|
44
|
-
userInfo,
|
|
45
|
-
isMFAEnabled,
|
|
46
|
-
getUserInfo
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.useWeb3AuthUser = useWeb3AuthUser;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var noModal = require('@web3auth/no-modal');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var useSolanaWallet = require('./useSolanaWallet.js');
|
|
6
|
-
|
|
7
|
-
const useSignAndSendTransaction = () => {
|
|
8
|
-
const {
|
|
9
|
-
solanaWallet
|
|
10
|
-
} = useSolanaWallet.useSolanaWallet();
|
|
11
|
-
const [loading, setLoading] = react.useState(false);
|
|
12
|
-
const [error, setError] = react.useState(null);
|
|
13
|
-
const [data, setData] = react.useState(null);
|
|
14
|
-
const signAndSendTransaction = react.useCallback(async transaction => {
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
try {
|
|
18
|
-
if (!solanaWallet) throw noModal.WalletInitializationError.notReady();
|
|
19
|
-
const signature = await solanaWallet.signAndSendTransaction(transaction);
|
|
20
|
-
setData(signature);
|
|
21
|
-
return signature;
|
|
22
|
-
} catch (error) {
|
|
23
|
-
setError(error);
|
|
24
|
-
} finally {
|
|
25
|
-
setLoading(false);
|
|
26
|
-
}
|
|
27
|
-
}, [solanaWallet]);
|
|
28
|
-
return {
|
|
29
|
-
loading,
|
|
30
|
-
error,
|
|
31
|
-
data,
|
|
32
|
-
signAndSendTransaction
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.useSignAndSendTransaction = useSignAndSendTransaction;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var noModal = require('@web3auth/no-modal');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var useSolanaWallet = require('./useSolanaWallet.js');
|
|
6
|
-
|
|
7
|
-
const useSignMessage = () => {
|
|
8
|
-
const {
|
|
9
|
-
solanaWallet,
|
|
10
|
-
accounts
|
|
11
|
-
} = useSolanaWallet.useSolanaWallet();
|
|
12
|
-
const [loading, setLoading] = react.useState(false);
|
|
13
|
-
const [error, setError] = react.useState(null);
|
|
14
|
-
const [data, setData] = react.useState(null);
|
|
15
|
-
const signMessage = react.useCallback(async (message, from) => {
|
|
16
|
-
setLoading(true);
|
|
17
|
-
setError(null);
|
|
18
|
-
try {
|
|
19
|
-
if (!solanaWallet) throw noModal.WalletInitializationError.notReady();
|
|
20
|
-
const signature = await solanaWallet.signMessage(message, from !== null && from !== void 0 ? from : accounts === null || accounts === void 0 ? void 0 : accounts[0]);
|
|
21
|
-
setData(signature);
|
|
22
|
-
return signature;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
setError(error);
|
|
25
|
-
} finally {
|
|
26
|
-
setLoading(false);
|
|
27
|
-
}
|
|
28
|
-
}, [solanaWallet, accounts]);
|
|
29
|
-
return {
|
|
30
|
-
loading,
|
|
31
|
-
error,
|
|
32
|
-
data,
|
|
33
|
-
signMessage
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
exports.useSignMessage = useSignMessage;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var noModal = require('@web3auth/no-modal');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var useSolanaWallet = require('./useSolanaWallet.js');
|
|
6
|
-
|
|
7
|
-
const useSignTransaction = () => {
|
|
8
|
-
const {
|
|
9
|
-
solanaWallet
|
|
10
|
-
} = useSolanaWallet.useSolanaWallet();
|
|
11
|
-
const [loading, setLoading] = react.useState(false);
|
|
12
|
-
const [error, setError] = react.useState(null);
|
|
13
|
-
const [data, setData] = react.useState(null);
|
|
14
|
-
const signTransaction = react.useCallback(async transaction => {
|
|
15
|
-
setLoading(true);
|
|
16
|
-
setError(null);
|
|
17
|
-
try {
|
|
18
|
-
if (!solanaWallet) throw noModal.WalletInitializationError.notReady();
|
|
19
|
-
const signedTransaction = await solanaWallet.signTransaction(transaction);
|
|
20
|
-
setData(signedTransaction);
|
|
21
|
-
return signedTransaction;
|
|
22
|
-
} catch (error) {
|
|
23
|
-
setError(error);
|
|
24
|
-
} finally {
|
|
25
|
-
setLoading(false);
|
|
26
|
-
}
|
|
27
|
-
}, [solanaWallet]);
|
|
28
|
-
return {
|
|
29
|
-
loading,
|
|
30
|
-
error,
|
|
31
|
-
data,
|
|
32
|
-
signTransaction
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.useSignTransaction = useSignTransaction;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var web3_js = require('@solana/web3.js');
|
|
4
|
-
var noModal = require('@web3auth/no-modal');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var useChain = require('../../hooks/useChain.js');
|
|
7
|
-
require('@babel/runtime/helpers/objectSpread2');
|
|
8
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
9
|
-
require('@web3auth/auth');
|
|
10
|
-
require('deepmerge');
|
|
11
|
-
require('../../../config.js');
|
|
12
|
-
require('../../../ui/config.js');
|
|
13
|
-
require('../../../ui/interfaces.js');
|
|
14
|
-
require('react/jsx-runtime');
|
|
15
|
-
require('../../../ui/css/index.css.js');
|
|
16
|
-
require('bowser');
|
|
17
|
-
require('react-dom/client');
|
|
18
|
-
require('@toruslabs/http-helpers');
|
|
19
|
-
require('clsx');
|
|
20
|
-
require('tailwind-merge');
|
|
21
|
-
require('react-i18next');
|
|
22
|
-
require('../../../ui/context/RootContext.js');
|
|
23
|
-
require('../../../ui/localeImport.js');
|
|
24
|
-
require('classnames');
|
|
25
|
-
require('react-qrcode-logo');
|
|
26
|
-
require('../../../ui/components/Login/Login.js');
|
|
27
|
-
var useWeb3Auth = require('../../hooks/useWeb3Auth.js');
|
|
28
|
-
|
|
29
|
-
const useSolanaWallet = () => {
|
|
30
|
-
const {
|
|
31
|
-
provider,
|
|
32
|
-
web3Auth
|
|
33
|
-
} = useWeb3Auth.useWeb3Auth();
|
|
34
|
-
const {
|
|
35
|
-
chainNamespace
|
|
36
|
-
} = useChain.useChain();
|
|
37
|
-
const [accounts, setAccounts] = react.useState(null);
|
|
38
|
-
const solanaWallet = react.useMemo(() => {
|
|
39
|
-
if (!provider) return null;
|
|
40
|
-
if (chainNamespace !== noModal.CHAIN_NAMESPACES.SOLANA) return null;
|
|
41
|
-
return new noModal.SolanaWallet(provider);
|
|
42
|
-
}, [provider, chainNamespace]);
|
|
43
|
-
const connection = react.useMemo(() => {
|
|
44
|
-
if (!web3Auth || !provider || chainNamespace !== noModal.CHAIN_NAMESPACES.SOLANA) return null;
|
|
45
|
-
return new web3_js.Connection(web3Auth.currentChain.rpcTarget);
|
|
46
|
-
}, [web3Auth, provider, chainNamespace]);
|
|
47
|
-
react.useEffect(() => {
|
|
48
|
-
const init = async () => {
|
|
49
|
-
if (chainNamespace !== noModal.CHAIN_NAMESPACES.SOLANA) {
|
|
50
|
-
setAccounts(null);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (!solanaWallet) return;
|
|
54
|
-
const accounts = await solanaWallet.getAccounts();
|
|
55
|
-
if ((accounts === null || accounts === void 0 ? void 0 : accounts.length) > 0) {
|
|
56
|
-
setAccounts(accounts);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
if (solanaWallet) init();
|
|
60
|
-
}, [solanaWallet, chainNamespace]);
|
|
61
|
-
return {
|
|
62
|
-
solanaWallet,
|
|
63
|
-
accounts,
|
|
64
|
-
connection
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
exports.useSolanaWallet = useSolanaWallet;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var utils = require('../../utils.js');
|
|
5
|
-
|
|
6
|
-
function toSize(value, fallback = 160) {
|
|
7
|
-
return value !== null && value !== void 0 ? value : fallback;
|
|
8
|
-
}
|
|
9
|
-
const CircularLoader = props => {
|
|
10
|
-
const {
|
|
11
|
-
width,
|
|
12
|
-
height,
|
|
13
|
-
thickness = 12,
|
|
14
|
-
className = "",
|
|
15
|
-
children,
|
|
16
|
-
showChildren = true,
|
|
17
|
-
trackColor = "rgba(226, 232, 240, 1)",
|
|
18
|
-
// Tailwind slate-200 equivalent
|
|
19
|
-
gradient,
|
|
20
|
-
arcSizeDeg = 36,
|
|
21
|
-
arcColors
|
|
22
|
-
} = props;
|
|
23
|
-
const w = toSize(width, 160);
|
|
24
|
-
const h = toSize(height, 160);
|
|
25
|
-
const ringMask = `radial-gradient(farthest-side, transparent calc(100% - ${thickness}px), #000 calc(100% - ${thickness}px))`;
|
|
26
|
-
function hexToRgba(hex, alpha) {
|
|
27
|
-
const normalized = hex.replace("#", "");
|
|
28
|
-
const full = normalized.length === 3 ? normalized.split("").map(c => c + c).join("") : normalized;
|
|
29
|
-
const r = parseInt(full.substring(0, 2), 16);
|
|
30
|
-
const g = parseInt(full.substring(2, 4), 16);
|
|
31
|
-
const b = parseInt(full.substring(4, 6), 16);
|
|
32
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
33
|
-
}
|
|
34
|
-
function withAlpha(color, alpha) {
|
|
35
|
-
if (!color) return color;
|
|
36
|
-
const c = color.trim().toLowerCase();
|
|
37
|
-
if (c.startsWith("#")) return hexToRgba(c, alpha);
|
|
38
|
-
if (c.startsWith("rgba(")) return color;
|
|
39
|
-
if (c.startsWith("rgb(")) {
|
|
40
|
-
const nums = c.slice(4, -1);
|
|
41
|
-
return `rgba(${nums}, ${alpha})`;
|
|
42
|
-
}
|
|
43
|
-
// Fallback: return the same color (alpha may be ignored by browser)
|
|
44
|
-
return color;
|
|
45
|
-
}
|
|
46
|
-
const arcColorGradient = gradient || (arcColors ? `radial-gradient(210.91% 85.29% at 14.56% 18.67%, ${withAlpha(arcColors[0], 0)} 9.5%, ${arcColors[1]} 41.82%, ${arcColors[1]} 64.83%, ${withAlpha(arcColors[0], 0.44)} 100%)` : "radial-gradient(210.91% 85.29% at 14.56% 18.67%, rgba(255, 98, 58, 0.00) 9.5%, #FF623A 41.82%, #FF623A 64.83%, rgba(255, 98, 58, 0.44) 100%)");
|
|
47
|
-
const wedgeMask = `conic-gradient(#000 0deg ${arcSizeDeg}deg, transparent ${arcSizeDeg}deg 360deg)`;
|
|
48
|
-
return jsxRuntime.jsxs("div", {
|
|
49
|
-
className: utils.cn("w3a--relative w3a--inline-flex w3a--items-center w3a--justify-center", className),
|
|
50
|
-
style: {
|
|
51
|
-
width: w,
|
|
52
|
-
height: h
|
|
53
|
-
},
|
|
54
|
-
children: [jsxRuntime.jsx("div", {
|
|
55
|
-
className: "w3a--absolute w3a--inset-0 w3a--rounded-full",
|
|
56
|
-
style: {
|
|
57
|
-
background: trackColor,
|
|
58
|
-
WebkitMaskImage: ringMask,
|
|
59
|
-
maskImage: ringMask,
|
|
60
|
-
WebkitMaskRepeat: "no-repeat",
|
|
61
|
-
maskRepeat: "no-repeat"
|
|
62
|
-
}
|
|
63
|
-
}), jsxRuntime.jsx("div", {
|
|
64
|
-
className: "w3a--absolute w3a--inset-0 w3a--animate-spin",
|
|
65
|
-
style: {
|
|
66
|
-
WebkitMaskImage: wedgeMask,
|
|
67
|
-
maskImage: wedgeMask,
|
|
68
|
-
WebkitMaskRepeat: "no-repeat",
|
|
69
|
-
maskRepeat: "no-repeat"
|
|
70
|
-
},
|
|
71
|
-
children: jsxRuntime.jsx("div", {
|
|
72
|
-
className: "w3a--absolute w3a--inset-0 w3a--rounded-full",
|
|
73
|
-
style: {
|
|
74
|
-
background: arcColorGradient,
|
|
75
|
-
WebkitMaskImage: ringMask,
|
|
76
|
-
maskImage: ringMask,
|
|
77
|
-
WebkitMaskRepeat: "no-repeat",
|
|
78
|
-
maskRepeat: "no-repeat"
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
}), showChildren && children ? jsxRuntime.jsx("div", {
|
|
82
|
-
className: "w3a--relative",
|
|
83
|
-
children: children
|
|
84
|
-
}) : null]
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
module.exports = CircularLoader;
|