@web3jskit/walletkit 0.6.2 → 0.6.3
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/CHANGELOG.md +51 -0
- package/CHANGELOG.zh.md +50 -0
- package/README.md +17 -8
- package/README.zh.md +17 -8
- package/dist/{btcConnector-DyocBque.mjs → btcConnector-B-FBz618.mjs} +2 -2
- package/dist/{btcConnector-Ip851Zzx.js → btcConnector-BmBSGGDG.js} +1 -1
- package/dist/{btcConnector-ZZavkQAJ.mjs → btcConnector-CoDLrD-5.mjs} +2 -2
- package/dist/{btcConnector-CLm-gxx3.js → btcConnector-D6hRNl6J.js} +1 -1
- package/dist/core/connectors/connectorLoader.d.ts +1 -1
- package/dist/core/connectors/connectorLoader.d.ts.map +1 -1
- package/dist/core/connectors/createConnector.entry.d.ts +2 -0
- package/dist/core/connectors/createConnector.entry.d.ts.map +1 -0
- package/dist/core/connectors/createEvmConnectors.entry.d.ts +2 -0
- package/dist/core/connectors/createEvmConnectors.entry.d.ts.map +1 -0
- package/dist/createConnector.entry-C2ezrrEW.js +1 -0
- package/dist/createConnector.entry-CxyXzv78.mjs +4 -0
- package/dist/{createConnectors-BlSjbXr8.mjs → createConnectors-ADoTab9F.mjs} +79 -87
- package/dist/{createConnectors-C90GnGoD.mjs → createConnectors-DPb4fTuL.mjs} +174 -179
- package/dist/{createConnectors-DdVhGwOT.js → createConnectors-DvITc7A3.js} +2 -2
- package/dist/{createConnectors-C-XiQWnC.js → createConnectors-DzepxSHv.js} +3 -3
- package/dist/createEvmConnectors.entry-BEhiyNyg.mjs +4 -0
- package/dist/createEvmConnectors.entry-CgqSuemU.js +1 -0
- package/dist/{deepLinkConnector-GKwdlwJL.js → deepLinkConnector-1KSnxkrX.js} +1 -1
- package/dist/{deepLinkConnector-DH_Atv4n.js → deepLinkConnector-7KRiFI0W.js} +1 -1
- package/dist/{deepLinkConnector-DofAIemy.mjs → deepLinkConnector-AI0VLF-8.mjs} +1 -1
- package/dist/{deepLinkConnector-TxdCVtow.js → deepLinkConnector-B-M6QX4q.js} +1 -1
- package/dist/{deepLinkConnector-CtbmZOxo.js → deepLinkConnector-BeJUryP4.js} +1 -1
- package/dist/{deepLinkConnector-BTFq-fy4.mjs → deepLinkConnector-BpalZdJ0.mjs} +4 -4
- package/dist/{deepLinkConnector-8wywxaVw.mjs → deepLinkConnector-CO4p3xsf.mjs} +1 -1
- package/dist/{deepLinkConnector-BXBQDnmz.js → deepLinkConnector-ChrORWtA.js} +1 -1
- package/dist/{deepLinkConnector-CamW__vG.js → deepLinkConnector-D8rPZCzr.js} +1 -1
- package/dist/{deepLinkConnector-DndXk3_X.mjs → deepLinkConnector-DFrTWxB5.mjs} +1 -1
- package/dist/{deepLinkConnector-C_FpxXyQ.js → deepLinkConnector-DQYRdy1s.js} +1 -1
- package/dist/{deepLinkConnector-wZignBF4.mjs → deepLinkConnector-DxnaAx50.mjs} +1 -1
- package/dist/{deepLinkConnector-BoPREuPE.mjs → deepLinkConnector-OWmd-F6h.mjs} +1 -1
- package/dist/{deepLinkConnector-BNSwMCcK.mjs → deepLinkConnector-XCaUTjHC.mjs} +1 -1
- package/dist/{index-BYAhc19j.js → index-B7a9zLt1.js} +1 -1
- package/dist/{index-DcP0pe9L.mjs → index-BJQl8aKg.mjs} +15 -15
- package/dist/index-BNUh90Ws.js +44 -0
- package/dist/{index-Ca5U0KJA.mjs → index-BWBZ1f0K.mjs} +31 -31
- package/dist/{index-CYV63koi.js → index-C9mc2-wq.js} +1 -1
- package/dist/{index-Dyta9O3j.mjs → index-CAgSlROt.mjs} +9 -9
- package/dist/{index-D5CDP-Ja.mjs → index-g3j_3V8c.mjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +10 -10
- package/dist/index.js +1 -1
- package/dist/index.umd.js +15 -20
- package/dist/index2.css +1 -1
- package/dist/index3.css +1 -1
- package/dist/{silentConnect-BtDOIOBH.js → silentConnect-Dkz3iVLs.js} +1 -1
- package/dist/{silentConnect-Dwh-OCFz.mjs → silentConnect-Dl9do7n_.mjs} +2 -2
- package/dist/{tronConnector-1MzggiY6.mjs → tronConnector-BSEWGw1J.mjs} +2 -2
- package/dist/{tronConnector-CaAskj-A.mjs → tronConnector-BmK6mYOf.mjs} +2 -2
- package/dist/{tronConnector-D1XjDmX5.mjs → tronConnector-CzhOONmt.mjs} +2 -2
- package/dist/{tronConnector-CK8B1kxW.js → tronConnector-DBUzHKbS.js} +1 -1
- package/dist/{tronConnector-C2XAKGru.js → tronConnector-D_DSkWfc.js} +1 -1
- package/dist/{tronConnector-in2hmjSs.js → tronConnector-Dgq9lokx.js} +1 -1
- package/package.json +4 -2
- package/dist/index-Bo_G8w5V.js +0 -44
- /package/dist/{index-Dqp1KqTh.js → index-DuT-f-Zv.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { j as wt, q as We, r as pt, a as lt, w as He, s as he, t as gt, C as ae, v as vt, m as mt, x as Nt, y as Et } from "./index-BWBZ1f0K.mjs";
|
|
2
|
+
function xt(m) {
|
|
3
3
|
if (typeof window > "u")
|
|
4
4
|
return;
|
|
5
5
|
const f = (g) => m(g.detail);
|
|
6
6
|
return window.addEventListener("eip6963:announceProvider", f), window.dispatchEvent(new CustomEvent("eip6963:requestProvider")), () => window.removeEventListener("eip6963:announceProvider", f);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function yt() {
|
|
9
9
|
const m = /* @__PURE__ */ new Set();
|
|
10
10
|
let f = [];
|
|
11
|
-
const g = () =>
|
|
11
|
+
const g = () => xt((a) => {
|
|
12
12
|
f.some(({ info: p }) => p.uuid === a.info.uuid) || (f = [...f, a], m.forEach((p) => p(f, { added: [a] })));
|
|
13
13
|
});
|
|
14
14
|
let c = g();
|
|
@@ -36,9 +36,9 @@ function Ct() {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
var
|
|
39
|
+
var Ct = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, Re = Math.ceil, K = Math.floor, z = "[BigNumber Error] ", Ve = z + "Number primitive has more than 15 significant digits: ", Z = 1e14, M = 14, Ue = 9007199254740991, Fe = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], re = 1e7, G = 1e9;
|
|
40
40
|
function ut(m) {
|
|
41
|
-
var f, g, c, a = v.prototype = { constructor: v, toString: null, valueOf: null }, p = new v(1), N = 20, E = 4,
|
|
41
|
+
var f, g, c, a = v.prototype = { constructor: v, toString: null, valueOf: null }, p = new v(1), N = 20, E = 4, x = -7, S = 21, A = -1e7, _ = 1e7, k = !1, q = 1, I = 0, b = {
|
|
42
42
|
prefix: "",
|
|
43
43
|
groupSize: 3,
|
|
44
44
|
secondaryGroupSize: 0,
|
|
@@ -65,12 +65,12 @@ function ut(m) {
|
|
|
65
65
|
}
|
|
66
66
|
h = String(e);
|
|
67
67
|
} else {
|
|
68
|
-
if (!
|
|
68
|
+
if (!Ct.test(h = String(e))) return c(l, h, s);
|
|
69
69
|
l.s = h.charCodeAt(0) == 45 ? (h = h.slice(1), -1) : 1;
|
|
70
70
|
}
|
|
71
71
|
(o = h.indexOf(".")) > -1 && (h = h.replace(".", "")), (d = h.search(/e/i)) > 0 ? (o < 0 && (o = d), o += +h.slice(d + 1), h = h.substring(0, d)) : o < 0 && (o = h.length);
|
|
72
72
|
} else {
|
|
73
|
-
if (
|
|
73
|
+
if ($(t, 2, O.length, "Base"), t == 10 && V)
|
|
74
74
|
return l = new v(e), j(l, N + l.e + 1, E);
|
|
75
75
|
if (h = String(e), s = typeof e == "number") {
|
|
76
76
|
if (e * 0 != 0) return c(l, h, s, t);
|
|
@@ -119,10 +119,10 @@ function ut(m) {
|
|
|
119
119
|
var t, n;
|
|
120
120
|
if (e != null)
|
|
121
121
|
if (typeof e == "object") {
|
|
122
|
-
if (e.hasOwnProperty(t = "DECIMAL_PLACES") && (n = e[t],
|
|
122
|
+
if (e.hasOwnProperty(t = "DECIMAL_PLACES") && (n = e[t], $(n, 0, G, t), N = n), e.hasOwnProperty(t = "ROUNDING_MODE") && (n = e[t], $(n, 0, 8, t), E = n), e.hasOwnProperty(t = "EXPONENTIAL_AT") && (n = e[t], n && n.pop ? ($(n[0], -G, 0, t), $(n[1], 0, G, t), x = n[0], S = n[1]) : ($(n, -G, G, t), x = -(S = n < 0 ? -n : n))), e.hasOwnProperty(t = "RANGE"))
|
|
123
123
|
if (n = e[t], n && n.pop)
|
|
124
|
-
|
|
125
|
-
else if (
|
|
124
|
+
$(n[0], -G, -1, t), $(n[1], 1, G, t), A = n[0], _ = n[1];
|
|
125
|
+
else if ($(n, -G, G, t), n)
|
|
126
126
|
A = -(_ = n < 0 ? -n : n);
|
|
127
127
|
else
|
|
128
128
|
throw Error(z + t + " cannot be zero: " + n);
|
|
@@ -137,8 +137,8 @@ function ut(m) {
|
|
|
137
137
|
k = n;
|
|
138
138
|
else
|
|
139
139
|
throw Error(z + t + " not true or false: " + n);
|
|
140
|
-
if (e.hasOwnProperty(t = "MODULO_MODE") && (n = e[t],
|
|
141
|
-
if (n = e[t], typeof n == "object")
|
|
140
|
+
if (e.hasOwnProperty(t = "MODULO_MODE") && (n = e[t], $(n, 0, 9, t), q = n), e.hasOwnProperty(t = "POW_PRECISION") && (n = e[t], $(n, 0, G, t), I = n), e.hasOwnProperty(t = "FORMAT"))
|
|
141
|
+
if (n = e[t], typeof n == "object") b = n;
|
|
142
142
|
else throw Error(z + t + " not an object: " + n);
|
|
143
143
|
if (e.hasOwnProperty(t = "ALPHABET"))
|
|
144
144
|
if (n = e[t], typeof n == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(n))
|
|
@@ -150,12 +150,12 @@ function ut(m) {
|
|
|
150
150
|
return {
|
|
151
151
|
DECIMAL_PLACES: N,
|
|
152
152
|
ROUNDING_MODE: E,
|
|
153
|
-
EXPONENTIAL_AT: [
|
|
153
|
+
EXPONENTIAL_AT: [x, S],
|
|
154
154
|
RANGE: [A, _],
|
|
155
155
|
CRYPTO: k,
|
|
156
|
-
MODULO_MODE:
|
|
156
|
+
MODULO_MODE: q,
|
|
157
157
|
POW_PRECISION: I,
|
|
158
|
-
FORMAT:
|
|
158
|
+
FORMAT: b,
|
|
159
159
|
ALPHABET: O
|
|
160
160
|
};
|
|
161
161
|
}, v.isBigNumber = function(e) {
|
|
@@ -163,7 +163,7 @@ function ut(m) {
|
|
|
163
163
|
if (!v.DEBUG) return !0;
|
|
164
164
|
var t, n, u = e.c, r = e.e, o = e.s;
|
|
165
165
|
e: if ({}.toString.call(u) == "[object Array]") {
|
|
166
|
-
if ((o === 1 || o === -1) && r >= -
|
|
166
|
+
if ((o === 1 || o === -1) && r >= -G && r <= G && r === K(r)) {
|
|
167
167
|
if (u[0] === 0) {
|
|
168
168
|
if (r === 0 && u.length === 1) return !0;
|
|
169
169
|
break e;
|
|
@@ -189,7 +189,7 @@ function ut(m) {
|
|
|
189
189
|
};
|
|
190
190
|
return function(n) {
|
|
191
191
|
var u, r, o, d, s, i = 0, h = [], l = new v(p);
|
|
192
|
-
if (n == null ? n = N :
|
|
192
|
+
if (n == null ? n = N : $(n, 0, G), d = Re(n / M), k)
|
|
193
193
|
if (crypto.getRandomValues) {
|
|
194
194
|
for (u = crypto.getRandomValues(new Uint32Array(d *= 2)); i < d; )
|
|
195
195
|
s = u[i] * 131072 + (u[i + 1] >>> 11), s >= 9e15 ? (r = crypto.getRandomValues(new Uint32Array(2)), u[i] = r[0], u[i + 1] = r[1]) : (h.push(s % 1e14), i += 2);
|
|
@@ -203,7 +203,7 @@ function ut(m) {
|
|
|
203
203
|
if (!k)
|
|
204
204
|
for (; i < d; )
|
|
205
205
|
s = t(), s < 9e15 && (h[i++] = s % 1e14);
|
|
206
|
-
for (d = h[--i], n %= M, d && n && (s =
|
|
206
|
+
for (d = h[--i], n %= M, d && n && (s = Fe[M - n], h[i] = K(d / s) * s); h[i] === 0; h.pop(), i--) ;
|
|
207
207
|
if (i < 0)
|
|
208
208
|
h = [o = 0];
|
|
209
209
|
else {
|
|
@@ -227,31 +227,31 @@ function ut(m) {
|
|
|
227
227
|
return s.reverse();
|
|
228
228
|
}
|
|
229
229
|
return function(n, u, r, o, d) {
|
|
230
|
-
var s, i, h, l, w,
|
|
231
|
-
for (B >= 0 && (l = I, I = 0, n = n.replace(".", ""), L = new v(u),
|
|
232
|
-
se(Y(
|
|
230
|
+
var s, i, h, l, w, y, C, L, B = n.indexOf("."), F = N, T = E;
|
|
231
|
+
for (B >= 0 && (l = I, I = 0, n = n.replace(".", ""), L = new v(u), y = L.pow(n.length - B), I = l, L.c = t(
|
|
232
|
+
se(Y(y.c), y.e, "0"),
|
|
233
233
|
10,
|
|
234
234
|
r,
|
|
235
235
|
e
|
|
236
|
-
), L.e = L.c.length),
|
|
237
|
-
if (!
|
|
238
|
-
if (B < 0 ? --h : (
|
|
239
|
-
n = w ? se(s.charAt(1), -
|
|
236
|
+
), L.e = L.c.length), C = t(n, u, r, d ? (s = O, e) : (s = e, O)), h = l = C.length; C[--l] == 0; C.pop()) ;
|
|
237
|
+
if (!C[0]) return s.charAt(0);
|
|
238
|
+
if (B < 0 ? --h : (y.c = C, y.e = h, y.s = o, y = f(y, L, F, T, r), C = y.c, w = y.r, h = y.e), i = h + F + 1, B = C[i], l = r / 2, w = w || i < 0 || C[i + 1] != null, w = T < 4 ? (B != null || w) && (T == 0 || T == (y.s < 0 ? 3 : 2)) : B > l || B == l && (T == 4 || w || T == 6 && C[i - 1] & 1 || T == (y.s < 0 ? 8 : 7)), i < 1 || !C[0])
|
|
239
|
+
n = w ? se(s.charAt(1), -F, s.charAt(0)) : s.charAt(0);
|
|
240
240
|
else {
|
|
241
|
-
if (
|
|
242
|
-
for (--r; ++
|
|
243
|
-
|
|
244
|
-
for (l =
|
|
245
|
-
for (B = 0, n = ""; B <= l; n += s.charAt(
|
|
241
|
+
if (C.length = i, w)
|
|
242
|
+
for (--r; ++C[--i] > r; )
|
|
243
|
+
C[i] = 0, i || (++h, C = [1].concat(C));
|
|
244
|
+
for (l = C.length; !C[--l]; ) ;
|
|
245
|
+
for (B = 0, n = ""; B <= l; n += s.charAt(C[B++])) ;
|
|
246
246
|
n = se(n, h, s.charAt(0));
|
|
247
247
|
}
|
|
248
248
|
return n;
|
|
249
249
|
};
|
|
250
250
|
})(), f = /* @__PURE__ */ (function() {
|
|
251
251
|
function e(u, r, o) {
|
|
252
|
-
var d, s, i, h, l = 0, w = u.length,
|
|
252
|
+
var d, s, i, h, l = 0, w = u.length, y = r % re, C = r / re | 0;
|
|
253
253
|
for (u = u.slice(); w--; )
|
|
254
|
-
i = u[w] % re, h = u[w] / re | 0, d =
|
|
254
|
+
i = u[w] % re, h = u[w] / re | 0, d = C * i + h * y, s = y * i + d % re * re + l, l = (s / o | 0) + (d / re | 0) + C * h, u[w] = s % o;
|
|
255
255
|
return l && (u = [l].concat(u)), u;
|
|
256
256
|
}
|
|
257
257
|
function t(u, r, o, d) {
|
|
@@ -272,7 +272,7 @@ function ut(m) {
|
|
|
272
272
|
for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
|
|
273
273
|
}
|
|
274
274
|
return function(u, r, o, d, s) {
|
|
275
|
-
var i, h, l, w,
|
|
275
|
+
var i, h, l, w, y, C, L, B, F, T, P, W, fe, $e, Be, ee, ce, J = u.s == r.s ? 1 : -1, H = u.c, R = r.c;
|
|
276
276
|
if (!H || !H[0] || !R || !R[0])
|
|
277
277
|
return new v(
|
|
278
278
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
@@ -281,41 +281,41 @@ function ut(m) {
|
|
|
281
281
|
H && H[0] == 0 || !R ? J * 0 : J / 0
|
|
282
282
|
)
|
|
283
283
|
);
|
|
284
|
-
for (B = new v(J),
|
|
284
|
+
for (B = new v(J), F = B.c = [], h = u.e - r.e, J = o + h + 1, s || (s = Z, h = Q(u.e / M) - Q(r.e / M), J = J / M | 0), l = 0; R[l] == (H[l] || 0); l++) ;
|
|
285
285
|
if (R[l] > (H[l] || 0) && h--, J < 0)
|
|
286
|
-
|
|
286
|
+
F.push(1), w = !0;
|
|
287
287
|
else {
|
|
288
|
-
for (
|
|
288
|
+
for ($e = H.length, ee = R.length, l = 0, J += 2, y = K(s / (R[0] + 1)), y > 1 && (R = e(R, y, s), H = e(H, y, s), ee = R.length, $e = H.length), fe = ee, T = H.slice(0, ee), P = T.length; P < ee; T[P++] = 0) ;
|
|
289
289
|
ce = R.slice(), ce = [0].concat(ce), Be = R[0], R[1] >= s / 2 && Be++;
|
|
290
290
|
do {
|
|
291
|
-
if (
|
|
292
|
-
if (W = T[0], ee !=
|
|
293
|
-
for (
|
|
294
|
-
|
|
291
|
+
if (y = 0, i = t(R, T, ee, P), i < 0) {
|
|
292
|
+
if (W = T[0], ee != P && (W = W * s + (T[1] || 0)), y = K(W / Be), y > 1)
|
|
293
|
+
for (y >= s && (y = s - 1), C = e(R, y, s), L = C.length, P = T.length; t(C, T, L, P) == 1; )
|
|
294
|
+
y--, n(C, ee < L ? ce : R, L, s), L = C.length, i = 1;
|
|
295
295
|
else
|
|
296
|
-
|
|
297
|
-
if (L <
|
|
298
|
-
for (; t(R, T, ee,
|
|
299
|
-
|
|
300
|
-
} else i === 0 && (
|
|
301
|
-
|
|
302
|
-
} while ((fe++ <
|
|
303
|
-
w = T[0] != null,
|
|
296
|
+
y == 0 && (i = y = 1), C = R.slice(), L = C.length;
|
|
297
|
+
if (L < P && (C = [0].concat(C)), n(T, C, P, s), P = T.length, i == -1)
|
|
298
|
+
for (; t(R, T, ee, P) < 1; )
|
|
299
|
+
y++, n(T, ee < P ? ce : R, P, s), P = T.length;
|
|
300
|
+
} else i === 0 && (y++, T = [0]);
|
|
301
|
+
F[l++] = y, T[0] ? T[P++] = H[fe] || 0 : (T = [H[fe]], P = 1);
|
|
302
|
+
} while ((fe++ < $e || T[0] != null) && J--);
|
|
303
|
+
w = T[0] != null, F[0] || F.splice(0, 1);
|
|
304
304
|
}
|
|
305
305
|
if (s == Z) {
|
|
306
|
-
for (l = 1, J =
|
|
306
|
+
for (l = 1, J = F[0]; J >= 10; J /= 10, l++) ;
|
|
307
307
|
j(B, o + (B.e = l + h * M - 1) + 1, d, w);
|
|
308
308
|
} else
|
|
309
309
|
B.e = h, B.r = +w;
|
|
310
310
|
return B;
|
|
311
311
|
};
|
|
312
312
|
})();
|
|
313
|
-
function
|
|
313
|
+
function D(e, t, n, u) {
|
|
314
314
|
var r, o, d, s, i;
|
|
315
|
-
if (n == null ? n = E :
|
|
315
|
+
if (n == null ? n = E : $(n, 0, 8), !e.c) return e.toString();
|
|
316
316
|
if (r = e.c[0], d = e.e, t == null)
|
|
317
|
-
i = Y(e.c), i = u == 1 || u == 2 && (d <=
|
|
318
|
-
else if (e = j(new v(e), t, n), o = e.e, i = Y(e.c), s = i.length, u == 1 || u == 2 && (t <= o || o <=
|
|
317
|
+
i = Y(e.c), i = u == 1 || u == 2 && (d <= x || d >= S) ? we(i, d) : se(i, d, "0");
|
|
318
|
+
else if (e = j(new v(e), t, n), o = e.e, i = Y(e.c), s = i.length, u == 1 || u == 2 && (t <= o || o <= x)) {
|
|
319
319
|
for (; s < t; i += "0", s++) ;
|
|
320
320
|
i = we(i, o);
|
|
321
321
|
} else if (t -= d + (u === 2 && o > d), i = se(i, o, "0"), o + 1 > s) {
|
|
@@ -341,8 +341,8 @@ function ut(m) {
|
|
|
341
341
|
if (u.test(l))
|
|
342
342
|
o.s = isNaN(l) ? null : l < 0 ? -1 : 1;
|
|
343
343
|
else {
|
|
344
|
-
if (!s && (l = l.replace(e, function(w,
|
|
345
|
-
return h = (
|
|
344
|
+
if (!s && (l = l.replace(e, function(w, y, C) {
|
|
345
|
+
return h = (C = C.toLowerCase()) == "x" ? 16 : C == "b" ? 2 : 8, !i || i == h ? y : w;
|
|
346
346
|
}), i && (h = i, l = l.replace(t, "$1").replace(n, "0.$1")), d != l))
|
|
347
347
|
return new v(l, h);
|
|
348
348
|
if (v.DEBUG)
|
|
@@ -353,12 +353,12 @@ function ut(m) {
|
|
|
353
353
|
};
|
|
354
354
|
})();
|
|
355
355
|
function j(e, t, n, u) {
|
|
356
|
-
var r, o, d, s, i, h, l, w = e.c,
|
|
356
|
+
var r, o, d, s, i, h, l, w = e.c, y = Fe;
|
|
357
357
|
if (w) {
|
|
358
358
|
e: {
|
|
359
359
|
for (r = 1, s = w[0]; s >= 10; s /= 10, r++) ;
|
|
360
360
|
if (o = t - r, o < 0)
|
|
361
|
-
o += M, d = t, i = w[h = 0], l = K(i /
|
|
361
|
+
o += M, d = t, i = w[h = 0], l = K(i / y[r - d - 1] % 10);
|
|
362
362
|
else if (h = Re((o + 1) / M), h >= w.length)
|
|
363
363
|
if (u) {
|
|
364
364
|
for (; w.length <= h; w.push(0)) ;
|
|
@@ -367,15 +367,15 @@ function ut(m) {
|
|
|
367
367
|
break e;
|
|
368
368
|
else {
|
|
369
369
|
for (i = s = w[h], r = 1; s >= 10; s /= 10, r++) ;
|
|
370
|
-
o %= M, d = o - M + r, l = d < 0 ? 0 : K(i /
|
|
370
|
+
o %= M, d = o - M + r, l = d < 0 ? 0 : K(i / y[r - d - 1] % 10);
|
|
371
371
|
}
|
|
372
372
|
if (u = u || t < 0 || // Are there any non-zero digits after the rounding digit?
|
|
373
373
|
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
374
374
|
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
375
|
-
w[h + 1] != null || (d < 0 ? i : i %
|
|
376
|
-
(o > 0 ? d > 0 ? i /
|
|
377
|
-
return w.length = 0, u ? (t -= e.e + 1, w[0] =
|
|
378
|
-
if (o == 0 ? (w.length = h, s = 1, h--) : (w.length = h + 1, s =
|
|
375
|
+
w[h + 1] != null || (d < 0 ? i : i % y[r - d - 1]), u = n < 4 ? (l || u) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (n == 4 || u || n == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
376
|
+
(o > 0 ? d > 0 ? i / y[r - d] : 0 : w[h - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7)), t < 1 || !w[0])
|
|
377
|
+
return w.length = 0, u ? (t -= e.e + 1, w[0] = y[(M - t % M) % M], e.e = -t || 0) : w[0] = e.e = 0, e;
|
|
378
|
+
if (o == 0 ? (w.length = h, s = 1, h--) : (w.length = h + 1, s = y[M - o], w[h] = d > 0 ? K(i / y[r - d] % y[d]) * s : 0), u)
|
|
379
379
|
for (; ; )
|
|
380
380
|
if (h == 0) {
|
|
381
381
|
for (o = 1, d = w[0]; d >= 10; d /= 10, o++) ;
|
|
@@ -394,7 +394,7 @@ function ut(m) {
|
|
|
394
394
|
}
|
|
395
395
|
function ne(e) {
|
|
396
396
|
var t, n = e.e;
|
|
397
|
-
return n === null ? e.toString() : (t = Y(e.c), t = n <=
|
|
397
|
+
return n === null ? e.toString() : (t = Y(e.c), t = n <= x || n >= S ? we(t, n) : se(t, n, "0"), e.s < 0 ? "-" + t : t);
|
|
398
398
|
}
|
|
399
399
|
return a.absoluteValue = a.abs = function() {
|
|
400
400
|
var e = new v(this);
|
|
@@ -404,7 +404,7 @@ function ut(m) {
|
|
|
404
404
|
}, a.decimalPlaces = a.dp = function(e, t) {
|
|
405
405
|
var n, u, r, o = this;
|
|
406
406
|
if (e != null)
|
|
407
|
-
return
|
|
407
|
+
return $(e, 0, G), t == null ? t = E : $(t, 0, 8), j(new v(o), e + o.e + 1, t);
|
|
408
408
|
if (!(n = o.c)) return null;
|
|
409
409
|
if (u = ((r = n.length - 1) - Q(this.e / M)) * M, r = n[r]) for (; r % 10 == 0; r /= 10, u--) ;
|
|
410
410
|
return u < 0 && (u = 0), u;
|
|
@@ -445,7 +445,7 @@ function ut(m) {
|
|
|
445
445
|
return u ? l : (i && (l = p.div(l)), t ? l.mod(t) : o ? j(l, I, E, d) : l);
|
|
446
446
|
}, a.integerValue = function(e) {
|
|
447
447
|
var t = new v(this);
|
|
448
|
-
return e == null ? e = E :
|
|
448
|
+
return e == null ? e = E : $(e, 0, 8), j(t, t.e + 1, e);
|
|
449
449
|
}, a.isEqualTo = a.eq = function(e, t) {
|
|
450
450
|
return ie(this, new v(e, t)) === 0;
|
|
451
451
|
}, a.isFinite = function() {
|
|
@@ -503,15 +503,15 @@ function ut(m) {
|
|
|
503
503
|
return l[0] ? te(e, l, h) : (e.s = E == 3 ? -1 : 1, e.c = [e.e = 0], e);
|
|
504
504
|
}, a.modulo = a.mod = function(e, t) {
|
|
505
505
|
var n, u, r = this;
|
|
506
|
-
return e = new v(e, t), !r.c || !e.s || e.c && !e.c[0] ? new v(NaN) : !e.c || r.c && !r.c[0] ? new v(r) : (
|
|
506
|
+
return e = new v(e, t), !r.c || !e.s || e.c && !e.c[0] ? new v(NaN) : !e.c || r.c && !r.c[0] ? new v(r) : (q == 9 ? (u = e.s, e.s = 1, n = f(r, e, 0, 3), e.s = u, n.s *= u) : n = f(r, e, 0, q), e = r.minus(n.times(e)), !e.c[0] && q == 1 && (e.s = r.s), e);
|
|
507
507
|
}, a.multipliedBy = a.times = function(e, t) {
|
|
508
|
-
var n, u, r, o, d, s, i, h, l, w,
|
|
509
|
-
if (!
|
|
510
|
-
return !T.s || !e.s ||
|
|
511
|
-
for (u = Q(T.e / M) + Q(e.e / M), e.s *= T.s, i =
|
|
512
|
-
for (B = Z,
|
|
513
|
-
for (n = 0,
|
|
514
|
-
h =
|
|
508
|
+
var n, u, r, o, d, s, i, h, l, w, y, C, L, B, F, T = this, P = T.c, W = (e = new v(e, t)).c;
|
|
509
|
+
if (!P || !W || !P[0] || !W[0])
|
|
510
|
+
return !T.s || !e.s || P && !P[0] && !W || W && !W[0] && !P ? e.c = e.e = e.s = null : (e.s *= T.s, !P || !W ? e.c = e.e = null : (e.c = [0], e.e = 0)), e;
|
|
511
|
+
for (u = Q(T.e / M) + Q(e.e / M), e.s *= T.s, i = P.length, w = W.length, i < w && (L = P, P = W, W = L, r = i, i = w, w = r), r = i + w, L = []; r--; L.push(0)) ;
|
|
512
|
+
for (B = Z, F = re, r = w; --r >= 0; ) {
|
|
513
|
+
for (n = 0, y = W[r] % F, C = W[r] / F | 0, d = i, o = r + d; o > r; )
|
|
514
|
+
h = P[--d] % F, l = P[d] / F | 0, s = C * h + l * y, h = y * h + s % F * F + L[o] + n, n = (h / B | 0) + (s / F | 0) + C * l, L[o--] = h % B;
|
|
515
515
|
L[o] = n;
|
|
516
516
|
}
|
|
517
517
|
return n ? ++u : L.splice(0, 1), te(e, L, u);
|
|
@@ -538,7 +538,7 @@ function ut(m) {
|
|
|
538
538
|
}, a.precision = a.sd = function(e, t) {
|
|
539
539
|
var n, u, r, o = this;
|
|
540
540
|
if (e != null && e !== !!e)
|
|
541
|
-
return
|
|
541
|
+
return $(e, 1, G), t == null ? t = E : $(t, 0, 8), j(new v(o), e, t);
|
|
542
542
|
if (!(n = o.c)) return null;
|
|
543
543
|
if (r = n.length - 1, u = r * M + 1, r = n[r]) {
|
|
544
544
|
for (; r % 10 == 0; r /= 10, u--) ;
|
|
@@ -546,7 +546,7 @@ function ut(m) {
|
|
|
546
546
|
}
|
|
547
547
|
return e && o.e + 1 > u && (u = o.e + 1), u;
|
|
548
548
|
}, a.shiftedBy = function(e) {
|
|
549
|
-
return
|
|
549
|
+
return $(e, -Ue, Ue), this.times("1e" + e);
|
|
550
550
|
}, a.squareRoot = a.sqrt = function() {
|
|
551
551
|
var e, t, n, u, r, o = this, d = o.c, s = o.s, i = o.e, h = N + 4, l = new v("0.5");
|
|
552
552
|
if (s !== 1 || !d || !d[0])
|
|
@@ -567,20 +567,20 @@ function ut(m) {
|
|
|
567
567
|
}
|
|
568
568
|
return j(n, n.e + N + 1, E, e);
|
|
569
569
|
}, a.toExponential = function(e, t) {
|
|
570
|
-
return e != null && (
|
|
570
|
+
return e != null && ($(e, 0, G), e++), D(this, e, t, 1);
|
|
571
571
|
}, a.toFixed = function(e, t) {
|
|
572
|
-
return e != null && (
|
|
572
|
+
return e != null && ($(e, 0, G), e = e + this.e + 1), D(this, e, t);
|
|
573
573
|
}, a.toFormat = function(e, t, n) {
|
|
574
574
|
var u, r = this;
|
|
575
575
|
if (n == null)
|
|
576
|
-
e != null && t && typeof t == "object" ? (n = t, t = null) : e && typeof e == "object" ? (n = e, e = t = null) : n =
|
|
576
|
+
e != null && t && typeof t == "object" ? (n = t, t = null) : e && typeof e == "object" ? (n = e, e = t = null) : n = b;
|
|
577
577
|
else if (typeof n != "object")
|
|
578
578
|
throw Error(z + "Argument not an object: " + n);
|
|
579
579
|
if (u = r.toFixed(e, t), r.c) {
|
|
580
|
-
var o, d = u.split("."), s = +n.groupSize, i = +n.secondaryGroupSize, h = n.groupSeparator || "", l = d[0], w = d[1],
|
|
580
|
+
var o, d = u.split("."), s = +n.groupSize, i = +n.secondaryGroupSize, h = n.groupSeparator || "", l = d[0], w = d[1], y = r.s < 0, C = y ? l.slice(1) : l, L = C.length;
|
|
581
581
|
if (i && (o = s, s = i, i = o, L -= o), s > 0 && L > 0) {
|
|
582
|
-
for (o = L % s || s, l =
|
|
583
|
-
i > 0 && (l += h +
|
|
582
|
+
for (o = L % s || s, l = C.substr(0, o); o < L; o += s) l += h + C.substr(o, s);
|
|
583
|
+
i > 0 && (l += h + C.slice(o)), y && (l = "-" + l);
|
|
584
584
|
}
|
|
585
585
|
u = w ? l + (n.decimalSeparator || "") + ((i = +n.fractionGroupSize) ? w.replace(
|
|
586
586
|
new RegExp("\\d{" + i + "}\\B", "g"),
|
|
@@ -589,22 +589,22 @@ function ut(m) {
|
|
|
589
589
|
}
|
|
590
590
|
return (n.prefix || "") + u + (n.suffix || "");
|
|
591
591
|
}, a.toFraction = function(e) {
|
|
592
|
-
var t, n, u, r, o, d, s, i, h, l, w,
|
|
592
|
+
var t, n, u, r, o, d, s, i, h, l, w, y, C = this, L = C.c;
|
|
593
593
|
if (e != null && (s = new v(e), !s.isInteger() && (s.c || s.s !== 1) || s.lt(p)))
|
|
594
594
|
throw Error(z + "Argument " + (s.isInteger() ? "out of range: " : "not an integer: ") + ne(s));
|
|
595
|
-
if (!L) return new v(
|
|
596
|
-
for (t = new v(p), h = n = new v(p), u = i = new v(p),
|
|
595
|
+
if (!L) return new v(C);
|
|
596
|
+
for (t = new v(p), h = n = new v(p), u = i = new v(p), y = Y(L), o = t.e = y.length - C.e - 1, t.c[0] = Fe[(d = o % M) < 0 ? M + d : d], e = !e || s.comparedTo(t) > 0 ? o > 0 ? t : h : s, d = _, _ = 1 / 0, s = new v(y), i.c[0] = 0; l = f(s, t, 0, 1), r = n.plus(l.times(u)), r.comparedTo(e) != 1; )
|
|
597
597
|
n = u, u = r, h = i.plus(l.times(r = h)), i = r, t = s.minus(l.times(r = t)), s = r;
|
|
598
|
-
return r = f(e.minus(n), u, 0, 1), i = i.plus(r.times(h)), n = n.plus(r.times(u)), i.s = h.s =
|
|
599
|
-
f(i, n, o, E).minus(
|
|
598
|
+
return r = f(e.minus(n), u, 0, 1), i = i.plus(r.times(h)), n = n.plus(r.times(u)), i.s = h.s = C.s, o = o * 2, w = f(h, u, o, E).minus(C).abs().comparedTo(
|
|
599
|
+
f(i, n, o, E).minus(C).abs()
|
|
600
600
|
) < 1 ? [h, u] : [i, n], _ = d, w;
|
|
601
601
|
}, a.toNumber = function() {
|
|
602
602
|
return +ne(this);
|
|
603
603
|
}, a.toPrecision = function(e, t) {
|
|
604
|
-
return e != null &&
|
|
604
|
+
return e != null && $(e, 1, G), D(this, e, t, 2);
|
|
605
605
|
}, a.toString = function(e) {
|
|
606
606
|
var t, n = this, u = n.s, r = n.e;
|
|
607
|
-
return r === null ? u ? (t = "Infinity", u < 0 && (t = "-" + t)) : t = "NaN" : (e == null ? t = r <=
|
|
607
|
+
return r === null ? u ? (t = "Infinity", u < 0 && (t = "-" + t)) : t = "NaN" : (e == null ? t = r <= x || r >= S ? we(Y(n.c), r) : se(Y(n.c), r, "0") : e === 10 && V ? (n = j(new v(n), N + r + 1, E), t = se(Y(n.c), n.e, "0")) : ($(e, 2, O.length, "Base"), t = g(se(Y(n.c), r, "0"), 10, e, u, !0)), u < 0 && n.c[0] && (t = "-" + t)), t;
|
|
608
608
|
}, a.valueOf = a.toJSON = function() {
|
|
609
609
|
return ne(this);
|
|
610
610
|
}, a._isBigNumber = !0, a[Symbol.toStringTag] = "BigNumber", a[Symbol.for("nodejs.util.inspect.custom")] = a.valueOf, m != null && v.set(m), v;
|
|
@@ -622,16 +622,16 @@ function Y(m) {
|
|
|
622
622
|
return p.slice(0, a + 1 || 1);
|
|
623
623
|
}
|
|
624
624
|
function ie(m, f) {
|
|
625
|
-
var g, c, a = m.c, p = f.c, N = m.s, E = f.s,
|
|
625
|
+
var g, c, a = m.c, p = f.c, N = m.s, E = f.s, x = m.e, S = f.e;
|
|
626
626
|
if (!N || !E) return null;
|
|
627
627
|
if (g = a && !a[0], c = p && !p[0], g || c) return g ? c ? 0 : -E : N;
|
|
628
628
|
if (N != E) return N;
|
|
629
|
-
if (g = N < 0, c =
|
|
630
|
-
if (!c) return
|
|
631
|
-
for (E = (
|
|
632
|
-
return
|
|
629
|
+
if (g = N < 0, c = x == S, !a || !p) return c ? 0 : !a ^ g ? 1 : -1;
|
|
630
|
+
if (!c) return x > S ^ g ? 1 : -1;
|
|
631
|
+
for (E = (x = a.length) < (S = p.length) ? x : S, N = 0; N < E; N++) if (a[N] != p[N]) return a[N] > p[N] ^ g ? 1 : -1;
|
|
632
|
+
return x == S ? 0 : x > S ^ g ? 1 : -1;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function $(m, f, g, c) {
|
|
635
635
|
if (m < f || m > g || m !== K(m))
|
|
636
636
|
throw Error(z + (c || "Argument") + (typeof m == "number" ? m < f || m > g ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(m));
|
|
637
637
|
}
|
|
@@ -743,10 +743,10 @@ const Ee = class Ee extends X {
|
|
|
743
743
|
};
|
|
744
744
|
Ee.code = -32601;
|
|
745
745
|
let Je = Ee;
|
|
746
|
-
const
|
|
746
|
+
const xe = class xe extends X {
|
|
747
747
|
constructor(f) {
|
|
748
748
|
super(f, {
|
|
749
|
-
code:
|
|
749
|
+
code: xe.code,
|
|
750
750
|
name: "InvalidParamsRpcError",
|
|
751
751
|
shortMessage: [
|
|
752
752
|
"Invalid parameters were provided to the RPC method.",
|
|
@@ -756,23 +756,23 @@ const ye = class ye extends X {
|
|
|
756
756
|
});
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
|
-
|
|
760
|
-
let Ye =
|
|
761
|
-
const
|
|
759
|
+
xe.code = -32602;
|
|
760
|
+
let Ye = xe;
|
|
761
|
+
const ye = class ye extends X {
|
|
762
762
|
constructor(f) {
|
|
763
763
|
super(f, {
|
|
764
|
-
code:
|
|
764
|
+
code: ye.code,
|
|
765
765
|
name: "InternalRpcError",
|
|
766
766
|
shortMessage: "An internal error was received."
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
};
|
|
770
|
-
|
|
771
|
-
let Ke =
|
|
772
|
-
const
|
|
770
|
+
ye.code = -32603;
|
|
771
|
+
let Ke = ye;
|
|
772
|
+
const Ce = class Ce extends X {
|
|
773
773
|
constructor(f) {
|
|
774
774
|
super(f, {
|
|
775
|
-
code:
|
|
775
|
+
code: Ce.code,
|
|
776
776
|
name: "InvalidInputRpcError",
|
|
777
777
|
shortMessage: ["Missing or invalid parameters.", "Double check you have provided the correct parameters."].join(
|
|
778
778
|
`
|
|
@@ -781,8 +781,8 @@ const xe = class xe extends X {
|
|
|
781
781
|
});
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
-
|
|
785
|
-
let Qe =
|
|
784
|
+
Ce.code = -32e3;
|
|
785
|
+
let Qe = Ce;
|
|
786
786
|
const _e = class _e extends X {
|
|
787
787
|
constructor(f) {
|
|
788
788
|
super(f, {
|
|
@@ -882,45 +882,45 @@ const Le = class Le extends oe {
|
|
|
882
882
|
};
|
|
883
883
|
Le.code = 4200;
|
|
884
884
|
let it = Le;
|
|
885
|
-
const
|
|
885
|
+
const qe = class qe extends oe {
|
|
886
886
|
constructor(f) {
|
|
887
887
|
super(f, {
|
|
888
|
-
code:
|
|
888
|
+
code: qe.code,
|
|
889
889
|
name: "ProviderDisconnectedError",
|
|
890
890
|
shortMessage: "The Provider is disconnected from all chains."
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
};
|
|
894
|
-
|
|
895
|
-
let ot =
|
|
896
|
-
const
|
|
894
|
+
qe.code = 4900;
|
|
895
|
+
let ot = qe;
|
|
896
|
+
const Pe = class Pe extends oe {
|
|
897
897
|
constructor(f) {
|
|
898
898
|
super(f, {
|
|
899
|
-
code:
|
|
899
|
+
code: Pe.code,
|
|
900
900
|
name: "ChainDisconnectedError",
|
|
901
901
|
shortMessage: "The Provider is not connected to the requested chain."
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
904
|
};
|
|
905
|
-
|
|
906
|
-
let ct =
|
|
907
|
-
const
|
|
905
|
+
Pe.code = 4901;
|
|
906
|
+
let ct = Pe;
|
|
907
|
+
const De = class De extends oe {
|
|
908
908
|
constructor(f) {
|
|
909
909
|
super(f, {
|
|
910
|
-
code:
|
|
910
|
+
code: De.code,
|
|
911
911
|
name: "SwitchChainError",
|
|
912
912
|
shortMessage: "An error occurred when attempting to switch chain."
|
|
913
913
|
});
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
|
-
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
let pe =
|
|
916
|
+
De.code = 4902;
|
|
917
|
+
let Ge = De;
|
|
918
|
+
const be = 256;
|
|
919
|
+
let pe = be, ge;
|
|
920
920
|
function Mt(m = 11) {
|
|
921
|
-
if (!ge || pe + m >
|
|
921
|
+
if (!ge || pe + m > be * 2) {
|
|
922
922
|
ge = "", pe = 0;
|
|
923
|
-
for (let f = 0; f <
|
|
923
|
+
for (let f = 0; f < be; f++)
|
|
924
924
|
ge += (256 + Math.random() * 256 | 0).toString(16).substring(1);
|
|
925
925
|
}
|
|
926
926
|
return ge.substring(pe, pe++ + m);
|
|
@@ -931,17 +931,17 @@ var ht = { exports: {} };
|
|
|
931
931
|
function c() {
|
|
932
932
|
}
|
|
933
933
|
Object.create && (c.prototype = /* @__PURE__ */ Object.create(null), new c().__proto__ || (g = !1));
|
|
934
|
-
function a(
|
|
935
|
-
this.fn =
|
|
934
|
+
function a(x, S, A) {
|
|
935
|
+
this.fn = x, this.context = S, this.once = A || !1;
|
|
936
936
|
}
|
|
937
|
-
function p(
|
|
937
|
+
function p(x, S, A, _, k) {
|
|
938
938
|
if (typeof A != "function")
|
|
939
939
|
throw new TypeError("The listener must be a function");
|
|
940
|
-
var
|
|
941
|
-
return
|
|
940
|
+
var q = new a(A, _ || x, k), I = g ? g + S : S;
|
|
941
|
+
return x._events[I] ? x._events[I].fn ? x._events[I] = [x._events[I], q] : x._events[I].push(q) : (x._events[I] = q, x._eventsCount++), x;
|
|
942
942
|
}
|
|
943
|
-
function N(
|
|
944
|
-
--
|
|
943
|
+
function N(x, S) {
|
|
944
|
+
--x._eventsCount === 0 ? x._events = new c() : delete x._events[S];
|
|
945
945
|
}
|
|
946
946
|
function E() {
|
|
947
947
|
this._events = new c(), this._eventsCount = 0;
|
|
@@ -956,16 +956,16 @@ var ht = { exports: {} };
|
|
|
956
956
|
var A = g ? g + S : S, _ = this._events[A];
|
|
957
957
|
if (!_) return [];
|
|
958
958
|
if (_.fn) return [_.fn];
|
|
959
|
-
for (var k = 0,
|
|
959
|
+
for (var k = 0, q = _.length, I = new Array(q); k < q; k++)
|
|
960
960
|
I[k] = _[k].fn;
|
|
961
961
|
return I;
|
|
962
962
|
}, E.prototype.listenerCount = function(S) {
|
|
963
963
|
var A = g ? g + S : S, _ = this._events[A];
|
|
964
964
|
return _ ? _.fn ? 1 : _.length : 0;
|
|
965
|
-
}, E.prototype.emit = function(S, A, _, k,
|
|
966
|
-
var
|
|
967
|
-
if (!this._events[
|
|
968
|
-
var O = this._events[
|
|
965
|
+
}, E.prototype.emit = function(S, A, _, k, q, I) {
|
|
966
|
+
var b = g ? g + S : S;
|
|
967
|
+
if (!this._events[b]) return !1;
|
|
968
|
+
var O = this._events[b], V = arguments.length, v, D;
|
|
969
969
|
if (O.fn) {
|
|
970
970
|
switch (O.once && this.removeListener(S, O.fn, void 0, !0), V) {
|
|
971
971
|
case 1:
|
|
@@ -977,33 +977,33 @@ var ht = { exports: {} };
|
|
|
977
977
|
case 4:
|
|
978
978
|
return O.fn.call(O.context, A, _, k), !0;
|
|
979
979
|
case 5:
|
|
980
|
-
return O.fn.call(O.context, A, _, k,
|
|
980
|
+
return O.fn.call(O.context, A, _, k, q), !0;
|
|
981
981
|
case 6:
|
|
982
|
-
return O.fn.call(O.context, A, _, k,
|
|
982
|
+
return O.fn.call(O.context, A, _, k, q, I), !0;
|
|
983
983
|
}
|
|
984
|
-
for (
|
|
985
|
-
v[
|
|
984
|
+
for (D = 1, v = new Array(V - 1); D < V; D++)
|
|
985
|
+
v[D - 1] = arguments[D];
|
|
986
986
|
O.fn.apply(O.context, v);
|
|
987
987
|
} else {
|
|
988
988
|
var ue = O.length, te;
|
|
989
|
-
for (
|
|
990
|
-
switch (O[
|
|
989
|
+
for (D = 0; D < ue; D++)
|
|
990
|
+
switch (O[D].once && this.removeListener(S, O[D].fn, void 0, !0), V) {
|
|
991
991
|
case 1:
|
|
992
|
-
O[
|
|
992
|
+
O[D].fn.call(O[D].context);
|
|
993
993
|
break;
|
|
994
994
|
case 2:
|
|
995
|
-
O[
|
|
995
|
+
O[D].fn.call(O[D].context, A);
|
|
996
996
|
break;
|
|
997
997
|
case 3:
|
|
998
|
-
O[
|
|
998
|
+
O[D].fn.call(O[D].context, A, _);
|
|
999
999
|
break;
|
|
1000
1000
|
case 4:
|
|
1001
|
-
O[
|
|
1001
|
+
O[D].fn.call(O[D].context, A, _, k);
|
|
1002
1002
|
break;
|
|
1003
1003
|
default:
|
|
1004
1004
|
if (!v) for (te = 1, v = new Array(V - 1); te < V; te++)
|
|
1005
1005
|
v[te - 1] = arguments[te];
|
|
1006
|
-
O[
|
|
1006
|
+
O[D].fn.apply(O[D].context, v);
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
1009
|
return !0;
|
|
@@ -1012,17 +1012,17 @@ var ht = { exports: {} };
|
|
|
1012
1012
|
}, E.prototype.once = function(S, A, _) {
|
|
1013
1013
|
return p(this, S, A, _, !0);
|
|
1014
1014
|
}, E.prototype.removeListener = function(S, A, _, k) {
|
|
1015
|
-
var
|
|
1016
|
-
if (!this._events[
|
|
1015
|
+
var q = g ? g + S : S;
|
|
1016
|
+
if (!this._events[q]) return this;
|
|
1017
1017
|
if (!A)
|
|
1018
|
-
return N(this,
|
|
1019
|
-
var I = this._events[
|
|
1018
|
+
return N(this, q), this;
|
|
1019
|
+
var I = this._events[q];
|
|
1020
1020
|
if (I.fn)
|
|
1021
|
-
I.fn === A && (!k || I.once) && (!_ || I.context === _) && N(this,
|
|
1021
|
+
I.fn === A && (!k || I.once) && (!_ || I.context === _) && N(this, q);
|
|
1022
1022
|
else {
|
|
1023
|
-
for (var
|
|
1024
|
-
(I[
|
|
1025
|
-
O.length ? this._events[
|
|
1023
|
+
for (var b = 0, O = [], V = I.length; b < V; b++)
|
|
1024
|
+
(I[b].fn !== A || k && !I[b].once || _ && I[b].context !== _) && O.push(I[b]);
|
|
1025
|
+
O.length ? this._events[q] = O.length === 1 ? O[0] : O : N(this, q);
|
|
1026
1026
|
}
|
|
1027
1027
|
return this;
|
|
1028
1028
|
}, E.prototype.removeAllListeners = function(S) {
|
|
@@ -1137,12 +1137,12 @@ class at extends Tt {
|
|
|
1137
1137
|
method: "eth_requestAccounts"
|
|
1138
1138
|
});
|
|
1139
1139
|
p = await this.getChainId(), N = Number(p) !== Number(a), N && await this.switchNetwork(a);
|
|
1140
|
-
const
|
|
1141
|
-
return this.connectSuccess(
|
|
1140
|
+
const x = E[0];
|
|
1141
|
+
return this.connectSuccess(x), this.addEventListener(c), localStorage.setItem("isWalletConnected", "true"), this.setIsConnected(), this.walletEventEmitter.emit("connect", x), x;
|
|
1142
1142
|
} catch (E) {
|
|
1143
1143
|
this.connectError(), N && this.store.getState().setCurrentNetwork(Number(p));
|
|
1144
|
-
const
|
|
1145
|
-
throw
|
|
1144
|
+
const x = E;
|
|
1145
|
+
throw x.code === U.code ? new U(x) : x.code === ve.code ? new ve(x) : x;
|
|
1146
1146
|
}
|
|
1147
1147
|
}, this.autoConnect = async () => {
|
|
1148
1148
|
const c = await this.getProvider(), a = c.selectedAddress;
|
|
@@ -1171,7 +1171,7 @@ class at extends Tt {
|
|
|
1171
1171
|
const a = await (await this.getProvider()).request({ method: "eth_chainId" });
|
|
1172
1172
|
return Number(a);
|
|
1173
1173
|
}, this.switchChain = async ({ addEthereumChainParameter: c, chainId: a }) => {
|
|
1174
|
-
var E,
|
|
1174
|
+
var E, x, S, A;
|
|
1175
1175
|
const p = await this.getProvider(), N = this.config.chains.find((_) => _.id === a);
|
|
1176
1176
|
try {
|
|
1177
1177
|
return await Promise.all([
|
|
@@ -1182,8 +1182,8 @@ class at extends Tt {
|
|
|
1182
1182
|
await this.getChainId() === a && this.emitter.emit("change", { chainId: a });
|
|
1183
1183
|
}),
|
|
1184
1184
|
new Promise((_) => {
|
|
1185
|
-
const k = ((
|
|
1186
|
-
"chainId" in
|
|
1185
|
+
const k = ((q) => {
|
|
1186
|
+
"chainId" in q && q.chainId === a && (this.emitter.off("change", k), _());
|
|
1187
1187
|
});
|
|
1188
1188
|
this.emitter.on("change", k);
|
|
1189
1189
|
})
|
|
@@ -1192,15 +1192,15 @@ class at extends Tt {
|
|
|
1192
1192
|
const k = _;
|
|
1193
1193
|
if (k.code === 4902 || // Unwrapping for MetaMask Mobile
|
|
1194
1194
|
// https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719
|
|
1195
|
-
((
|
|
1195
|
+
((x = (E = k == null ? void 0 : k.data) == null ? void 0 : E.originalError) == null ? void 0 : x.code) === 4902)
|
|
1196
1196
|
try {
|
|
1197
|
-
const { default:
|
|
1198
|
-
let
|
|
1199
|
-
c != null && c.blockExplorerUrls ?
|
|
1197
|
+
const { default: q, ...I } = N.blockExplorers ?? {};
|
|
1198
|
+
let b;
|
|
1199
|
+
c != null && c.blockExplorerUrls ? b = c.blockExplorerUrls : q && (b = [q.url, ...Object.values(I).map((D) => D.url)]);
|
|
1200
1200
|
let O;
|
|
1201
1201
|
(S = c == null ? void 0 : c.rpcUrls) != null && S.length ? O = c.rpcUrls : O = [((A = N.rpcUrls.default) == null ? void 0 : A.http[0]) ?? ""];
|
|
1202
1202
|
const V = {
|
|
1203
|
-
blockExplorerUrls:
|
|
1203
|
+
blockExplorerUrls: b,
|
|
1204
1204
|
chainId: he(a),
|
|
1205
1205
|
chainName: (c == null ? void 0 : c.chainName) ?? N.name,
|
|
1206
1206
|
iconUrls: c == null ? void 0 : c.iconUrls,
|
|
@@ -1213,10 +1213,10 @@ class at extends Tt {
|
|
|
1213
1213
|
}), await this.getChainId() !== a)
|
|
1214
1214
|
throw new U(new Error("User rejected switch after adding network."));
|
|
1215
1215
|
return N;
|
|
1216
|
-
} catch (
|
|
1217
|
-
throw new U(
|
|
1216
|
+
} catch (q) {
|
|
1217
|
+
throw new U(q);
|
|
1218
1218
|
}
|
|
1219
|
-
throw k.code === U.code ? new U(k) : new
|
|
1219
|
+
throw k.code === U.code ? new U(k) : new Ge(k);
|
|
1220
1220
|
}
|
|
1221
1221
|
}, this.__onConnect = async (c) => {
|
|
1222
1222
|
console.log("__onConnect---", c);
|
|
@@ -1280,7 +1280,7 @@ class at extends Tt {
|
|
|
1280
1280
|
params: [c]
|
|
1281
1281
|
});
|
|
1282
1282
|
if (E) return E;
|
|
1283
|
-
await new Promise((
|
|
1283
|
+
await new Promise((x) => setTimeout(x, 1e3));
|
|
1284
1284
|
} catch (E) {
|
|
1285
1285
|
throw E;
|
|
1286
1286
|
}
|
|
@@ -1343,15 +1343,15 @@ class at extends Tt {
|
|
|
1343
1343
|
}), this.store.getState().setCurrentNetwork(Number(c));
|
|
1344
1344
|
} catch (p) {
|
|
1345
1345
|
if ((p == null ? void 0 : p.code) === 4902) {
|
|
1346
|
-
const E = this.supportedNetworks.find((
|
|
1346
|
+
const E = this.supportedNetworks.find((x) => x.chainId === c);
|
|
1347
1347
|
if (E) {
|
|
1348
|
-
const
|
|
1348
|
+
const x = {
|
|
1349
1349
|
...E,
|
|
1350
1350
|
chainId: he(E == null ? void 0 : E.chainId)
|
|
1351
1351
|
};
|
|
1352
1352
|
await a.request({
|
|
1353
1353
|
method: "wallet_addEthereumChain",
|
|
1354
|
-
params: [
|
|
1354
|
+
params: [x]
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
return;
|
|
@@ -1369,7 +1369,7 @@ class at extends Tt {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
1371
|
async function Pt() {
|
|
1372
|
-
const m = typeof window < "u" ?
|
|
1372
|
+
const m = typeof window < "u" ? yt() : void 0, f = Et(() => {
|
|
1373
1373
|
const g = [], c = /* @__PURE__ */ new Set();
|
|
1374
1374
|
if (m) {
|
|
1375
1375
|
const a = m.getProviders();
|
|
@@ -1388,15 +1388,10 @@ async function Pt() {
|
|
|
1388
1388
|
f.setState((p) => [...p, ...a], !0);
|
|
1389
1389
|
}), [...f.getState()];
|
|
1390
1390
|
}
|
|
1391
|
-
const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1392
|
-
__proto__: null,
|
|
1393
|
-
createConnectors: Pt
|
|
1394
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1395
1391
|
export {
|
|
1396
1392
|
Tt as B,
|
|
1397
1393
|
at as E,
|
|
1398
1394
|
U,
|
|
1399
1395
|
it as a,
|
|
1400
|
-
$t as b,
|
|
1401
1396
|
Pt as c
|
|
1402
1397
|
};
|