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