react-web3-storage 2.0.21 → 2.0.32
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/dist/{ReownAuthentication-7iIT4jS4.mjs → ReownAuthentication-ZWJVb5u8.mjs} +5 -5
- package/dist/{ReownAuthentication-BEGlJitZ.js → ReownAuthentication-_EMKUe4O.js} +1 -1
- package/dist/{SwapController-DNucRoq5.js → SwapController-75y039lY.js} +1 -1
- package/dist/{SwapController-CmWZu4cY.mjs → SwapController-CNHVjC6V.mjs} +16 -16
- package/dist/{ccip-Cy73HTCR.js → ccip-BgoVuN3u.js} +1 -1
- package/dist/{ccip-BCIUIeQM.mjs → ccip-CQrFYKlN.mjs} +6 -6
- package/dist/{data-capture-CaxHvefN.mjs → data-capture-CgKKCS0j.mjs} +5 -5
- package/dist/{data-capture-DbbP8JDT.js → data-capture-hbDyOOyJ.js} +1 -1
- package/dist/{email-B3WQnC0b.mjs → email-C2N4HkZQ.mjs} +9 -9
- package/dist/{email-CYJMBkHW.js → email-DYvAHYik.js} +1 -1
- package/dist/{embedded-wallet-t_Jd_LFV.js → embedded-wallet-CYNDQvBG.js} +1 -1
- package/dist/{embedded-wallet-Dlo0wBgH.mjs → embedded-wallet-_7JcZAOC.mjs} +22 -22
- package/dist/{features-B1ezv71b.js → features-BA8f0aFu.js} +1 -1
- package/dist/{features-5qKGISK9.mjs → features-JvQHn7sG.mjs} +1 -1
- package/dist/{index-2WfSPp5U.mjs → index-B--AiWBy.mjs} +5 -5
- package/dist/index-B7Og0OLg.js +1 -0
- package/dist/{index-CFLg0HEy.mjs → index-BHukHFIh.mjs} +4250 -4171
- package/dist/{index-BhaYgUya.js → index-BNobBA-8.js} +281 -281
- package/dist/{index-SXXuh_Wo.mjs → index-Bxg-paEQ.mjs} +346 -394
- package/dist/{index-BCZXGGtc.js → index-CASDFBE7.js} +1 -1
- package/dist/{index-DAGaFidW.js → index-CLUlCRLy.js} +1 -1
- package/dist/{index-VrnBQez9.js → index-C_fopi0u.js} +1 -1
- package/dist/{index-D3R3_EiN.mjs → index-Ccy2zz9q.mjs} +1 -1
- package/dist/index-CgI_Ukj5.mjs +267 -0
- package/dist/{index-D1agTf42.js → index-CjS2YG3n.js} +1 -1
- package/dist/{index-CAtS1mbf.mjs → index-Clu0wU1d.mjs} +15 -15
- package/dist/{index-BR1aMNYm.mjs → index-DIxai2A2.mjs} +1 -1
- package/dist/{index-BBH4oh8q.mjs → index-DVNi_N99.mjs} +2 -2
- package/dist/{index-D8W2bJl5.mjs → index-DnKQlXMR.mjs} +1 -1
- package/dist/{index-MeOSUHRy.js → index-DzjJtqrG.js} +1 -1
- package/dist/{index-Dk48RrmB.js → index-mvH0tD6I.js} +8 -8
- package/dist/{index-CZuajWCC.js → index-xYJPqvul.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{onramp-BMMneL8g.js → onramp-DlA5BSaX.js} +1 -1
- package/dist/{onramp-qJaw31Jf.mjs → onramp-zhj-U9X5.mjs} +31 -31
- package/dist/{parseSignature-jZAFls5F.js → parseSignature-CWAxHYP1.js} +6 -6
- package/dist/{parseSignature-zKnspnY-.mjs → parseSignature-ZB66mPGB.mjs} +56 -74
- package/dist/{pay-with-exchange-CgjKtyDu.js → pay-with-exchange-BQaMDGKp.js} +1 -1
- package/dist/{pay-with-exchange-CTRrPVEx.mjs → pay-with-exchange-Czbx9cbv.mjs} +2 -2
- package/dist/{receive-eP1MrUw6.js → receive-BA736NNd.js} +1 -1
- package/dist/{receive-D9mYL7F2.mjs → receive-VPGRuO6J.mjs} +1 -1
- package/dist/{send-tFHrHPh4.js → send-BhagKj7q.js} +1 -1
- package/dist/{send-DmCwhyow.mjs → send-xiZMc6dE.mjs} +21 -21
- package/dist/{socials-BXz_VcPl.js → socials-B-mhVCLM.js} +1 -1
- package/dist/{socials-BbYHDCTQ.mjs → socials-BX3hluqS.mjs} +13 -13
- package/dist/{swaps-D06KGkWD.mjs → swaps-BFl7r_MZ.mjs} +3 -3
- package/dist/{swaps-C9W-NxLv.js → swaps-DQYnz8sb.js} +1 -1
- package/dist/{transactions-B-bDj0J7.mjs → transactions-BooVIWm5.mjs} +1 -1
- package/dist/{transactions-CHNmwPaw.js → transactions-DWsNckfd.js} +1 -1
- package/dist/{w3m-modal-B82zwpqg.mjs → w3m-modal-BLoHPTsO.mjs} +18 -18
- package/dist/{w3m-modal-CaxvJDN5.js → w3m-modal-D6NKq8XS.js} +1 -1
- package/package.json +5 -3
- package/dist/index-DWRWjePT.mjs +0 -267
- package/dist/index-R_8iHUbU.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Es = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var F = (e, t, n) =>
|
|
4
|
-
import { ad as _,
|
|
5
|
-
import {
|
|
2
|
+
var Ss = (e, t, n) => t in e ? Es(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var F = (e, t, n) => Ss(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { ad as _, d1 as Ye, d2 as dr, d3 as Dt, d4 as ks, d5 as Be, d6 as As, d7 as Ps, d8 as ja, d9 as Is, bn as xe, bA as Oe, bd as Os, b9 as Qe, ac as Mr, ba as he, da as Cs, bb as Je, bf as ge, by as M, bi as Da, bL as Xt, b3 as pt, bB as ke, bQ as Lr, b4 as Ne, bN as Ts, db as _s, dc as Bs, I as Fr, be as qe, dd as Us, de as Rs, df as Ns, bI as Ma, bj as js, bu as Gr, bs as xn, bm as Hr, bz as Ds, bq as Kr, bp as vt } from "./index-BHukHFIh.mjs";
|
|
5
|
+
import { aU as mt, aV as be, aW as lr, aX as Ms, ab as La, ax as Ls, au as Fs, ar as Gs, av as Hs, aP as Ks, an as zs, aC as Vs, aH as cn, aY as Fa, aZ as En, p as qs, a_ as Zs, a1 as Ws, E as Ys, D as Js, A as Xs, a$ as Qs, b0 as $s, at as eo, ay as to, b1 as no, b2 as ro, l as ao, m as io, b3 as Ga, a3 as Ha, aE as so, a9 as oo, a0 as Ka } from "./parseSignature-ZB66mPGB.mjs";
|
|
6
6
|
class Qt extends _ {
|
|
7
7
|
constructor({ docsPath: t } = {}) {
|
|
8
8
|
super([
|
|
@@ -16,7 +16,7 @@ class Qt extends _ {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
async function
|
|
19
|
+
async function co(e, t) {
|
|
20
20
|
var u;
|
|
21
21
|
const { account: n = e.account, chainId: r, nonce: a } = t;
|
|
22
22
|
if (!n)
|
|
@@ -31,13 +31,13 @@ async function so(e, t) {
|
|
|
31
31
|
chainId: r,
|
|
32
32
|
nonce: a
|
|
33
33
|
};
|
|
34
|
-
return typeof o.chainId > "u" && (o.chainId = ((u = e.chain) == null ? void 0 : u.id) ?? await be(e, lr, "getChainId")({})), typeof o.nonce > "u" && (o.nonce = await be(e,
|
|
34
|
+
return typeof o.chainId > "u" && (o.chainId = ((u = e.chain) == null ? void 0 : u.id) ?? await be(e, lr, "getChainId")({})), typeof o.nonce > "u" && (o.nonce = await be(e, Ms, "getTransactionCount")({
|
|
35
35
|
address: i.address,
|
|
36
36
|
blockTag: "pending"
|
|
37
37
|
}), (s === "self" || s != null && s.address && La(s.address, i.address)) && (o.nonce += 1)), o;
|
|
38
38
|
}
|
|
39
39
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
40
|
-
const fr = /* @__PURE__ */ BigInt(0),
|
|
40
|
+
const fr = /* @__PURE__ */ BigInt(0), Sn = /* @__PURE__ */ BigInt(1);
|
|
41
41
|
function Mt(e, t = "") {
|
|
42
42
|
if (typeof e != "boolean") {
|
|
43
43
|
const n = t && `"${t}"`;
|
|
@@ -66,7 +66,7 @@ function $t(e) {
|
|
|
66
66
|
return za(Ye(e));
|
|
67
67
|
}
|
|
68
68
|
function Va(e) {
|
|
69
|
-
return
|
|
69
|
+
return ks(e), za(Ye(Uint8Array.from(e).reverse()));
|
|
70
70
|
}
|
|
71
71
|
function pr(e, t) {
|
|
72
72
|
return Dt(e.toString(16).padStart(t * 2, "0"));
|
|
@@ -89,21 +89,21 @@ function ue(e, t, n) {
|
|
|
89
89
|
return r.length, r;
|
|
90
90
|
}
|
|
91
91
|
const un = (e) => typeof e == "bigint" && fr <= e;
|
|
92
|
-
function
|
|
92
|
+
function uo(e, t, n) {
|
|
93
93
|
return un(e) && un(t) && un(n) && t <= e && e < n;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (!
|
|
95
|
+
function lo(e, t, n, r) {
|
|
96
|
+
if (!uo(t, n, r))
|
|
97
97
|
throw new Error("expected valid " + e + ": " + n + " <= n < " + r + ", got " + t);
|
|
98
98
|
}
|
|
99
99
|
function Za(e) {
|
|
100
100
|
let t;
|
|
101
|
-
for (t = 0; e > fr; e >>=
|
|
101
|
+
for (t = 0; e > fr; e >>= Sn, t += 1)
|
|
102
102
|
;
|
|
103
103
|
return t;
|
|
104
104
|
}
|
|
105
|
-
const bt = (e) => (
|
|
106
|
-
function
|
|
105
|
+
const bt = (e) => (Sn << BigInt(e)) - Sn;
|
|
106
|
+
function fo(e, t, n) {
|
|
107
107
|
if (typeof e != "number" || e < 2)
|
|
108
108
|
throw new Error("hashLen must be a number");
|
|
109
109
|
if (typeof t != "number" || t < 2)
|
|
@@ -160,18 +160,18 @@ function zr(e) {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
163
|
-
const
|
|
163
|
+
const de = BigInt(0), oe = BigInt(1), Le = /* @__PURE__ */ BigInt(2), Wa = /* @__PURE__ */ BigInt(3), Ya = /* @__PURE__ */ BigInt(4), Ja = /* @__PURE__ */ BigInt(5), po = /* @__PURE__ */ BigInt(7), Xa = /* @__PURE__ */ BigInt(8), mo = /* @__PURE__ */ BigInt(9), Qa = /* @__PURE__ */ BigInt(16);
|
|
164
164
|
function ye(e, t) {
|
|
165
165
|
const n = e % t;
|
|
166
|
-
return n >=
|
|
166
|
+
return n >= de ? n : t + n;
|
|
167
167
|
}
|
|
168
168
|
function Vr(e, t) {
|
|
169
|
-
if (e ===
|
|
169
|
+
if (e === de)
|
|
170
170
|
throw new Error("invert: expected non-zero number");
|
|
171
|
-
if (t <=
|
|
171
|
+
if (t <= de)
|
|
172
172
|
throw new Error("invert: expected positive modulus, got " + t);
|
|
173
|
-
let n = ye(e, t), r = t, a =
|
|
174
|
-
for (; n !==
|
|
173
|
+
let n = ye(e, t), r = t, a = de, i = oe;
|
|
174
|
+
for (; n !== de; ) {
|
|
175
175
|
const o = r / n, u = r % n, c = a - i * o;
|
|
176
176
|
r = n, n = u, a = i, i = c;
|
|
177
177
|
}
|
|
@@ -187,12 +187,12 @@ function $a(e, t) {
|
|
|
187
187
|
const n = (e.ORDER + oe) / Ya, r = e.pow(t, n);
|
|
188
188
|
return hr(e, r, t), r;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function ho(e, t) {
|
|
191
191
|
const n = (e.ORDER - Ja) / Xa, r = e.mul(t, Le), a = e.pow(r, n), i = e.mul(t, a), s = e.mul(e.mul(i, Le), a), o = e.mul(i, e.sub(s, e.ONE));
|
|
192
192
|
return hr(e, o, t), o;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const t = ze(e), n = ei(e), r = n(t, t.neg(t.ONE)), a = n(t, r), i = n(t, t.neg(r)), s = (e +
|
|
194
|
+
function yo(e) {
|
|
195
|
+
const t = ze(e), n = ei(e), r = n(t, t.neg(t.ONE)), a = n(t, r), i = n(t, t.neg(r)), s = (e + po) / Qa;
|
|
196
196
|
return (o, u) => {
|
|
197
197
|
let c = o.pow(u, s), f = o.mul(c, r);
|
|
198
198
|
const l = o.mul(c, a), p = o.mul(c, i), d = o.eql(o.sqr(f), u), h = o.eql(o.sqr(l), u);
|
|
@@ -205,7 +205,7 @@ function ei(e) {
|
|
|
205
205
|
if (e < Wa)
|
|
206
206
|
throw new Error("sqrt is not defined for small field");
|
|
207
207
|
let t = e - oe, n = 0;
|
|
208
|
-
for (; t % Le ===
|
|
208
|
+
for (; t % Le === de; )
|
|
209
209
|
t /= Le, n++;
|
|
210
210
|
let r = Le;
|
|
211
211
|
const a = ze(e);
|
|
@@ -235,10 +235,10 @@ function ei(e) {
|
|
|
235
235
|
return d;
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return e % Ya === Wa ? $a : e % Xa === Ja ?
|
|
238
|
+
function go(e) {
|
|
239
|
+
return e % Ya === Wa ? $a : e % Xa === Ja ? ho : e % Qa === mo ? yo(e) : ei(e);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const bo = [
|
|
242
242
|
"create",
|
|
243
243
|
"isValid",
|
|
244
244
|
"is0",
|
|
@@ -257,24 +257,24 @@ const yo = [
|
|
|
257
257
|
"mulN",
|
|
258
258
|
"sqrN"
|
|
259
259
|
];
|
|
260
|
-
function
|
|
260
|
+
function wo(e) {
|
|
261
261
|
const t = {
|
|
262
262
|
ORDER: "bigint",
|
|
263
263
|
MASK: "bigint",
|
|
264
264
|
BYTES: "number",
|
|
265
265
|
BITS: "number"
|
|
266
|
-
}, n =
|
|
266
|
+
}, n = bo.reduce((r, a) => (r[a] = "function", r), t);
|
|
267
267
|
return mr(e, n), e;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
if (n <
|
|
269
|
+
function vo(e, t, n) {
|
|
270
|
+
if (n < de)
|
|
271
271
|
throw new Error("invalid exponent, negatives unsupported");
|
|
272
|
-
if (n ===
|
|
272
|
+
if (n === de)
|
|
273
273
|
return e.ONE;
|
|
274
274
|
if (n === oe)
|
|
275
275
|
return t;
|
|
276
276
|
let r = e.ONE, a = t;
|
|
277
|
-
for (; n >
|
|
277
|
+
for (; n > de; )
|
|
278
278
|
n & oe && (r = e.mul(r, a)), a = e.sqr(a), n >>= oe;
|
|
279
279
|
return r;
|
|
280
280
|
}
|
|
@@ -294,7 +294,7 @@ function ni(e, t) {
|
|
|
294
294
|
return { nBitLength: n, nByteLength: r };
|
|
295
295
|
}
|
|
296
296
|
function ze(e, t, n = !1, r = {}) {
|
|
297
|
-
if (e <=
|
|
297
|
+
if (e <= de)
|
|
298
298
|
throw new Error("invalid field: expected ORDER > 0, got " + e);
|
|
299
299
|
let a, i, s = !1, o;
|
|
300
300
|
if (typeof t == "object" && t != null) {
|
|
@@ -314,16 +314,16 @@ function ze(e, t, n = !1, r = {}) {
|
|
|
314
314
|
BITS: u,
|
|
315
315
|
BYTES: c,
|
|
316
316
|
MASK: bt(u),
|
|
317
|
-
ZERO:
|
|
317
|
+
ZERO: de,
|
|
318
318
|
ONE: oe,
|
|
319
319
|
allowedLengths: o,
|
|
320
320
|
create: (p) => ye(p, e),
|
|
321
321
|
isValid: (p) => {
|
|
322
322
|
if (typeof p != "bigint")
|
|
323
323
|
throw new Error("invalid field element: expected bigint, got " + typeof p);
|
|
324
|
-
return
|
|
324
|
+
return de <= p && p < e;
|
|
325
325
|
},
|
|
326
|
-
is0: (p) => p ===
|
|
326
|
+
is0: (p) => p === de,
|
|
327
327
|
// is valid and invertible
|
|
328
328
|
isValidNot0: (p) => !l.is0(p) && l.isValid(p),
|
|
329
329
|
isOdd: (p) => (p & oe) === oe,
|
|
@@ -333,7 +333,7 @@ function ze(e, t, n = !1, r = {}) {
|
|
|
333
333
|
add: (p, d) => ye(p + d, e),
|
|
334
334
|
sub: (p, d) => ye(p - d, e),
|
|
335
335
|
mul: (p, d) => ye(p * d, e),
|
|
336
|
-
pow: (p, d) =>
|
|
336
|
+
pow: (p, d) => vo(l, p, d),
|
|
337
337
|
div: (p, d) => ye(p * Vr(d, e), e),
|
|
338
338
|
// Same as above, but doesn't normalize
|
|
339
339
|
sqrN: (p) => p * p,
|
|
@@ -341,7 +341,7 @@ function ze(e, t, n = !1, r = {}) {
|
|
|
341
341
|
subN: (p, d) => p - d,
|
|
342
342
|
mulN: (p, d) => p * d,
|
|
343
343
|
inv: (p) => Vr(p, e),
|
|
344
|
-
sqrt: i || ((p) => (f || (f =
|
|
344
|
+
sqrt: i || ((p) => (f || (f = go(e)), f(l, p))),
|
|
345
345
|
toBytes: (p) => n ? qa(p, c) : pr(p, c),
|
|
346
346
|
fromBytes: (p, d = !0) => {
|
|
347
347
|
if (o) {
|
|
@@ -375,7 +375,7 @@ function ai(e) {
|
|
|
375
375
|
const t = ri(e);
|
|
376
376
|
return t + Math.ceil(t / 2);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function xo(e, t, n = !1) {
|
|
379
379
|
const r = e.length, a = ri(t), i = ai(t);
|
|
380
380
|
if (r < 16 || r < i || r > 1024)
|
|
381
381
|
throw new Error("expected " + i + "-1024 bytes of input, got " + r);
|
|
@@ -408,7 +408,7 @@ function Zr(e, t, n) {
|
|
|
408
408
|
const c = t * r, f = c + Math.abs(o) - 1, l = o === 0, p = o < 0, d = t % 2 !== 0;
|
|
409
409
|
return { nextN: u, offset: f, isZero: l, isNeg: p, isNegF: d, offsetF: c };
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Eo(e, t) {
|
|
412
412
|
if (!Array.isArray(e))
|
|
413
413
|
throw new Error("array expected");
|
|
414
414
|
e.forEach((n, r) => {
|
|
@@ -416,7 +416,7 @@ function vo(e, t) {
|
|
|
416
416
|
throw new Error("invalid point at index " + r);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function So(e, t) {
|
|
420
420
|
if (!Array.isArray(e))
|
|
421
421
|
throw new Error("array of scalars expected");
|
|
422
422
|
e.forEach((n, r) => {
|
|
@@ -432,7 +432,7 @@ function Wr(e) {
|
|
|
432
432
|
if (e !== $e)
|
|
433
433
|
throw new Error("invalid wNAF");
|
|
434
434
|
}
|
|
435
|
-
class
|
|
435
|
+
class ko {
|
|
436
436
|
// Parametrized with a given Point class (not individual point)
|
|
437
437
|
constructor(t, n) {
|
|
438
438
|
this.BASE = t.BASE, this.ZERO = t.ZERO, this.Fn = t.Fn, this.bits = n;
|
|
@@ -522,14 +522,14 @@ class Eo {
|
|
|
522
522
|
return pn(t) !== 1;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Ao(e, t, n, r) {
|
|
526
526
|
let a = t, i = e.ZERO, s = e.ZERO;
|
|
527
527
|
for (; n > $e || r > $e; )
|
|
528
528
|
n & Fe && (i = i.add(a)), r & Fe && (s = s.add(a)), a = a.double(), n >>= Fe, r >>= Fe;
|
|
529
529
|
return { p1: i, p2: s };
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
531
|
+
function Po(e, t, n, r) {
|
|
532
|
+
Eo(n, e), So(r, t);
|
|
533
533
|
const a = n.length, i = r.length;
|
|
534
534
|
if (a !== i)
|
|
535
535
|
throw new Error("arrays of points and scalars must have equal length");
|
|
@@ -557,11 +557,11 @@ function Yr(e, t, n) {
|
|
|
557
557
|
if (t) {
|
|
558
558
|
if (t.ORDER !== e)
|
|
559
559
|
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
560
|
-
return
|
|
560
|
+
return wo(t), t;
|
|
561
561
|
} else
|
|
562
562
|
return ze(e, { isLE: n });
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Io(e, t, n = {}, r) {
|
|
565
565
|
if (r === void 0 && (r = e === "edwards"), !t || typeof t != "object")
|
|
566
566
|
throw new Error(`expected valid ${e} CURVE object`);
|
|
567
567
|
for (const u of ["p", "n", "h"]) {
|
|
@@ -577,7 +577,7 @@ function Ao(e, t, n = {}, r) {
|
|
|
577
577
|
}
|
|
578
578
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
579
579
|
const Jr = (e, t) => (e + (e >= 0 ? t : -t) / oi) / t;
|
|
580
|
-
function
|
|
580
|
+
function Oo(e, t, n) {
|
|
581
581
|
const [[r, a], [i, s]] = t, o = Jr(s * e, n), u = Jr(-a * e, n);
|
|
582
582
|
let c = e - o * r - u * i, f = -o * a - u * s;
|
|
583
583
|
const l = c < Ie, p = f < Ie;
|
|
@@ -587,7 +587,7 @@ function Po(e, t, n) {
|
|
|
587
587
|
throw new Error("splitScalar (endomorphism): failed, k=" + e);
|
|
588
588
|
return { k1neg: l, k1: c, k2neg: p, k2: f };
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function kn(e) {
|
|
591
591
|
if (!["compact", "recovered", "der"].includes(e))
|
|
592
592
|
throw new Error('Signature format must be "compact", "recovered", or "der"');
|
|
593
593
|
return e;
|
|
@@ -596,16 +596,16 @@ function mn(e, t) {
|
|
|
596
596
|
const n = {};
|
|
597
597
|
for (let r of Object.keys(t))
|
|
598
598
|
n[r] = e[r] === void 0 ? t[r] : e[r];
|
|
599
|
-
return Mt(n.lowS, "lowS"), Mt(n.prehash, "prehash"), n.format !== void 0 &&
|
|
599
|
+
return Mt(n.lowS, "lowS"), Mt(n.prehash, "prehash"), n.format !== void 0 && kn(n.format), n;
|
|
600
600
|
}
|
|
601
|
-
class
|
|
601
|
+
class Co extends Error {
|
|
602
602
|
constructor(t = "") {
|
|
603
603
|
super(t);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
const Ae = {
|
|
607
607
|
// asn.1 DER encoding utils
|
|
608
|
-
Err:
|
|
608
|
+
Err: Co,
|
|
609
609
|
// Basic building block is TLV (Tag-Length-Value)
|
|
610
610
|
_tlv: {
|
|
611
611
|
encode: (e, t) => {
|
|
@@ -690,7 +690,7 @@ const Ae = {
|
|
|
690
690
|
const { _tlv: t, _int: n } = Ae, r = t.encode(2, n.encode(e.r)), a = t.encode(2, n.encode(e.s)), i = r + a;
|
|
691
691
|
return t.encode(48, i);
|
|
692
692
|
}
|
|
693
|
-
}, Ie = BigInt(0), Xe = BigInt(1), oi = BigInt(2), Et = BigInt(3),
|
|
693
|
+
}, Ie = BigInt(0), Xe = BigInt(1), oi = BigInt(2), Et = BigInt(3), To = BigInt(4);
|
|
694
694
|
function We(e, t) {
|
|
695
695
|
const { BYTES: n } = e;
|
|
696
696
|
let r;
|
|
@@ -708,8 +708,8 @@ function We(e, t) {
|
|
|
708
708
|
throw new Error("invalid private key: out of range [1..N-1]");
|
|
709
709
|
return r;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
const n =
|
|
711
|
+
function _o(e, t = {}) {
|
|
712
|
+
const n = Io("weierstrass", e, t), { Fp: r, Fn: a } = n;
|
|
713
713
|
let i = n.CURVE;
|
|
714
714
|
const { h: s, n: o } = i;
|
|
715
715
|
mr(t, {}, {
|
|
@@ -730,18 +730,18 @@ function Co(e, t = {}) {
|
|
|
730
730
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
731
731
|
}
|
|
732
732
|
function l(L, v, g) {
|
|
733
|
-
const { x: y, y:
|
|
733
|
+
const { x: y, y: k } = v.toAffine(), P = r.toBytes(y);
|
|
734
734
|
if (Mt(g, "isCompressed"), g) {
|
|
735
735
|
f();
|
|
736
|
-
const C = !r.isOdd(
|
|
736
|
+
const C = !r.isOdd(k);
|
|
737
737
|
return Be(ci(C), P);
|
|
738
738
|
} else
|
|
739
|
-
return Be(Uint8Array.of(4), P, r.toBytes(
|
|
739
|
+
return Be(Uint8Array.of(4), P, r.toBytes(k));
|
|
740
740
|
}
|
|
741
741
|
function p(L) {
|
|
742
742
|
Me(L, void 0, "Point");
|
|
743
|
-
const { publicKey: v, publicKeyUncompressed: g } = c, y = L.length,
|
|
744
|
-
if (y === v && (
|
|
743
|
+
const { publicKey: v, publicKeyUncompressed: g } = c, y = L.length, k = L[0], P = L.subarray(1);
|
|
744
|
+
if (y === v && (k === 2 || k === 3)) {
|
|
745
745
|
const C = r.fromBytes(P);
|
|
746
746
|
if (!r.isValid(C))
|
|
747
747
|
throw new Error("bad point: is not on curve, wrong x");
|
|
@@ -755,8 +755,8 @@ function Co(e, t = {}) {
|
|
|
755
755
|
}
|
|
756
756
|
f();
|
|
757
757
|
const T = r.isOdd(I);
|
|
758
|
-
return (
|
|
759
|
-
} else if (y === g &&
|
|
758
|
+
return (k & 1) === 1 !== T && (I = r.neg(I)), { x: C, y: I };
|
|
759
|
+
} else if (y === g && k === 4) {
|
|
760
760
|
const C = r.BYTES, O = r.fromBytes(P.subarray(0, C)), I = r.fromBytes(P.subarray(C, C * 2));
|
|
761
761
|
if (!b(O, I))
|
|
762
762
|
throw new Error("bad point: is not on curve");
|
|
@@ -775,7 +775,7 @@ function Co(e, t = {}) {
|
|
|
775
775
|
}
|
|
776
776
|
if (!b(i.Gx, i.Gy))
|
|
777
777
|
throw new Error("bad curve params: generator point");
|
|
778
|
-
const E = r.mul(r.pow(i.a, Et),
|
|
778
|
+
const E = r.mul(r.pow(i.a, Et), To), w = r.mul(r.sqr(i.b), BigInt(27));
|
|
779
779
|
if (r.is0(r.add(E, w)))
|
|
780
780
|
throw new Error("bad curve params: a or b");
|
|
781
781
|
function A(L, v, g = !1) {
|
|
@@ -790,15 +790,15 @@ function Co(e, t = {}) {
|
|
|
790
790
|
function ee(L) {
|
|
791
791
|
if (!u || !u.basises)
|
|
792
792
|
throw new Error("no endo");
|
|
793
|
-
return
|
|
793
|
+
return Oo(L, u.basises, a.ORDER);
|
|
794
794
|
}
|
|
795
795
|
const ae = zr((L, v) => {
|
|
796
|
-
const { X: g, Y: y, Z:
|
|
797
|
-
if (r.eql(
|
|
796
|
+
const { X: g, Y: y, Z: k } = L;
|
|
797
|
+
if (r.eql(k, r.ONE))
|
|
798
798
|
return { x: g, y };
|
|
799
799
|
const P = L.is0();
|
|
800
|
-
v == null && (v = P ? r.ONE : r.inv(
|
|
801
|
-
const C = r.mul(g, v), O = r.mul(y, v), I = r.mul(
|
|
800
|
+
v == null && (v = P ? r.ONE : r.inv(k));
|
|
801
|
+
const C = r.mul(g, v), O = r.mul(y, v), I = r.mul(k, v);
|
|
802
802
|
if (P)
|
|
803
803
|
return { x: r.ZERO, y: r.ZERO };
|
|
804
804
|
if (!r.eql(I, r.ONE))
|
|
@@ -819,8 +819,8 @@ function Co(e, t = {}) {
|
|
|
819
819
|
throw new Error("bad point: not in prime-order subgroup");
|
|
820
820
|
return !0;
|
|
821
821
|
});
|
|
822
|
-
function j(L, v, g, y,
|
|
823
|
-
return g = new B(r.mul(g.X, L), g.Y, g.Z), v = Lt(y, v), g = Lt(
|
|
822
|
+
function j(L, v, g, y, k) {
|
|
823
|
+
return g = new B(r.mul(g.X, L), g.Y, g.Z), v = Lt(y, v), g = Lt(k, g), v.add(g);
|
|
824
824
|
}
|
|
825
825
|
class B {
|
|
826
826
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
@@ -859,7 +859,7 @@ function Co(e, t = {}) {
|
|
|
859
859
|
* @returns
|
|
860
860
|
*/
|
|
861
861
|
precompute(v = 8, g = !0) {
|
|
862
|
-
return
|
|
862
|
+
return le.createCache(this, v), g || this.multiply(Et), this;
|
|
863
863
|
}
|
|
864
864
|
// TODO: return `this`
|
|
865
865
|
/** A point on curve is valid if it conforms to equation. */
|
|
@@ -875,7 +875,7 @@ function Co(e, t = {}) {
|
|
|
875
875
|
/** Compare one point to another. */
|
|
876
876
|
equals(v) {
|
|
877
877
|
N(v);
|
|
878
|
-
const { X: g, Y: y, Z:
|
|
878
|
+
const { X: g, Y: y, Z: k } = this, { X: P, Y: C, Z: O } = v, I = r.eql(r.mul(g, O), r.mul(P, k)), T = r.eql(r.mul(y, O), r.mul(C, k));
|
|
879
879
|
return I && T;
|
|
880
880
|
}
|
|
881
881
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
@@ -887,9 +887,9 @@ function Co(e, t = {}) {
|
|
|
887
887
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
888
888
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
889
889
|
double() {
|
|
890
|
-
const { a: v, b: g } = i, y = r.mul(g, Et), { X:
|
|
891
|
-
let O = r.ZERO, I = r.ZERO, T = r.ZERO, R = r.mul(
|
|
892
|
-
return D = r.add(D, D), T = r.mul(
|
|
890
|
+
const { a: v, b: g } = i, y = r.mul(g, Et), { X: k, Y: P, Z: C } = this;
|
|
891
|
+
let O = r.ZERO, I = r.ZERO, T = r.ZERO, R = r.mul(k, k), ne = r.mul(P, P), V = r.mul(C, C), D = r.mul(k, P);
|
|
892
|
+
return D = r.add(D, D), T = r.mul(k, C), T = r.add(T, T), O = r.mul(v, T), I = r.mul(y, V), I = r.add(O, I), O = r.sub(ne, I), I = r.add(ne, I), I = r.mul(O, I), O = r.mul(D, O), T = r.mul(y, T), V = r.mul(v, V), D = r.sub(R, V), D = r.mul(v, D), D = r.add(D, T), T = r.add(R, R), R = r.add(T, R), R = r.add(R, V), R = r.mul(R, D), I = r.add(I, R), V = r.mul(P, C), V = r.add(V, V), R = r.mul(V, D), O = r.sub(O, R), T = r.mul(V, ne), T = r.add(T, T), T = r.add(T, T), new B(O, I, T);
|
|
893
893
|
}
|
|
894
894
|
// Renes-Costello-Batina exception-free addition formula.
|
|
895
895
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -897,13 +897,13 @@ function Co(e, t = {}) {
|
|
|
897
897
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
898
898
|
add(v) {
|
|
899
899
|
N(v);
|
|
900
|
-
const { X: g, Y: y, Z:
|
|
900
|
+
const { X: g, Y: y, Z: k } = this, { X: P, Y: C, Z: O } = v;
|
|
901
901
|
let I = r.ZERO, T = r.ZERO, R = r.ZERO;
|
|
902
902
|
const ne = i.a, V = r.mul(i.b, Et);
|
|
903
|
-
let D = r.mul(g, P), W = r.mul(y, C), re = r.mul(
|
|
904
|
-
ce = r.mul(ce, Y), Y = r.add(D, W), ce = r.sub(ce, Y), Y = r.add(g,
|
|
903
|
+
let D = r.mul(g, P), W = r.mul(y, C), re = r.mul(k, O), ce = r.add(g, y), Y = r.add(P, C);
|
|
904
|
+
ce = r.mul(ce, Y), Y = r.add(D, W), ce = r.sub(ce, Y), Y = r.add(g, k);
|
|
905
905
|
let ie = r.add(P, O);
|
|
906
|
-
return Y = r.mul(Y, ie), ie = r.add(D, re), Y = r.sub(Y, ie), ie = r.add(y,
|
|
906
|
+
return Y = r.mul(Y, ie), ie = r.add(D, re), Y = r.sub(Y, ie), ie = r.add(y, k), I = r.add(C, O), ie = r.mul(ie, I), I = r.add(W, re), ie = r.sub(ie, I), R = r.mul(ne, Y), I = r.mul(V, re), R = r.add(I, R), I = r.sub(W, R), R = r.add(W, R), T = r.mul(I, R), W = r.add(D, D), W = r.add(W, D), re = r.mul(ne, re), Y = r.mul(V, Y), W = r.add(W, re), re = r.sub(D, re), re = r.mul(ne, re), Y = r.add(Y, re), D = r.mul(W, Y), T = r.add(T, D), D = r.mul(ie, Y), I = r.mul(ce, I), I = r.sub(I, D), D = r.mul(ce, W), R = r.mul(ie, R), R = r.add(R, D), new B(I, T, R);
|
|
907
907
|
}
|
|
908
908
|
subtract(v) {
|
|
909
909
|
return this.add(v.negate());
|
|
@@ -924,16 +924,16 @@ function Co(e, t = {}) {
|
|
|
924
924
|
const { endo: g } = t;
|
|
925
925
|
if (!a.isValidNot0(v))
|
|
926
926
|
throw new Error("invalid scalar: out of range");
|
|
927
|
-
let y,
|
|
928
|
-
const P = (C) =>
|
|
927
|
+
let y, k;
|
|
928
|
+
const P = (C) => le.cached(this, C, (O) => dn(B, O));
|
|
929
929
|
if (g) {
|
|
930
930
|
const { k1neg: C, k1: O, k2neg: I, k2: T } = ee(v), { p: R, f: ne } = P(O), { p: V, f: D } = P(T);
|
|
931
|
-
|
|
931
|
+
k = ne.add(D), y = j(g.beta, R, V, C, I);
|
|
932
932
|
} else {
|
|
933
933
|
const { p: C, f: O } = P(v);
|
|
934
|
-
y = C,
|
|
934
|
+
y = C, k = O;
|
|
935
935
|
}
|
|
936
|
-
return dn(B, [y,
|
|
936
|
+
return dn(B, [y, k])[0];
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
939
939
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -948,17 +948,17 @@ function Co(e, t = {}) {
|
|
|
948
948
|
return B.ZERO;
|
|
949
949
|
if (v === Xe)
|
|
950
950
|
return y;
|
|
951
|
-
if (
|
|
951
|
+
if (le.hasCache(this))
|
|
952
952
|
return this.multiply(v);
|
|
953
953
|
if (g) {
|
|
954
|
-
const { k1neg:
|
|
955
|
-
return j(g.beta, I, T,
|
|
954
|
+
const { k1neg: k, k1: P, k2neg: C, k2: O } = ee(v), { p1: I, p2: T } = Ao(B, y, P, O);
|
|
955
|
+
return j(g.beta, I, T, k, C);
|
|
956
956
|
} else
|
|
957
|
-
return
|
|
957
|
+
return le.unsafe(y, v);
|
|
958
958
|
}
|
|
959
959
|
multiplyAndAddUnsafe(v, g, y) {
|
|
960
|
-
const
|
|
961
|
-
return
|
|
960
|
+
const k = this.multiplyUnsafe(g).add(v.multiplyUnsafe(y));
|
|
961
|
+
return k.is0() ? void 0 : k;
|
|
962
962
|
}
|
|
963
963
|
/**
|
|
964
964
|
* Converts Projective point to affine (x, y) coordinates.
|
|
@@ -973,7 +973,7 @@ function Co(e, t = {}) {
|
|
|
973
973
|
*/
|
|
974
974
|
isTorsionFree() {
|
|
975
975
|
const { isTorsionFree: v } = t;
|
|
976
|
-
return s === Xe ? !0 : v ? v(B, this) :
|
|
976
|
+
return s === Xe ? !0 : v ? v(B, this) : le.unsafe(this, o).is0();
|
|
977
977
|
}
|
|
978
978
|
clearCofactor() {
|
|
979
979
|
const { clearCofactor: v } = t;
|
|
@@ -1011,14 +1011,14 @@ function Co(e, t = {}) {
|
|
|
1011
1011
|
return dn(B, v);
|
|
1012
1012
|
}
|
|
1013
1013
|
static msm(v, g) {
|
|
1014
|
-
return
|
|
1014
|
+
return Po(B, a, v, g);
|
|
1015
1015
|
}
|
|
1016
1016
|
static fromPrivateKey(v) {
|
|
1017
1017
|
return B.BASE.multiply(We(a, v));
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
B.BASE = new B(i.Gx, i.Gy, r.ONE), B.ZERO = new B(r.ZERO, r.ONE, r.ZERO), B.Fp = r, B.Fn = a;
|
|
1021
|
-
const se = a.BITS,
|
|
1021
|
+
const se = a.BITS, le = new ko(B, t.endo ? Math.ceil(se / 2) : se);
|
|
1022
1022
|
return B.BASE.precompute(8), B;
|
|
1023
1023
|
}
|
|
1024
1024
|
function ci(e) {
|
|
@@ -1033,7 +1033,7 @@ function ui(e, t) {
|
|
|
1033
1033
|
signature: 2 * t.BYTES
|
|
1034
1034
|
};
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Bo(e, t = {}) {
|
|
1037
1037
|
const { Fn: n } = e, r = t.randomBytes || ja, a = Object.assign(ui(e.Fp, n), { seed: ai(n.ORDER) });
|
|
1038
1038
|
function i(d) {
|
|
1039
1039
|
try {
|
|
@@ -1052,7 +1052,7 @@ function To(e, t = {}) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
function o(d = r(a.seed)) {
|
|
1055
|
-
return
|
|
1055
|
+
return xo(Me(d, a.seed, "seed"), n.ORDER);
|
|
1056
1056
|
}
|
|
1057
1057
|
function u(d, h = !0) {
|
|
1058
1058
|
return e.BASE.multiply(We(n, d)).toBytes(h);
|
|
@@ -1093,7 +1093,7 @@ function To(e, t = {}) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}, lengths: a });
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Uo(e, t, n = {}) {
|
|
1097
1097
|
Ps(t), mr(n, {}, {
|
|
1098
1098
|
hmac: "function",
|
|
1099
1099
|
lowS: "boolean",
|
|
@@ -1101,7 +1101,7 @@ function _o(e, t, n = {}) {
|
|
|
1101
1101
|
bits2int: "function",
|
|
1102
1102
|
bits2int_modN: "function"
|
|
1103
1103
|
});
|
|
1104
|
-
const r = n.randomBytes || ja, a = n.hmac || ((g, ...y) => Is(t, g, Be(...y))), { Fp: i, Fn: s } = e, { ORDER: o, BITS: u } = s, { keygen: c, getPublicKey: f, getSharedSecret: l, utils: p, lengths: d } =
|
|
1104
|
+
const r = n.randomBytes || ja, a = n.hmac || ((g, ...y) => Is(t, g, Be(...y))), { Fp: i, Fn: s } = e, { ORDER: o, BITS: u } = s, { keygen: c, getPublicKey: f, getSharedSecret: l, utils: p, lengths: d } = Bo(e, n), h = {
|
|
1105
1105
|
prehash: !1,
|
|
1106
1106
|
lowS: typeof n.lowS == "boolean" ? n.lowS : !1,
|
|
1107
1107
|
format: void 0,
|
|
@@ -1118,36 +1118,36 @@ function _o(e, t, n = {}) {
|
|
|
1118
1118
|
return y;
|
|
1119
1119
|
}
|
|
1120
1120
|
function w(g, y) {
|
|
1121
|
-
|
|
1122
|
-
const
|
|
1121
|
+
kn(y);
|
|
1122
|
+
const k = d.signature, P = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
|
|
1123
1123
|
return Me(g, P, `${y} signature`);
|
|
1124
1124
|
}
|
|
1125
1125
|
class A {
|
|
1126
|
-
constructor(y,
|
|
1127
|
-
this.r = E("r", y), this.s = E("s",
|
|
1126
|
+
constructor(y, k, P) {
|
|
1127
|
+
this.r = E("r", y), this.s = E("s", k), P != null && (this.recovery = P), Object.freeze(this);
|
|
1128
1128
|
}
|
|
1129
|
-
static fromBytes(y,
|
|
1130
|
-
w(y,
|
|
1129
|
+
static fromBytes(y, k = m) {
|
|
1130
|
+
w(y, k);
|
|
1131
1131
|
let P;
|
|
1132
|
-
if (
|
|
1132
|
+
if (k === "der") {
|
|
1133
1133
|
const { r: T, s: R } = Ae.toSig(Me(y));
|
|
1134
1134
|
return new A(T, R);
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1136
|
+
k === "recovered" && (P = y[0], k = "compact", y = y.subarray(1));
|
|
1137
1137
|
const C = s.BYTES, O = y.subarray(0, C), I = y.subarray(C, C * 2);
|
|
1138
1138
|
return new A(s.fromBytes(O), s.fromBytes(I), P);
|
|
1139
1139
|
}
|
|
1140
|
-
static fromHex(y,
|
|
1141
|
-
return this.fromBytes(Dt(y),
|
|
1140
|
+
static fromHex(y, k) {
|
|
1141
|
+
return this.fromBytes(Dt(y), k);
|
|
1142
1142
|
}
|
|
1143
1143
|
addRecoveryBit(y) {
|
|
1144
1144
|
return new A(this.r, this.s, y);
|
|
1145
1145
|
}
|
|
1146
1146
|
recoverPublicKey(y) {
|
|
1147
|
-
const
|
|
1147
|
+
const k = i.ORDER, { r: P, s: C, recovery: O } = this;
|
|
1148
1148
|
if (O == null || ![0, 1, 2, 3].includes(O))
|
|
1149
1149
|
throw new Error("recovery id invalid");
|
|
1150
|
-
if (o * oi <
|
|
1150
|
+
if (o * oi < k && O > 1)
|
|
1151
1151
|
throw new Error("recovery id is ambiguous for h>1 curve");
|
|
1152
1152
|
const T = O === 2 || O === 3 ? P + o : P;
|
|
1153
1153
|
if (!i.isValid(T))
|
|
@@ -1162,15 +1162,15 @@ function _o(e, t, n = {}) {
|
|
|
1162
1162
|
return b(this.s);
|
|
1163
1163
|
}
|
|
1164
1164
|
toBytes(y = m) {
|
|
1165
|
-
if (
|
|
1165
|
+
if (kn(y), y === "der")
|
|
1166
1166
|
return Dt(Ae.hexFromSig(this));
|
|
1167
|
-
const
|
|
1167
|
+
const k = s.toBytes(this.r), P = s.toBytes(this.s);
|
|
1168
1168
|
if (y === "recovered") {
|
|
1169
1169
|
if (this.recovery == null)
|
|
1170
1170
|
throw new Error("recovery bit must be present");
|
|
1171
|
-
return Be(Uint8Array.of(this.recovery),
|
|
1171
|
+
return Be(Uint8Array.of(this.recovery), k, P);
|
|
1172
1172
|
}
|
|
1173
|
-
return Be(
|
|
1173
|
+
return Be(k, P);
|
|
1174
1174
|
}
|
|
1175
1175
|
toHex(y) {
|
|
1176
1176
|
return Ye(this.toBytes(y));
|
|
@@ -1203,21 +1203,21 @@ function _o(e, t, n = {}) {
|
|
|
1203
1203
|
const N = n.bits2int || function(y) {
|
|
1204
1204
|
if (y.length > 8192)
|
|
1205
1205
|
throw new Error("input is too large");
|
|
1206
|
-
const
|
|
1207
|
-
return P > 0 ?
|
|
1206
|
+
const k = $t(y), P = y.length * 8 - u;
|
|
1207
|
+
return P > 0 ? k >> BigInt(P) : k;
|
|
1208
1208
|
}, ee = n.bits2int_modN || function(y) {
|
|
1209
1209
|
return s.create(N(y));
|
|
1210
1210
|
}, ae = bt(u);
|
|
1211
1211
|
function U(g) {
|
|
1212
|
-
return
|
|
1212
|
+
return lo("num < 2^" + u, g, Ie, ae), s.toBytes(g);
|
|
1213
1213
|
}
|
|
1214
1214
|
function j(g, y) {
|
|
1215
1215
|
return Me(g, void 0, "message"), y ? Me(t(g), void 0, "prehashed message") : g;
|
|
1216
1216
|
}
|
|
1217
|
-
function B(g, y,
|
|
1218
|
-
if (["recovered", "canonical"].some((W) => W in
|
|
1217
|
+
function B(g, y, k) {
|
|
1218
|
+
if (["recovered", "canonical"].some((W) => W in k))
|
|
1219
1219
|
throw new Error("sign() legacy options not supported");
|
|
1220
|
-
const { lowS: P, prehash: C, extraEntropy: O } = mn(
|
|
1220
|
+
const { lowS: P, prehash: C, extraEntropy: O } = mn(k, h);
|
|
1221
1221
|
g = j(g, C);
|
|
1222
1222
|
const I = ee(g), T = We(s, y), R = [U(T), U(I)];
|
|
1223
1223
|
if (O != null && O !== !1) {
|
|
@@ -1240,19 +1240,19 @@ function _o(e, t, n = {}) {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
return { seed: ne, k2sig: D };
|
|
1242
1242
|
}
|
|
1243
|
-
function se(g, y,
|
|
1243
|
+
function se(g, y, k = {}) {
|
|
1244
1244
|
g = ue("message", g);
|
|
1245
|
-
const { seed: P, k2sig: C } = B(g, y,
|
|
1246
|
-
return
|
|
1245
|
+
const { seed: P, k2sig: C } = B(g, y, k);
|
|
1246
|
+
return fo(t.outputLen, s.BYTES, a)(P, C);
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function le(g) {
|
|
1249
1249
|
let y;
|
|
1250
|
-
const
|
|
1251
|
-
if (!
|
|
1250
|
+
const k = typeof g == "string" || dr(g), P = !k && g !== null && typeof g == "object" && typeof g.r == "bigint" && typeof g.s == "bigint";
|
|
1251
|
+
if (!k && !P)
|
|
1252
1252
|
throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
|
|
1253
1253
|
if (P)
|
|
1254
1254
|
y = new A(g.r, g.s);
|
|
1255
|
-
else if (
|
|
1255
|
+
else if (k) {
|
|
1256
1256
|
try {
|
|
1257
1257
|
y = A.fromBytes(ue("sig", g), "der");
|
|
1258
1258
|
} catch (C) {
|
|
@@ -1268,15 +1268,15 @@ function _o(e, t, n = {}) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
return y || !1;
|
|
1270
1270
|
}
|
|
1271
|
-
function L(g, y,
|
|
1271
|
+
function L(g, y, k, P = {}) {
|
|
1272
1272
|
const { lowS: C, prehash: O, format: I } = mn(P, h);
|
|
1273
|
-
if (
|
|
1273
|
+
if (k = ue("publicKey", k), y = j(ue("message", y), O), "strict" in P)
|
|
1274
1274
|
throw new Error("options.strict was renamed to lowS");
|
|
1275
|
-
const T = I === void 0 ?
|
|
1275
|
+
const T = I === void 0 ? le(g) : A.fromBytes(ue("sig", g), I);
|
|
1276
1276
|
if (T === !1)
|
|
1277
1277
|
return !1;
|
|
1278
1278
|
try {
|
|
1279
|
-
const R = e.fromBytes(
|
|
1279
|
+
const R = e.fromBytes(k);
|
|
1280
1280
|
if (C && T.hasHighS())
|
|
1281
1281
|
return !1;
|
|
1282
1282
|
const { r: ne, s: V } = T, D = ee(y), W = s.inv(V), re = s.create(D * W), ce = s.create(ne * W), Y = e.BASE.multiplyUnsafe(re).add(R.multiplyUnsafe(ce));
|
|
@@ -1285,8 +1285,8 @@ function _o(e, t, n = {}) {
|
|
|
1285
1285
|
return !1;
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
function v(g, y,
|
|
1289
|
-
const { prehash: P } = mn(
|
|
1288
|
+
function v(g, y, k = {}) {
|
|
1289
|
+
const { prehash: P } = mn(k, h);
|
|
1290
1290
|
return y = j(y, P), A.fromBytes(g, "recovered").recoverPublicKey(y).toBytes();
|
|
1291
1291
|
}
|
|
1292
1292
|
return Object.freeze({
|
|
@@ -1303,7 +1303,7 @@ function _o(e, t, n = {}) {
|
|
|
1303
1303
|
hash: t
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function Ro(e) {
|
|
1307
1307
|
const t = {
|
|
1308
1308
|
a: e.a,
|
|
1309
1309
|
b: e.b,
|
|
@@ -1330,8 +1330,8 @@ function Bo(e) {
|
|
|
1330
1330
|
};
|
|
1331
1331
|
return { CURVE: t, curveOpts: i };
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1334
|
-
const { CURVE: t, curveOpts: n } =
|
|
1333
|
+
function No(e) {
|
|
1334
|
+
const { CURVE: t, curveOpts: n } = Ro(e), r = {
|
|
1335
1335
|
hmac: e.hmac,
|
|
1336
1336
|
randomBytes: e.randomBytes,
|
|
1337
1337
|
lowS: e.lowS,
|
|
@@ -1340,23 +1340,23 @@ function Uo(e) {
|
|
|
1340
1340
|
};
|
|
1341
1341
|
return { CURVE: t, curveOpts: n, hash: e.hash, ecdsaOpts: r };
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function jo(e, t) {
|
|
1344
1344
|
const n = t.Point;
|
|
1345
1345
|
return Object.assign({}, t, {
|
|
1346
1346
|
ProjectivePoint: n,
|
|
1347
1347
|
CURVE: Object.assign({}, e, ni(n.Fn.ORDER, n.Fn.BITS))
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const { CURVE: t, curveOpts: n, hash: r, ecdsaOpts: a } =
|
|
1352
|
-
return
|
|
1350
|
+
function Do(e) {
|
|
1351
|
+
const { CURVE: t, curveOpts: n, hash: r, ecdsaOpts: a } = No(e), i = _o(t, n), s = Uo(i, r, a);
|
|
1352
|
+
return jo(e, s);
|
|
1353
1353
|
}
|
|
1354
1354
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1355
1355
|
function yr(e, t) {
|
|
1356
|
-
const n = (r) =>
|
|
1356
|
+
const n = (r) => Do({ ...e, hash: r });
|
|
1357
1357
|
return { ...n(t), create: n };
|
|
1358
1358
|
}
|
|
1359
|
-
const
|
|
1359
|
+
const Mo = {
|
|
1360
1360
|
gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
|
|
1361
1361
|
l1Block: { address: "0x4200000000000000000000000000000000000015" },
|
|
1362
1362
|
l2CrossDomainMessenger: {
|
|
@@ -1367,28 +1367,28 @@ const jo = {
|
|
|
1367
1367
|
l2ToL1MessagePasser: {
|
|
1368
1368
|
address: "0x4200000000000000000000000000000000000016"
|
|
1369
1369
|
}
|
|
1370
|
-
},
|
|
1371
|
-
block: /* @__PURE__ */
|
|
1370
|
+
}, Lo = {
|
|
1371
|
+
block: /* @__PURE__ */ Gs({
|
|
1372
1372
|
format(e) {
|
|
1373
1373
|
var n;
|
|
1374
1374
|
return {
|
|
1375
1375
|
transactions: (n = e.transactions) == null ? void 0 : n.map((r) => {
|
|
1376
1376
|
if (typeof r == "string")
|
|
1377
1377
|
return r;
|
|
1378
|
-
const a =
|
|
1378
|
+
const a = Hs(r);
|
|
1379
1379
|
return a.typeHex === "0x7e" && (a.isSystemTx = r.isSystemTx, a.mint = r.mint ? xe(r.mint) : void 0, a.sourceHash = r.sourceHash, a.type = "deposit"), a;
|
|
1380
1380
|
}),
|
|
1381
1381
|
stateRoot: e.stateRoot
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
}),
|
|
1385
|
-
transaction: /* @__PURE__ */
|
|
1385
|
+
transaction: /* @__PURE__ */ Fs({
|
|
1386
1386
|
format(e) {
|
|
1387
1387
|
const t = {};
|
|
1388
1388
|
return e.type === "0x7e" && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ? xe(e.mint) : void 0, t.sourceHash = e.sourceHash, t.type = "deposit"), t;
|
|
1389
1389
|
}
|
|
1390
1390
|
}),
|
|
1391
|
-
transactionReceipt: /* @__PURE__ */
|
|
1391
|
+
transactionReceipt: /* @__PURE__ */ Ls({
|
|
1392
1392
|
format(e) {
|
|
1393
1393
|
return {
|
|
1394
1394
|
l1GasPrice: e.l1GasPrice ? xe(e.l1GasPrice) : null,
|
|
@@ -1399,14 +1399,14 @@ const jo = {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
})
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1402
|
+
function Fo(e, t) {
|
|
1403
|
+
return Ko(e) ? Ho(e) : Ks(e, t);
|
|
1404
1404
|
}
|
|
1405
|
-
const
|
|
1406
|
-
transaction:
|
|
1405
|
+
const Go = {
|
|
1406
|
+
transaction: Fo
|
|
1407
1407
|
};
|
|
1408
|
-
function
|
|
1409
|
-
|
|
1408
|
+
function Ho(e) {
|
|
1409
|
+
zo(e);
|
|
1410
1410
|
const { sourceHash: t, data: n, from: r, gas: a, isSystemTx: i, mint: s, to: o, value: u } = e, c = [
|
|
1411
1411
|
t,
|
|
1412
1412
|
r,
|
|
@@ -1419,13 +1419,13 @@ function Fo(e) {
|
|
|
1419
1419
|
];
|
|
1420
1420
|
return Os([
|
|
1421
1421
|
"0x7e",
|
|
1422
|
-
|
|
1422
|
+
zs(c)
|
|
1423
1423
|
]);
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function Ko(e) {
|
|
1426
1426
|
return e.type === "deposit" || typeof e.sourceHash < "u";
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function zo(e) {
|
|
1429
1429
|
const { from: t, to: n } = e;
|
|
1430
1430
|
if (t && !Qe(t))
|
|
1431
1431
|
throw new Mr({ address: t });
|
|
@@ -1434,10 +1434,10 @@ function Ho(e) {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
const Ee = {
|
|
1436
1436
|
blockTime: 2e3,
|
|
1437
|
-
contracts:
|
|
1438
|
-
formatters:
|
|
1439
|
-
serializers:
|
|
1440
|
-
},
|
|
1437
|
+
contracts: Mo,
|
|
1438
|
+
formatters: Lo,
|
|
1439
|
+
serializers: Go
|
|
1440
|
+
}, Vo = /* @__PURE__ */ he({
|
|
1441
1441
|
id: 42161,
|
|
1442
1442
|
name: "Arbitrum One",
|
|
1443
1443
|
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1460,7 +1460,7 @@ const Ee = {
|
|
|
1460
1460
|
blockCreated: 7654707
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
-
}),
|
|
1463
|
+
}), qo = /* @__PURE__ */ he({
|
|
1464
1464
|
id: 43114,
|
|
1465
1465
|
name: "Avalanche",
|
|
1466
1466
|
blockTime: 1700,
|
|
@@ -1485,7 +1485,7 @@ const Ee = {
|
|
|
1485
1485
|
blockCreated: 11907934
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
|
-
}), st = 1, di = /* @__PURE__ */
|
|
1488
|
+
}), st = 1, di = /* @__PURE__ */ he({
|
|
1489
1489
|
...Ee,
|
|
1490
1490
|
id: 8453,
|
|
1491
1491
|
name: "Base",
|
|
@@ -1536,7 +1536,7 @@ const Ee = {
|
|
|
1536
1536
|
({
|
|
1537
1537
|
...di
|
|
1538
1538
|
});
|
|
1539
|
-
const ot = 11155111, li = /* @__PURE__ */
|
|
1539
|
+
const ot = 11155111, li = /* @__PURE__ */ he({
|
|
1540
1540
|
...Ee,
|
|
1541
1541
|
id: 84532,
|
|
1542
1542
|
network: "base-sepolia",
|
|
@@ -1589,32 +1589,7 @@ const ot = 11155111, li = /* @__PURE__ */ de({
|
|
|
1589
1589
|
({
|
|
1590
1590
|
...li
|
|
1591
1591
|
});
|
|
1592
|
-
const
|
|
1593
|
-
id: 56,
|
|
1594
|
-
name: "BNB Smart Chain",
|
|
1595
|
-
blockTime: 750,
|
|
1596
|
-
nativeCurrency: {
|
|
1597
|
-
decimals: 18,
|
|
1598
|
-
name: "BNB",
|
|
1599
|
-
symbol: "BNB"
|
|
1600
|
-
},
|
|
1601
|
-
rpcUrls: {
|
|
1602
|
-
default: { http: ["https://56.rpc.thirdweb.com"] }
|
|
1603
|
-
},
|
|
1604
|
-
blockExplorers: {
|
|
1605
|
-
default: {
|
|
1606
|
-
name: "BscScan",
|
|
1607
|
-
url: "https://bscscan.com",
|
|
1608
|
-
apiUrl: "https://api.bscscan.com/api"
|
|
1609
|
-
}
|
|
1610
|
-
},
|
|
1611
|
-
contracts: {
|
|
1612
|
-
multicall3: {
|
|
1613
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
1614
|
-
blockCreated: 15921452
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
}), qo = /* @__PURE__ */ de({
|
|
1592
|
+
const Zo = /* @__PURE__ */ he({
|
|
1618
1593
|
id: 1,
|
|
1619
1594
|
name: "Ethereum",
|
|
1620
1595
|
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1641,7 +1616,7 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1641
1616
|
blockCreated: 14353601
|
|
1642
1617
|
}
|
|
1643
1618
|
}
|
|
1644
|
-
}), ct = 1,
|
|
1619
|
+
}), ct = 1, Wo = /* @__PURE__ */ he({
|
|
1645
1620
|
...Ee,
|
|
1646
1621
|
id: 10,
|
|
1647
1622
|
name: "OP Mainnet",
|
|
@@ -1686,7 +1661,7 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1686
1661
|
}
|
|
1687
1662
|
},
|
|
1688
1663
|
sourceId: ct
|
|
1689
|
-
}), ut = 11155111,
|
|
1664
|
+
}), ut = 11155111, Yo = /* @__PURE__ */ he({
|
|
1690
1665
|
...Ee,
|
|
1691
1666
|
id: 11155420,
|
|
1692
1667
|
name: "OP Sepolia",
|
|
@@ -1732,30 +1707,7 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1732
1707
|
},
|
|
1733
1708
|
testnet: !0,
|
|
1734
1709
|
sourceId: ut
|
|
1735
|
-
}),
|
|
1736
|
-
id: 137,
|
|
1737
|
-
name: "Polygon",
|
|
1738
|
-
blockTime: 2e3,
|
|
1739
|
-
nativeCurrency: { name: "POL", symbol: "POL", decimals: 18 },
|
|
1740
|
-
rpcUrls: {
|
|
1741
|
-
default: {
|
|
1742
|
-
http: ["https://polygon-rpc.com"]
|
|
1743
|
-
}
|
|
1744
|
-
},
|
|
1745
|
-
blockExplorers: {
|
|
1746
|
-
default: {
|
|
1747
|
-
name: "PolygonScan",
|
|
1748
|
-
url: "https://polygonscan.com",
|
|
1749
|
-
apiUrl: "https://api.etherscan.io/v2/api"
|
|
1750
|
-
}
|
|
1751
|
-
},
|
|
1752
|
-
contracts: {
|
|
1753
|
-
multicall3: {
|
|
1754
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
1755
|
-
blockCreated: 25770160
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
}), Jo = /* @__PURE__ */ de({
|
|
1710
|
+
}), Jo = /* @__PURE__ */ he({
|
|
1759
1711
|
id: 11155111,
|
|
1760
1712
|
name: "Sepolia",
|
|
1761
1713
|
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1782,7 +1734,7 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1782
1734
|
}
|
|
1783
1735
|
},
|
|
1784
1736
|
testnet: !0
|
|
1785
|
-
}),
|
|
1737
|
+
}), St = 1, Xo = /* @__PURE__ */ he({
|
|
1786
1738
|
...Ee,
|
|
1787
1739
|
id: 7777777,
|
|
1788
1740
|
name: "Zora",
|
|
@@ -1807,7 +1759,7 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1807
1759
|
contracts: {
|
|
1808
1760
|
...Ee.contracts,
|
|
1809
1761
|
l2OutputOracle: {
|
|
1810
|
-
[
|
|
1762
|
+
[St]: {
|
|
1811
1763
|
address: "0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"
|
|
1812
1764
|
}
|
|
1813
1765
|
},
|
|
@@ -1816,17 +1768,17 @@ const Vo = /* @__PURE__ */ de({
|
|
|
1816
1768
|
blockCreated: 5882
|
|
1817
1769
|
},
|
|
1818
1770
|
portal: {
|
|
1819
|
-
[
|
|
1771
|
+
[St]: {
|
|
1820
1772
|
address: "0x1a0ad011913A150f69f6A19DF447A0CfD9551054"
|
|
1821
1773
|
}
|
|
1822
1774
|
},
|
|
1823
1775
|
l1StandardBridge: {
|
|
1824
|
-
[
|
|
1776
|
+
[St]: {
|
|
1825
1777
|
address: "0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"
|
|
1826
1778
|
}
|
|
1827
1779
|
}
|
|
1828
1780
|
},
|
|
1829
|
-
sourceId:
|
|
1781
|
+
sourceId: St
|
|
1830
1782
|
}), Qo = "@base-org/account", $o = "2.4.0", fi = {
|
|
1831
1783
|
name: Qo,
|
|
1832
1784
|
version: $o
|
|
@@ -2679,27 +2631,27 @@ function On(e, t) {
|
|
|
2679
2631
|
function $r(e, t) {
|
|
2680
2632
|
return typeof e == "object" && e !== null && t in e && typeof e[t] == "string";
|
|
2681
2633
|
}
|
|
2682
|
-
const
|
|
2634
|
+
const S = {
|
|
2683
2635
|
rpc: {
|
|
2684
|
-
parse: (e) =>
|
|
2685
|
-
invalidRequest: (e) =>
|
|
2686
|
-
invalidParams: (e) =>
|
|
2687
|
-
methodNotFound: (e) =>
|
|
2688
|
-
internal: (e) =>
|
|
2636
|
+
parse: (e) => fe(X.rpc.parse, e),
|
|
2637
|
+
invalidRequest: (e) => fe(X.rpc.invalidRequest, e),
|
|
2638
|
+
invalidParams: (e) => fe(X.rpc.invalidParams, e),
|
|
2639
|
+
methodNotFound: (e) => fe(X.rpc.methodNotFound, e),
|
|
2640
|
+
internal: (e) => fe(X.rpc.internal, e),
|
|
2689
2641
|
server: (e) => {
|
|
2690
2642
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2691
2643
|
throw new Error("Ethereum RPC Server errors must provide single object argument.");
|
|
2692
2644
|
const { code: t } = e;
|
|
2693
2645
|
if (!Number.isInteger(t) || t > -32005 || t < -32099)
|
|
2694
2646
|
throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
|
|
2695
|
-
return
|
|
2647
|
+
return fe(t, e);
|
|
2696
2648
|
},
|
|
2697
|
-
invalidInput: (e) =>
|
|
2698
|
-
resourceNotFound: (e) =>
|
|
2699
|
-
resourceUnavailable: (e) =>
|
|
2700
|
-
transactionRejected: (e) =>
|
|
2701
|
-
methodNotSupported: (e) =>
|
|
2702
|
-
limitExceeded: (e) =>
|
|
2649
|
+
invalidInput: (e) => fe(X.rpc.invalidInput, e),
|
|
2650
|
+
resourceNotFound: (e) => fe(X.rpc.resourceNotFound, e),
|
|
2651
|
+
resourceUnavailable: (e) => fe(X.rpc.resourceUnavailable, e),
|
|
2652
|
+
transactionRejected: (e) => fe(X.rpc.transactionRejected, e),
|
|
2653
|
+
methodNotSupported: (e) => fe(X.rpc.methodNotSupported, e),
|
|
2654
|
+
limitExceeded: (e) => fe(X.rpc.limitExceeded, e)
|
|
2703
2655
|
},
|
|
2704
2656
|
provider: {
|
|
2705
2657
|
userRejectedRequest: (e) => Ve(X.provider.userRejectedRequest, e),
|
|
@@ -2718,7 +2670,7 @@ const k = {
|
|
|
2718
2670
|
}
|
|
2719
2671
|
}
|
|
2720
2672
|
};
|
|
2721
|
-
function
|
|
2673
|
+
function fe(e, t) {
|
|
2722
2674
|
const [n, r] = bi(t);
|
|
2723
2675
|
return new vr(e, n || wr(e), r);
|
|
2724
2676
|
}
|
|
@@ -2757,12 +2709,12 @@ class wi extends vr {
|
|
|
2757
2709
|
* `code` must be an integer in the 1000 <= 4999 range.
|
|
2758
2710
|
*/
|
|
2759
2711
|
constructor(t, n, r) {
|
|
2760
|
-
if (!
|
|
2712
|
+
if (!Sc(t))
|
|
2761
2713
|
throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
|
|
2762
2714
|
super(t, n, r);
|
|
2763
2715
|
}
|
|
2764
2716
|
}
|
|
2765
|
-
function
|
|
2717
|
+
function Sc(e) {
|
|
2766
2718
|
return Number.isInteger(e) && e >= 1e3 && e <= 4999;
|
|
2767
2719
|
}
|
|
2768
2720
|
function ea(e) {
|
|
@@ -2771,7 +2723,7 @@ function ea(e) {
|
|
|
2771
2723
|
function vi(e) {
|
|
2772
2724
|
return typeof e == "object" && e !== null && "details" in e;
|
|
2773
2725
|
}
|
|
2774
|
-
function
|
|
2726
|
+
function kc(e) {
|
|
2775
2727
|
try {
|
|
2776
2728
|
const t = JSON.parse(e.details);
|
|
2777
2729
|
return new vr(t.code, t.message, t.data);
|
|
@@ -2779,16 +2731,16 @@ function Sc(e) {
|
|
|
2779
2731
|
return null;
|
|
2780
2732
|
}
|
|
2781
2733
|
}
|
|
2782
|
-
function
|
|
2734
|
+
function me(e, t, n) {
|
|
2783
2735
|
if (e == null)
|
|
2784
|
-
throw t ??
|
|
2736
|
+
throw t ?? S.rpc.invalidParams({
|
|
2785
2737
|
message: "value must be present",
|
|
2786
2738
|
data: e
|
|
2787
2739
|
});
|
|
2788
2740
|
}
|
|
2789
2741
|
function _e(e, t) {
|
|
2790
2742
|
if (!Array.isArray(e))
|
|
2791
|
-
throw
|
|
2743
|
+
throw S.rpc.invalidParams({
|
|
2792
2744
|
message: t ?? "value must be an array",
|
|
2793
2745
|
data: e
|
|
2794
2746
|
});
|
|
@@ -2901,7 +2853,7 @@ function Rc() {
|
|
|
2901
2853
|
const t = document.createElement("style");
|
|
2902
2854
|
t.setAttribute("base-sdk-font", na), t.textContent = Uc, document.head.appendChild(t);
|
|
2903
2855
|
}
|
|
2904
|
-
var tn, G, Ei, De, ra,
|
|
2856
|
+
var tn, G, Ei, De, ra, Si, Cn, Er, Tn, _n, ht = {}, ki = [], Nc = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Sr = Array.isArray;
|
|
2905
2857
|
function Ue(e, t) {
|
|
2906
2858
|
for (var n in t) e[n] = t[n];
|
|
2907
2859
|
return e;
|
|
@@ -2941,21 +2893,21 @@ function Ii(e) {
|
|
|
2941
2893
|
}
|
|
2942
2894
|
}
|
|
2943
2895
|
function aa(e) {
|
|
2944
|
-
(!e.__d && (e.__d = !0) && De.push(e) && !Ft.__r++ || ra !== G.debounceRendering) && ((ra = G.debounceRendering) ||
|
|
2896
|
+
(!e.__d && (e.__d = !0) && De.push(e) && !Ft.__r++ || ra !== G.debounceRendering) && ((ra = G.debounceRendering) || Si)(Ft);
|
|
2945
2897
|
}
|
|
2946
2898
|
function Ft() {
|
|
2947
2899
|
var e, t, n, r, a, i, s, o;
|
|
2948
|
-
for (De.sort(Cn); e = De.shift(); ) e.__d && (t = De.length, r = void 0, i = (a = (n = e).__v).__e, s = [], o = [], n.__P && ((r = Ue({}, a)).__v = a.__v + 1, G.vnode && G.vnode(r),
|
|
2900
|
+
for (De.sort(Cn); e = De.shift(); ) e.__d && (t = De.length, r = void 0, i = (a = (n = e).__v).__e, s = [], o = [], n.__P && ((r = Ue({}, a)).__v = a.__v + 1, G.vnode && G.vnode(r), kr(n.__P, r, a, n.__n, n.__P.namespaceURI, 32 & a.__u ? [i] : null, s, i ?? et(a), !!(32 & a.__u), o), r.__v = a.__v, r.__.__k[r.__i] = r, Ti(s, r, o), r.__e != i && Ii(r)), De.length > t && De.sort(Cn));
|
|
2949
2901
|
Ft.__r = 0;
|
|
2950
2902
|
}
|
|
2951
2903
|
function Oi(e, t, n, r, a, i, s, o, u, c, f) {
|
|
2952
|
-
var l, p, d, h, m, b = r && r.__k ||
|
|
2953
|
-
for (n.__d = u, jc(n, t, b), u = n.__d, l = 0; l < E; l++) (d = n.__k[l]) != null && (p = d.__i === -1 ? ht : b[d.__i] || ht, d.__i = l,
|
|
2904
|
+
var l, p, d, h, m, b = r && r.__k || ki, E = t.length;
|
|
2905
|
+
for (n.__d = u, jc(n, t, b), u = n.__d, l = 0; l < E; l++) (d = n.__k[l]) != null && (p = d.__i === -1 ? ht : b[d.__i] || ht, d.__i = l, kr(e, d, p, a, i, s, o, u, c, f), h = d.__e, d.ref && p.ref != d.ref && (p.ref && Ar(p.ref, null, d), f.push(d.ref, d.__c || h, d)), m == null && h != null && (m = h), 65536 & d.__u || p.__k === d.__k ? u = Ci(d, u, e) : typeof d.type == "function" && d.__d !== void 0 ? u = d.__d : h && (u = h.nextSibling), d.__d = void 0, d.__u &= -196609);
|
|
2954
2906
|
n.__d = u, n.__e = m;
|
|
2955
2907
|
}
|
|
2956
2908
|
function jc(e, t, n) {
|
|
2957
2909
|
var r, a, i, s, o, u = t.length, c = n.length, f = c, l = 0;
|
|
2958
|
-
for (e.__k = [], r = 0; r < u; r++) (a = t[r]) != null && typeof a != "boolean" && typeof a != "function" ? (s = r + l, (a = e.__k[r] = typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? Rt(null, a, null, null, null) :
|
|
2910
|
+
for (e.__k = [], r = 0; r < u; r++) (a = t[r]) != null && typeof a != "boolean" && typeof a != "function" ? (s = r + l, (a = e.__k[r] = typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? Rt(null, a, null, null, null) : Sr(a) ? Rt(nn, { children: a }, null, null, null) : a.constructor === void 0 && a.__b > 0 ? Rt(a.type, a.props, a.key, a.ref ? a.ref : null, a.__v) : a).__ = e, a.__b = e.__b + 1, i = null, (o = a.__i = Dc(a, n, s, f)) !== -1 && (f--, (i = n[o]) && (i.__u |= 131072)), i == null || i.__v === null ? (o == -1 && l--, typeof a.type != "function" && (a.__u |= 65536)) : o !== s && (o == s - 1 ? l-- : o == s + 1 ? l++ : (o > s ? l-- : l++, a.__u |= 65536))) : a = e.__k[r] = null;
|
|
2959
2911
|
if (f) for (r = 0; r < c; r++) (i = n[r]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = et(i)), _i(i, i));
|
|
2960
2912
|
}
|
|
2961
2913
|
function Ci(e, t, n) {
|
|
@@ -2988,7 +2940,7 @@ function Dc(e, t, n, r) {
|
|
|
2988
2940
|
function ia(e, t, n) {
|
|
2989
2941
|
t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Nc.test(t) ? n : n + "px";
|
|
2990
2942
|
}
|
|
2991
|
-
function
|
|
2943
|
+
function kt(e, t, n, r, a) {
|
|
2992
2944
|
var i;
|
|
2993
2945
|
e: if (t === "style") if (typeof n == "string") e.style.cssText = n;
|
|
2994
2946
|
else {
|
|
@@ -3016,7 +2968,7 @@ function sa(e) {
|
|
|
3016
2968
|
}
|
|
3017
2969
|
};
|
|
3018
2970
|
}
|
|
3019
|
-
function
|
|
2971
|
+
function kr(e, t, n, r, a, i, s, o, u, c) {
|
|
3020
2972
|
var f, l, p, d, h, m, b, E, w, A, N, ee, ae, U, j, B, se = t.type;
|
|
3021
2973
|
if (t.constructor !== void 0) return null;
|
|
3022
2974
|
128 & n.__u && (u = !!(32 & n.__u), i = [o = t.__e = n.__e]), (f = G.__b) && f(t);
|
|
@@ -3024,8 +2976,8 @@ function Sr(e, t, n, r, a, i, s, o, u, c) {
|
|
|
3024
2976
|
if (E = t.props, w = "prototype" in se && se.prototype.render, A = (f = se.contextType) && r[f.__c], N = f ? A ? A.props.value : f.__ : r, n.__c ? b = (l = t.__c = n.__c).__ = l.__E : (w ? t.__c = l = new se(E, N) : (t.__c = l = new Nt(E, N), l.constructor = se, l.render = Lc), A && A.sub(l), l.props = E, l.state || (l.state = {}), l.context = N, l.__n = r, p = l.__d = !0, l.__h = [], l._sb = []), w && l.__s == null && (l.__s = l.state), w && se.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = Ue({}, l.__s)), Ue(l.__s, se.getDerivedStateFromProps(E, l.__s))), d = l.props, h = l.state, l.__v = t, p) w && se.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), w && l.componentDidMount != null && l.__h.push(l.componentDidMount);
|
|
3025
2977
|
else {
|
|
3026
2978
|
if (w && se.getDerivedStateFromProps == null && E !== d && l.componentWillReceiveProps != null && l.componentWillReceiveProps(E, N), !l.__e && (l.shouldComponentUpdate != null && l.shouldComponentUpdate(E, l.__s, N) === !1 || t.__v === n.__v)) {
|
|
3027
|
-
for (t.__v !== n.__v && (l.props = E, l.state = l.__s, l.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(
|
|
3028
|
-
|
|
2979
|
+
for (t.__v !== n.__v && (l.props = E, l.state = l.__s, l.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(le) {
|
|
2980
|
+
le && (le.__ = t);
|
|
3029
2981
|
}), ee = 0; ee < l._sb.length; ee++) l.__h.push(l._sb[ee]);
|
|
3030
2982
|
l._sb = [], l.__h.length && s.push(l);
|
|
3031
2983
|
break e;
|
|
@@ -3040,13 +2992,13 @@ function Sr(e, t, n, r, a, i, s, o, u, c) {
|
|
|
3040
2992
|
} else do
|
|
3041
2993
|
l.__d = !1, ae && ae(t), f = l.render(l.props, l.state, l.context), l.state = l.__s;
|
|
3042
2994
|
while (l.__d && ++U < 25);
|
|
3043
|
-
l.state = l.__s, l.getChildContext != null && (r = Ue(Ue({}, r), l.getChildContext())), w && !p && l.getSnapshotBeforeUpdate != null && (m = l.getSnapshotBeforeUpdate(d, h)), Oi(e,
|
|
3044
|
-
} catch (
|
|
2995
|
+
l.state = l.__s, l.getChildContext != null && (r = Ue(Ue({}, r), l.getChildContext())), w && !p && l.getSnapshotBeforeUpdate != null && (m = l.getSnapshotBeforeUpdate(d, h)), Oi(e, Sr(B = f != null && f.type === nn && f.key == null ? f.props.children : f) ? B : [B], t, n, r, a, i, s, o, u, c), l.base = t.__e, t.__u &= -161, l.__h.length && s.push(l), b && (l.__E = l.__ = null);
|
|
2996
|
+
} catch (le) {
|
|
3045
2997
|
if (t.__v = null, u || i != null) {
|
|
3046
2998
|
for (t.__u |= u ? 160 : 32; o && o.nodeType === 8 && o.nextSibling; ) o = o.nextSibling;
|
|
3047
2999
|
i[i.indexOf(o)] = null, t.__e = o;
|
|
3048
3000
|
} else t.__e = n.__e, t.__k = n.__k;
|
|
3049
|
-
G.__e(
|
|
3001
|
+
G.__e(le, t, n);
|
|
3050
3002
|
}
|
|
3051
3003
|
else i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Mc(n.__e, t, n, r, a, i, s, u, c);
|
|
3052
3004
|
(f = G.diffed) && f(t);
|
|
@@ -3083,13 +3035,13 @@ function Mc(e, t, n, r, a, i, s, o, u) {
|
|
|
3083
3035
|
if (c == "dangerouslySetInnerHTML") l = d;
|
|
3084
3036
|
else if (!(c in E)) {
|
|
3085
3037
|
if (c == "value" && "defaultValue" in E || c == "checked" && "defaultChecked" in E) continue;
|
|
3086
|
-
|
|
3038
|
+
kt(e, c, null, d, a);
|
|
3087
3039
|
}
|
|
3088
3040
|
}
|
|
3089
|
-
for (c in E) d = E[c], c == "children" ? p = d : c == "dangerouslySetInnerHTML" ? f = d : c == "value" ? h = d : c == "checked" ? m = d : o && typeof d != "function" || b[c] === d ||
|
|
3041
|
+
for (c in E) d = E[c], c == "children" ? p = d : c == "dangerouslySetInnerHTML" ? f = d : c == "value" ? h = d : c == "checked" ? m = d : o && typeof d != "function" || b[c] === d || kt(e, c, d, b[c], a);
|
|
3090
3042
|
if (f) o || l && (f.__html === l.__html || f.__html === e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
3091
|
-
else if (l && (e.innerHTML = ""), Oi(e,
|
|
3092
|
-
o || (c = "value", w === "progress" && h == null ? e.removeAttribute("value") : h !== void 0 && (h !== e[c] || w === "progress" && !h || w === "option" && h !== b[c]) &&
|
|
3043
|
+
else if (l && (e.innerHTML = ""), Oi(e, Sr(p) ? p : [p], t, n, r, w === "foreignObject" ? "http://www.w3.org/1999/xhtml" : a, i, s, i ? i[0] : n.__k && et(n, 0), o, u), i != null) for (c = i.length; c--; ) Ai(i[c]);
|
|
3044
|
+
o || (c = "value", w === "progress" && h == null ? e.removeAttribute("value") : h !== void 0 && (h !== e[c] || w === "progress" && !h || w === "option" && h !== b[c]) && kt(e, c, h, b[c], a), c = "checked", m !== void 0 && m !== e[c] && kt(e, c, m, b[c], a));
|
|
3093
3045
|
}
|
|
3094
3046
|
return e;
|
|
3095
3047
|
}
|
|
@@ -3121,9 +3073,9 @@ function Lc(e, t, n) {
|
|
|
3121
3073
|
}
|
|
3122
3074
|
function oa(e, t, n) {
|
|
3123
3075
|
var r, a, i, s;
|
|
3124
|
-
G.__ && G.__(e, t), a = (r = !1) ? null : t.__k, i = [], s = [],
|
|
3076
|
+
G.__ && G.__(e, t), a = (r = !1) ? null : t.__k, i = [], s = [], kr(t, e = t.__k = Pi(nn, null, [e]), a || ht, ht, t.namespaceURI, a ? null : t.firstChild ? tn.call(t.childNodes) : null, i, a ? a.__e : t.firstChild, r, s), Ti(i, e, s);
|
|
3125
3077
|
}
|
|
3126
|
-
tn =
|
|
3078
|
+
tn = ki.slice, G = { __e: function(e, t, n, r) {
|
|
3127
3079
|
for (var a, i, s; t = t.__; ) if ((a = t.__c) && !a.__) try {
|
|
3128
3080
|
if ((i = a.constructor) && i.getDerivedStateFromError != null && (a.setState(i.getDerivedStateFromError(e)), s = a.__d), a.componentDidCatch != null && (a.componentDidCatch(e, r || {}), s = a.__d), s) return a.__E = a;
|
|
3129
3081
|
} catch (o) {
|
|
@@ -3135,7 +3087,7 @@ tn = Si.slice, G = { __e: function(e, t, n, r) {
|
|
|
3135
3087
|
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Ue({}, this.state), typeof e == "function" && (e = e(Ue({}, n), this.props)), e && Ue(n, e), e != null && this.__v && (t && this._sb.push(t), aa(this));
|
|
3136
3088
|
}, Nt.prototype.forceUpdate = function(e) {
|
|
3137
3089
|
this.__v && (this.__e = !0, e && this.__h.push(e), aa(this));
|
|
3138
|
-
}, Nt.prototype.render = nn, De = [],
|
|
3090
|
+
}, Nt.prototype.render = nn, De = [], Si = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Cn = function(e, t) {
|
|
3139
3091
|
return e.__v.__b - t.__v.__b;
|
|
3140
3092
|
}, Ft.__r = 0, Er = 0, Tn = sa(!1), _n = sa(!0);
|
|
3141
3093
|
var Fc = 0;
|
|
@@ -3412,7 +3364,7 @@ function ou(e) {
|
|
|
3412
3364
|
He({
|
|
3413
3365
|
dialogContext: "popup_blocked",
|
|
3414
3366
|
dialogAction: "cancel"
|
|
3415
|
-
}), i(
|
|
3367
|
+
}), i(S.rpc.internal("Popup window was blocked"));
|
|
3416
3368
|
},
|
|
3417
3369
|
actionItems: [
|
|
3418
3370
|
{
|
|
@@ -3424,7 +3376,7 @@ function ou(e) {
|
|
|
3424
3376
|
dialogAction: "confirm"
|
|
3425
3377
|
});
|
|
3426
3378
|
const s = e();
|
|
3427
|
-
s ? a(s) : i(
|
|
3379
|
+
s ? a(s) : i(S.rpc.internal("Popup window was blocked")), n.clear();
|
|
3428
3380
|
}
|
|
3429
3381
|
},
|
|
3430
3382
|
{
|
|
@@ -3434,7 +3386,7 @@ function ou(e) {
|
|
|
3434
3386
|
He({
|
|
3435
3387
|
dialogContext: "popup_blocked",
|
|
3436
3388
|
dialogAction: "cancel"
|
|
3437
|
-
}), i(
|
|
3389
|
+
}), i(S.rpc.internal("Popup window was blocked")), n.clear();
|
|
3438
3390
|
}
|
|
3439
3391
|
}
|
|
3440
3392
|
]
|
|
@@ -3478,7 +3430,7 @@ class cu {
|
|
|
3478
3430
|
*/
|
|
3479
3431
|
F(this, "disconnect", () => {
|
|
3480
3432
|
iu(this.popup), this.popup = null, this.listeners.forEach(({ reject: t }, n) => {
|
|
3481
|
-
t(
|
|
3433
|
+
t(S.provider.userRejectedRequest("Request rejected")), window.removeEventListener("message", n);
|
|
3482
3434
|
}), this.listeners.clear();
|
|
3483
3435
|
});
|
|
3484
3436
|
/**
|
|
@@ -3500,7 +3452,7 @@ class cu {
|
|
|
3500
3452
|
});
|
|
3501
3453
|
}).then(() => {
|
|
3502
3454
|
if (!this.popup)
|
|
3503
|
-
throw
|
|
3455
|
+
throw S.rpc.internal();
|
|
3504
3456
|
return _c(), this.popup;
|
|
3505
3457
|
})));
|
|
3506
3458
|
this.url = new URL(t), this.metadata = n, this.preference = r;
|
|
@@ -3598,13 +3550,13 @@ function jn(e, t = !1) {
|
|
|
3598
3550
|
if (Di.test(n))
|
|
3599
3551
|
return Gt(t ? `0x${n}` : n);
|
|
3600
3552
|
}
|
|
3601
|
-
throw
|
|
3553
|
+
throw S.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`);
|
|
3602
3554
|
}
|
|
3603
3555
|
function Eu(e, t = !1) {
|
|
3604
3556
|
let n = jn(e, !1);
|
|
3605
3557
|
return n.length % 2 === 1 && (n = Gt(`0${n}`)), t ? Gt(`0x${n}`) : n;
|
|
3606
3558
|
}
|
|
3607
|
-
function
|
|
3559
|
+
function Su(e) {
|
|
3608
3560
|
if (typeof e == "number" && Number.isInteger(e))
|
|
3609
3561
|
return yn(e);
|
|
3610
3562
|
if (typeof e == "string") {
|
|
@@ -3613,9 +3565,9 @@ function ku(e) {
|
|
|
3613
3565
|
if (xu(e))
|
|
3614
3566
|
return yn(Number(BigInt(Eu(e, !0))));
|
|
3615
3567
|
}
|
|
3616
|
-
throw
|
|
3568
|
+
throw S.rpc.invalidParams(`Not an integer: ${String(e)}`);
|
|
3617
3569
|
}
|
|
3618
|
-
const
|
|
3570
|
+
const ku = ({ method: e, correlationId: t }) => {
|
|
3619
3571
|
const n = x.subAccountsConfig.get();
|
|
3620
3572
|
Z("scw_signer.handshake.started", {
|
|
3621
3573
|
action: K.unknown,
|
|
@@ -4600,14 +4552,14 @@ function Ku(e) {
|
|
|
4600
4552
|
], [
|
|
4601
4553
|
d,
|
|
4602
4554
|
f,
|
|
4603
|
-
|
|
4604
|
-
|
|
4555
|
+
ke(N),
|
|
4556
|
+
ke(s),
|
|
4605
4557
|
o,
|
|
4606
4558
|
h,
|
|
4607
4559
|
p,
|
|
4608
4560
|
u,
|
|
4609
4561
|
c,
|
|
4610
|
-
|
|
4562
|
+
ke(l)
|
|
4611
4563
|
]);
|
|
4612
4564
|
}
|
|
4613
4565
|
if (r === "0.7") {
|
|
@@ -4626,20 +4578,20 @@ function Ku(e) {
|
|
|
4626
4578
|
], [
|
|
4627
4579
|
w.sender,
|
|
4628
4580
|
w.nonce,
|
|
4629
|
-
|
|
4630
|
-
|
|
4581
|
+
ke(w.initCode),
|
|
4582
|
+
ke(w.callData),
|
|
4631
4583
|
w.accountGasLimits,
|
|
4632
4584
|
w.preVerificationGas,
|
|
4633
4585
|
w.gasFees,
|
|
4634
|
-
|
|
4586
|
+
ke(w.paymasterAndData)
|
|
4635
4587
|
]);
|
|
4636
4588
|
}
|
|
4637
4589
|
throw new Error(`entryPointVersion "${r}" not supported.`);
|
|
4638
4590
|
})();
|
|
4639
|
-
return
|
|
4591
|
+
return ke(pt([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [ke(m), n, BigInt(t)]));
|
|
4640
4592
|
}
|
|
4641
4593
|
async function zu(e) {
|
|
4642
|
-
const { extend: t, nonceKeyManager: n =
|
|
4594
|
+
const { extend: t, nonceKeyManager: n = Vs({
|
|
4643
4595
|
source: {
|
|
4644
4596
|
get() {
|
|
4645
4597
|
return Date.now();
|
|
@@ -4664,7 +4616,7 @@ async function zu(e) {
|
|
|
4664
4616
|
client: e.client
|
|
4665
4617
|
}));
|
|
4666
4618
|
return e.getNonce ? await e.getNonce({ ...s, key: o }) : await En(e.client, {
|
|
4667
|
-
abi:
|
|
4619
|
+
abi: qs([
|
|
4668
4620
|
"function getNonce(address, uint192) pure returns (uint256)"
|
|
4669
4621
|
]),
|
|
4670
4622
|
address: e.entryPoint.address,
|
|
@@ -5316,7 +5268,7 @@ Object.defineProperty(sr, "message", {
|
|
|
5316
5268
|
});
|
|
5317
5269
|
class qu extends _ {
|
|
5318
5270
|
constructor(t, { callData: n, callGasLimit: r, docsPath: a, factory: i, factoryData: s, initCode: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: f, paymaster: l, paymasterAndData: p, paymasterData: d, paymasterPostOpGasLimit: h, paymasterVerificationGasLimit: m, preVerificationGas: b, sender: E, signature: w, verificationGasLimit: A }) {
|
|
5319
|
-
const N =
|
|
5271
|
+
const N = Zs({
|
|
5320
5272
|
callData: n,
|
|
5321
5273
|
callGasLimit: r,
|
|
5322
5274
|
factory: i,
|
|
@@ -5586,7 +5538,7 @@ function Qu(e) {
|
|
|
5586
5538
|
return u[0];
|
|
5587
5539
|
const c = u.filter((f) => {
|
|
5588
5540
|
try {
|
|
5589
|
-
return !!
|
|
5541
|
+
return !!Ws({
|
|
5590
5542
|
abi: f.abi,
|
|
5591
5543
|
data: n
|
|
5592
5544
|
});
|
|
@@ -5600,12 +5552,12 @@ function Qu(e) {
|
|
|
5600
5552
|
args: void 0,
|
|
5601
5553
|
to: void 0
|
|
5602
5554
|
};
|
|
5603
|
-
})(), o = n === "0x" ? new
|
|
5555
|
+
})(), o = n === "0x" ? new Ys({ functionName: a }) : new Js({
|
|
5604
5556
|
abi: r,
|
|
5605
5557
|
data: n,
|
|
5606
5558
|
functionName: a
|
|
5607
5559
|
});
|
|
5608
|
-
return new
|
|
5560
|
+
return new Xs(o, {
|
|
5609
5561
|
abi: r,
|
|
5610
5562
|
args: i,
|
|
5611
5563
|
contractAddress: s,
|
|
@@ -5761,7 +5713,7 @@ async function Or(e, t) {
|
|
|
5761
5713
|
};
|
|
5762
5714
|
}
|
|
5763
5715
|
try {
|
|
5764
|
-
const j = o.client ?? e, B = await be(j,
|
|
5716
|
+
const j = o.client ?? e, B = await be(j, Qs, "estimateFeesPerGas")({
|
|
5765
5717
|
chain: j.chain,
|
|
5766
5718
|
type: "eip1559"
|
|
5767
5719
|
});
|
|
@@ -5790,7 +5742,7 @@ async function Or(e, t) {
|
|
|
5790
5742
|
return n.authorization;
|
|
5791
5743
|
if (s.authorization && !await s.isDeployed())
|
|
5792
5744
|
return {
|
|
5793
|
-
...await
|
|
5745
|
+
...await co(s.client, s.authorization),
|
|
5794
5746
|
r: "0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",
|
|
5795
5747
|
s: "0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
5796
5748
|
yParity: 1
|
|
@@ -5868,7 +5820,7 @@ async function Ki(e, t) {
|
|
|
5868
5820
|
const { account: n = e.account, entryPointAddress: r, stateOverride: a } = t;
|
|
5869
5821
|
if (!n && !t.sender)
|
|
5870
5822
|
throw new Qt();
|
|
5871
|
-
const i = n ? mt(n) : void 0, s =
|
|
5823
|
+
const i = n ? mt(n) : void 0, s = $s(a), o = i ? await be(e, Or, "prepareUserOperation")({
|
|
5872
5824
|
...t,
|
|
5873
5825
|
parameters: [
|
|
5874
5826
|
"authorization",
|
|
@@ -5920,7 +5872,7 @@ async function sd(e, { hash: t }) {
|
|
|
5920
5872
|
}
|
|
5921
5873
|
function od(e) {
|
|
5922
5874
|
const t = { ...e };
|
|
5923
|
-
return e.actualGasCost && (t.actualGasCost = BigInt(e.actualGasCost)), e.actualGasUsed && (t.actualGasUsed = BigInt(e.actualGasUsed)), e.logs && (t.logs = e.logs.map((n) =>
|
|
5875
|
+
return e.actualGasCost && (t.actualGasCost = BigInt(e.actualGasCost)), e.actualGasUsed && (t.actualGasUsed = BigInt(e.actualGasUsed)), e.logs && (t.logs = e.logs.map((n) => eo(n))), e.receipt && (t.receipt = to(t.receipt)), t;
|
|
5924
5876
|
}
|
|
5925
5877
|
async function zi(e, { hash: t }) {
|
|
5926
5878
|
const n = await e.request({
|
|
@@ -5966,10 +5918,10 @@ function ud(e, t) {
|
|
|
5966
5918
|
n
|
|
5967
5919
|
]);
|
|
5968
5920
|
return new Promise((u, c) => {
|
|
5969
|
-
const f =
|
|
5921
|
+
const f = no(o, { resolve: u, reject: c }, (l) => {
|
|
5970
5922
|
const p = (m) => {
|
|
5971
5923
|
h(), m(), f();
|
|
5972
|
-
}, d = i ? setTimeout(() => p(() => l.reject(new wa({ hash: n }))), i) : void 0, h =
|
|
5924
|
+
}, d = i ? setTimeout(() => p(() => l.reject(new wa({ hash: n }))), i) : void 0, h = ro(async () => {
|
|
5973
5925
|
a && s >= a && (clearTimeout(d), p(() => l.reject(new wa({ hash: n }))));
|
|
5974
5926
|
try {
|
|
5975
5927
|
const m = await be(e, zi, "getUserOperationReceipt")({ hash: n });
|
|
@@ -6001,7 +5953,7 @@ function dd(e) {
|
|
|
6001
5953
|
}
|
|
6002
5954
|
function ld(e) {
|
|
6003
5955
|
const { client: t, key: n = "bundler", name: r = "Bundler Client", paymaster: a, paymasterContext: i, transport: s, userOperation: o } = e;
|
|
6004
|
-
return Object.assign(
|
|
5956
|
+
return Object.assign(ao({
|
|
6005
5957
|
...e,
|
|
6006
5958
|
chain: e.chain ?? (t == null ? void 0 : t.chain),
|
|
6007
5959
|
key: n,
|
|
@@ -6012,17 +5964,17 @@ function ld(e) {
|
|
|
6012
5964
|
}
|
|
6013
5965
|
const Vi = gr(() => ({})), fd = [
|
|
6014
5966
|
di,
|
|
6015
|
-
zo,
|
|
6016
|
-
Ko,
|
|
6017
|
-
Yo,
|
|
6018
5967
|
qo,
|
|
6019
5968
|
Vo,
|
|
5969
|
+
_s,
|
|
5970
|
+
Zo,
|
|
5971
|
+
Bs,
|
|
6020
5972
|
Xo,
|
|
6021
|
-
|
|
5973
|
+
Wo
|
|
6022
5974
|
], pd = [
|
|
6023
5975
|
li,
|
|
6024
5976
|
Jo,
|
|
6025
|
-
|
|
5977
|
+
Yo
|
|
6026
5978
|
], md = [
|
|
6027
5979
|
...fd,
|
|
6028
5980
|
...pd
|
|
@@ -6039,7 +5991,7 @@ function qi(e) {
|
|
|
6039
5991
|
function hd(e, t, n) {
|
|
6040
5992
|
var u, c;
|
|
6041
5993
|
const r = n == null ? void 0 : n.viemChain, a = n == null ? void 0 : n.nativeCurrency, i = (a == null ? void 0 : a.name) ?? (r == null ? void 0 : r.name) ?? "", s = (a == null ? void 0 : a.symbol) ?? ((u = r == null ? void 0 : r.nativeCurrency) == null ? void 0 : u.symbol) ?? "", o = (a == null ? void 0 : a.decimal) ?? ((c = r == null ? void 0 : r.nativeCurrency) == null ? void 0 : c.decimals) ?? 18;
|
|
6042
|
-
return
|
|
5994
|
+
return he({
|
|
6043
5995
|
id: e,
|
|
6044
5996
|
name: i,
|
|
6045
5997
|
nativeCurrency: {
|
|
@@ -6072,7 +6024,7 @@ function Zi(e) {
|
|
|
6072
6024
|
const { chainId: t, rpcUrl: n, nativeCurrency: r, viemChain: a } = e, i = hd(t, n, {
|
|
6073
6025
|
viemChain: a,
|
|
6074
6026
|
nativeCurrency: r
|
|
6075
|
-
}), s =
|
|
6027
|
+
}), s = io({
|
|
6076
6028
|
chain: i,
|
|
6077
6029
|
transport: Fr(n)
|
|
6078
6030
|
}), o = ld({
|
|
@@ -6132,15 +6084,15 @@ const Pt = gr(() => ({
|
|
|
6132
6084
|
};
|
|
6133
6085
|
function It(e) {
|
|
6134
6086
|
if (typeof e != "object" || e === null)
|
|
6135
|
-
throw
|
|
6087
|
+
throw S.rpc.internal("sub account info is not an object");
|
|
6136
6088
|
if (!("address" in e))
|
|
6137
|
-
throw
|
|
6089
|
+
throw S.rpc.internal("sub account is invalid");
|
|
6138
6090
|
if ("address" in e && typeof e.address == "string" && !Qe(e.address))
|
|
6139
|
-
throw
|
|
6091
|
+
throw S.rpc.internal("sub account address is invalid");
|
|
6140
6092
|
if ("factory" in e && typeof e.factory == "string" && !Qe(e.factory))
|
|
6141
|
-
throw
|
|
6093
|
+
throw S.rpc.internal("sub account factory address is invalid");
|
|
6142
6094
|
if ("factoryData" in e && typeof e.factoryData == "string" && !qe(e.factoryData))
|
|
6143
|
-
throw
|
|
6095
|
+
throw S.rpc.internal("sub account factory data is invalid");
|
|
6144
6096
|
}
|
|
6145
6097
|
async function gd() {
|
|
6146
6098
|
return crypto.subtle.generateKey({
|
|
@@ -6224,20 +6176,20 @@ async function lt(e, t) {
|
|
|
6224
6176
|
throw i;
|
|
6225
6177
|
return a;
|
|
6226
6178
|
}
|
|
6227
|
-
function
|
|
6179
|
+
function Sd(e) {
|
|
6228
6180
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
6229
|
-
throw
|
|
6181
|
+
throw S.rpc.invalidParams({
|
|
6230
6182
|
message: "Expected a single, non-array, object argument.",
|
|
6231
6183
|
data: e
|
|
6232
6184
|
});
|
|
6233
6185
|
const { method: t, params: n } = e;
|
|
6234
6186
|
if (typeof t != "string" || t.length === 0)
|
|
6235
|
-
throw
|
|
6187
|
+
throw S.rpc.invalidParams({
|
|
6236
6188
|
message: "'args.method' must be a non-empty string.",
|
|
6237
6189
|
data: e
|
|
6238
6190
|
});
|
|
6239
6191
|
if (n !== void 0 && !Array.isArray(n) && (typeof n != "object" || n === null))
|
|
6240
|
-
throw
|
|
6192
|
+
throw S.rpc.invalidParams({
|
|
6241
6193
|
message: "'args.params' must be an object or array if provided.",
|
|
6242
6194
|
data: e
|
|
6243
6195
|
});
|
|
@@ -6246,12 +6198,12 @@ function kd(e) {
|
|
|
6246
6198
|
case "eth_signTypedData_v2":
|
|
6247
6199
|
case "eth_subscribe":
|
|
6248
6200
|
case "eth_unsubscribe":
|
|
6249
|
-
throw
|
|
6201
|
+
throw S.provider.unsupportedMethod();
|
|
6250
6202
|
}
|
|
6251
6203
|
}
|
|
6252
|
-
const
|
|
6204
|
+
const kd = "0.1.1";
|
|
6253
6205
|
function Ad() {
|
|
6254
|
-
return
|
|
6206
|
+
return kd;
|
|
6255
6207
|
}
|
|
6256
6208
|
class q extends Error {
|
|
6257
6209
|
constructor(t, n = {}) {
|
|
@@ -6562,7 +6514,7 @@ function Hd(e, t, n) {
|
|
|
6562
6514
|
size: rt(e)
|
|
6563
6515
|
});
|
|
6564
6516
|
}
|
|
6565
|
-
const
|
|
6517
|
+
const Se = {
|
|
6566
6518
|
zero: 48,
|
|
6567
6519
|
nine: 57,
|
|
6568
6520
|
A: 65,
|
|
@@ -6571,12 +6523,12 @@ const ke = {
|
|
|
6571
6523
|
f: 102
|
|
6572
6524
|
};
|
|
6573
6525
|
function Ea(e) {
|
|
6574
|
-
if (e >=
|
|
6575
|
-
return e -
|
|
6576
|
-
if (e >=
|
|
6577
|
-
return e - (
|
|
6578
|
-
if (e >=
|
|
6579
|
-
return e - (
|
|
6526
|
+
if (e >= Se.zero && e <= Se.nine)
|
|
6527
|
+
return e - Se.zero;
|
|
6528
|
+
if (e >= Se.A && e <= Se.F)
|
|
6529
|
+
return e - (Se.A - 10);
|
|
6530
|
+
if (e >= Se.a && e <= Se.f)
|
|
6531
|
+
return e - (Se.a - 10);
|
|
6580
6532
|
}
|
|
6581
6533
|
function _r(e, t) {
|
|
6582
6534
|
if (je(e) > t)
|
|
@@ -6618,13 +6570,13 @@ const Vd = /* @__PURE__ */ new TextEncoder(), qd = /* @__PURE__ */ Array.from({
|
|
|
6618
6570
|
function Zd(e, t = {}) {
|
|
6619
6571
|
const { strict: n = !1 } = t;
|
|
6620
6572
|
if (!e)
|
|
6621
|
-
throw new
|
|
6573
|
+
throw new Sa(e);
|
|
6622
6574
|
if (typeof e != "string")
|
|
6623
|
-
throw new ka(e);
|
|
6624
|
-
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6625
6575
|
throw new Sa(e);
|
|
6576
|
+
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6577
|
+
throw new ka(e);
|
|
6626
6578
|
if (!e.startsWith("0x"))
|
|
6627
|
-
throw new
|
|
6579
|
+
throw new ka(e);
|
|
6628
6580
|
}
|
|
6629
6581
|
function sn(...e) {
|
|
6630
6582
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
@@ -6666,7 +6618,7 @@ function Wd(e, t) {
|
|
|
6666
6618
|
function as(e, t) {
|
|
6667
6619
|
return ts(e, { dir: "right", size: t });
|
|
6668
6620
|
}
|
|
6669
|
-
function
|
|
6621
|
+
function pe(e, t, n, r = {}) {
|
|
6670
6622
|
const { strict: a } = r;
|
|
6671
6623
|
Kd(e, t);
|
|
6672
6624
|
const i = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
|
|
@@ -6702,7 +6654,7 @@ class Xd extends q {
|
|
|
6702
6654
|
});
|
|
6703
6655
|
}
|
|
6704
6656
|
}
|
|
6705
|
-
class
|
|
6657
|
+
class Sa extends q {
|
|
6706
6658
|
constructor(t) {
|
|
6707
6659
|
super(`Value \`${typeof t == "object" ? an(t) : t}\` of type \`${typeof t}\` is an invalid hex type.`, {
|
|
6708
6660
|
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
@@ -6714,7 +6666,7 @@ class ka extends q {
|
|
|
6714
6666
|
});
|
|
6715
6667
|
}
|
|
6716
6668
|
}
|
|
6717
|
-
class
|
|
6669
|
+
class ka extends q {
|
|
6718
6670
|
constructor(t) {
|
|
6719
6671
|
super(`Value \`${t}\` is an invalid hex value.`, {
|
|
6720
6672
|
metaMessages: [
|
|
@@ -6886,7 +6838,7 @@ function fs(e) {
|
|
|
6886
6838
|
if (e.length !== 132 && e.length !== 130 && e.length !== 68)
|
|
6887
6839
|
throw new cl({ publicKey: e });
|
|
6888
6840
|
if (e.length === 130) {
|
|
6889
|
-
const r = BigInt(
|
|
6841
|
+
const r = BigInt(pe(e, 0, 32)), a = BigInt(pe(e, 32, 64));
|
|
6890
6842
|
return {
|
|
6891
6843
|
prefix: 4,
|
|
6892
6844
|
x: r,
|
|
@@ -6894,14 +6846,14 @@ function fs(e) {
|
|
|
6894
6846
|
};
|
|
6895
6847
|
}
|
|
6896
6848
|
if (e.length === 132) {
|
|
6897
|
-
const r = Number(
|
|
6849
|
+
const r = Number(pe(e, 0, 1)), a = BigInt(pe(e, 1, 33)), i = BigInt(pe(e, 33, 65));
|
|
6898
6850
|
return {
|
|
6899
6851
|
prefix: r,
|
|
6900
6852
|
x: a,
|
|
6901
6853
|
y: i
|
|
6902
6854
|
};
|
|
6903
6855
|
}
|
|
6904
|
-
const t = Number(
|
|
6856
|
+
const t = Number(pe(e, 0, 1)), n = BigInt(pe(e, 1, 33));
|
|
6905
6857
|
return {
|
|
6906
6858
|
prefix: t,
|
|
6907
6859
|
x: n
|
|
@@ -6999,7 +6951,7 @@ function ul(e, t = {}) {
|
|
|
6999
6951
|
function ps(e) {
|
|
7000
6952
|
if (e.length !== 130 && e.length !== 132)
|
|
7001
6953
|
throw new pl({ signature: e });
|
|
7002
|
-
const t = BigInt(
|
|
6954
|
+
const t = BigInt(pe(e, 0, 32)), n = BigInt(pe(e, 32, 64)), r = (() => {
|
|
7003
6955
|
const a = +`0x${e.slice(130)}`;
|
|
7004
6956
|
if (!Number.isNaN(a))
|
|
7005
6957
|
try {
|
|
@@ -7150,11 +7102,11 @@ const ms = {
|
|
|
7150
7102
|
b: BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),
|
|
7151
7103
|
Gx: BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),
|
|
7152
7104
|
Gy: BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")
|
|
7153
|
-
}, vl = ze(ms.p), xl = ze(hs.p), El = ze(ys.p),
|
|
7154
|
-
yr({ ...hs, Fp: xl, lowS: !1 },
|
|
7155
|
-
yr({ ...ys, Fp: El, lowS: !1, allowedPrivateKeyLengths: [130, 131, 132] },
|
|
7105
|
+
}, vl = ze(ms.p), xl = ze(hs.p), El = ze(ys.p), Sl = yr({ ...ms, Fp: vl, lowS: !1 }, Us);
|
|
7106
|
+
yr({ ...hs, Fp: xl, lowS: !1 }, Rs);
|
|
7107
|
+
yr({ ...ys, Fp: El, lowS: !1, allowedPrivateKeyLengths: [130, 131, 132] }, Ns);
|
|
7156
7108
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7157
|
-
const Ca =
|
|
7109
|
+
const Ca = Sl;
|
|
7158
7110
|
Uint8Array.from([
|
|
7159
7111
|
105,
|
|
7160
7112
|
171,
|
|
@@ -7173,7 +7125,7 @@ Uint8Array.from([
|
|
|
7173
7125
|
186,
|
|
7174
7126
|
233
|
|
7175
7127
|
]);
|
|
7176
|
-
function
|
|
7128
|
+
function kl(e = {}) {
|
|
7177
7129
|
const { flag: t = 5, rpId: n = window.location.hostname, signCount: r = 0 } = e, a = ds(rs(n)), i = Re(t, { size: 1 }), s = Re(r, { size: 4 });
|
|
7178
7130
|
return sn(a, i, s);
|
|
7179
7131
|
}
|
|
@@ -7188,7 +7140,7 @@ function Al(e) {
|
|
|
7188
7140
|
});
|
|
7189
7141
|
}
|
|
7190
7142
|
function Pl(e) {
|
|
7191
|
-
const { challenge: t, crossOrigin: n, extraClientData: r, flag: a, origin: i, rpId: s, signCount: o, userVerification: u = "required" } = e, c =
|
|
7143
|
+
const { challenge: t, crossOrigin: n, extraClientData: r, flag: a, origin: i, rpId: s, signCount: o, userVerification: u = "required" } = e, c = kl({
|
|
7192
7144
|
flag: a,
|
|
7193
7145
|
rpId: s,
|
|
7194
7146
|
signCount: o
|
|
@@ -7261,7 +7213,7 @@ function Bl(e, t) {
|
|
|
7261
7213
|
}
|
|
7262
7214
|
const Ul = "base-acc-sdk", Rl = "keys", Nr = "activeId", at = Bl(Ul, Rl);
|
|
7263
7215
|
async function Nl() {
|
|
7264
|
-
const e = await Il({ extractable: !1 }), t =
|
|
7216
|
+
const e = await Il({ extractable: !1 }), t = pe(Br(e.publicKey), 1);
|
|
7265
7217
|
return await at.setItem(t, e), await at.setItem(Nr, t), e;
|
|
7266
7218
|
}
|
|
7267
7219
|
async function jl() {
|
|
@@ -7274,13 +7226,13 @@ async function jl() {
|
|
|
7274
7226
|
async function Dl() {
|
|
7275
7227
|
const e = await jl();
|
|
7276
7228
|
if (!e) {
|
|
7277
|
-
const t = await Nl(), n =
|
|
7229
|
+
const t = await Nl(), n = pe(Br(t.publicKey), 1);
|
|
7278
7230
|
return await at.setItem(n, t), await at.setItem(Nr, n), t;
|
|
7279
7231
|
}
|
|
7280
7232
|
return e;
|
|
7281
7233
|
}
|
|
7282
7234
|
async function Ml() {
|
|
7283
|
-
const e = await Dl(), t =
|
|
7235
|
+
const e = await Dl(), t = pe(Br(e.publicKey), 1), n = async (r) => {
|
|
7284
7236
|
const { payload: a, metadata: i } = Pl({
|
|
7285
7237
|
challenge: r,
|
|
7286
7238
|
origin: "https://keys.coinbase.com",
|
|
@@ -7393,7 +7345,7 @@ function Ua(e) {
|
|
|
7393
7345
|
}
|
|
7394
7346
|
function Fl(e, t) {
|
|
7395
7347
|
if (!Array.isArray(e.params))
|
|
7396
|
-
throw
|
|
7348
|
+
throw S.rpc.invalidParams();
|
|
7397
7349
|
const n = [...e.params];
|
|
7398
7350
|
switch (e.method) {
|
|
7399
7351
|
case "eth_signTransaction":
|
|
@@ -7413,17 +7365,17 @@ function Fl(e, t) {
|
|
|
7413
7365
|
function Ra(e) {
|
|
7414
7366
|
var t;
|
|
7415
7367
|
if (!e || !Array.isArray(e) || !((t = e[0]) != null && t.chainId) || typeof e[0].chainId != "string" && typeof e[0].chainId != "number")
|
|
7416
|
-
throw
|
|
7368
|
+
throw S.rpc.invalidParams();
|
|
7417
7369
|
}
|
|
7418
7370
|
function Gl(e) {
|
|
7419
7371
|
if (!e || !Array.isArray(e) || e.length !== 1 && e.length !== 2 || typeof e[0] != "string" || !Qe(e[0]))
|
|
7420
|
-
throw
|
|
7372
|
+
throw S.rpc.invalidParams();
|
|
7421
7373
|
if (e.length === 2) {
|
|
7422
7374
|
if (!Array.isArray(e[1]))
|
|
7423
|
-
throw
|
|
7375
|
+
throw S.rpc.invalidParams();
|
|
7424
7376
|
for (const t of e[1])
|
|
7425
7377
|
if (typeof t != "string" || !t.startsWith("0x"))
|
|
7426
|
-
throw
|
|
7378
|
+
throw S.rpc.invalidParams();
|
|
7427
7379
|
}
|
|
7428
7380
|
}
|
|
7429
7381
|
function gt(e, t) {
|
|
@@ -7431,7 +7383,7 @@ function gt(e, t) {
|
|
|
7431
7383
|
if (t && e.method.startsWith("wallet_")) {
|
|
7432
7384
|
let r = ft(n, "params.0.capabilities");
|
|
7433
7385
|
if (typeof r > "u" && (r = {}), typeof r != "object")
|
|
7434
|
-
throw
|
|
7386
|
+
throw S.rpc.invalidParams();
|
|
7435
7387
|
r = {
|
|
7436
7388
|
...t,
|
|
7437
7389
|
...r
|
|
@@ -7447,7 +7399,7 @@ async function ur() {
|
|
|
7447
7399
|
if (e.creation === "on-connect") {
|
|
7448
7400
|
const { account: n } = e.toOwnerAccount ? await e.toOwnerAccount() : await cr();
|
|
7449
7401
|
if (!n)
|
|
7450
|
-
throw
|
|
7402
|
+
throw S.provider.unauthorized("No owner account found");
|
|
7451
7403
|
t.addSubAccount = {
|
|
7452
7404
|
account: {
|
|
7453
7405
|
type: "create",
|
|
@@ -7469,14 +7421,14 @@ function Hl(e) {
|
|
|
7469
7421
|
if (!(e.method === "coinbase_fetchPermissions" && e.params === void 0)) {
|
|
7470
7422
|
if (e.method === "coinbase_fetchPermissions" && Array.isArray(e.params) && e.params.length === 1 && typeof e.params[0] == "object") {
|
|
7471
7423
|
if (typeof e.params[0].account != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7472
|
-
throw
|
|
7424
|
+
throw S.rpc.invalidParams("FetchPermissions - Invalid params: params[0].account must be a hex string");
|
|
7473
7425
|
if (typeof e.params[0].chainId != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7474
|
-
throw
|
|
7426
|
+
throw S.rpc.invalidParams("FetchPermissions - Invalid params: params[0].chainId must be a hex string");
|
|
7475
7427
|
if (typeof e.params[0].spender != "string" || !e.params[0].spender.startsWith("0x"))
|
|
7476
|
-
throw
|
|
7428
|
+
throw S.rpc.invalidParams("FetchPermissions - Invalid params: params[0].spender must be a hex string");
|
|
7477
7429
|
return;
|
|
7478
7430
|
}
|
|
7479
|
-
throw
|
|
7431
|
+
throw S.rpc.invalidParams();
|
|
7480
7432
|
}
|
|
7481
7433
|
}
|
|
7482
7434
|
function Kl(e) {
|
|
@@ -7485,7 +7437,7 @@ function Kl(e) {
|
|
|
7485
7437
|
return e;
|
|
7486
7438
|
const t = (a = x.getState().account.accounts) == null ? void 0 : a[0], n = (i = x.getState().account.chain) == null ? void 0 : i.id, r = (s = x.getState().subAccount) == null ? void 0 : s.address;
|
|
7487
7439
|
if (!t || !r || !n)
|
|
7488
|
-
throw
|
|
7440
|
+
throw S.rpc.invalidParams("FetchPermissions - one or more of account, sub account, or chain id is missing, connect to sub account via wallet_connect first");
|
|
7489
7441
|
return {
|
|
7490
7442
|
method: "coinbase_fetchPermissions",
|
|
7491
7443
|
params: [
|
|
@@ -7504,7 +7456,7 @@ async function bs({ client: e, id: t }) {
|
|
|
7504
7456
|
});
|
|
7505
7457
|
if (n.status === "success")
|
|
7506
7458
|
return (r = n.receipts) == null ? void 0 : r[0].transactionHash;
|
|
7507
|
-
throw
|
|
7459
|
+
throw S.rpc.internal("failed to send transaction");
|
|
7508
7460
|
}
|
|
7509
7461
|
function ws({ calls: e, from: t, chainId: n, capabilities: r }) {
|
|
7510
7462
|
const a = mi.get().paymasterUrls;
|
|
@@ -7566,7 +7518,7 @@ function ql(e) {
|
|
|
7566
7518
|
return Array.isArray(e) && e.length === 1 && typeof e[0] == "object" && e[0] !== null && "to" in e[0];
|
|
7567
7519
|
}
|
|
7568
7520
|
function Zl(e) {
|
|
7569
|
-
return
|
|
7521
|
+
return js(ke(Oe(e)), 0, 16);
|
|
7570
7522
|
}
|
|
7571
7523
|
function Wl({ attribution: e, dappOrigin: t }) {
|
|
7572
7524
|
if (e) {
|
|
@@ -7786,7 +7738,7 @@ function $l({ webauthn: e, signature: t }) {
|
|
|
7786
7738
|
], [
|
|
7787
7739
|
{
|
|
7788
7740
|
authenticatorData: e.authenticatorData,
|
|
7789
|
-
clientDataJSON:
|
|
7741
|
+
clientDataJSON: Ds(e.clientDataJSON),
|
|
7790
7742
|
challengeIndex: BigInt(e.challengeIndex),
|
|
7791
7743
|
typeIndex: BigInt(e.typeIndex),
|
|
7792
7744
|
r: n,
|
|
@@ -7798,8 +7750,8 @@ function dt(e) {
|
|
|
7798
7750
|
const { ownerIndex: t = 0 } = e, n = (() => {
|
|
7799
7751
|
if (Da(e.signature) !== 65)
|
|
7800
7752
|
return e.signature;
|
|
7801
|
-
const r =
|
|
7802
|
-
return
|
|
7753
|
+
const r = so(e.signature);
|
|
7754
|
+
return oo(["bytes32", "bytes32", "uint8"], [r.r, r.s, r.yParity === 0 ? 27 : 28]);
|
|
7803
7755
|
})();
|
|
7804
7756
|
return pt([
|
|
7805
7757
|
{
|
|
@@ -7830,7 +7782,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7830
7782
|
factoryData: r
|
|
7831
7783
|
}, c = (p = t.chain) == null ? void 0 : p.id;
|
|
7832
7784
|
if (!c)
|
|
7833
|
-
throw
|
|
7785
|
+
throw S.rpc.internal("chainId not found");
|
|
7834
7786
|
const f = await Ql({
|
|
7835
7787
|
owner: a,
|
|
7836
7788
|
ownerIndex: i ?? 1,
|
|
@@ -7854,7 +7806,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7854
7806
|
case "eth_sendTransaction": {
|
|
7855
7807
|
_e(d.params);
|
|
7856
7808
|
const m = d.params[0];
|
|
7857
|
-
|
|
7809
|
+
me(m.to, S.rpc.invalidParams("to is required"));
|
|
7858
7810
|
const b = {
|
|
7859
7811
|
to: m.to,
|
|
7860
7812
|
data: jn(m.data ?? "0x", !0),
|
|
@@ -7874,13 +7826,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7874
7826
|
_e(d.params);
|
|
7875
7827
|
const m = ft(d.params[0], "chainId");
|
|
7876
7828
|
if (!m)
|
|
7877
|
-
throw
|
|
7829
|
+
throw S.rpc.invalidParams("chainId is required");
|
|
7878
7830
|
if (!qe(m))
|
|
7879
|
-
throw
|
|
7831
|
+
throw S.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7880
7832
|
if (!d.params[0])
|
|
7881
|
-
throw
|
|
7833
|
+
throw S.rpc.invalidParams("params are required");
|
|
7882
7834
|
if (!("calls" in d.params[0]))
|
|
7883
|
-
throw
|
|
7835
|
+
throw S.rpc.invalidParams("calls are required");
|
|
7884
7836
|
let b = {
|
|
7885
7837
|
method: "wallet_prepareCalls",
|
|
7886
7838
|
params: [
|
|
@@ -7912,7 +7864,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7912
7864
|
}));
|
|
7913
7865
|
let A;
|
|
7914
7866
|
if (!w)
|
|
7915
|
-
throw
|
|
7867
|
+
throw S.rpc.internal("signature not found");
|
|
7916
7868
|
return qe(w) ? A = {
|
|
7917
7869
|
type: "secp256k1",
|
|
7918
7870
|
data: {
|
|
@@ -7945,9 +7897,9 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7945
7897
|
_e(d.params);
|
|
7946
7898
|
const m = ft(d.params[0], "chainId");
|
|
7947
7899
|
if (!m)
|
|
7948
|
-
throw
|
|
7900
|
+
throw S.rpc.invalidParams("chainId is required");
|
|
7949
7901
|
if (!qe(m))
|
|
7950
|
-
throw
|
|
7902
|
+
throw S.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7951
7903
|
return await t.request({
|
|
7952
7904
|
method: "wallet_sendPreparedCalls",
|
|
7953
7905
|
params: d.params
|
|
@@ -7957,13 +7909,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7957
7909
|
_e(d.params);
|
|
7958
7910
|
const m = ft(d.params[0], "chainId");
|
|
7959
7911
|
if (!m)
|
|
7960
|
-
throw
|
|
7912
|
+
throw S.rpc.invalidParams("chainId is required");
|
|
7961
7913
|
if (!qe(m))
|
|
7962
|
-
throw
|
|
7914
|
+
throw S.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7963
7915
|
if (!d.params[0])
|
|
7964
|
-
throw
|
|
7916
|
+
throw S.rpc.invalidParams("params are required");
|
|
7965
7917
|
if (!ft(d.params[0], "calls"))
|
|
7966
|
-
throw
|
|
7918
|
+
throw S.rpc.invalidParams("calls are required");
|
|
7967
7919
|
const b = d.params[0];
|
|
7968
7920
|
return o && b.capabilities && !("attribution" in b.capabilities) && (b.capabilities.attribution = o), await t.request({
|
|
7969
7921
|
method: "wallet_prepareCalls",
|
|
@@ -7972,7 +7924,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7972
7924
|
}
|
|
7973
7925
|
case "personal_sign": {
|
|
7974
7926
|
if (_e(d.params), !qe(d.params[0]))
|
|
7975
|
-
throw
|
|
7927
|
+
throw S.rpc.invalidParams("message must be a hex encoded string");
|
|
7976
7928
|
const m = Kr(d.params[0]);
|
|
7977
7929
|
return f.signMessage({ message: m });
|
|
7978
7930
|
}
|
|
@@ -7986,11 +7938,11 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7986
7938
|
case "wallet_addEthereumChain":
|
|
7987
7939
|
case "wallet_switchEthereumChain":
|
|
7988
7940
|
default:
|
|
7989
|
-
throw
|
|
7941
|
+
throw S.rpc.methodNotSupported();
|
|
7990
7942
|
}
|
|
7991
7943
|
} catch (m) {
|
|
7992
7944
|
if (vi(m)) {
|
|
7993
|
-
const b =
|
|
7945
|
+
const b = kc(m);
|
|
7994
7946
|
if (b)
|
|
7995
7947
|
throw b;
|
|
7996
7948
|
}
|
|
@@ -8008,7 +7960,7 @@ async function vs({ address: e, client: t, publicKey: n, factory: r, factoryData
|
|
|
8008
7960
|
data: a
|
|
8009
7961
|
});
|
|
8010
7962
|
if (o.functionName !== "createAccount")
|
|
8011
|
-
throw
|
|
7963
|
+
throw S.rpc.internal("unknown factory function");
|
|
8012
7964
|
const [u] = o.args;
|
|
8013
7965
|
return u.findIndex((c) => c.toLowerCase() === Na(n).toLowerCase());
|
|
8014
7966
|
}
|
|
@@ -8070,7 +8022,7 @@ async function tf() {
|
|
|
8070
8022
|
async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
8071
8023
|
var d, h;
|
|
8072
8024
|
const r = x.account.get(), a = x.subAccounts.get(), i = (d = r.accounts) == null ? void 0 : d.find((m) => m.toLowerCase() !== (a == null ? void 0 : a.address.toLowerCase()));
|
|
8073
|
-
|
|
8025
|
+
me(i, S.provider.unauthorized("no global account")), me((h = r.chain) == null ? void 0 : h.id, S.provider.unauthorized("no chain id")), me(a == null ? void 0 : a.address, S.provider.unauthorized("no sub account"));
|
|
8074
8026
|
const s = [];
|
|
8075
8027
|
if (e.type === "local" && e.address && s.push({
|
|
8076
8028
|
to: a.address,
|
|
@@ -8104,19 +8056,19 @@ async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
|
8104
8056
|
]
|
|
8105
8057
|
};
|
|
8106
8058
|
if (await tf() === "cancel")
|
|
8107
|
-
throw
|
|
8059
|
+
throw S.provider.unauthorized("user cancelled");
|
|
8108
8060
|
const c = await t(o), f = Yi(r.chain.id);
|
|
8109
|
-
if (
|
|
8061
|
+
if (me(f, S.rpc.internal(`client not found for chainId ${r.chain.id}`)), (await Ga(f, {
|
|
8110
8062
|
id: c
|
|
8111
8063
|
})).status !== "success")
|
|
8112
|
-
throw
|
|
8064
|
+
throw S.rpc.internal("add owner call failed");
|
|
8113
8065
|
const p = await vs({
|
|
8114
8066
|
address: a.address,
|
|
8115
8067
|
publicKey: e.type === "local" && e.address ? e.address : e.publicKey,
|
|
8116
8068
|
client: f
|
|
8117
8069
|
});
|
|
8118
8070
|
if (p === -1)
|
|
8119
|
-
throw
|
|
8071
|
+
throw S.rpc.internal("failed to find owner index");
|
|
8120
8072
|
return p;
|
|
8121
8073
|
}
|
|
8122
8074
|
async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, client: r, globalAccountRequest: a, chainId: i, prependCalls: s }) {
|
|
@@ -8172,11 +8124,11 @@ async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, c
|
|
|
8172
8124
|
async function rf({ globalAccountAddress: e, subAccountAddress: t, client: n, request: r, globalAccountRequest: a }) {
|
|
8173
8125
|
var o;
|
|
8174
8126
|
const i = (o = n.chain) == null ? void 0 : o.id;
|
|
8175
|
-
|
|
8127
|
+
me(i, S.rpc.internal("invalid chainId"));
|
|
8176
8128
|
try {
|
|
8177
8129
|
await zl();
|
|
8178
8130
|
} catch {
|
|
8179
|
-
throw
|
|
8131
|
+
throw S.provider.userRejectedRequest({
|
|
8180
8132
|
message: "User cancelled funding"
|
|
8181
8133
|
});
|
|
8182
8134
|
}
|
|
@@ -8209,7 +8161,7 @@ class af {
|
|
|
8209
8161
|
async handshake(t) {
|
|
8210
8162
|
var r, a;
|
|
8211
8163
|
const n = Pe.get(t);
|
|
8212
|
-
|
|
8164
|
+
ku({ method: t.method, correlationId: n });
|
|
8213
8165
|
try {
|
|
8214
8166
|
await ((a = (r = this.communicator).waitForPopupLoaded) == null ? void 0 : a.call(r));
|
|
8215
8167
|
const i = await this.createRequestMessage({
|
|
@@ -8263,7 +8215,7 @@ class af {
|
|
|
8263
8215
|
case "wallet_sign":
|
|
8264
8216
|
return this.sendRequestToPopup(t);
|
|
8265
8217
|
default:
|
|
8266
|
-
throw
|
|
8218
|
+
throw S.provider.unauthorized();
|
|
8267
8219
|
}
|
|
8268
8220
|
if (this.shouldRequestUseSubAccountSigner(t)) {
|
|
8269
8221
|
const c = Pe.get(t);
|
|
@@ -8323,7 +8275,7 @@ class af {
|
|
|
8323
8275
|
subAccounts: [c]
|
|
8324
8276
|
};
|
|
8325
8277
|
if (!this.chain.rpcUrl)
|
|
8326
|
-
throw
|
|
8278
|
+
throw S.rpc.internal("No RPC URL set for chain");
|
|
8327
8279
|
const f = await lt(t, this.chain.rpcUrl);
|
|
8328
8280
|
if (_e(f.subAccounts, "subAccounts"), f.subAccounts.length > 0) {
|
|
8329
8281
|
It(f.subAccounts[0]);
|
|
@@ -8352,7 +8304,7 @@ class af {
|
|
|
8352
8304
|
}
|
|
8353
8305
|
default:
|
|
8354
8306
|
if (!this.chain.rpcUrl)
|
|
8355
|
-
throw
|
|
8307
|
+
throw S.rpc.internal("No RPC URL set for chain");
|
|
8356
8308
|
return lt(t, this.chain.rpcUrl);
|
|
8357
8309
|
}
|
|
8358
8310
|
}
|
|
@@ -8420,7 +8372,7 @@ class af {
|
|
|
8420
8372
|
*/
|
|
8421
8373
|
async handleSwitchChainRequest(t) {
|
|
8422
8374
|
Ra(t.params);
|
|
8423
|
-
const n =
|
|
8375
|
+
const n = Su(t.params[0].chainId);
|
|
8424
8376
|
if (this.updateChain(n))
|
|
8425
8377
|
return null;
|
|
8426
8378
|
const a = await this.sendRequestToPopup(t);
|
|
@@ -8430,7 +8382,7 @@ class af {
|
|
|
8430
8382
|
Gl(t.params);
|
|
8431
8383
|
const n = t.params[0], r = t.params[1];
|
|
8432
8384
|
if (!this.accounts.some((o) => La(o, n)))
|
|
8433
|
-
throw
|
|
8385
|
+
throw S.provider.unauthorized("no active account found when getting capabilities");
|
|
8434
8386
|
const a = x.getState().account.capabilities;
|
|
8435
8387
|
if (!a)
|
|
8436
8388
|
return {};
|
|
@@ -8449,7 +8401,7 @@ class af {
|
|
|
8449
8401
|
async sendEncryptedRequest(t) {
|
|
8450
8402
|
const n = await this.keyManager.getSharedSecret();
|
|
8451
8403
|
if (!n)
|
|
8452
|
-
throw
|
|
8404
|
+
throw S.provider.unauthorized("No shared secret found when encrypting request");
|
|
8453
8405
|
const r = await xd({
|
|
8454
8406
|
action: t,
|
|
8455
8407
|
chainId: this.chain.id
|
|
@@ -8473,7 +8425,7 @@ class af {
|
|
|
8473
8425
|
throw n.failure;
|
|
8474
8426
|
const r = await this.keyManager.getSharedSecret();
|
|
8475
8427
|
if (!r)
|
|
8476
|
-
throw
|
|
8428
|
+
throw S.provider.unauthorized("Invalid session: no shared secret found when decrypting response");
|
|
8477
8429
|
const a = await Ed(n.encrypted, r), i = (o = a.data) == null ? void 0 : o.chains;
|
|
8478
8430
|
if (i) {
|
|
8479
8431
|
const f = (u = a.data) == null ? void 0 : u.nativeCurrencies, l = Object.entries(i).map(([p, d]) => {
|
|
@@ -8510,7 +8462,7 @@ class af {
|
|
|
8510
8462
|
else {
|
|
8511
8463
|
const f = x.subAccountsConfig.get() ?? {}, { account: l } = f.toOwnerAccount ? await f.toOwnerAccount() : await cr();
|
|
8512
8464
|
if (!l)
|
|
8513
|
-
throw
|
|
8465
|
+
throw S.provider.unauthorized("could not get subaccount owner account when adding sub account");
|
|
8514
8466
|
c = [
|
|
8515
8467
|
{
|
|
8516
8468
|
type: l.address ? "address" : "webauthn-p256",
|
|
@@ -8530,16 +8482,16 @@ class af {
|
|
|
8530
8482
|
async sendRequestToSubAccountSigner(t) {
|
|
8531
8483
|
var m, b, E;
|
|
8532
8484
|
const n = x.subAccounts.get(), r = x.subAccountsConfig.get(), a = x.config.get();
|
|
8533
|
-
|
|
8485
|
+
me(n == null ? void 0 : n.address, S.provider.unauthorized("no active sub account when sending request to sub account signer"));
|
|
8534
8486
|
const i = r != null && r.toOwnerAccount ? await r.toOwnerAccount() : await cr();
|
|
8535
|
-
|
|
8487
|
+
me(i == null ? void 0 : i.account, S.provider.unauthorized("no active sub account owner when sending request to sub account signer")), Ua(t) === void 0 && (t = Fl(t, n.address));
|
|
8536
8488
|
const o = this.accounts.find((w) => w.toLowerCase() !== n.address.toLowerCase());
|
|
8537
|
-
|
|
8489
|
+
me(o, S.provider.unauthorized("no global account found when sending request to sub account signer"));
|
|
8538
8490
|
const u = Wl({
|
|
8539
8491
|
attribution: (m = a.preference) == null ? void 0 : m.attribution,
|
|
8540
8492
|
dappOrigin: window.location.origin
|
|
8541
8493
|
}), c = t.method === "wallet_sendCalls" && ((E = (b = t.params) == null ? void 0 : b[0]) == null ? void 0 : E.chainId), f = c ? vt(c) : this.chain.id, l = Yi(f);
|
|
8542
|
-
if (
|
|
8494
|
+
if (me(l, S.rpc.internal(`client not found for chainId ${f} when sending request to sub account signer`)), ["eth_sendTransaction", "wallet_sendCalls"].includes(t.method)) {
|
|
8543
8495
|
const w = x.subAccountsConfig.get();
|
|
8544
8496
|
if ((w == null ? void 0 : w.funding) === "spend-permissions" && br.get().length === 0)
|
|
8545
8497
|
return await xs({
|
|
@@ -8573,7 +8525,7 @@ class af {
|
|
|
8573
8525
|
method: t.method,
|
|
8574
8526
|
correlationId: w,
|
|
8575
8527
|
errorMessage: Ze(A)
|
|
8576
|
-
}),
|
|
8528
|
+
}), S.provider.unauthorized("failed to add sub account owner when sending request to sub account signer");
|
|
8577
8529
|
}
|
|
8578
8530
|
}
|
|
8579
8531
|
const { request: h } = await ef({
|
|
@@ -8661,7 +8613,7 @@ class sf extends fu {
|
|
|
8661
8613
|
async _request(n) {
|
|
8662
8614
|
var r;
|
|
8663
8615
|
try {
|
|
8664
|
-
if (
|
|
8616
|
+
if (Sd(n), !this.signer.isConnected)
|
|
8665
8617
|
switch (n.method) {
|
|
8666
8618
|
case "eth_requestAccounts": {
|
|
8667
8619
|
await this.signer.handshake({ method: "handshake" }), await ur(), await this.signer.request({
|
|
@@ -8697,7 +8649,7 @@ class sf extends fu {
|
|
|
8697
8649
|
case "eth_chainId":
|
|
8698
8650
|
return Mi(1);
|
|
8699
8651
|
default:
|
|
8700
|
-
throw
|
|
8652
|
+
throw S.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");
|
|
8701
8653
|
}
|
|
8702
8654
|
return await this.signer.request(n);
|
|
8703
8655
|
} catch (a) {
|
|
@@ -8706,7 +8658,7 @@ class sf extends fu {
|
|
|
8706
8658
|
}
|
|
8707
8659
|
}
|
|
8708
8660
|
async disconnect() {
|
|
8709
|
-
await this.signer.cleanup(), Pe.clear(), this.emit("disconnect",
|
|
8661
|
+
await this.signer.cleanup(), Pe.clear(), this.emit("disconnect", S.provider.disconnected("User initiated disconnection"));
|
|
8710
8662
|
}
|
|
8711
8663
|
}
|
|
8712
8664
|
const of = "isCoinbaseBrowser";
|
|
@@ -8767,7 +8719,7 @@ function hf(e) {
|
|
|
8767
8719
|
addOwner: async ({ address: c, publicKey: f, chainId: l }) => {
|
|
8768
8720
|
var m, b;
|
|
8769
8721
|
const p = x.subAccounts.get(), d = x.account.get();
|
|
8770
|
-
|
|
8722
|
+
me(d, new Error("account does not exist")), me(p == null ? void 0 : p.address, new Error("subaccount does not exist"));
|
|
8771
8723
|
const h = [];
|
|
8772
8724
|
if (f) {
|
|
8773
8725
|
const [E, w] = Ka([{ type: "bytes32" }, { type: "bytes32" }], f);
|