@springmicro/auth 0.3.0 → 0.3.5

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 (148) hide show
  1. package/.eslintrc.cjs +0 -0
  2. package/README.md +60 -60
  3. package/dist/{Index-c419311f-DolmVisI.js → Index-64ac63ff-mcEPPGzJ.js} +101 -102
  4. package/dist/{Index-652aeb8c-Cr1mbyJJ.js → Index-6c094240-D4xpr8fA.js} +70 -71
  5. package/dist/{Web3Auth-C5tucK1E.js → Web3Auth-DB9s-qbl.js} +12454 -12511
  6. package/dist/alphawallet-B7eovdf-.js +0 -0
  7. package/dist/apexwallet-ysP20G9D.js +0 -0
  8. package/dist/atoken-BBnNTzcz.js +0 -0
  9. package/dist/bifrostwallet-CNNBO92h.js +0 -0
  10. package/dist/binance-DvPgAzCw.js +0 -0
  11. package/dist/bitget-DZOUrwgy.js +0 -0
  12. package/dist/bitpie-C_uxmEzw.js +0 -0
  13. package/dist/bitski-DpzkHNkv.js +0 -0
  14. package/dist/blockwallet-BL69cqkA.js +0 -0
  15. package/dist/brave-DnRzMQYW.js +0 -0
  16. package/dist/ccip-c78d2f16-DLcRlwod.js +0 -0
  17. package/dist/coin98wallet-CkFdOvXt.js +0 -0
  18. package/dist/coinbase-CaGNx5if.js +0 -0
  19. package/dist/core-9rK8tWud.js +0 -0
  20. package/dist/defiwallet-0AsgJBSy.js +0 -0
  21. package/dist/detected-CX_JZaUk.js +0 -0
  22. package/dist/echooo-CmaetT_Z.js +0 -0
  23. package/dist/enkrypt-BibtwvK7.js +0 -0
  24. package/dist/exodus-BxzkDWWP.js +0 -0
  25. package/dist/fordefi-CvKyVwhI.js +0 -0
  26. package/dist/foxwallet-D7c_LDTf.js +0 -0
  27. package/dist/frame-CDfNmjUy.js +0 -0
  28. package/dist/frontier-DqKNSj2z.js +0 -0
  29. package/dist/hashMessage-Dw0KdqMZ.js +2101 -0
  30. package/dist/huobiwallet-CxSwqa5L.js +0 -0
  31. package/dist/hyperpay-nmHE3WqM.js +0 -0
  32. package/dist/icon-2Zqy7pqQ.js +0 -0
  33. package/dist/icon-CGWI1Ies.js +0 -0
  34. package/dist/icon-C_O4nprO.js +0 -0
  35. package/dist/icon-DbgmZCnU.js +0 -0
  36. package/dist/icon-Dbjb6jc5.js +20 -0
  37. package/dist/icon-cAd7RhSC.js +0 -0
  38. package/dist/imtoken-yENtOTS3.js +0 -0
  39. package/dist/index-021f6a62-Zz543EDB.js +0 -0
  40. package/dist/index-40a497ea-Bn2mC0r7.js +0 -0
  41. package/dist/{index-YKlm7xSx.js → index-C0yeApwY.js} +750 -751
  42. package/dist/{index-C4uVsW-I.js → index-CDaoza_m.js} +2 -2
  43. package/dist/index-CiwBcaZ0.js +384 -0
  44. package/dist/{index-DOUI-2vv.js → index-CroNOC7e.js} +27 -29
  45. package/dist/{index-Boi-WcMK.js → index-Df5ie3cE.js} +2 -2
  46. package/dist/{index-DzOmdGpF.js → index-F-gl3DJX.js} +8 -10
  47. package/dist/index-wNV8PBAh.js +11412 -0
  48. package/dist/index.d.ts +0 -0
  49. package/dist/index.js +1 -1
  50. package/dist/index.umd.cjs +327 -291
  51. package/dist/infinitywallet-C8J4FUYw.js +0 -0
  52. package/dist/kayros-AIrUK1za.js +0 -0
  53. package/dist/keplr-CyLTca9B.js +36 -0
  54. package/dist/lif3wallet-C5D6r8pg.js +0 -0
  55. package/dist/liquality-nbCtErVq.js +0 -0
  56. package/dist/mathwallet-CWkivCXo.js +0 -0
  57. package/dist/meetone-kKmvI8md.js +0 -0
  58. package/dist/metamask-BN7yiDV1.js +0 -0
  59. package/dist/mykey-CQZ6UcLH.js +0 -0
  60. package/dist/native-FDN9oNjc.js +15 -0
  61. package/dist/{number-UhidYs-H.js → number-ByqdQYDu.js} +1 -1
  62. package/dist/okxwallet-CJLVogh2.js +0 -0
  63. package/dist/oneInch-CciyZ4Pz.js +0 -0
  64. package/dist/onekey-Dal8kYjU.js +0 -0
  65. package/dist/opera-DnKg-TJU.js +0 -0
  66. package/dist/ownbit-BshJUVuW.js +0 -0
  67. package/dist/phantom-CJ8dIcov.js +0 -0
  68. package/dist/rabby-D4thTcd6.js +0 -0
  69. package/dist/rainbow-mXld6yWV.js +0 -0
  70. package/dist/roninwallet-ZyYrd-D1.js +0 -0
  71. package/dist/safeheron-Eg1Jb29V.js +0 -0
  72. package/dist/safepal-DVIKy94N.js +0 -0
  73. package/dist/sequence-BS2IbtDg.js +0 -0
  74. package/dist/stablewallet-jyB079Wb.js +0 -0
  75. package/dist/status-FrAvQjfn.js +0 -0
  76. package/dist/subwallet-DMvFqKyY.js +0 -0
  77. package/dist/talisman-Bp8zUXqB.js +0 -0
  78. package/dist/tallywallet-B4OS9nIr.js +0 -0
  79. package/dist/tokenary-C7jjcbQa.js +0 -0
  80. package/dist/tokenpocket-9ZRPmAFA.js +0 -0
  81. package/dist/tp-V2em5bdl.js +0 -0
  82. package/dist/transactionRequest-be6a8ea9-CUKWo5mx.js +0 -0
  83. package/dist/trust-SgHubMq7.js +20 -0
  84. package/dist/xdefi-COVIyGz4.js +0 -0
  85. package/dist/zeal-DxHbDqm0.js +0 -0
  86. package/dist/zerion-BfW0UElc.js +0 -0
  87. package/dist/zodiacpilot-CrId6F4w.js +0 -0
  88. package/index.html +0 -0
  89. package/package.json +2 -2
  90. package/src/auth/config.ts +91 -91
  91. package/src/components/SignUp.tsx +442 -442
  92. package/src/components/forms/AgreementModal.tsx +88 -88
  93. package/src/components/forms/CaptchaController.tsx +94 -94
  94. package/src/components/forms/CaptchaModal.jsx +171 -171
  95. package/src/components/forms/CaptchaWidget.jsx +146 -146
  96. package/src/components/forms/PasswordChecker.ts +88 -88
  97. package/src/components/forms/SendCodeInput.tsx +149 -149
  98. package/src/components/forms/SignUpFormItem.tsx +704 -704
  99. package/src/components/forms/util/application-api.ts +155 -155
  100. package/src/components/forms/util/auth-api.ts +198 -198
  101. package/src/components/forms/util/auth-util.tsx +346 -346
  102. package/src/components/forms/util/core.ts +493 -493
  103. package/src/components/forms/util/invitation-api.ts +132 -132
  104. package/src/components/forms/util/provider.tsx +603 -603
  105. package/src/components/forms/util/user-api.ts +303 -303
  106. package/src/components/provider/AdfsLoginButton.jsx +38 -38
  107. package/src/components/provider/AlipayLoginButton.jsx +38 -38
  108. package/src/components/provider/AppleLoginButton.jsx +38 -38
  109. package/src/components/provider/AzureADB2CLoginButton.jsx +38 -38
  110. package/src/components/provider/AzureADLoginButton.jsx +38 -38
  111. package/src/components/provider/BaiduLoginButton.jsx +38 -38
  112. package/src/components/provider/BilibiliLoginButton.jsx +37 -37
  113. package/src/components/provider/CasdoorLoginButton.jsx +38 -38
  114. package/src/components/provider/DingTalkLoginButton.jsx +37 -37
  115. package/src/components/provider/DouyinLoginButton.jsx +38 -38
  116. package/src/components/provider/FacebookLoginButton.jsx +37 -37
  117. package/src/components/provider/GitHubLoginButton.jsx +37 -37
  118. package/src/components/provider/GitLabLoginButton.jsx +38 -38
  119. package/src/components/provider/GiteeLoginButton.jsx +34 -34
  120. package/src/components/provider/GoogleLoginButton.jsx +68 -68
  121. package/src/components/provider/InfoflowLoginButton.jsx +38 -38
  122. package/src/components/provider/LarkLoginButton.jsx +38 -38
  123. package/src/components/provider/LinkedInLoginButton.jsx +37 -37
  124. package/src/components/provider/LoginButton.jsx +33 -33
  125. package/src/components/provider/OktaLoginButton.jsx +38 -38
  126. package/src/components/provider/Provider.jsx +3 -3
  127. package/src/components/provider/ProviderButton.jsx +327 -327
  128. package/src/components/provider/QqLoginButton.jsx +31 -31
  129. package/src/components/provider/SelfLoginButton.jsx +47 -47
  130. package/src/components/provider/SlackLoginButton.jsx +38 -38
  131. package/src/components/provider/SteamLoginButton.jsx +38 -38
  132. package/src/components/provider/WeComLoginButton.jsx +34 -34
  133. package/src/components/provider/Web3Auth.jsx +365 -365
  134. package/src/components/provider/WechatLoginButton.jsx +37 -37
  135. package/src/components/provider/WeiboLoginButton.jsx +34 -34
  136. package/src/components/util.tsx +173 -173
  137. package/src/i18n/en/signup.json +48 -48
  138. package/src/i18n/index.ts +17 -17
  139. package/src/index.tsx +8 -8
  140. package/src/vite-env.d.ts +0 -0
  141. package/tsconfig.json +0 -0
  142. package/tsconfig.node.json +0 -0
  143. package/vite.config.ts +33 -33
  144. package/dist/icon-duCa3gfT.js +0 -11
  145. package/dist/index-BtLU53lm.js +0 -6023
  146. package/dist/index-CLfsMiG4.js +0 -2021
  147. package/dist/index-DPq81SIn.js +0 -161
  148. package/dist/trust-gPypS1O7.js +0 -11
