@web3auth/modal 11.0.0-beta.0 → 11.0.0-beta.2
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/README.md +4 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
- package/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +446 -26
- package/dist/lib.cjs/packages/modal/src/react/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +27 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/config.js +3 -1
- package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.cjs/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/Login.js +48 -42
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +1 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +113 -4
- package/dist/lib.cjs/packages/modal/src/vue/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +27 -14
- package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
- package/dist/lib.cjs/types/modalManager.d.ts +40 -2
- package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/Root/Root.d.ts +1 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +43 -8
- package/dist/lib.cjs/types/ui/loginModal.d.ts +27 -2
- package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
- package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
- package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +451 -28
- package/dist/lib.esm/packages/modal/src/react/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +28 -13
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/config.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.esm/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/Login.js +49 -43
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +24 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +115 -6
- package/dist/lib.esm/packages/modal/src/vue/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +28 -15
- package/package.json +43 -20
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var modal = {
|
|
6
|
+
"account-linking.failed-connect-wallet": "连接{{wallet}}失败。",
|
|
7
|
+
"account-linking.failed-switch-wallet": "使用{{wallet}}切换钱包失败。",
|
|
8
|
+
"account-linking.initializing-wallet": "正在初始化{{wallet}}...",
|
|
9
|
+
"account-linking.linking-wallet": "正在关联钱包...",
|
|
10
|
+
"account-linking.preparing-wallet-qr": "正在准备{{wallet}} QR码...",
|
|
11
|
+
"account-linking.scan-wallet": "使用{{wallet}}扫描QR码。",
|
|
12
|
+
"account-linking.scan-walletconnect": "使用兼容WalletConnect的钱包扫描QR码。",
|
|
13
|
+
"account-linking.switching-wallet": "正在切换钱包...",
|
|
14
|
+
"account-linking.wallet-connected-preparing-linking": "钱包已连接。正在准备账户关联...",
|
|
15
|
+
"account-linking.wallet-connected-preparing-switch": "钱包已连接。正在准备账户切换...",
|
|
16
|
+
"account-linking.wallet-linked": "钱包已关联。",
|
|
17
|
+
"account-linking.wallet-switched": "钱包已切换。",
|
|
6
18
|
"adapter-loader.message": "验证您的{{adapter}}帐户以继续",
|
|
7
19
|
"adapter-loader.message1": "在您的{{adapter}}上验证",
|
|
8
20
|
"adapter-loader.message2": "帐号继续",
|
|
@@ -53,6 +65,7 @@ var modal = {
|
|
|
53
65
|
"header-title": "登录",
|
|
54
66
|
"header-tooltip-desc": "钱包作为一个账户用于在区块链上存储和管理您的数字资产。",
|
|
55
67
|
"header-tooltip-title": "钱包",
|
|
68
|
+
linkYourWallet: "关联您的钱包",
|
|
56
69
|
"loader.authorizing-header": "{{connector}}验证",
|
|
57
70
|
"loader.authorizing-message": "我们已经向您的钱包发送了请求。请在您的钱包上确认,以确认您拥有此钱包。",
|
|
58
71
|
"loader.authorizing-verify-btn": "点击此处进行验证",
|
|
@@ -103,6 +116,7 @@ var modal = {
|
|
|
103
116
|
"social.view-more-socials": "查看更多socials"
|
|
104
117
|
};
|
|
105
118
|
var passwordless = {
|
|
119
|
+
"captcha-default-error": "验证过程中发生意外错误。请重新加载页面。",
|
|
106
120
|
"error-invalid-link": "无效的验证链接或链接已过期",
|
|
107
121
|
"error-invalid-origin": "出问题了, 错误代码: E002",
|
|
108
122
|
"error-invalid-otp": "无效的OTP,请重试",
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var modal = {
|
|
6
|
+
"account-linking.failed-connect-wallet": "Falha ao conectar com {{wallet}}.",
|
|
7
|
+
"account-linking.failed-switch-wallet": "Falha ao trocar carteira com {{wallet}}.",
|
|
8
|
+
"account-linking.initializing-wallet": "Inicializando {{wallet}}...",
|
|
9
|
+
"account-linking.linking-wallet": "Vinculando carteira...",
|
|
10
|
+
"account-linking.preparing-wallet-qr": "Preparando código QR do {{wallet}}...",
|
|
11
|
+
"account-linking.scan-wallet": "Digitalize o código QR com {{wallet}}.",
|
|
12
|
+
"account-linking.scan-walletconnect": "Digitalize o código QR com uma carteira compatível com WalletConnect.",
|
|
13
|
+
"account-linking.switching-wallet": "Trocando carteira...",
|
|
14
|
+
"account-linking.wallet-connected-preparing-linking": "Carteira conectada. Preparando vinculação de conta...",
|
|
15
|
+
"account-linking.wallet-connected-preparing-switch": "Carteira conectada. Preparando troca de conta...",
|
|
16
|
+
"account-linking.wallet-linked": "Carteira vinculada.",
|
|
17
|
+
"account-linking.wallet-switched": "Carteira trocada.",
|
|
6
18
|
"adapter-loader.message": "Verifique a sua conta {{adapter}} para continuar",
|
|
7
19
|
"adapter-loader.message1": "Verifique o(a) seu/sua {{adapter}}",
|
|
8
20
|
"adapter-loader.message2": "conta para continuar",
|
|
@@ -53,6 +65,7 @@ var modal = {
|
|
|
53
65
|
"header-title": "Entrar",
|
|
54
66
|
"header-tooltip-desc": "A carteira serve como uma conta para armazenar e gerenciar seus ativos digitais na blockchain.",
|
|
55
67
|
"header-tooltip-title": "Carteira",
|
|
68
|
+
linkYourWallet: "Vincule sua carteira",
|
|
56
69
|
"loader.authorizing-header": "Verificar em {{connector}}",
|
|
57
70
|
"loader.authorizing-message": "Enviamos uma solicitação para seu portfólio. Verifique no seu portfólio para confirmar que você possui este portfólio.",
|
|
58
71
|
"loader.authorizing-verify-btn": "Clique aqui para verificar",
|
|
@@ -103,6 +116,7 @@ var modal = {
|
|
|
103
116
|
"social.view-more-socials": "Ver mais socials"
|
|
104
117
|
};
|
|
105
118
|
var passwordless = {
|
|
119
|
+
"captcha-default-error": "Ocorreu um erro inesperado durante a verificação. Por favor, tente recarregar a página.",
|
|
106
120
|
"error-invalid-link": "Link de verificação inválido ou link expirado",
|
|
107
121
|
"error-invalid-origin": "Algo deu errado, código de erro: E002",
|
|
108
122
|
"error-invalid-otp": "OTP inválido, por favor tente novamente",
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var modal = {
|
|
6
|
+
"account-linking.failed-connect-wallet": "Error al conectar con {{wallet}}.",
|
|
7
|
+
"account-linking.failed-switch-wallet": "Error al cambiar la billetera con {{wallet}}.",
|
|
8
|
+
"account-linking.initializing-wallet": "Inicializando {{wallet}}...",
|
|
9
|
+
"account-linking.linking-wallet": "Vinculando billetera...",
|
|
10
|
+
"account-linking.preparing-wallet-qr": "Preparando el código QR de {{wallet}}...",
|
|
11
|
+
"account-linking.scan-wallet": "Escanea el código QR con {{wallet}}.",
|
|
12
|
+
"account-linking.scan-walletconnect": "Escanea el código QR con una billetera compatible con WalletConnect.",
|
|
13
|
+
"account-linking.switching-wallet": "Cambiando billetera...",
|
|
14
|
+
"account-linking.wallet-connected-preparing-linking": "Billetera conectada. Preparando vinculación de cuenta...",
|
|
15
|
+
"account-linking.wallet-connected-preparing-switch": "Billetera conectada. Preparando cambio de cuenta...",
|
|
16
|
+
"account-linking.wallet-linked": "Billetera vinculada.",
|
|
17
|
+
"account-linking.wallet-switched": "Billetera cambiada.",
|
|
6
18
|
"adapter-loader.message": "Verifica tu cuenta {{adapter}} para continuar",
|
|
7
19
|
"adapter-loader.message1": "Verifique su {{adapter}}",
|
|
8
20
|
"adapter-loader.message2": "cuenta para continuar",
|
|
@@ -53,6 +65,7 @@ var modal = {
|
|
|
53
65
|
"header-title": "Iniciar sesión",
|
|
54
66
|
"header-tooltip-desc": "La billetera sirve como una cuenta para almacenar y administrar sus activos digitales en la blockchain.",
|
|
55
67
|
"header-tooltip-title": "Billetera",
|
|
68
|
+
linkYourWallet: "Vincula tu billetera",
|
|
56
69
|
"loader.authorizing-header": "Verificar en {{connector}}",
|
|
57
70
|
"loader.authorizing-message": "Hemos enviado una solicitud a su cartera. Verifique en su cartera para confirmar que posee esta cartera.",
|
|
58
71
|
"loader.authorizing-verify-btn": "Haga clic aquí para verificar",
|
|
@@ -103,6 +116,7 @@ var modal = {
|
|
|
103
116
|
"social.view-more-socials": "Ver más socials"
|
|
104
117
|
};
|
|
105
118
|
var passwordless = {
|
|
119
|
+
"captcha-default-error": "Se ha producido un error inesperado durante la verificación. Por favor, inténtelo de nuevo recargando la página.",
|
|
106
120
|
"error-invalid-link": "El enlace o el enlace de verificación ha expirado",
|
|
107
121
|
"error-invalid-origin": "Algo salió mal, código de error: E002",
|
|
108
122
|
"error-invalid-otp": "OTP no válido, intente nuevamente",
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var modal = {
|
|
6
|
+
"account-linking.failed-connect-wallet": "{{wallet}} ile bağlantı kurulamadı.",
|
|
7
|
+
"account-linking.failed-switch-wallet": "{{wallet}} ile cüzdan değiştirme başarısız oldu.",
|
|
8
|
+
"account-linking.initializing-wallet": "{{wallet}} başlatılıyor...",
|
|
9
|
+
"account-linking.linking-wallet": "Cüzdan bağlanıyor...",
|
|
10
|
+
"account-linking.preparing-wallet-qr": "{{wallet}} QR kodu hazırlanıyor...",
|
|
11
|
+
"account-linking.scan-wallet": "QR kodunu {{wallet}} ile tarayın.",
|
|
12
|
+
"account-linking.scan-walletconnect": "QR kodunu WalletConnect uyumlu bir cüzdanla tarayın.",
|
|
13
|
+
"account-linking.switching-wallet": "Cüzdan değiştiriliyor...",
|
|
14
|
+
"account-linking.wallet-connected-preparing-linking": "Cüzdan bağlandı. Hesap bağlantısı hazırlanıyor...",
|
|
15
|
+
"account-linking.wallet-connected-preparing-switch": "Cüzdan bağlandı. Hesap değişimi hazırlanıyor...",
|
|
16
|
+
"account-linking.wallet-linked": "Cüzdan bağlandı.",
|
|
17
|
+
"account-linking.wallet-switched": "Cüzdan değiştirildi.",
|
|
6
18
|
"adapter-loader.message": "Devam etmek için {{adapter}} hesabınızı doğrula",
|
|
7
19
|
"adapter-loader.message1": "{{adapter}} doğrula",
|
|
8
20
|
"adapter-loader.message2": "devam edecek hesap",
|
|
@@ -53,6 +65,7 @@ var modal = {
|
|
|
53
65
|
"header-title": "Giriş yap",
|
|
54
66
|
"header-tooltip-desc": "Cüzdan, dijital varlıklarınızı blockchain'de saklama ve yönetme görevi görür.",
|
|
55
67
|
"header-tooltip-title": "Cüzdan",
|
|
68
|
+
linkYourWallet: "Cüzdanınızı bağlayın",
|
|
56
69
|
"loader.authorizing-header": "{{connector}} ile doğrula",
|
|
57
70
|
"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.",
|
|
58
71
|
"loader.authorizing-verify-btn": "Doğrulamak için buraya tıklayın",
|
|
@@ -103,6 +116,7 @@ var modal = {
|
|
|
103
116
|
"social.view-more-socials": "Daha fazlasını görüntüle socials"
|
|
104
117
|
};
|
|
105
118
|
var passwordless = {
|
|
119
|
+
"captcha-default-error": "Doğrulama sırasında beklenmedik bir hata oluştu. Lütfen sayfayı yeniden yükleyin.",
|
|
106
120
|
"error-invalid-link": "Hatalı ya da süresi geçmiş doğrulama linki",
|
|
107
121
|
"error-invalid-origin": "Bir şeyler ters gitti, hata kodu: E002",
|
|
108
122
|
"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
|
exports.TOAST_TYPE = void 0;
|
|
16
39
|
(function (TOAST_TYPE) {
|
|
17
40
|
TOAST_TYPE["SUCCESS"] = "success";
|
|
@@ -20,5 +43,8 @@ exports.TOAST_TYPE = void 0;
|
|
|
20
43
|
TOAST_TYPE["INFO"] = "info";
|
|
21
44
|
})(exports.TOAST_TYPE || (exports.TOAST_TYPE = {}));
|
|
22
45
|
|
|
46
|
+
exports.ACCOUNT_LINKING_INTENT = ACCOUNT_LINKING_INTENT;
|
|
47
|
+
exports.ACCOUNT_LINKING_STATUS = ACCOUNT_LINKING_STATUS;
|
|
48
|
+
exports.DEFAULT_ACCOUNT_LINKING_STATE = DEFAULT_ACCOUNT_LINKING_STATE;
|
|
23
49
|
exports.LOGIN_MODAL_EVENTS = LOGIN_MODAL_EVENTS;
|
|
24
50
|
exports.MODAL_STATUS = MODAL_STATUS;
|
|
@@ -44,6 +44,7 @@ class LoginModal {
|
|
|
44
44
|
_defineProperty(this, "externalWalletsConfig", void 0);
|
|
45
45
|
_defineProperty(this, "analytics", void 0);
|
|
46
46
|
_defineProperty(this, "modalStatus", interfaces.MODAL_STATUS.INITIALIZED);
|
|
47
|
+
_defineProperty(this, "accountLinkingState", _objectSpread({}, interfaces.DEFAULT_ACCOUNT_LINKING_STATE));
|
|
47
48
|
_defineProperty(this, "initModal", async () => {
|
|
48
49
|
const useLang = this.uiConfig.defaultLanguage || auth.LANGUAGES.en;
|
|
49
50
|
// Load new language resource
|
|
@@ -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({}, interfaces.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 : interfaces.ACCOUNT_LINKING_INTENT.LINK,
|
|
207
|
+
status: interfaces.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({}, interfaces.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({}, interfaces.DEFAULT_ACCOUNT_LINKING_STATE), {}, {
|
|
227
|
+
active: true,
|
|
228
|
+
pickerActive: true,
|
|
229
|
+
chainId: params.chainId,
|
|
230
|
+
intent: interfaces.ACCOUNT_LINKING_INTENT.LINK
|
|
231
|
+
});
|
|
232
|
+
this.setState({
|
|
233
|
+
accountLinking: this.accountLinkingState,
|
|
234
|
+
currentPage: constants.PAGES.WALLET_LIST,
|
|
235
|
+
modalVisibility: true,
|
|
236
|
+
status: interfaces.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: interfaces.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: interfaces.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 === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN;
|
|
284
|
+
this.setState({
|
|
285
|
+
status: isConnectAndSign ? interfaces.MODAL_STATUS.AUTHORIZED : interfaces.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: interfaces.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({
|
|
@@ -372,7 +479,8 @@ class LoginModal {
|
|
|
372
479
|
listener.on(noModal.CONNECTOR_EVENTS.AUTHORIZED, () => {
|
|
373
480
|
if (this.modalStatus === interfaces.MODAL_STATUS.CONSENT_REQUIRING) return;
|
|
374
481
|
this.setState({
|
|
375
|
-
status: interfaces.MODAL_STATUS.AUTHORIZED
|
|
482
|
+
status: interfaces.MODAL_STATUS.AUTHORIZED,
|
|
483
|
+
postLoadingMessage: ""
|
|
376
484
|
});
|
|
377
485
|
});
|
|
378
486
|
listener.on(noModal.CONNECTOR_EVENTS.CONSENT_REQUIRING, () => {
|
|
@@ -385,7 +493,8 @@ class LoginModal {
|
|
|
385
493
|
if (this.uiConfig.initialAuthenticationMode === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN) {
|
|
386
494
|
this.setState({
|
|
387
495
|
status: interfaces.MODAL_STATUS.AUTHORIZED,
|
|
388
|
-
modalVisibility: true
|
|
496
|
+
modalVisibility: true,
|
|
497
|
+
postLoadingMessage: ""
|
|
389
498
|
});
|
|
390
499
|
} else if (!data.reconnected) {
|
|
391
500
|
this.setState({
|
|
@@ -430,8 +539,8 @@ class LoginModal {
|
|
|
430
539
|
this.subscribeCoreEvents(this.uiConfig.connectorListener);
|
|
431
540
|
}
|
|
432
541
|
get consentRequired() {
|
|
433
|
-
|
|
434
|
-
return
|
|
542
|
+
// consent required is true if the consent required is true and the privacy policy and tnc link are set
|
|
543
|
+
return this.uiConfig.consentRequired && Boolean(this.uiConfig.privacyPolicy) && Boolean(this.uiConfig.tncLink) || false;
|
|
435
544
|
}
|
|
436
545
|
get isDark() {
|
|
437
546
|
return this.uiConfig.mode === "dark" || this.uiConfig.mode === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var vue = require('@web3auth/no-modal/vue');
|
|
3
4
|
var useWeb3Auth = require('./composables/useWeb3Auth.js');
|
|
4
5
|
var useWeb3AuthConnect = require('./composables/useWeb3AuthConnect.js');
|
|
5
|
-
var vue = require('@web3auth/no-modal/vue');
|
|
6
6
|
var Web3AuthProvider = require('./Web3AuthProvider.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.useWeb3Auth = useWeb3Auth.useWeb3Auth;
|
|
11
|
-
exports.useWeb3AuthConnect = useWeb3AuthConnect.useWeb3AuthConnect;
|
|
12
10
|
Object.defineProperty(exports, "useAuthTokenInfo", {
|
|
13
11
|
enumerable: true,
|
|
14
12
|
get: function () { return vue.useAuthTokenInfo; }
|
|
@@ -57,6 +55,10 @@ Object.defineProperty(exports, "useWalletUI", {
|
|
|
57
55
|
enumerable: true,
|
|
58
56
|
get: function () { return vue.useWalletUI; }
|
|
59
57
|
});
|
|
58
|
+
Object.defineProperty(exports, "useWallets", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return vue.useWallets; }
|
|
61
|
+
});
|
|
60
62
|
Object.defineProperty(exports, "useWeb3AuthDisconnect", {
|
|
61
63
|
enumerable: true,
|
|
62
64
|
get: function () { return vue.useWeb3AuthDisconnect; }
|
|
@@ -65,4 +67,6 @@ Object.defineProperty(exports, "useWeb3AuthUser", {
|
|
|
65
67
|
enumerable: true,
|
|
66
68
|
get: function () { return vue.useWeb3AuthUser; }
|
|
67
69
|
});
|
|
70
|
+
exports.useWeb3Auth = useWeb3Auth.useWeb3Auth;
|
|
71
|
+
exports.useWeb3AuthConnect = useWeb3AuthConnect.useWeb3AuthConnect;
|
|
68
72
|
exports.Web3AuthProvider = Web3AuthProvider.Web3AuthProvider;
|
|
@@ -8,8 +8,8 @@ var auth = require('@web3auth/auth');
|
|
|
8
8
|
var noModal = require('@web3auth/no-modal');
|
|
9
9
|
var viem = require('viem');
|
|
10
10
|
var vue = require('vue');
|
|
11
|
-
var useWeb3Auth = require('../composables/useWeb3Auth.js');
|
|
12
11
|
var vue$1 = require('@web3auth/no-modal/vue');
|
|
12
|
+
var useWeb3Auth = require('../composables/useWeb3Auth.js');
|
|
13
13
|
var constants = require('./constants.js');
|
|
14
14
|
|
|
15
15
|
const WEB3AUTH_CONNECTOR_ID = "web3auth";
|
|
@@ -75,7 +75,8 @@ const Web3AuthWagmiProvider = vue.defineComponent({
|
|
|
75
75
|
setup() {
|
|
76
76
|
const {
|
|
77
77
|
isConnected,
|
|
78
|
-
connection
|
|
78
|
+
connection,
|
|
79
|
+
web3Auth
|
|
79
80
|
} = useWeb3Auth.useWeb3Auth();
|
|
80
81
|
const {
|
|
81
82
|
disconnect
|
|
@@ -84,6 +85,7 @@ const Web3AuthWagmiProvider = vue.defineComponent({
|
|
|
84
85
|
const {
|
|
85
86
|
mutate: reconnect
|
|
86
87
|
} = vue$2.useReconnect();
|
|
88
|
+
const lastSyncedWeb3AuthConnection = vue.shallowRef(null);
|
|
87
89
|
vue$2.useConnectionEffect({
|
|
88
90
|
onDisconnect: async () => {
|
|
89
91
|
noModal.log.info("Disconnected from wagmi");
|
|
@@ -97,17 +99,28 @@ const Web3AuthWagmiProvider = vue.defineComponent({
|
|
|
97
99
|
}
|
|
98
100
|
});
|
|
99
101
|
vue.watch([isConnected, connection], async () => {
|
|
100
|
-
var
|
|
102
|
+
var _newConnection$ethere, _web3Auth$value;
|
|
101
103
|
const newIsConnected = isConnected.value;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const newConnection = connection.value;
|
|
105
|
+
const newEth = (_newConnection$ethere = newConnection === null || newConnection === void 0 ? void 0 : newConnection.ethereumProvider) !== null && _newConnection$ethere !== void 0 ? _newConnection$ethere : null;
|
|
106
|
+
if (newIsConnected && newConnection && newEth && newConnection.connectorName === ((_web3Auth$value = web3Auth.value) === null || _web3Auth$value === void 0 ? void 0 : _web3Auth$value.primaryConnectorName)) {
|
|
107
|
+
// `ethereumProvider` is a stable proxy (`commonJRPCProvider`) across account switches,
|
|
108
|
+
// so key wagmi resyncs off the Web3Auth connection object instead of provider identity.
|
|
109
|
+
if (lastSyncedWeb3AuthConnection.value !== newConnection) {
|
|
110
|
+
if (getWeb3authConnector(wagmiConfig)) {
|
|
111
|
+
resetConnectorState(wagmiConfig);
|
|
112
|
+
}
|
|
113
|
+
lastSyncedWeb3AuthConnection.value = newConnection;
|
|
114
|
+
const connector = await setupConnector(newEth, wagmiConfig);
|
|
115
|
+
if (!connector) {
|
|
116
|
+
noModal.log.error("Failed to setup vue wagmi connector");
|
|
117
|
+
throw new Error("Failed to setup connector");
|
|
118
|
+
}
|
|
119
|
+
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
120
|
+
reconnect();
|
|
107
121
|
}
|
|
108
|
-
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
109
|
-
reconnect();
|
|
110
122
|
} else if (!newIsConnected) {
|
|
123
|
+
lastSyncedWeb3AuthConnection.value = null;
|
|
111
124
|
if (wagmiConfig.state.status === "connected") {
|
|
112
125
|
await disconnectWeb3AuthFromWagmi(wagmiConfig);
|
|
113
126
|
}
|
|
@@ -173,7 +186,7 @@ const WagmiProvider = vue.defineComponent({
|
|
|
173
186
|
return viem.fallback(transports);
|
|
174
187
|
};
|
|
175
188
|
const defineWagmiConfig = () => {
|
|
176
|
-
var _web3Auth$
|
|
189
|
+
var _web3Auth$value2;
|
|
177
190
|
const configParams = _objectSpread(_objectSpread({
|
|
178
191
|
ssr: true
|
|
179
192
|
}, config), {}, {
|
|
@@ -184,7 +197,7 @@ const WagmiProvider = vue.defineComponent({
|
|
|
184
197
|
client: undefined
|
|
185
198
|
});
|
|
186
199
|
const wagmiChains = [];
|
|
187
|
-
if (isInitialized.value && web3Auth !== null && web3Auth !== void 0 && (_web3Auth$
|
|
200
|
+
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) {
|
|
188
201
|
var _web3Auth$value$curre;
|
|
189
202
|
const defaultChainId = (_web3Auth$value$curre = web3Auth.value.currentChain) === null || _web3Auth$value$curre === void 0 ? void 0 : _web3Auth$value$curre.chainId;
|
|
190
203
|
const chains = web3Auth.value.coreOptions.chains.filter(chain => chain.chainNamespace === noModal.CHAIN_NAMESPACES.EIP155);
|
|
@@ -232,8 +245,8 @@ const WagmiProvider = vue.defineComponent({
|
|
|
232
245
|
}
|
|
233
246
|
};
|
|
234
247
|
vue.watch(isInitialized, (newIsInitialized, prevIsInitialized) => {
|
|
235
|
-
var _web3Auth$
|
|
236
|
-
(_web3Auth$
|
|
248
|
+
var _web3Auth$value3;
|
|
249
|
+
(_web3Auth$value3 = web3Auth.value) === null || _web3Auth$value3 === void 0 || _web3Auth$value3.setAnalyticsProperties({
|
|
237
250
|
wagmi_enabled: true
|
|
238
251
|
});
|
|
239
252
|
if (newIsInitialized && !prevIsInitialized) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@web3auth/no-modal/account-linking";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { CITADEL_NETWORK, CitadelLinkAccountPayload, IUseLinkAccount, IUseSwitchAccount, LinkAccountParams, LinkAccountResult, LinkedAccountInfo, UnlinkAccountPayload, UnlinkAccountResult, } from "@web3auth/no-modal/account-linking/react";
|
|
2
|
+
export { makeAccountLinkingRequest, makeAccountUnlinkingRequest, useLinkAccount, useSwitchAccount } from "@web3auth/no-modal/account-linking/react";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { CITADEL_NETWORK, CitadelLinkAccountPayload, IUseLinkAccount, IUseSwitchAccount, LinkAccountParams, LinkAccountResult, LinkedAccountInfo, UnlinkAccountPayload, UnlinkAccountResult, } from "@web3auth/no-modal/account-linking/vue";
|
|
2
|
+
export { makeAccountLinkingRequest, makeAccountUnlinkingRequest, useLinkAccount, useSwitchAccount } from "@web3auth/no-modal/account-linking/vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Connection, type IWeb3AuthCoreOptions, IWeb3AuthState, LoginModeType, type ProjectConfig, Web3AuthNoModal } from "@web3auth/no-modal";
|
|
1
|
+
import { type Connection, type IConnector, type IWeb3AuthCoreOptions, IWeb3AuthState, type LinkAccountParams, type LinkAccountResult, type LinkedAccountInfo, LoginModeType, type ProjectConfig, type WALLET_CONNECTOR_TYPE, Web3AuthNoModal } from "@web3auth/no-modal";
|
|
2
2
|
import { type ConnectorsModalConfig, type IWeb3AuthModal } from "./interface";
|
|
3
|
-
import { LoginModal, type UIConfig } from "./ui";
|
|
3
|
+
import { ACCOUNT_LINKING_INTENT, type AccountLinkingState, LoginModal, type UIConfig } from "./ui";
|
|
4
4
|
export interface Web3AuthOptions extends IWeb3AuthCoreOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Config for configuring modal ui display properties
|
|
@@ -16,12 +16,29 @@ export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal
|
|
|
16
16
|
loginMode: LoginModeType;
|
|
17
17
|
readonly options: Web3AuthOptions;
|
|
18
18
|
private modalConfig;
|
|
19
|
+
private removeAccountLinkingConnectorListeners;
|
|
20
|
+
private removeAccountLinkingResetOnCloseListener;
|
|
21
|
+
private accountLinkingPickerResolver;
|
|
22
|
+
private removeAccountLinkingPickerCloseListener;
|
|
19
23
|
constructor(options: Web3AuthOptions, initialState?: Partial<IWeb3AuthState>);
|
|
20
24
|
init(options?: {
|
|
21
25
|
signal?: AbortSignal;
|
|
22
26
|
}): Promise<void>;
|
|
23
27
|
connect(): Promise<Connection | null>;
|
|
24
28
|
acceptConsent(): Promise<void>;
|
|
29
|
+
switchAccount(account: LinkedAccountInfo): Promise<void>;
|
|
30
|
+
linkAccount(params?: LinkAccountParams): Promise<LinkAccountResult>;
|
|
31
|
+
protected startAccountLinkingModalSession(params: {
|
|
32
|
+
connectorName: WALLET_CONNECTOR_TYPE | string;
|
|
33
|
+
transportConnectorName?: WALLET_CONNECTOR_TYPE | string;
|
|
34
|
+
chainId: string;
|
|
35
|
+
intent: (typeof ACCOUNT_LINKING_INTENT)[keyof typeof ACCOUNT_LINKING_INTENT];
|
|
36
|
+
}): void;
|
|
37
|
+
protected updateAccountLinkingModalSession(accountLinking: Partial<AccountLinkingState>): void;
|
|
38
|
+
protected resetAccountLinkingModalSession(): void;
|
|
39
|
+
protected formatAccountLinkingErrorMessage(error: unknown): string | undefined;
|
|
40
|
+
protected prepareAccountLinkingConnector(connectorName: WALLET_CONNECTOR_TYPE | string, chainId: string): Promise<IConnector<unknown>>;
|
|
41
|
+
protected prepareAccountSwitchConnector(connectorName: WALLET_CONNECTOR_TYPE | string, chainId: string, projectConfig?: ProjectConfig): Promise<IConnector<unknown>>;
|
|
25
42
|
protected initUIConfig(projectConfig: ProjectConfig): void;
|
|
26
43
|
protected getInitializationTrackData(): Record<string, unknown>;
|
|
27
44
|
private filterWalletRegistry;
|
|
@@ -39,5 +56,26 @@ export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal
|
|
|
39
56
|
private onAcceptConsent;
|
|
40
57
|
private onDeclineConsent;
|
|
41
58
|
private getChainNamespaces;
|
|
59
|
+
private switchToWalletConnectV2Account;
|
|
60
|
+
/**
|
|
61
|
+
* Runs a link/switch action for WalletConnect v2, racing connector.connect()
|
|
62
|
+
* against a modal-close promise to cancel and clean up the WC session if the
|
|
63
|
+
* user closes the modal during QR scanning.
|
|
64
|
+
* For synchronous connectors use {@link runNonWalletConnectAccountAction}.
|
|
65
|
+
*/
|
|
66
|
+
private runWalletConnectV2AccountAction;
|
|
67
|
+
private linkAccountWithChosenConnector;
|
|
68
|
+
private pickWalletForAccountLinking;
|
|
69
|
+
/**
|
|
70
|
+
* Runs a link/switch action for synchronous connectors (injected wallets, already-connected).
|
|
71
|
+
* Shows the connecting loader, forwards AUTHORIZING events to the modal, and
|
|
72
|
+
* resolves/rejects the loader on completion.
|
|
73
|
+
* For WalletConnect v2 use {@link runWalletConnectV2AccountAction}.
|
|
74
|
+
*/
|
|
75
|
+
private runNonWalletConnectAccountAction;
|
|
76
|
+
private subscribeToAccountLinkingConnectorEvents;
|
|
77
|
+
private clearAccountLinkingConnectorListeners;
|
|
78
|
+
private installAccountLinkingResetOnCloseListener;
|
|
79
|
+
private clearAccountLinkingResetOnCloseListener;
|
|
42
80
|
private getCombinedConnectionId;
|
|
43
81
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./useWallets";
|
|
1
2
|
export * from "./useWeb3Auth";
|
|
2
3
|
export * from "./useWeb3AuthConnect";
|
|
3
4
|
export type { IUseAuthTokenInfo, IUseChain, IUseCheckout, IUseEnableMFA, IUseFunding, IUseManageMFA, IUseReceive, IUseSwap, IUseSwitchChain, IUseWalletConnectScanner, IUseWalletUI, IUseWeb3AuthDisconnect, IUseWeb3AuthUser, } from "@web3auth/no-modal/react";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ExternalButton } from "../../interfaces";
|
|
2
|
+
interface AccountLinkingProps {
|
|
3
|
+
allExternalWallets: ExternalButton[];
|
|
4
|
+
}
|
|
5
|
+
declare function AccountLinking(props: AccountLinkingProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default AccountLinking;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./AccountLinking";
|
|
@@ -45,14 +45,6 @@ export interface UIConfig extends CoreUIConfig, LoginModalConfig {
|
|
|
45
45
|
*/
|
|
46
46
|
hideSuccessScreen?: boolean;
|
|
47
47
|
connectorListener: SafeEventEmitter<Web3AuthNoModalEvents>;
|
|
48
|
-
/**
|
|
49
|
-
* Config for consent required.
|
|
50
|
-
*
|
|
51
|
-
* @defaultValue `undefined`
|
|
52
|
-
*/
|
|
53
|
-
consentConfig?: {
|
|
54
|
-
required: boolean;
|
|
55
|
-
};
|
|
56
48
|
}
|
|
57
49
|
export type ModalLoginParams = Pick<AuthLoginParams, "authConnection" | "authConnectionId" | "groupedAuthConnectionId" | "loginHint" | "extraLoginOptions"> & {
|
|
58
50
|
name: string;
|
|
@@ -104,6 +96,48 @@ export declare const MODAL_STATUS: {
|
|
|
104
96
|
readonly CONSENT_REQUIRING: "consent_requiring";
|
|
105
97
|
};
|
|
106
98
|
export type ModalStatusType = (typeof MODAL_STATUS)[keyof typeof MODAL_STATUS];
|
|
99
|
+
export declare const ACCOUNT_LINKING_STATUS: {
|
|
100
|
+
readonly IDLE: "idle";
|
|
101
|
+
readonly INITIALIZING: "initializing";
|
|
102
|
+
readonly AWAITING_CONNECTION: "awaiting_connection";
|
|
103
|
+
readonly WALLET_CONNECTED: "wallet_connected";
|
|
104
|
+
readonly LINKING: "linking";
|
|
105
|
+
readonly ERRORED: "errored";
|
|
106
|
+
readonly COMPLETED: "completed";
|
|
107
|
+
};
|
|
108
|
+
export type AccountLinkingStatusType = (typeof ACCOUNT_LINKING_STATUS)[keyof typeof ACCOUNT_LINKING_STATUS];
|
|
109
|
+
export declare const ACCOUNT_LINKING_INTENT: {
|
|
110
|
+
readonly LINK: "link";
|
|
111
|
+
readonly SWITCH: "switch";
|
|
112
|
+
};
|
|
113
|
+
export type AccountLinkingIntentType = (typeof ACCOUNT_LINKING_INTENT)[keyof typeof ACCOUNT_LINKING_INTENT];
|
|
114
|
+
export interface AccountLinkingState {
|
|
115
|
+
active: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* True when the modal is showing the wallet picker for `linkAccount()` called
|
|
118
|
+
* without a `connectorName`. The user's selection in the ConnectWallet UI will
|
|
119
|
+
* be routed to the linking flow instead of the regular login flow.
|
|
120
|
+
*/
|
|
121
|
+
pickerActive: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* The name of the wallet to be linked to.
|
|
124
|
+
*/
|
|
125
|
+
connectorName: WALLET_CONNECTOR_TYPE | string | null;
|
|
126
|
+
/**
|
|
127
|
+
* The underlying actual connector that is used to connect to the target account.
|
|
128
|
+
* This is different from the connectorName coz except for Metamask, others wallet can be used to connect with injectedEvmConnector/solanaStandardWalletConnector if installed.
|
|
129
|
+
* Otherwise, will fallback to the wallet-connect connector.
|
|
130
|
+
*
|
|
131
|
+
* This is useful when we want to rehydrate the linked account, using this transport connector to connect back to the target account.
|
|
132
|
+
**/
|
|
133
|
+
transportConnectorName: WALLET_CONNECTOR_TYPE | string | null;
|
|
134
|
+
chainId: string | null;
|
|
135
|
+
intent: AccountLinkingIntentType;
|
|
136
|
+
status: AccountLinkingStatusType;
|
|
137
|
+
walletConnectUri?: string;
|
|
138
|
+
errorMessage: string;
|
|
139
|
+
}
|
|
140
|
+
export declare const DEFAULT_ACCOUNT_LINKING_STATE: AccountLinkingState;
|
|
107
141
|
export interface ModalState {
|
|
108
142
|
status: ModalStatusType;
|
|
109
143
|
modalVisibility: boolean;
|
|
@@ -117,6 +151,7 @@ export interface ModalState {
|
|
|
117
151
|
showExternalWalletsOnly: boolean;
|
|
118
152
|
walletConnectUri: string;
|
|
119
153
|
metamaskConnectUri: string;
|
|
154
|
+
accountLinking: AccountLinkingState;
|
|
120
155
|
socialLoginsConfig: SocialLoginsConfig;
|
|
121
156
|
externalWalletsConfig: Record<string, BaseConnectorConfig>;
|
|
122
157
|
}
|