@web3auth/modal 11.0.0-beta.0 → 11.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
  2. package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
  3. package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
  4. package/dist/lib.cjs/packages/modal/src/config.js +1 -1
  5. package/dist/lib.cjs/packages/modal/src/modalManager.js +446 -26
  6. package/dist/lib.cjs/packages/modal/src/react/index.js +7 -3
  7. package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +27 -12
  8. package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
  9. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
  10. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
  11. package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
  12. package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +4 -4
  13. package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +28 -28
  14. package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
  15. package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +19 -19
  16. package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
  17. package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
  18. package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
  19. package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
  20. package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +11 -11
  21. package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
  22. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
  23. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
  24. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
  25. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
  26. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
  27. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
  28. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
  29. package/dist/lib.cjs/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
  30. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/Login.js +45 -41
  31. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
  32. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
  33. package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +24 -9
  34. package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
  35. package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
  36. package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +1 -0
  37. package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
  38. package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
  39. package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
  40. package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
  41. package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
  42. package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
  43. package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
  44. package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
  45. package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
  46. package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
  47. package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
  48. package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
  49. package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +113 -4
  50. package/dist/lib.cjs/packages/modal/src/vue/index.js +7 -3
  51. package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +27 -14
  52. package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
  53. package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
  54. package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
  55. package/dist/lib.cjs/types/modalManager.d.ts +40 -2
  56. package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
  57. package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
  58. package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
  59. package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
  60. package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
  61. package/dist/lib.cjs/types/ui/containers/Root/Root.d.ts +1 -1
  62. package/dist/lib.cjs/types/ui/interfaces.d.ts +43 -8
  63. package/dist/lib.cjs/types/ui/loginModal.d.ts +27 -2
  64. package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
  65. package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
  66. package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
  67. package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
  68. package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
  69. package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
  70. package/dist/lib.esm/packages/modal/src/config.js +1 -1
  71. package/dist/lib.esm/packages/modal/src/modalManager.js +451 -28
  72. package/dist/lib.esm/packages/modal/src/react/index.js +1 -1
  73. package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +28 -13
  74. package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
  75. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
  76. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
  77. package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
  78. package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +4 -4
  79. package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +28 -28
  80. package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
  81. package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +19 -19
  82. package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
  83. package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
  84. package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
  85. package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
  86. package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +11 -11
  87. package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
  88. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
  89. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
  90. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
  91. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
  92. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
  93. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
  94. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
  95. package/dist/lib.esm/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
  96. package/dist/lib.esm/packages/modal/src/ui/containers/Login/Login.js +46 -42
  97. package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
  98. package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
  99. package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +24 -9
  100. package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
  101. package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
  102. package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +2 -1
  103. package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
  104. package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
  105. package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
  106. package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
  107. package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
  108. package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
  109. package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
  110. package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
  111. package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
  112. package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
  113. package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
  114. package/dist/lib.esm/packages/modal/src/ui/interfaces.js +24 -1
  115. package/dist/lib.esm/packages/modal/src/ui/loginModal.js +115 -6
  116. package/dist/lib.esm/packages/modal/src/vue/index.js +1 -1
  117. package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +28 -15
  118. package/package.json +42 -19