@@ -1,5 +1,5 @@
1
- import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-UhidYs-H.js";
2
- import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth-C5tucK1E.js";
1
+ import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-ByqdQYDu.js";
2
+ import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth-DB9s-qbl.js";
3
3
  const et = /* @__PURE__ */ e({
4
4
  id: 787,
5
5
  name: "Acala",
@@ -0,0 +1,384 @@
1
+ import { e as y, h as T, a as k } from "./hashMessage-Dw0KdqMZ.js";
2
+ const I = () => "9.1.0", q = (t) => t.toString(16).padStart(2, "0"), v = (t) => {
3
+ const e = new Uint8Array(t / 2);
4
+ return window.crypto.getRandomValues(e), Array.from(e, q).join("");
5
+ }, C = () => typeof window < "u" ? v(10) : (/* @__PURE__ */ new Date()).getTime().toString(36);
6
+ class g {
7
+ }
8
+ g.makeRequest = (t, e) => ({
9
+ id: C(),
10
+ method: t,
11
+ params: e,
12
+ env: {
13
+ sdkVersion: I()
14
+ }
15
+ });
16
+ g.makeResponse = (t, e, s) => ({
17
+ id: t,
18
+ success: !0,
19
+ version: s,
20
+ data: e
21
+ });
22
+ g.makeErrorResponse = (t, e, s) => ({
23
+ id: t,
24
+ success: !1,
25
+ error: e,
26
+ version: s
27
+ });
28
+ var r;
29
+ (function(t) {
30
+ t.sendTransactions = "sendTransactions", t.rpcCall = "rpcCall", t.getChainInfo = "getChainInfo", t.getSafeInfo = "getSafeInfo", t.getTxBySafeTxHash = "getTxBySafeTxHash", t.getSafeBalances = "getSafeBalances", t.signMessage = "signMessage", t.signTypedMessage = "signTypedMessage", t.getEnvironmentInfo = "getEnvironmentInfo", t.getOffChainSignature = "getOffChainSignature", t.requestAddressBook = "requestAddressBook", t.wallet_getPermissions = "wallet_getPermissions", t.wallet_requestPermissions = "wallet_requestPermissions";
31
+ })(r || (r = {}));
32
+ var m;
33
+ (function(t) {
34
+ t.requestAddressBook = "requestAddressBook";
35
+ })(m || (m = {}));
36
+ class R {
37
+ constructor(e = null, s = !1) {
38
+ this.allowedOrigins = null, this.callbacks = /* @__PURE__ */ new Map(), this.debugMode = !1, this.isServer = typeof window > "u", this.isValidMessage = ({ origin: a, data: n, source: i }) => {
39
+ const o = !n, l = !this.isServer && i === window.parent, u = typeof n.version < "u" && parseInt(n.version.split(".")[0]), B = typeof u == "number" && u >= 1;
40
+ let p = !0;
41
+ return Array.isArray(this.allowedOrigins) && (p = this.allowedOrigins.find((P) => P.test(a)) !== void 0), !o && l && B && p;
42
+ }, this.logIncomingMessage = (a) => {
43
+ console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `, a.data);
44
+ }, this.onParentMessage = (a) => {
45
+ this.isValidMessage(a) && (this.debugMode && this.logIncomingMessage(a), this.handleIncomingMessage(a.data));
46
+ }, this.handleIncomingMessage = (a) => {
47
+ const { id: n } = a, i = this.callbacks.get(n);
48
+ i && (i(a), this.callbacks.delete(n));
49
+ }, this.send = (a, n) => {
50
+ const i = g.makeRequest(a, n);
51
+ if (this.isServer)
52
+ throw new Error("Window doesn't exist");
53
+ return window.parent.postMessage(i, "*"), new Promise((o, l) => {
54
+ this.callbacks.set(i.id, (u) => {
55
+ if (!u.success) {
56
+ l(new Error(u.error));
57
+ return;
58
+ }
59
+ o(u);
60
+ });
61
+ });
62
+ }, this.allowedOrigins = e, this.debugMode = s, this.isServer || window.addEventListener("message", this.onParentMessage);
63
+ }
64
+ }
65
+ const b = (t) => typeof t == "object" && t != null && "domain" in t && "types" in t && "message" in t;
66
+ class H {
67
+ constructor(e) {
68
+ this.communicator = e;
69
+ }
70
+ async getBySafeTxHash(e) {
71
+ if (!e)
72
+ throw new Error("Invalid safeTxHash");
73
+ return (await this.communicator.send(r.getTxBySafeTxHash, { safeTxHash: e })).data;
74
+ }
75
+ async signMessage(e) {
76
+ const s = {
77
+ message: e
78
+ };
79
+ return (await this.communicator.send(r.signMessage, s)).data;
80
+ }
81
+ async signTypedMessage(e) {
82
+ if (!b(e))
83
+ throw new Error("Invalid typed data");
84
+ return (await this.communicator.send(r.signTypedMessage, { typedData: e })).data;
85
+ }
86
+ async send({ txs: e, params: s }) {
87
+ if (!e || !e.length)
88
+ throw new Error("No transactions were passed");
89
+ const a = {
90
+ txs: e,
91
+ params: s
92
+ };
93
+ return (await this.communicator.send(r.sendTransactions, a)).data;
94
+ }
95
+ }
96
+ const c = {
97
+ eth_call: "eth_call",
98
+ eth_gasPrice: "eth_gasPrice",
99
+ eth_getLogs: "eth_getLogs",
100
+ eth_getBalance: "eth_getBalance",
101
+ eth_getCode: "eth_getCode",
102
+ eth_getBlockByHash: "eth_getBlockByHash",
103
+ eth_getBlockByNumber: "eth_getBlockByNumber",
104
+ eth_getStorageAt: "eth_getStorageAt",
105
+ eth_getTransactionByHash: "eth_getTransactionByHash",
106
+ eth_getTransactionReceipt: "eth_getTransactionReceipt",
107
+ eth_getTransactionCount: "eth_getTransactionCount",
108
+ eth_estimateGas: "eth_estimateGas",
109
+ safe_setSettings: "safe_setSettings"
110
+ }, h = {
111
+ defaultBlockParam: (t = "latest") => t,
112
+ returnFullTxObjectParam: (t = !1) => t,
113
+ blockNumberToHex: (t) => Number.isInteger(t) ? `0x${t.toString(16)}` : t
114
+ };
115
+ class E {
116
+ constructor(e) {
117
+ this.communicator = e, this.call = this.buildRequest({
118
+ call: c.eth_call,
119
+ formatters: [null, h.defaultBlockParam]
120
+ }), this.getBalance = this.buildRequest({
121
+ call: c.eth_getBalance,
122
+ formatters: [null, h.defaultBlockParam]
123
+ }), this.getCode = this.buildRequest({
124
+ call: c.eth_getCode,
125
+ formatters: [null, h.defaultBlockParam]
126
+ }), this.getStorageAt = this.buildRequest({
127
+ call: c.eth_getStorageAt,
128
+ formatters: [null, h.blockNumberToHex, h.defaultBlockParam]
129
+ }), this.getPastLogs = this.buildRequest({
130
+ call: c.eth_getLogs
131
+ }), this.getBlockByHash = this.buildRequest({
132
+ call: c.eth_getBlockByHash,
133
+ formatters: [null, h.returnFullTxObjectParam]
134
+ }), this.getBlockByNumber = this.buildRequest({
135
+ call: c.eth_getBlockByNumber,
136
+ formatters: [h.blockNumberToHex, h.returnFullTxObjectParam]
137
+ }), this.getTransactionByHash = this.buildRequest({
138
+ call: c.eth_getTransactionByHash
139
+ }), this.getTransactionReceipt = this.buildRequest({
140
+ call: c.eth_getTransactionReceipt
141
+ }), this.getTransactionCount = this.buildRequest({
142
+ call: c.eth_getTransactionCount,
143
+ formatters: [null, h.defaultBlockParam]
144
+ }), this.getGasPrice = this.buildRequest({
145
+ call: c.eth_gasPrice
146
+ }), this.getEstimateGas = (s) => this.buildRequest({
147
+ call: c.eth_estimateGas
148
+ })([s]), this.setSafeSettings = this.buildRequest({
149
+ call: c.safe_setSettings
150
+ });
151
+ }
152
+ buildRequest(e) {
153
+ const { call: s, formatters: a } = e;
154
+ return async (n) => {
155
+ a && Array.isArray(n) && a.forEach((l, u) => {
156
+ l && (n[u] = l(n[u]));
157
+ });
158
+ const i = {
159
+ call: s,
160
+ params: n || []
161
+ };
162
+ return (await this.communicator.send(r.rpcCall, i)).data;
163
+ };
164
+ }
165
+ }
166
+ const A = "0x1626ba7e", x = "0x20c13b0b", f = 4001;
167
+ class d extends Error {
168
+ constructor(e, s, a) {
169
+ super(e), this.code = s, this.data = a, Object.setPrototypeOf(this, d.prototype);
170
+ }
171
+ }
172
+ class S {
173
+ constructor(e) {
174
+ this.communicator = e;
175
+ }
176
+ async getPermissions() {
177
+ return (await this.communicator.send(r.wallet_getPermissions, void 0)).data;
178
+ }
179
+ async requestPermissions(e) {
180
+ if (!this.isPermissionRequestValid(e))
181
+ throw new d("Permissions request is invalid", f);
182
+ try {
183
+ return (await this.communicator.send(r.wallet_requestPermissions, e)).data;
184
+ } catch {
185
+ throw new d("Permissions rejected", f);
186
+ }
187
+ }
188
+ isPermissionRequestValid(e) {
189
+ return e.every((s) => typeof s == "object" ? Object.keys(s).every((a) => !!Object.values(m).includes(a)) : !1);
190
+ }
191
+ }
192
+ const w = (t, e) => e.some((s) => s.parentCapability === t), O = () => (t, e, s) => {
193
+ const a = s.value;
194
+ return s.value = async function() {
195
+ const n = new S(this.communicator);
196
+ let i = await n.getPermissions();
197
+ if (w(e, i) || (i = await n.requestPermissions([{ [e]: {} }])), !w(e, i))
198
+ throw new d("Permissions rejected", f);
199
+ return a.apply(this);
200
+ }, s;
201
+ };
202
+ var V = function(t, e, s, a) {
203
+ var n = arguments.length, i = n < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, o;
204
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
205
+ else for (var l = t.length - 1; l >= 0; l--) (o = t[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, s, i) : o(e, s)) || i);
206
+ return n > 3 && i && Object.defineProperty(e, s, i), i;
207
+ };
208
+ class _ {
209
+ constructor(e) {
210
+ this.communicator = e;
211
+ }
212
+ async getChainInfo() {
213
+ return (await this.communicator.send(r.getChainInfo, void 0)).data;
214
+ }
215
+ async getInfo() {
216
+ return (await this.communicator.send(r.getSafeInfo, void 0)).data;
217
+ }
218
+ // There is a possibility that this method will change because we may add pagination to the endpoint
219
+ async experimental_getBalances({ currency: e = "usd" } = {}) {
220
+ return (await this.communicator.send(r.getSafeBalances, {
221
+ currency: e
222
+ })).data;
223
+ }
224
+ async check1271Signature(e, s = "0x") {
225
+ const a = await this.getInfo(), n = y({
226
+ abi: [
227
+ {
228
+ constant: !1,
229
+ inputs: [
230
+ {
231
+ name: "_dataHash",
232
+ type: "bytes32"
233
+ },
234
+ {
235
+ name: "_signature",
236
+ type: "bytes"
237
+ }
238
+ ],
239
+ name: "isValidSignature",
240
+ outputs: [
241
+ {
242
+ name: "",
243
+ type: "bytes4"
244
+ }
245
+ ],
246
+ payable: !1,
247
+ stateMutability: "nonpayable",
248
+ type: "function"
249
+ }
250
+ ],
251
+ functionName: "isValidSignature",
252
+ args: [e, s]
253
+ }), i = {
254
+ call: c.eth_call,
255
+ params: [
256
+ {
257
+ to: a.safeAddress,
258
+ data: n
259
+ },
260
+ "latest"
261
+ ]
262
+ };
263
+ try {
264
+ return (await this.communicator.send(r.rpcCall, i)).data.slice(0, 10).toLowerCase() === A;
265
+ } catch {
266
+ return !1;
267
+ }
268
+ }
269
+ async check1271SignatureBytes(e, s = "0x") {
270
+ const a = await this.getInfo(), n = y({
271
+ abi: [
272
+ {
273
+ constant: !1,
274
+ inputs: [
275
+ {
276
+ name: "_data",
277
+ type: "bytes"
278
+ },
279
+ {
280
+ name: "_signature",
281
+ type: "bytes"
282
+ }
283
+ ],
284
+ name: "isValidSignature",
285
+ outputs: [
286
+ {
287
+ name: "",
288
+ type: "bytes4"
289
+ }
290
+ ],
291
+ payable: !1,
292
+ stateMutability: "nonpayable",
293
+ type: "function"
294
+ }
295
+ ],
296
+ functionName: "isValidSignature",
297
+ args: [e, s]
298
+ }), i = {
299
+ call: c.eth_call,
300
+ params: [
301
+ {
302
+ to: a.safeAddress,
303
+ data: n
304
+ },
305
+ "latest"
306
+ ]
307
+ };
308
+ try {
309
+ return (await this.communicator.send(r.rpcCall, i)).data.slice(0, 10).toLowerCase() === x;
310
+ } catch {
311
+ return !1;
312
+ }
313
+ }
314
+ calculateMessageHash(e) {
315
+ return T(e);
316
+ }
317
+ calculateTypedMessageHash(e) {
318
+ const s = typeof e.domain.chainId == "object" ? e.domain.chainId.toNumber() : Number(e.domain.chainId);
319
+ let a = e.primaryType;
320
+ if (!a) {
321
+ const n = Object.values(e.types), i = Object.keys(e.types).filter((o) => n.every((l) => l.every(({ type: u }) => u.replace("[", "").replace("]", "") !== o)));
322
+ if (i.length === 0 || i.length > 1)
323
+ throw new Error("Please specify primaryType");
324
+ a = i[0];
325
+ }
326
+ return k({
327
+ message: e.message,
328
+ domain: {
329
+ ...e.domain,
330
+ chainId: s,
331
+ verifyingContract: e.domain.verifyingContract,
332
+ salt: e.domain.salt
333
+ },
334
+ types: e.types,
335
+ primaryType: a
336
+ });
337
+ }
338
+ async getOffChainSignature(e) {
339
+ return (await this.communicator.send(r.getOffChainSignature, e)).data;
340
+ }
341
+ async isMessageSigned(e, s = "0x") {
342
+ let a;
343
+ if (typeof e == "string" && (a = async () => {
344
+ const n = this.calculateMessageHash(e);
345
+ return await this.isMessageHashSigned(n, s);
346
+ }), b(e) && (a = async () => {
347
+ const n = this.calculateTypedMessageHash(e);
348
+ return await this.isMessageHashSigned(n, s);
349
+ }), a)
350
+ return await a();
351
+ throw new Error("Invalid message type");
352
+ }
353
+ async isMessageHashSigned(e, s = "0x") {
354
+ const a = [this.check1271Signature.bind(this), this.check1271SignatureBytes.bind(this)];
355
+ for (const n of a)
356
+ if (await n(e, s))
357
+ return !0;
358
+ return !1;
359
+ }
360
+ async getEnvironmentInfo() {
361
+ return (await this.communicator.send(r.getEnvironmentInfo, void 0)).data;
362
+ }
363
+ async requestAddressBook() {
364
+ return (await this.communicator.send(r.requestAddressBook, void 0)).data;
365
+ }
366
+ }
367
+ V([
368
+ O()
369
+ ], _.prototype, "requestAddressBook", null);
370
+ class j {
371
+ constructor(e = {}) {
372
+ const { allowedDomains: s = null, debug: a = !1 } = e;
373
+ this.communicator = new R(s, a), this.eth = new E(this.communicator), this.txs = new H(this.communicator), this.safe = new _(this.communicator), this.wallet = new S(this.communicator);
374
+ }
375
+ }
376
+ export {
377
+ g as MessageFormatter,
378
+ r as Methods,
379
+ c as RPC_CALLS,
380
+ m as RestrictedMethods,
381
+ j as default,
382
+ I as getSDKVersion,
383
+ b as isObjectEIP712TypedData
384
+ };
@@ -1,7 +1,7 @@
1
- import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth-C5tucK1E.js";
2
- import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac, J as Tc, K as Ic } from "./Web3Auth-C5tucK1E.js";
3
- import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-UhidYs-H.js";
4
- import { X as Sc, Y as kc, Z as Nc, _ as Rc, a6 as $c, a7 as Cc, a8 as jc, a9 as Fc, ab as qc, $ as Mc, ac as zc, a0 as Lc, a2 as _c, a3 as Dc, V as Hc, a4 as Gc, ae as Uc, af as Vc, ad as Zc, ag as Wc, aa as Yc, a5 as Jc, a1 as Kc } from "./number-UhidYs-H.js";
1
+ import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth-DB9s-qbl.js";
2
+ import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac } from "./Web3Auth-DB9s-qbl.js";
3
+ import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-ByqdQYDu.js";
4
+ import { X as Ic, Y as Oc, Z as Sc, _ as kc, a6 as Nc, a7 as Rc, a8 as $c, a9 as Cc, ab as jc, $ as Fc, ac as qc, a0 as Mc, a2 as zc, a3 as Lc, V as _c, a4 as Dc, ae as Hc, af as Gc, ad as Uc, ag as Vc, aa as Zc, a5 as Wc, a1 as Yc } from "./number-ByqdQYDu.js";
5
5
  function Ls(e, t) {
6
6
  const n = e.exec(t);
7
7
  return n == null ? void 0 : n.groups;
@@ -6024,15 +6024,15 @@ export {
6024
6024
  ve as InvalidAddressError,
6025
6025
  Qs as InvalidArrayError,
6026
6026
  ms as InvalidBytesBooleanError,
6027
- Sc as InvalidChainIdError,
6027
+ Ic as InvalidChainIdError,
6028
6028
  eo as InvalidDefinitionTypeError,
6029
6029
  dc as InvalidHexBooleanError,
6030
6030
  Pe as InvalidInputRpcError,
6031
- kc as InvalidLegacyVError,
6031
+ Oc as InvalidLegacyVError,
6032
6032
  Ke as InvalidParamsRpcError,
6033
6033
  Ye as InvalidRequestRpcError,
6034
- Nc as InvalidSerializableTransactionError,
6035
- Rc as InvalidStorageKeySizeError,
6034
+ Sc as InvalidSerializableTransactionError,
6035
+ kc as InvalidStorageKeySizeError,
6036
6036
  nt as JsonRpcVersionUnsupportedError,
6037
6037
  $e as LimitExceededRpcError,
6038
6038
  Lo as MaxFeePerGasTooLowError,
@@ -6068,9 +6068,9 @@ export {
6068
6068
  ke as UserRejectedRequestError,
6069
6069
  Gn as WaitForTransactionReceiptTimeoutError,
6070
6070
  hn as assertRequest,
6071
- $c as assertTransactionEIP1559,
6072
- Cc as assertTransactionEIP2930,
6073
- jc as assertTransactionLegacy,
6071
+ Nc as assertTransactionEIP1559,
6072
+ Rc as assertTransactionEIP2930,
6073
+ $c as assertTransactionLegacy,
6074
6074
  As as blobsToCommitments,
6075
6075
  Is as blobsToProofs,
6076
6076
  yc as boolToBytes,
@@ -6083,10 +6083,10 @@ export {
6083
6083
  Kr as ccipFetch,
6084
6084
  Kr as ccipRequest,
6085
6085
  xs as checksumAddress,
6086
- Fc as commitmentToVersionedHash,
6086
+ Cc as commitmentToVersionedHash,
6087
6087
  Ts as commitmentsToVersionedHashes,
6088
6088
  ee as concat,
6089
- qc as concatBytes,
6089
+ jc as concatBytes,
6090
6090
  br as concatHex,
6091
6091
  ua as createClient,
6092
6092
  cc as createPublicClient,
@@ -6095,11 +6095,11 @@ export {
6095
6095
  Ir as decodeErrorResult,
6096
6096
  wn as decodeEventLog,
6097
6097
  Le as decodeFunctionResult,
6098
- Mc as defineBlock,
6099
- zc as defineChain,
6100
- Lc as defineTransaction,
6101
- _c as defineTransactionReceipt,
6102
- Dc as defineTransactionRequest,
6098
+ Fc as defineBlock,
6099
+ qc as defineChain,
6100
+ Mc as defineTransaction,
6101
+ zc as defineTransactionReceipt,
6102
+ Lc as defineTransactionRequest,
6103
6103
  Me as encodeAbiParameters,
6104
6104
  ri as encodeDeployData,
6105
6105
  pt as encodeEventTopics,
@@ -6139,7 +6139,7 @@ export {
6139
6139
  Re as isHex,
6140
6140
  W as keccak256,
6141
6141
  ma as labelhash,
6142
- Hc as maxUint16,
6142
+ _c as maxUint16,
6143
6143
  Kt as multicall3Abi,
6144
6144
  Et as namehash,
6145
6145
  Pc as numberToBytes,
@@ -6150,27 +6150,25 @@ export {
6150
6150
  Bc as pad,
6151
6151
  Ac as padBytes,
6152
6152
  he as padHex,
6153
- Tc as parseEther,
6154
6153
  vn as parseEventLogs,
6155
- Ic as parseUnits,
6156
6154
  ho as prepareEncodeFunctionData,
6157
6155
  si as presignMessagePrefix,
6158
6156
  nc as publicActions,
6159
- Gc as rpcTransactionType,
6160
- Uc as serializeAccessList,
6157
+ Dc as rpcTransactionType,
6158
+ Hc as serializeAccessList,
6161
6159
  Gi as serializeSignature,
6162
- Vc as serializeTransaction,
6163
- Zc as sha256,
6160
+ Gc as serializeTransaction,
6161
+ Uc as sha256,
6164
6162
  Gi as signatureToHex,
6165
6163
  Z as size,
6166
6164
  xt as slice,
6167
6165
  Ps as sliceBytes,
6168
- Wc as sliceHex,
6166
+ Vc as sliceHex,
6169
6167
  ye as stringToBytes,
6170
6168
  gs as stringToHex,
6171
6169
  _ as stringify,
6172
6170
  Os as toBlobSidecars,
6173
- Yc as toBlobs,
6171
+ Zc as toBlobs,
6174
6172
  Ne as toBytes,
6175
6173
  Pr as toEventHash,
6176
6174
  un as toEventSelector,
@@ -6179,8 +6177,8 @@ export {
6179
6177
  pn as toFunctionSelector,
6180
6178
  oo as toFunctionSignature,
6181
6179
  qe as toHex,
6182
- Jc as toRlp,
6183
- Kc as transactionType,
6180
+ Wc as toRlp,
6181
+ Yc as transactionType,
6184
6182
  At as trim,
6185
6183
  ti as validateTypedData,
6186
6184
  en as withRetry,
@@ -3005,10 +3005,10 @@ function Qe(t, e) {
3005
3005
  });
3006
3006
  }
3007
3007
  function Bt(t, e, o) {
3008
- e.type === "MetaMask" ? import("./Web3Auth-C5tucK1E.js").then((r) => r.bR).then((r) => {
3008
+ e.type === "MetaMask" ? import("./Web3Auth-DB9s-qbl.js").then((r) => r.bO).then((r) => {
3009
3009
  const a = r.authViaMetaMask;
3010
3010
  a(t, e, o);
3011
- }) : e.type === "Web3Onboard" && import("./Web3Auth-C5tucK1E.js").then((r) => r.bR).then((r) => {
3011
+ }) : e.type === "Web3Onboard" && import("./Web3Auth-DB9s-qbl.js").then((r) => r.bO).then((r) => {
3012
3012
  const a = r.authViaWeb3Onboard;
3013
3013
  a(t, e, o);
3014
3014
  });
@@ -1,4 +1,4 @@
1
- import { by as o, b4 as r, bu as t, bF as i, bH as n, bI as b, bJ as f, bE as d, bz as c, bD as l, D as h, bC as m, i as p, J as I, q as w, bG as x, bA as E, bB as H } from "./Web3Auth-C5tucK1E.js";
1
+ import { bw as o, b2 as r, bs as t, bC as i, bE as n, bF as f, bG as b, bB as d, bx as c, D as l, bA as m, i as p, q as h, bD as w, by as x, bz as I } from "./Web3Auth-DB9s-qbl.js";
2
2
  const a = `
3
3
  @font-face {
4
4
  font-family: 'Inter';
@@ -15,17 +15,15 @@ export {
15
15
  t as bigIntToHex,
16
16
  i as chainIdToViemImport,
17
17
  n as chainIdValidation,
18
- b as chainNamespaceValidation,
19
- f as chainValidation,
18
+ f as chainNamespaceValidation,
19
+ b as chainValidation,
20
20
  d as createDownloadMessage,
21
21
  c as createEIP1193Provider,
22
- l as ethToWeiBigInt,
23
- h as fromHex,
22
+ l as fromHex,
24
23
  m as isAddress,
25
24
  p as isHex,
26
- I as parseEther,
27
- w as toHex,
28
- x as validate,
29
- E as weiHexToEth,
30
- H as weiToEth
25
+ h as toHex,
26
+ w as validate,
27
+ x as weiHexToEth,
28
+ I as weiToEth
31
29
  };