@@ -1,4 +1,16 @@
1
1
  var modal = {
2
+ "account-linking.failed-connect-wallet": "连接{{wallet}}失败。",
3
+ "account-linking.failed-switch-wallet": "使用{{wallet}}切换钱包失败。",
4
+ "account-linking.initializing-wallet": "正在初始化{{wallet}}...",
5
+ "account-linking.linking-wallet": "正在关联钱包...",
6
+ "account-linking.preparing-wallet-qr": "正在准备{{wallet}} QR码...",
7
+ "account-linking.scan-wallet": "使用{{wallet}}扫描QR码。",
8
+ "account-linking.scan-walletconnect": "使用兼容WalletConnect的钱包扫描QR码。",
9
+ "account-linking.switching-wallet": "正在切换钱包...",
10
+ "account-linking.wallet-connected-preparing-linking": "钱包已连接。正在准备账户关联...",
11
+ "account-linking.wallet-connected-preparing-switch": "钱包已连接。正在准备账户切换...",
12
+ "account-linking.wallet-linked": "钱包已关联。",
13
+ "account-linking.wallet-switched": "钱包已切换。",
2
14
  "adapter-loader.message": "验证您的{{adapter}}帐户以继续",
3
15
  "adapter-loader.message1": "在您的{{adapter}}上验证",
4
16
  "adapter-loader.message2": "帐号继续",
@@ -49,6 +61,7 @@ var modal = {
49
61
  "header-title": "登录",
50
62
  "header-tooltip-desc": "钱包作为一个账户用于在区块链上存储和管理您的数字资产。",
51
63
  "header-tooltip-title": "钱包",
64
+ linkYourWallet: "关联您的钱包",
52
65
  "loader.authorizing-header": "{{connector}}验证",
53
66
  "loader.authorizing-message": "我们已经向您的钱包发送了请求。请在您的钱包上确认,以确认您拥有此钱包。",
54
67
  "loader.authorizing-verify-btn": "点击此处进行验证",
@@ -99,6 +112,7 @@ var modal = {
99
112
  "social.view-more-socials": "查看更多socials"
100
113
  };
101
114
  var passwordless = {
115
+ "captcha-default-error": "验证过程中发生意外错误。请重新加载页面。",
102
116
  "error-invalid-link": "无效的验证链接或链接已过期",
103
117
  "error-invalid-origin": "出问题了, 错误代码: E002",
104
118
  "error-invalid-otp": "无效的OTP,请重试",
@@ -1,4 +1,16 @@
1
1
  var modal = {
2
+ "account-linking.failed-connect-wallet": "Falha ao conectar com {{wallet}}.",
3
+ "account-linking.failed-switch-wallet": "Falha ao trocar carteira com {{wallet}}.",
4
+ "account-linking.initializing-wallet": "Inicializando {{wallet}}...",
5
+ "account-linking.linking-wallet": "Vinculando carteira...",
6
+ "account-linking.preparing-wallet-qr": "Preparando código QR do {{wallet}}...",
7
+ "account-linking.scan-wallet": "Digitalize o código QR com {{wallet}}.",
8
+ "account-linking.scan-walletconnect": "Digitalize o código QR com uma carteira compatível com WalletConnect.",
9
+ "account-linking.switching-wallet": "Trocando carteira...",
10
+ "account-linking.wallet-connected-preparing-linking": "Carteira conectada. Preparando vinculação de conta...",
11
+ "account-linking.wallet-connected-preparing-switch": "Carteira conectada. Preparando troca de conta...",
12
+ "account-linking.wallet-linked": "Carteira vinculada.",
13
+ "account-linking.wallet-switched": "Carteira trocada.",
2
14
  "adapter-loader.message": "Verifique a sua conta {{adapter}} para continuar",
3
15
  "adapter-loader.message1": "Verifique o(a) seu/sua {{adapter}}",
4
16
  "adapter-loader.message2": "conta para continuar",
@@ -49,6 +61,7 @@ var modal = {
49
61
  "header-title": "Entrar",
50
62
  "header-tooltip-desc": "A carteira serve como uma conta para armazenar e gerenciar seus ativos digitais na blockchain.",
51
63
  "header-tooltip-title": "Carteira",
64
+ linkYourWallet: "Vincule sua carteira",
52
65
  "loader.authorizing-header": "Verificar em {{connector}}",
53
66
  "loader.authorizing-message": "Enviamos uma solicitação para seu portfólio. Verifique no seu portfólio para confirmar que você possui este portfólio.",
54
67
  "loader.authorizing-verify-btn": "Clique aqui para verificar",
@@ -99,6 +112,7 @@ var modal = {
99
112
  "social.view-more-socials": "Ver mais socials"
100
113
  };
101
114
  var passwordless = {
115
+ "captcha-default-error": "Ocorreu um erro inesperado durante a verificação. Por favor, tente recarregar a página.",
102
116
  "error-invalid-link": "Link de verificação inválido ou link expirado",
103
117
  "error-invalid-origin": "Algo deu errado, código de erro: E002",
104
118
  "error-invalid-otp": "OTP inválido, por favor tente novamente",
@@ -1,4 +1,16 @@
1
1
  var modal = {
2
+ "account-linking.failed-connect-wallet": "Error al conectar con {{wallet}}.",
3
+ "account-linking.failed-switch-wallet": "Error al cambiar la billetera con {{wallet}}.",
4
+ "account-linking.initializing-wallet": "Inicializando {{wallet}}...",
5
+ "account-linking.linking-wallet": "Vinculando billetera...",
6
+ "account-linking.preparing-wallet-qr": "Preparando el código QR de {{wallet}}...",
7
+ "account-linking.scan-wallet": "Escanea el código QR con {{wallet}}.",
8
+ "account-linking.scan-walletconnect": "Escanea el código QR con una billetera compatible con WalletConnect.",
9
+ "account-linking.switching-wallet": "Cambiando billetera...",
10
+ "account-linking.wallet-connected-preparing-linking": "Billetera conectada. Preparando vinculación de cuenta...",
11
+ "account-linking.wallet-connected-preparing-switch": "Billetera conectada. Preparando cambio de cuenta...",
12
+ "account-linking.wallet-linked": "Billetera vinculada.",
13
+ "account-linking.wallet-switched": "Billetera cambiada.",
2
14
  "adapter-loader.message": "Verifica tu cuenta {{adapter}} para continuar",
3
15
  "adapter-loader.message1": "Verifique su {{adapter}}",
4
16
  "adapter-loader.message2": "cuenta para continuar",
@@ -49,6 +61,7 @@ var modal = {
49
61
  "header-title": "Iniciar sesión",
50
62
  "header-tooltip-desc": "La billetera sirve como una cuenta para almacenar y administrar sus activos digitales en la blockchain.",
51
63
  "header-tooltip-title": "Billetera",
64
+ linkYourWallet: "Vincula tu billetera",
52
65
  "loader.authorizing-header": "Verificar en {{connector}}",
53
66
  "loader.authorizing-message": "Hemos enviado una solicitud a su cartera. Verifique en su cartera para confirmar que posee esta cartera.",
54
67
  "loader.authorizing-verify-btn": "Haga clic aquí para verificar",
@@ -99,6 +112,7 @@ var modal = {
99
112
  "social.view-more-socials": "Ver más socials"
100
113
  };
101
114
  var passwordless = {
115
+ "captcha-default-error": "Se ha producido un error inesperado durante la verificación. Por favor, inténtelo de nuevo recargando la página.",
102
116
  "error-invalid-link": "El enlace o el enlace de verificación ha expirado",
103
117
  "error-invalid-origin": "Algo salió mal, código de error: E002",
104
118
  "error-invalid-otp": "OTP no válido, intente nuevamente",
@@ -1,4 +1,16 @@
1
1
  var modal = {
2
+ "account-linking.failed-connect-wallet": "{{wallet}} ile bağlantı kurulamadı.",
3
+ "account-linking.failed-switch-wallet": "{{wallet}} ile cüzdan değiştirme başarısız oldu.",
4
+ "account-linking.initializing-wallet": "{{wallet}} başlatılıyor...",
5
+ "account-linking.linking-wallet": "Cüzdan bağlanıyor...",
6
+ "account-linking.preparing-wallet-qr": "{{wallet}} QR kodu hazırlanıyor...",
7
+ "account-linking.scan-wallet": "QR kodunu {{wallet}} ile tarayın.",
8
+ "account-linking.scan-walletconnect": "QR kodunu WalletConnect uyumlu bir cüzdanla tarayın.",
9
+ "account-linking.switching-wallet": "Cüzdan değiştiriliyor...",
10
+ "account-linking.wallet-connected-preparing-linking": "Cüzdan bağlandı. Hesap bağlantısı hazırlanıyor...",
11
+ "account-linking.wallet-connected-preparing-switch": "Cüzdan bağlandı. Hesap değişimi hazırlanıyor...",
12
+ "account-linking.wallet-linked": "Cüzdan bağlandı.",
13
+ "account-linking.wallet-switched": "Cüzdan değiştirildi.",
2
14
  "adapter-loader.message": "Devam etmek için {{adapter}} hesabınızı doğrula",
3
15
  "adapter-loader.message1": "{{adapter}} doğrula",
4
16
  "adapter-loader.message2": "devam edecek hesap",
@@ -49,6 +61,7 @@ var modal = {
49
61
  "header-title": "Giriş yap",
50
62
  "header-tooltip-desc": "Cüzdan, dijital varlıklarınızı blockchain'de saklama ve yönetme görevi görür.",
51
63
  "header-tooltip-title": "Cüzdan",
64
+ linkYourWallet: "Cüzdanınızı bağlayın",
52
65
  "loader.authorizing-header": "{{connector}} ile doğrula",
53
66
  "loader.authorizing-message": "Biz size bir istek gönderdik. Bu cüzdanınız olduğunu doğrulamak için cüzdanınızda doğrulayın.",
54
67
  "loader.authorizing-verify-btn": "Doğrulamak için buraya tıklayın",
@@ -99,6 +112,7 @@ var modal = {
99
112
  "social.view-more-socials": "Daha fazlasını görüntüle socials"
100
113
  };
101
114
  var passwordless = {
115
+ "captcha-default-error": "Doğrulama sırasında beklenmedik bir hata oluştu. Lütfen sayfayı yeniden yükleyin.",
102
116
  "error-invalid-link": "Hatalı ya da süresi geçmiş doğrulama linki",
103
117
  "error-invalid-origin": "Bir şeyler ters gitti, hata kodu: E002",
104
118
  "error-invalid-otp": "Hatalı OTP, lütfen tekrar deneyin.",
@@ -12,6 +12,29 @@ const MODAL_STATUS = {
12
12
  AUTHORIZED: "authorized",
13
13
  CONSENT_REQUIRING: "consent_requiring"
14
14
  };
15
+ const ACCOUNT_LINKING_STATUS = {
16
+ IDLE: "idle",
17
+ INITIALIZING: "initializing",
18
+ AWAITING_CONNECTION: "awaiting_connection",
19
+ WALLET_CONNECTED: "wallet_connected",
20
+ LINKING: "linking",
21
+ ERRORED: "errored",
22
+ COMPLETED: "completed"
23
+ };
24
+ const ACCOUNT_LINKING_INTENT = {
25
+ LINK: "link",
26
+ SWITCH: "switch"
27
+ };
28
+ const DEFAULT_ACCOUNT_LINKING_STATE = {
29
+ active: false,
30
+ pickerActive: false,
31
+ connectorName: null,
32
+ transportConnectorName: null,
33
+ chainId: null,
34
+ intent: ACCOUNT_LINKING_INTENT.LINK,
35
+ status: ACCOUNT_LINKING_STATUS.IDLE,
36
+ errorMessage: ""
37
+ };
15
38
  let TOAST_TYPE = /*#__PURE__*/function (TOAST_TYPE) {
16
39
  TOAST_TYPE["SUCCESS"] = "success";
17
40
  TOAST_TYPE["ERROR"] = "error";
@@ -20,4 +43,4 @@ let TOAST_TYPE = /*#__PURE__*/function (TOAST_TYPE) {
20
43
  return TOAST_TYPE;
21
44
  }({});
22
45
 
23
- export { LOGIN_MODAL_EVENTS, MODAL_STATUS, TOAST_TYPE };
46
+ export { ACCOUNT_LINKING_INTENT, ACCOUNT_LINKING_STATUS, DEFAULT_ACCOUNT_LINKING_STATE, LOGIN_MODAL_EVENTS, MODAL_STATUS, TOAST_TYPE };
@@ -3,7 +3,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import './css/index.css.js';
5
5
  import { LANGUAGES, applyWhiteLabelTheme, THEME_MODES, SafeEventEmitter } from '@web3auth/auth';
6
- import { log, WIDGET_TYPE, WalletInitializationError, WALLET_CONNECTORS, ANALYTICS_EVENTS, getWhitelabelAnalyticsProperties, CONNECTOR_EVENTS, LOGIN_MODE, CONNECTOR_INITIAL_AUTHENTICATION_MODE } from '@web3auth/no-modal';
6
+ import { log, WIDGET_TYPE, WalletInitializationError, WALLET_CONNECTORS, CONNECTOR_INITIAL_AUTHENTICATION_MODE, ANALYTICS_EVENTS, getWhitelabelAnalyticsProperties, CONNECTOR_EVENTS, LOGIN_MODE } from '@web3auth/no-modal';
7
7
  import Bowser from 'bowser';
8
8
  import { createRoot } from 'react-dom/client';
9
9
  import { getLoginModalAnalyticsProperties } from '../utils.js';
@@ -11,7 +11,7 @@ import { DEFAULT_PRIMARY_COLOR, DEFAULT_ON_PRIMARY_COLOR, PAGES, DEFAULT_LOGO_DA
11
11
  import Widget from './containers/Widget/Widget.js';
12
12
  import { AnalyticsContext } from './context/AnalyticsContext.js';
13
13
  import { WidgetProvider } from './context/WidgetContext.js';
14
- import { MODAL_STATUS } from './interfaces.js';
14
+ import { MODAL_STATUS, DEFAULT_ACCOUNT_LINKING_STATE, ACCOUNT_LINKING_STATUS, ACCOUNT_LINKING_INTENT } from './interfaces.js';
15
15
  import i18nInstance from './localeImport.js';
16
16
  import { getUserLanguage } from './utils.js';
17
17
  import { jsx } from 'react/jsx-runtime';
@@ -42,6 +42,7 @@ class LoginModal {
42
42
  _defineProperty(this, "externalWalletsConfig", void 0);
43
43
  _defineProperty(this, "analytics", void 0);
44
44
  _defineProperty(this, "modalStatus", MODAL_STATUS.INITIALIZED);
45
+ _defineProperty(this, "accountLinkingState", _objectSpread({}, DEFAULT_ACCOUNT_LINKING_STATE));
45
46
  _defineProperty(this, "initModal", async () => {
46
47
  const useLang = this.uiConfig.defaultLanguage || LANGUAGES.en;
47
48
 
@@ -195,6 +196,112 @@ class LoginModal {
195
196
  externalWalletsVisibility: isMMAvailable ? false : !!options.externalWalletsVisibility
196
197
  });
197
198
  });
199
+ _defineProperty(this, "startAccountLinkingSession", params => {
200
+ var _params$transportConn, _params$intent;
201
+ this.updateAccountLinkingState(_objectSpread(_objectSpread({}, DEFAULT_ACCOUNT_LINKING_STATE), {}, {
202
+ active: true,
203
+ connectorName: params.connectorName,
204
+ transportConnectorName: (_params$transportConn = params.transportConnectorName) !== null && _params$transportConn !== void 0 ? _params$transportConn : params.connectorName,
205
+ chainId: params.chainId,
206
+ intent: (_params$intent = params.intent) !== null && _params$intent !== void 0 ? _params$intent : ACCOUNT_LINKING_INTENT.LINK,
207
+ status: ACCOUNT_LINKING_STATUS.INITIALIZING
208
+ }));
209
+ });
210
+ _defineProperty(this, "updateAccountLinkingState", accountLinking => {
211
+ this.accountLinkingState = _objectSpread(_objectSpread({}, this.accountLinkingState), accountLinking);
212
+ this.setState({
213
+ accountLinking: this.accountLinkingState
214
+ });
215
+ });
216
+ _defineProperty(this, "resetAccountLinkingSession", () => {
217
+ this.accountLinkingState = _objectSpread({}, DEFAULT_ACCOUNT_LINKING_STATE);
218
+ this.setState({
219
+ accountLinking: this.accountLinkingState
220
+ });
221
+ });
222
+ _defineProperty(this, "hasActiveAccountLinkingSession", () => {
223
+ return this.accountLinkingState.active;
224
+ });
225
+ _defineProperty(this, "startAccountLinkingPicker", params => {
226
+ this.accountLinkingState = _objectSpread(_objectSpread({}, DEFAULT_ACCOUNT_LINKING_STATE), {}, {
227
+ active: true,
228
+ pickerActive: true,
229
+ chainId: params.chainId,
230
+ intent: ACCOUNT_LINKING_INTENT.LINK
231
+ });
232
+ this.setState({
233
+ accountLinking: this.accountLinkingState,
234
+ currentPage: PAGES.WALLET_LIST,
235
+ modalVisibility: true,
236
+ status: MODAL_STATUS.INITIALIZED
237
+ });
238
+ if (this.callbacks.onModalVisibility) {
239
+ this.callbacks.onModalVisibility(true);
240
+ }
241
+ });
242
+ _defineProperty(this, "endAccountLinkingPicker", () => {
243
+ this.accountLinkingState = _objectSpread(_objectSpread({}, this.accountLinkingState), {}, {
244
+ pickerActive: false,
245
+ active: false
246
+ });
247
+ this.setState({
248
+ accountLinking: this.accountLinkingState
249
+ });
250
+ });
251
+ _defineProperty(this, "startConnectingLoader", params => {
252
+ this.setState({
253
+ status: MODAL_STATUS.CONNECTING,
254
+ modalVisibility: true,
255
+ detailedLoaderConnector: params.connector,
256
+ detailedLoaderConnectorName: params.connectorName
257
+ });
258
+ if (this.callbacks.onModalVisibility) {
259
+ this.callbacks.onModalVisibility(true);
260
+ }
261
+ });
262
+ _defineProperty(this, "markLoaderAuthorizing", () => {
263
+ this.setState({
264
+ status: MODAL_STATUS.AUTHORIZING
265
+ });
266
+ });
267
+ _defineProperty(this, "endConnectingLoader", params => {
268
+ if (params.success) {
269
+ var _params$successMessag;
270
+ if (params.skipSuccessScreen) {
271
+ this.setState({
272
+ modalVisibility: false
273
+ });
274
+ if (this.callbacks.onModalVisibility) {
275
+ this.callbacks.onModalVisibility(false);
276
+ }
277
+ return;
278
+ }
279
+ // Account-linking success is terminal regardless of authentication mode (no signing step),
280
+ // so emit the mode's terminal success status so the Loader renders the success UI and auto-closes:
281
+ // - CONNECT_AND_SIGN expects AUTHORIZED as terminal success.
282
+ // - Other modes expect CONNECTED.
283
+ const isConnectAndSign = this.uiConfig.initialAuthenticationMode === CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN;
284
+ this.setState({
285
+ status: isConnectAndSign ? MODAL_STATUS.AUTHORIZED : MODAL_STATUS.CONNECTED,
286
+ postLoadingMessage: (_params$successMessag = params.successMessage) !== null && _params$successMessag !== void 0 ? _params$successMessag : "modal.post-loading.connected"
287
+ });
288
+ return;
289
+ }
290
+ if (this.uiConfig.displayErrorsOnModal) {
291
+ this.setState({
292
+ modalVisibility: true,
293
+ status: MODAL_STATUS.ERRORED,
294
+ postLoadingMessage: params.errorMessage || "modal.post-loading.something-wrong"
295
+ });
296
+ } else {
297
+ this.setState({
298
+ modalVisibility: false
299
+ });
300
+ if (this.callbacks.onModalVisibility) {
301
+ this.callbacks.onModalVisibility(false);
302
+ }
303
+ }
304
+ });
198
305
  _defineProperty(this, "open", () => {
199
306
  var _this$analytics, _this$uiConfig$wallet, _this$uiConfig$wallet2;
200
307
  this.setState({
@@ -373,7 +480,8 @@ class LoginModal {
373
480
  listener.on(CONNECTOR_EVENTS.AUTHORIZED, () => {
374
481
  if (this.modalStatus === MODAL_STATUS.CONSENT_REQUIRING) return;
375
482
  this.setState({
376
- status: MODAL_STATUS.AUTHORIZED
483
+ status: MODAL_STATUS.AUTHORIZED,
484
+ postLoadingMessage: ""
377
485
  });
378
486
  });
379
487
  listener.on(CONNECTOR_EVENTS.CONSENT_REQUIRING, () => {
@@ -386,7 +494,8 @@ class LoginModal {
386
494
  if (this.uiConfig.initialAuthenticationMode === CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN) {
387
495
  this.setState({
388
496
  status: MODAL_STATUS.AUTHORIZED,
389
- modalVisibility: true
497
+ modalVisibility: true,
498
+ postLoadingMessage: ""
390
499
  });
391
500
  } else if (!data.reconnected) {
392
501
  this.setState({
@@ -431,8 +540,8 @@ class LoginModal {
431
540
  this.subscribeCoreEvents(this.uiConfig.connectorListener);
432
541
  }
433
542
  get consentRequired() {
434
- var _this$uiConfig$consen;
435
- return ((_this$uiConfig$consen = this.uiConfig.consentConfig) === null || _this$uiConfig$consen === void 0 ? void 0 : _this$uiConfig$consen.required) || false;
543
+ // consent required is true if the consent required is true and the privacy policy and tnc link are set
544
+ return this.uiConfig.consentRequired && Boolean(this.uiConfig.privacyPolicy) && Boolean(this.uiConfig.tncLink) || false;
436
545
  }
437
546
  get isDark() {
438
547
  return this.uiConfig.mode === "dark" || this.uiConfig.mode === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -1,4 +1,4 @@
1
+ export { useAuthTokenInfo, useChain, useCheckout, useEnableMFA, useFunding, useManageMFA, useReceive, useSwap, useSwitchChain, useWalletConnectScanner, useWalletServicesPlugin, useWalletUI, useWallets, useWeb3AuthDisconnect, useWeb3AuthUser } from '@web3auth/no-modal/vue';
1
2
  export { useWeb3Auth } from './composables/useWeb3Auth.js';
2
3
  export { useWeb3AuthConnect } from './composables/useWeb3AuthConnect.js';
3
- export { useAuthTokenInfo, useChain, useCheckout, useEnableMFA, useFunding, useManageMFA, useReceive, useSwap, useSwitchChain, useWalletConnectScanner, useWalletServicesPlugin, useWalletUI, useWeb3AuthDisconnect, useWeb3AuthUser } from '@web3auth/no-modal/vue';
4
4
  export { Web3AuthProvider } from './Web3AuthProvider.js';
@@ -5,9 +5,9 @@ import { injected } from '@wagmi/vue/connectors';
5
5
  import { randomId } from '@web3auth/auth';
6
6
  import { log, CHAIN_NAMESPACES, WalletInitializationError } from '@web3auth/no-modal';
7
7
  import { defineChain, webSocket, http, fallback } from 'viem';
8
- import { defineComponent, h, watch, provide, shallowRef, ref } from 'vue';
9
- import { useWeb3Auth } from '../composables/useWeb3Auth.js';
8
+ import { defineComponent, h, shallowRef, watch, provide, ref } from 'vue';
10
9
  import { useWeb3AuthDisconnect } from '@web3auth/no-modal/vue';
10
+ import { useWeb3Auth } from '../composables/useWeb3Auth.js';
11
11
  import { defaultWagmiConfig } from './constants.js';
12
12
 
13
13
  const WEB3AUTH_CONNECTOR_ID = "web3auth";
@@ -76,7 +76,8 @@ const Web3AuthWagmiProvider = defineComponent({
76
76
  setup() {
77
77
  const {
78
78
  isConnected,
79
- connection
79
+ connection,
80
+ web3Auth
80
81
  } = useWeb3Auth();
81
82
  const {
82
83
  disconnect
@@ -85,6 +86,7 @@ const Web3AuthWagmiProvider = defineComponent({
85
86
  const {
86
87
  mutate: reconnect
87
88
  } = useReconnect();
89
+ const lastSyncedWeb3AuthConnection = shallowRef(null);
88
90
  useConnectionEffect({
89
91
  onDisconnect: async () => {
90
92
  log.info("Disconnected from wagmi");
@@ -98,17 +100,28 @@ const Web3AuthWagmiProvider = defineComponent({
98
100
  }
99
101
  });
100
102
  watch([isConnected, connection], async () => {
101
- var _connection$value;
103
+ var _newConnection$ethere, _web3Auth$value;
102
104
  const newIsConnected = isConnected.value;
103
- if (newIsConnected && (_connection$value = connection.value) !== null && _connection$value !== void 0 && _connection$value.ethereumProvider) {
104
- const connector = await setupConnector(connection.value.ethereumProvider, wagmiConfig);
105
- if (!connector) {
106
- log.error("Failed to setup vue wagmi connector");
107
- throw new Error("Failed to setup connector");
105
+ const newConnection = connection.value;
106
+ const newEth = (_newConnection$ethere = newConnection === null || newConnection === void 0 ? void 0 : newConnection.ethereumProvider) !== null && _newConnection$ethere !== void 0 ? _newConnection$ethere : null;
107
+ if (newIsConnected && newConnection && newEth && newConnection.connectorName === ((_web3Auth$value = web3Auth.value) === null || _web3Auth$value === void 0 ? void 0 : _web3Auth$value.primaryConnectorName)) {
108
+ // `ethereumProvider` is a stable proxy (`commonJRPCProvider`) across account switches,
109
+ // so key wagmi resyncs off the Web3Auth connection object instead of provider identity.
110
+ if (lastSyncedWeb3AuthConnection.value !== newConnection) {
111
+ if (getWeb3authConnector(wagmiConfig)) {
112
+ resetConnectorState(wagmiConfig);
113
+ }
114
+ lastSyncedWeb3AuthConnection.value = newConnection;
115
+ const connector = await setupConnector(newEth, wagmiConfig);
116
+ if (!connector) {
117
+ log.error("Failed to setup vue wagmi connector");
118
+ throw new Error("Failed to setup connector");
119
+ }
120
+ await connectWeb3AuthWithWagmi(connector, wagmiConfig);
121
+ reconnect();
108
122
  }
109
- await connectWeb3AuthWithWagmi(connector, wagmiConfig);
110
- reconnect();
111
123
  } else if (!newIsConnected) {
124
+ lastSyncedWeb3AuthConnection.value = null;
112
125
  if (wagmiConfig.state.status === "connected") {
113
126
  await disconnectWeb3AuthFromWagmi(wagmiConfig);
114
127
  }
@@ -174,7 +187,7 @@ const WagmiProvider = defineComponent({
174
187
  return fallback(transports);
175
188
  };
176
189
  const defineWagmiConfig = () => {
177
- var _web3Auth$value;
190
+ var _web3Auth$value2;
178
191
  const configParams = _objectSpread(_objectSpread({
179
192
  ssr: true
180
193
  }, config), {}, {
@@ -185,7 +198,7 @@ const WagmiProvider = defineComponent({
185
198
  client: undefined
186
199
  });
187
200
  const wagmiChains = [];
188
- if (isInitialized.value && web3Auth !== null && web3Auth !== void 0 && (_web3Auth$value = web3Auth.value) !== null && _web3Auth$value !== void 0 && (_web3Auth$value = _web3Auth$value.coreOptions) !== null && _web3Auth$value !== void 0 && _web3Auth$value.chains) {
201
+ if (isInitialized.value && web3Auth !== null && web3Auth !== void 0 && (_web3Auth$value2 = web3Auth.value) !== null && _web3Auth$value2 !== void 0 && (_web3Auth$value2 = _web3Auth$value2.coreOptions) !== null && _web3Auth$value2 !== void 0 && _web3Auth$value2.chains) {
189
202
  var _web3Auth$value$curre;
190
203
  const defaultChainId = (_web3Auth$value$curre = web3Auth.value.currentChain) === null || _web3Auth$value$curre === void 0 ? void 0 : _web3Auth$value$curre.chainId;
191
204
  const chains = web3Auth.value.coreOptions.chains.filter(chain => chain.chainNamespace === CHAIN_NAMESPACES.EIP155);
@@ -233,8 +246,8 @@ const WagmiProvider = defineComponent({
233
246
  }
234
247
  };
235
248
  watch(isInitialized, (newIsInitialized, prevIsInitialized) => {
236
- var _web3Auth$value2;
237
- (_web3Auth$value2 = web3Auth.value) === null || _web3Auth$value2 === void 0 || _web3Auth$value2.setAnalyticsProperties({
249
+ var _web3Auth$value3;
250
+ (_web3Auth$value3 = web3Auth.value) === null || _web3Auth$value3 === void 0 || _web3Auth$value3.setAnalyticsProperties({
238
251
  wagmi_enabled: true
239
252
  });
240
253
  if (newIsInitialized && !prevIsInitialized) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web3auth/modal",
3
- "version": "11.0.0-beta.0",
3
+ "version": "11.0.0-beta.1",
4
4
  "description": "Multi chain wallet aggregator for web3Auth",
5
5
  "keywords": [
6
6
  "web3Auth/ui",
@@ -55,45 +55,44 @@
55
55
  "devDependencies": {
56
56
  "@babel/preset-react": "^7.28.5",
57
57
  "@coinbase/wallet-sdk": "^4.3.7",
58
- "@mertasan/tailwindcss-variables": "^2.7.0",
59
58
  "@rollup/plugin-json": "^6.1.0",
60
59
  "@rollup/plugin-replace": "^6.0.3",
61
60
  "@rollup/plugin-url": "^8.0.2",
62
61
  "@solana/client": "^1.7.0",
63
- "@solana/kit": "^6.5.0",
62
+ "@solana/kit": "^6.8.0",
64
63
  "@svgr/rollup": "^8.1.0",
65
64
  "@svgr/webpack": "^8.1.0",
65
+ "@tailwindcss/postcss": "^4.2.4",
66
66
  "@toruslabs/eslint-config-react": "^5.0.1",
67
67
  "@toruslabs/eslint-config-vue": "^5.0.1",
68
68
  "@toruslabs/isomorphic-style-loader": "^5.4.0",
69
- "@toruslabs/vue-components": "^8.1.2",
69
+ "@toruslabs/vue-components": "^9.0.1",
70
70
  "@types/react": "^19.2.14",
71
71
  "@types/react-dom": "^19.2.3",
72
- "@wagmi/core": "^3.4.1",
73
- "@wagmi/vue": "^0.5.1",
74
- "autoprefixer": "^10.4.27",
72
+ "@wagmi/core": "^3.4.7",
73
+ "@wagmi/vue": "^0.5.9",
75
74
  "css-loader": "^7.1.4",
76
75
  "live-server": "^1.2.2",
77
- "postcss": "^8.5.8",
76
+ "postcss": "^8.5.12",
78
77
  "postcss-loader": "^8.2.1",
79
78
  "postcss-prefix-selector": "^2.1.1",
80
- "react": "^19.2.4",
81
- "react-dom": "^19.2.4",
79
+ "react": "^19.2.5",
80
+ "react-dom": "^19.2.5",
82
81
  "rollup-plugin-postcss": "^4.0.2",
83
82
  "rollup-preserve-directives": "^1.1.3",
84
83
  "style-loader": "^4.0.0",
85
- "tailwindcss": "^3.4.17",
84
+ "tailwindcss": "^4.2.4",
86
85
  "url-loader": "^4.1.1",
87
- "viem": "^2.47.6",
88
- "vue": "^3.5.31",
89
- "wagmi": "^3.6.0"
86
+ "viem": "^2.48.4",
87
+ "vue": "^3.5.33",
88
+ "wagmi": "^3.6.8"
90
89
  },
91
90
  "dependencies": {
92
91
  "@hcaptcha/react-hcaptcha": "^2.0.2",
93
- "@toruslabs/base-controllers": "^9.5.0",
92
+ "@toruslabs/base-controllers": "^9.8.0",
94
93
  "@toruslabs/http-helpers": "^9.0.0",
95
- "@web3auth/auth": "^11.6.0",
96
- "@web3auth/no-modal": "^11.0.0-beta.0",
94
+ "@web3auth/auth": "^11.8.0",
95
+ "@web3auth/no-modal": "^11.0.0-beta.1",
97
96
  "@web3auth/ws-embed": "^6.0.0",
98
97
  "bowser": "^2.14.1",
99
98
  "classnames": "^2.5.1",
@@ -105,7 +104,7 @@
105
104
  "react-i18next": "^16.6.6",
106
105
  "react-qrcode-logo": "^4.0.0",
107
106
  "tailwind-merge": "^3.5.0",
108
- "vitest": "^4.1.2"
107
+ "vitest": "^4.1.5"
109
108
  },
110
109
  "exports": {
111
110
  ".": {
@@ -113,6 +112,21 @@
113
112
  "require": "./dist/lib.cjs/packages/modal/src/index.js",
114
113
  "types": "./dist/lib.cjs/types/index.d.ts"
115
114
  },
115
+ "./account-linking": {
116
+ "import": "./dist/lib.esm/packages/modal/src/account-linking/index.js",
117
+ "require": "./dist/lib.cjs/packages/modal/src/account-linking/index.js",
118
+ "types": "./dist/lib.cjs/types/account-linking/index.d.ts"
119
+ },
120
+ "./account-linking/react": {
121
+ "import": "./dist/lib.esm/packages/modal/src/account-linking/react.js",
122
+ "require": "./dist/lib.cjs/packages/modal/src/account-linking/react.js",
123
+ "types": "./dist/lib.cjs/types/account-linking/react.d.ts"
124
+ },
125
+ "./account-linking/vue": {
126
+ "import": "./dist/lib.esm/packages/modal/src/account-linking/vue.js",
127
+ "require": "./dist/lib.cjs/packages/modal/src/account-linking/vue.js",
128
+ "types": "./dist/lib.cjs/types/account-linking/vue.d.ts"
129
+ },
116
130
  "./x402": {
117
131
  "import": "./dist/lib.esm/packages/modal/src/x402/index.js",
118
132
  "require": "./dist/lib.cjs/packages/modal/src/x402/index.js",
@@ -171,6 +185,15 @@
171
185
  },
172
186
  "typesVersions": {
173
187
  "*": {
188
+ "account-linking": [
189
+ "./dist/lib.cjs/types/account-linking/index.d.ts"
190
+ ],
191
+ "account-linking/react": [
192
+ "./dist/lib.cjs/types/account-linking/react.d.ts"
193
+ ],
194
+ "account-linking/vue": [
195
+ "./dist/lib.cjs/types/account-linking/vue.d.ts"
196
+ ],
174
197
  "x402": [
175
198
  "./dist/lib.cjs/types/x402/index.d.ts"
176
199
  ],
@@ -227,5 +250,5 @@
227
250
  "type": "git",
228
251
  "url": "git+https://github.com/Web3Auth/Web3Auth.git"
229
252
  },
230
- "gitHead": "992aabbd96cd8f19e6cdab1bebf498bb15157024"
253
+ "gitHead": "a15a4f552ee844c7b743f48f4b725c52b6b7316d"
231
254
  }