react-web3-storage 2.0.3 → 2.0.21
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-ZWJVb5u8.mjs → ReownAuthentication-7iIT4jS4.mjs} +5 -5
- package/dist/{ReownAuthentication-_EMKUe4O.js → ReownAuthentication-BEGlJitZ.js} +1 -1
- package/dist/{SwapController-CNHVjC6V.mjs → SwapController-CmWZu4cY.mjs} +16 -16
- package/dist/{SwapController-75y039lY.js → SwapController-DNucRoq5.js} +1 -1
- package/dist/{ccip-CQrFYKlN.mjs → ccip-BCIUIeQM.mjs} +6 -6
- package/dist/{ccip-BgoVuN3u.js → ccip-Cy73HTCR.js} +1 -1
- package/dist/{data-capture-CgKKCS0j.mjs → data-capture-CaxHvefN.mjs} +5 -5
- package/dist/{data-capture-hbDyOOyJ.js → data-capture-DbbP8JDT.js} +1 -1
- package/dist/{email-C2N4HkZQ.mjs → email-B3WQnC0b.mjs} +9 -9
- package/dist/{email-DYvAHYik.js → email-CYJMBkHW.js} +1 -1
- package/dist/{embedded-wallet-_7JcZAOC.mjs → embedded-wallet-Dlo0wBgH.mjs} +22 -22
- package/dist/{embedded-wallet-CYNDQvBG.js → embedded-wallet-t_Jd_LFV.js} +1 -1
- package/dist/{features-JvQHn7sG.mjs → features-5qKGISK9.mjs} +1 -1
- package/dist/{features-BA8f0aFu.js → features-B1ezv71b.js} +1 -1
- package/dist/{index-B--AiWBy.mjs → index-2WfSPp5U.mjs} +5 -5
- package/dist/{index-DVNi_N99.mjs → index-BBH4oh8q.mjs} +2 -2
- package/dist/{index-CASDFBE7.js → index-BCZXGGtc.js} +1 -1
- package/dist/{index-DIxai2A2.mjs → index-BR1aMNYm.mjs} +1 -1
- package/dist/{index-BNobBA-8.js → index-BhaYgUya.js} +281 -281
- package/dist/{index-Clu0wU1d.mjs → index-CAtS1mbf.mjs} +15 -15
- package/dist/{index-BHukHFIh.mjs → index-CFLg0HEy.mjs} +4171 -4250
- package/dist/{index-xYJPqvul.js → index-CZuajWCC.js} +1 -1
- package/dist/{index-CjS2YG3n.js → index-D1agTf42.js} +1 -1
- package/dist/{index-Ccy2zz9q.mjs → index-D3R3_EiN.mjs} +1 -1
- package/dist/{index-DnKQlXMR.mjs → index-D8W2bJl5.mjs} +1 -1
- package/dist/{index-CLUlCRLy.js → index-DAGaFidW.js} +1 -1
- package/dist/index-DWRWjePT.mjs +267 -0
- package/dist/{index-mvH0tD6I.js → index-Dk48RrmB.js} +8 -8
- package/dist/{index-DzjJtqrG.js → index-MeOSUHRy.js} +1 -1
- package/dist/index-R_8iHUbU.js +1 -0
- package/dist/{index-Bxg-paEQ.mjs → index-SXXuh_Wo.mjs} +394 -346
- package/dist/{index-C_fopi0u.js → index-VrnBQez9.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{onramp-DlA5BSaX.js → onramp-BMMneL8g.js} +1 -1
- package/dist/{onramp-zhj-U9X5.mjs → onramp-qJaw31Jf.mjs} +31 -31
- package/dist/{parseSignature-CWAxHYP1.js → parseSignature-jZAFls5F.js} +6 -6
- package/dist/{parseSignature-ZB66mPGB.mjs → parseSignature-zKnspnY-.mjs} +74 -56
- package/dist/{pay-with-exchange-Czbx9cbv.mjs → pay-with-exchange-CTRrPVEx.mjs} +2 -2
- package/dist/{pay-with-exchange-BQaMDGKp.js → pay-with-exchange-CgjKtyDu.js} +1 -1
- package/dist/{receive-VPGRuO6J.mjs → receive-D9mYL7F2.mjs} +1 -1
- package/dist/{receive-BA736NNd.js → receive-eP1MrUw6.js} +1 -1
- package/dist/{send-xiZMc6dE.mjs → send-DmCwhyow.mjs} +21 -21
- package/dist/{send-BhagKj7q.js → send-tFHrHPh4.js} +1 -1
- package/dist/{socials-B-mhVCLM.js → socials-BXz_VcPl.js} +1 -1
- package/dist/{socials-BX3hluqS.mjs → socials-BbYHDCTQ.mjs} +13 -13
- package/dist/{swaps-DQYnz8sb.js → swaps-C9W-NxLv.js} +1 -1
- package/dist/{swaps-BFl7r_MZ.mjs → swaps-D06KGkWD.mjs} +3 -3
- package/dist/{transactions-BooVIWm5.mjs → transactions-B-bDj0J7.mjs} +1 -1
- package/dist/{transactions-DWsNckfd.js → transactions-CHNmwPaw.js} +1 -1
- package/dist/{w3m-modal-BLoHPTsO.mjs → w3m-modal-B82zwpqg.mjs} +18 -18
- package/dist/{w3m-modal-D6NKq8XS.js → w3m-modal-CaxvJDN5.js} +1 -1
- package/package.json +3 -4
- package/dist/index-B7Og0OLg.js +0 -1
- package/dist/index-CgI_Ukj5.mjs +0 -267
|
@@ -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 ks = (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) => ks(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { ad as _, d0 as Ye, d1 as dr, d2 as Dt, d3 as Ss, d4 as Be, d5 as As, d6 as Ps, d7 as ja, d8 as Is, bm as xe, bz as Oe, bc as Os, b9 as Qe, ac as Mr, d9 as Cs, ba as Je, be as ge, bx as M, bh as Da, bK as Xt, b3 as pt, bA as Se, bP as Lr, b4 as Ne, bM as Ts, I as Fr, bd as qe, da as _s, db as Bs, dc as Us, bH as Ma, bi as Rs, bt as Gr, br as xn, bl as Hr, by as Ns, bp as Kr, bo as vt } from "./index-CFLg0HEy.mjs";
|
|
5
|
+
import { aV as mt, aW as be, aX as lr, aY as js, ab as La, ay as Ds, av as Ms, as as Ls, aw as Fs, aQ as Gs, ao as Hs, ai as de, aD as Ks, aI as cn, aZ as Fa, a_ as En, p as zs, a$ as Vs, a1 as qs, E as Zs, D as Ws, A as Ys, b0 as Js, b1 as Xs, au as Qs, az as $s, b2 as eo, b3 as to, l as no, m as ro, b4 as Ga, a3 as Ha, aF as ao, a9 as io, a0 as Ka } from "./parseSignature-zKnspnY-.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 so(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 co(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, js, "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), kn = /* @__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 Ss(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 oo(e, t, n) {
|
|
93
93
|
return un(e) && un(t) && un(n) && t <= e && e < n;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (!
|
|
95
|
+
function co(e, t, n, r) {
|
|
96
|
+
if (!oo(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 >>= kn, t += 1)
|
|
102
102
|
;
|
|
103
103
|
return t;
|
|
104
104
|
}
|
|
105
|
-
const bt = (e) => (
|
|
106
|
-
function
|
|
105
|
+
const bt = (e) => (kn << BigInt(e)) - kn;
|
|
106
|
+
function uo(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 le = BigInt(0), oe = BigInt(1), Le = /* @__PURE__ */ BigInt(2), Wa = /* @__PURE__ */ BigInt(3), Ya = /* @__PURE__ */ BigInt(4), Ja = /* @__PURE__ */ BigInt(5), lo = /* @__PURE__ */ BigInt(7), Xa = /* @__PURE__ */ BigInt(8), fo = /* @__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 >= le ? n : t + n;
|
|
167
167
|
}
|
|
168
168
|
function Vr(e, t) {
|
|
169
|
-
if (e ===
|
|
169
|
+
if (e === le)
|
|
170
170
|
throw new Error("invert: expected non-zero number");
|
|
171
|
-
if (t <=
|
|
171
|
+
if (t <= le)
|
|
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 = le, i = oe;
|
|
174
|
+
for (; n !== le; ) {
|
|
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 po(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 mo(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 + lo) / 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 === le; )
|
|
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 ho(e) {
|
|
239
|
+
return e % Ya === Wa ? $a : e % Xa === Ja ? po : e % Qa === fo ? mo(e) : ei(e);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const yo = [
|
|
242
242
|
"create",
|
|
243
243
|
"isValid",
|
|
244
244
|
"is0",
|
|
@@ -257,24 +257,24 @@ const bo = [
|
|
|
257
257
|
"mulN",
|
|
258
258
|
"sqrN"
|
|
259
259
|
];
|
|
260
|
-
function
|
|
260
|
+
function go(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 = yo.reduce((r, a) => (r[a] = "function", r), t);
|
|
267
267
|
return mr(e, n), e;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
if (n <
|
|
269
|
+
function bo(e, t, n) {
|
|
270
|
+
if (n < le)
|
|
271
271
|
throw new Error("invalid exponent, negatives unsupported");
|
|
272
|
-
if (n ===
|
|
272
|
+
if (n === le)
|
|
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 > le; )
|
|
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 <= le)
|
|
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: le,
|
|
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 le <= p && p < e;
|
|
325
325
|
},
|
|
326
|
-
is0: (p) => p ===
|
|
326
|
+
is0: (p) => p === le,
|
|
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) => bo(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 = ho(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 wo(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 vo(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 Eo(e, t) {
|
|
|
416
416
|
throw new Error("invalid point at index " + r);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function xo(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 Eo {
|
|
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 ko {
|
|
|
522
522
|
return pn(t) !== 1;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function ko(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 So(e, t, n, r) {
|
|
532
|
+
vo(n, e), xo(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 go(t), t;
|
|
561
561
|
} else
|
|
562
562
|
return ze(e, { isLE: n });
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Ao(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 Io(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 Po(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 Oo(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 Sn(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 && Sn(n.format), n;
|
|
600
600
|
}
|
|
601
|
-
class
|
|
601
|
+
class Io 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: Io,
|
|
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), Oo = 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 Co(e, t = {}) {
|
|
712
|
+
const n = Ao("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 _o(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: S } = 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(S);
|
|
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(S));
|
|
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, S = L[0], P = L.subarray(1);
|
|
744
|
+
if (y === v && (S === 2 || S === 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 _o(e, t = {}) {
|
|
|
755
755
|
}
|
|
756
756
|
f();
|
|
757
757
|
const T = r.isOdd(I);
|
|
758
|
-
return (
|
|
759
|
-
} else if (y === g &&
|
|
758
|
+
return (S & 1) === 1 !== T && (I = r.neg(I)), { x: C, y: I };
|
|
759
|
+
} else if (y === g && S === 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 _o(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), Oo), 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 _o(e, t = {}) {
|
|
|
790
790
|
function ee(L) {
|
|
791
791
|
if (!u || !u.basises)
|
|
792
792
|
throw new Error("no endo");
|
|
793
|
-
return
|
|
793
|
+
return Po(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: S } = L;
|
|
797
|
+
if (r.eql(S, 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(S));
|
|
801
|
+
const C = r.mul(g, v), O = r.mul(y, v), I = r.mul(S, 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 _o(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, S) {
|
|
823
|
+
return g = new B(r.mul(g.X, L), g.Y, g.Z), v = Lt(y, v), g = Lt(S, 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 _o(e, t = {}) {
|
|
|
859
859
|
* @returns
|
|
860
860
|
*/
|
|
861
861
|
precompute(v = 8, g = !0) {
|
|
862
|
-
return
|
|
862
|
+
return fe.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 _o(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: S } = this, { X: P, Y: C, Z: O } = v, I = r.eql(r.mul(g, O), r.mul(P, S)), T = r.eql(r.mul(y, O), r.mul(C, S));
|
|
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 _o(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: S, Y: P, Z: C } = this;
|
|
891
|
+
let O = r.ZERO, I = r.ZERO, T = r.ZERO, R = r.mul(S, S), ne = r.mul(P, P), V = r.mul(C, C), D = r.mul(S, P);
|
|
892
|
+
return D = r.add(D, D), T = r.mul(S, 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 _o(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: S } = 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(S, 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, S);
|
|
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, S), 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 _o(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, S;
|
|
928
|
+
const P = (C) => fe.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
|
+
S = 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, S = O;
|
|
935
935
|
}
|
|
936
|
-
return dn(B, [y,
|
|
936
|
+
return dn(B, [y, S])[0];
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
939
939
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -948,17 +948,17 @@ function _o(e, t = {}) {
|
|
|
948
948
|
return B.ZERO;
|
|
949
949
|
if (v === Xe)
|
|
950
950
|
return y;
|
|
951
|
-
if (
|
|
951
|
+
if (fe.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: S, k1: P, k2neg: C, k2: O } = ee(v), { p1: I, p2: T } = ko(B, y, P, O);
|
|
955
|
+
return j(g.beta, I, T, S, C);
|
|
956
956
|
} else
|
|
957
|
-
return
|
|
957
|
+
return fe.unsafe(y, v);
|
|
958
958
|
}
|
|
959
959
|
multiplyAndAddUnsafe(v, g, y) {
|
|
960
|
-
const
|
|
961
|
-
return
|
|
960
|
+
const S = this.multiplyUnsafe(g).add(v.multiplyUnsafe(y));
|
|
961
|
+
return S.is0() ? void 0 : S;
|
|
962
962
|
}
|
|
963
963
|
/**
|
|
964
964
|
* Converts Projective point to affine (x, y) coordinates.
|
|
@@ -973,7 +973,7 @@ function _o(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) : fe.unsafe(this, o).is0();
|
|
977
977
|
}
|
|
978
978
|
clearCofactor() {
|
|
979
979
|
const { clearCofactor: v } = t;
|
|
@@ -1011,14 +1011,14 @@ function _o(e, t = {}) {
|
|
|
1011
1011
|
return dn(B, v);
|
|
1012
1012
|
}
|
|
1013
1013
|
static msm(v, g) {
|
|
1014
|
-
return
|
|
1014
|
+
return So(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, fe = new Eo(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 To(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 Bo(e, t = {}) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
function o(d = r(a.seed)) {
|
|
1055
|
-
return
|
|
1055
|
+
return wo(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 Bo(e, t = {}) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}, lengths: a });
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function _o(e, t, n = {}) {
|
|
1097
1097
|
Ps(t), mr(n, {}, {
|
|
1098
1098
|
hmac: "function",
|
|
1099
1099
|
lowS: "boolean",
|
|
@@ -1101,7 +1101,7 @@ function Uo(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 } = To(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 Uo(e, t, n = {}) {
|
|
|
1118
1118
|
return y;
|
|
1119
1119
|
}
|
|
1120
1120
|
function w(g, y) {
|
|
1121
|
-
|
|
1122
|
-
const
|
|
1121
|
+
Sn(y);
|
|
1122
|
+
const S = d.signature, P = y === "compact" ? S : y === "recovered" ? S + 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, S, P) {
|
|
1127
|
+
this.r = E("r", y), this.s = E("s", S), P != null && (this.recovery = P), Object.freeze(this);
|
|
1128
1128
|
}
|
|
1129
|
-
static fromBytes(y,
|
|
1130
|
-
w(y,
|
|
1129
|
+
static fromBytes(y, S = m) {
|
|
1130
|
+
w(y, S);
|
|
1131
1131
|
let P;
|
|
1132
|
-
if (
|
|
1132
|
+
if (S === "der") {
|
|
1133
1133
|
const { r: T, s: R } = Ae.toSig(Me(y));
|
|
1134
1134
|
return new A(T, R);
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1136
|
+
S === "recovered" && (P = y[0], S = "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, S) {
|
|
1141
|
+
return this.fromBytes(Dt(y), S);
|
|
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 S = 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 < S && 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 Uo(e, t, n = {}) {
|
|
|
1162
1162
|
return b(this.s);
|
|
1163
1163
|
}
|
|
1164
1164
|
toBytes(y = m) {
|
|
1165
|
-
if (
|
|
1165
|
+
if (Sn(y), y === "der")
|
|
1166
1166
|
return Dt(Ae.hexFromSig(this));
|
|
1167
|
-
const
|
|
1167
|
+
const S = 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), S, P);
|
|
1172
1172
|
}
|
|
1173
|
-
return Be(
|
|
1173
|
+
return Be(S, P);
|
|
1174
1174
|
}
|
|
1175
1175
|
toHex(y) {
|
|
1176
1176
|
return Ye(this.toBytes(y));
|
|
@@ -1203,21 +1203,21 @@ function Uo(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 S = $t(y), P = y.length * 8 - u;
|
|
1207
|
+
return P > 0 ? S >> BigInt(P) : S;
|
|
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 co("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, S) {
|
|
1218
|
+
if (["recovered", "canonical"].some((W) => W in S))
|
|
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(S, 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 Uo(e, t, n = {}) {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
return { seed: ne, k2sig: D };
|
|
1242
1242
|
}
|
|
1243
|
-
function se(g, y,
|
|
1243
|
+
function se(g, y, S = {}) {
|
|
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, S);
|
|
1246
|
+
return uo(t.outputLen, s.BYTES, a)(P, C);
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function fe(g) {
|
|
1249
1249
|
let y;
|
|
1250
|
-
const
|
|
1251
|
-
if (!
|
|
1250
|
+
const S = typeof g == "string" || dr(g), P = !S && g !== null && typeof g == "object" && typeof g.r == "bigint" && typeof g.s == "bigint";
|
|
1251
|
+
if (!S && !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 (S) {
|
|
1256
1256
|
try {
|
|
1257
1257
|
y = A.fromBytes(ue("sig", g), "der");
|
|
1258
1258
|
} catch (C) {
|
|
@@ -1268,15 +1268,15 @@ function Uo(e, t, n = {}) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
return y || !1;
|
|
1270
1270
|
}
|
|
1271
|
-
function L(g, y,
|
|
1271
|
+
function L(g, y, S, P = {}) {
|
|
1272
1272
|
const { lowS: C, prehash: O, format: I } = mn(P, h);
|
|
1273
|
-
if (
|
|
1273
|
+
if (S = ue("publicKey", S), 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 ? fe(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(S);
|
|
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 Uo(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, S = {}) {
|
|
1289
|
+
const { prehash: P } = mn(S, 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 Uo(e, t, n = {}) {
|
|
|
1303
1303
|
hash: t
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function Bo(e) {
|
|
1307
1307
|
const t = {
|
|
1308
1308
|
a: e.a,
|
|
1309
1309
|
b: e.b,
|
|
@@ -1330,8 +1330,8 @@ function Ro(e) {
|
|
|
1330
1330
|
};
|
|
1331
1331
|
return { CURVE: t, curveOpts: i };
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1334
|
-
const { CURVE: t, curveOpts: n } =
|
|
1333
|
+
function Uo(e) {
|
|
1334
|
+
const { CURVE: t, curveOpts: n } = Bo(e), r = {
|
|
1335
1335
|
hmac: e.hmac,
|
|
1336
1336
|
randomBytes: e.randomBytes,
|
|
1337
1337
|
lowS: e.lowS,
|
|
@@ -1340,23 +1340,23 @@ function No(e) {
|
|
|
1340
1340
|
};
|
|
1341
1341
|
return { CURVE: t, curveOpts: n, hash: e.hash, ecdsaOpts: r };
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Ro(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 No(e) {
|
|
1351
|
+
const { CURVE: t, curveOpts: n, hash: r, ecdsaOpts: a } = Uo(e), i = Co(t, n), s = _o(i, r, a);
|
|
1352
|
+
return Ro(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) => No({ ...e, hash: r });
|
|
1357
1357
|
return { ...n(t), create: n };
|
|
1358
1358
|
}
|
|
1359
|
-
const
|
|
1359
|
+
const jo = {
|
|
1360
1360
|
gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
|
|
1361
1361
|
l1Block: { address: "0x4200000000000000000000000000000000000015" },
|
|
1362
1362
|
l2CrossDomainMessenger: {
|
|
@@ -1367,28 +1367,28 @@ const Mo = {
|
|
|
1367
1367
|
l2ToL1MessagePasser: {
|
|
1368
1368
|
address: "0x4200000000000000000000000000000000000016"
|
|
1369
1369
|
}
|
|
1370
|
-
},
|
|
1371
|
-
block: /* @__PURE__ */
|
|
1370
|
+
}, Do = {
|
|
1371
|
+
block: /* @__PURE__ */ Ls({
|
|
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 = Fs(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__ */ Ms({
|
|
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__ */ Ds({
|
|
1392
1392
|
format(e) {
|
|
1393
1393
|
return {
|
|
1394
1394
|
l1GasPrice: e.l1GasPrice ? xe(e.l1GasPrice) : null,
|
|
@@ -1399,14 +1399,14 @@ const Mo = {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
})
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1402
|
+
function Mo(e, t) {
|
|
1403
|
+
return Go(e) ? Fo(e) : Gs(e, t);
|
|
1404
1404
|
}
|
|
1405
|
-
const
|
|
1406
|
-
transaction:
|
|
1405
|
+
const Lo = {
|
|
1406
|
+
transaction: Mo
|
|
1407
1407
|
};
|
|
1408
|
-
function
|
|
1409
|
-
|
|
1408
|
+
function Fo(e) {
|
|
1409
|
+
Ho(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 Ho(e) {
|
|
|
1419
1419
|
];
|
|
1420
1420
|
return Os([
|
|
1421
1421
|
"0x7e",
|
|
1422
|
-
|
|
1422
|
+
Hs(c)
|
|
1423
1423
|
]);
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function Go(e) {
|
|
1426
1426
|
return e.type === "deposit" || typeof e.sourceHash < "u";
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function Ho(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 zo(e) {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
const Ee = {
|
|
1436
1436
|
blockTime: 2e3,
|
|
1437
|
-
contracts:
|
|
1438
|
-
formatters:
|
|
1439
|
-
serializers:
|
|
1440
|
-
},
|
|
1437
|
+
contracts: jo,
|
|
1438
|
+
formatters: Do,
|
|
1439
|
+
serializers: Lo
|
|
1440
|
+
}, Ko = /* @__PURE__ */ de({
|
|
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
|
+
}), zo = /* @__PURE__ */ de({
|
|
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__ */ de({
|
|
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__ */ de({
|
|
1540
1540
|
...Ee,
|
|
1541
1541
|
id: 84532,
|
|
1542
1542
|
network: "base-sepolia",
|
|
@@ -1589,7 +1589,32 @@ const ot = 11155111, li = /* @__PURE__ */ he({
|
|
|
1589
1589
|
({
|
|
1590
1590
|
...li
|
|
1591
1591
|
});
|
|
1592
|
-
const
|
|
1592
|
+
const Vo = /* @__PURE__ */ de({
|
|
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({
|
|
1593
1618
|
id: 1,
|
|
1594
1619
|
name: "Ethereum",
|
|
1595
1620
|
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1616,7 +1641,7 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1616
1641
|
blockCreated: 14353601
|
|
1617
1642
|
}
|
|
1618
1643
|
}
|
|
1619
|
-
}), ct = 1,
|
|
1644
|
+
}), ct = 1, Zo = /* @__PURE__ */ de({
|
|
1620
1645
|
...Ee,
|
|
1621
1646
|
id: 10,
|
|
1622
1647
|
name: "OP Mainnet",
|
|
@@ -1661,7 +1686,7 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1661
1686
|
}
|
|
1662
1687
|
},
|
|
1663
1688
|
sourceId: ct
|
|
1664
|
-
}), ut = 11155111,
|
|
1689
|
+
}), ut = 11155111, Wo = /* @__PURE__ */ de({
|
|
1665
1690
|
...Ee,
|
|
1666
1691
|
id: 11155420,
|
|
1667
1692
|
name: "OP Sepolia",
|
|
@@ -1707,7 +1732,30 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1707
1732
|
},
|
|
1708
1733
|
testnet: !0,
|
|
1709
1734
|
sourceId: ut
|
|
1710
|
-
}),
|
|
1735
|
+
}), Yo = /* @__PURE__ */ de({
|
|
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({
|
|
1711
1759
|
id: 11155111,
|
|
1712
1760
|
name: "Sepolia",
|
|
1713
1761
|
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1734,7 +1782,7 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1734
1782
|
}
|
|
1735
1783
|
},
|
|
1736
1784
|
testnet: !0
|
|
1737
|
-
}),
|
|
1785
|
+
}), kt = 1, Xo = /* @__PURE__ */ de({
|
|
1738
1786
|
...Ee,
|
|
1739
1787
|
id: 7777777,
|
|
1740
1788
|
name: "Zora",
|
|
@@ -1759,7 +1807,7 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1759
1807
|
contracts: {
|
|
1760
1808
|
...Ee.contracts,
|
|
1761
1809
|
l2OutputOracle: {
|
|
1762
|
-
[
|
|
1810
|
+
[kt]: {
|
|
1763
1811
|
address: "0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"
|
|
1764
1812
|
}
|
|
1765
1813
|
},
|
|
@@ -1768,17 +1816,17 @@ const Zo = /* @__PURE__ */ he({
|
|
|
1768
1816
|
blockCreated: 5882
|
|
1769
1817
|
},
|
|
1770
1818
|
portal: {
|
|
1771
|
-
[
|
|
1819
|
+
[kt]: {
|
|
1772
1820
|
address: "0x1a0ad011913A150f69f6A19DF447A0CfD9551054"
|
|
1773
1821
|
}
|
|
1774
1822
|
},
|
|
1775
1823
|
l1StandardBridge: {
|
|
1776
|
-
[
|
|
1824
|
+
[kt]: {
|
|
1777
1825
|
address: "0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"
|
|
1778
1826
|
}
|
|
1779
1827
|
}
|
|
1780
1828
|
},
|
|
1781
|
-
sourceId:
|
|
1829
|
+
sourceId: kt
|
|
1782
1830
|
}), Qo = "@base-org/account", $o = "2.4.0", fi = {
|
|
1783
1831
|
name: Qo,
|
|
1784
1832
|
version: $o
|
|
@@ -2631,27 +2679,27 @@ function On(e, t) {
|
|
|
2631
2679
|
function $r(e, t) {
|
|
2632
2680
|
return typeof e == "object" && e !== null && t in e && typeof e[t] == "string";
|
|
2633
2681
|
}
|
|
2634
|
-
const
|
|
2682
|
+
const k = {
|
|
2635
2683
|
rpc: {
|
|
2636
|
-
parse: (e) =>
|
|
2637
|
-
invalidRequest: (e) =>
|
|
2638
|
-
invalidParams: (e) =>
|
|
2639
|
-
methodNotFound: (e) =>
|
|
2640
|
-
internal: (e) =>
|
|
2684
|
+
parse: (e) => pe(X.rpc.parse, e),
|
|
2685
|
+
invalidRequest: (e) => pe(X.rpc.invalidRequest, e),
|
|
2686
|
+
invalidParams: (e) => pe(X.rpc.invalidParams, e),
|
|
2687
|
+
methodNotFound: (e) => pe(X.rpc.methodNotFound, e),
|
|
2688
|
+
internal: (e) => pe(X.rpc.internal, e),
|
|
2641
2689
|
server: (e) => {
|
|
2642
2690
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2643
2691
|
throw new Error("Ethereum RPC Server errors must provide single object argument.");
|
|
2644
2692
|
const { code: t } = e;
|
|
2645
2693
|
if (!Number.isInteger(t) || t > -32005 || t < -32099)
|
|
2646
2694
|
throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
|
|
2647
|
-
return
|
|
2695
|
+
return pe(t, e);
|
|
2648
2696
|
},
|
|
2649
|
-
invalidInput: (e) =>
|
|
2650
|
-
resourceNotFound: (e) =>
|
|
2651
|
-
resourceUnavailable: (e) =>
|
|
2652
|
-
transactionRejected: (e) =>
|
|
2653
|
-
methodNotSupported: (e) =>
|
|
2654
|
-
limitExceeded: (e) =>
|
|
2697
|
+
invalidInput: (e) => pe(X.rpc.invalidInput, e),
|
|
2698
|
+
resourceNotFound: (e) => pe(X.rpc.resourceNotFound, e),
|
|
2699
|
+
resourceUnavailable: (e) => pe(X.rpc.resourceUnavailable, e),
|
|
2700
|
+
transactionRejected: (e) => pe(X.rpc.transactionRejected, e),
|
|
2701
|
+
methodNotSupported: (e) => pe(X.rpc.methodNotSupported, e),
|
|
2702
|
+
limitExceeded: (e) => pe(X.rpc.limitExceeded, e)
|
|
2655
2703
|
},
|
|
2656
2704
|
provider: {
|
|
2657
2705
|
userRejectedRequest: (e) => Ve(X.provider.userRejectedRequest, e),
|
|
@@ -2670,7 +2718,7 @@ const S = {
|
|
|
2670
2718
|
}
|
|
2671
2719
|
}
|
|
2672
2720
|
};
|
|
2673
|
-
function
|
|
2721
|
+
function pe(e, t) {
|
|
2674
2722
|
const [n, r] = bi(t);
|
|
2675
2723
|
return new vr(e, n || wr(e), r);
|
|
2676
2724
|
}
|
|
@@ -2709,12 +2757,12 @@ class wi extends vr {
|
|
|
2709
2757
|
* `code` must be an integer in the 1000 <= 4999 range.
|
|
2710
2758
|
*/
|
|
2711
2759
|
constructor(t, n, r) {
|
|
2712
|
-
if (!
|
|
2760
|
+
if (!kc(t))
|
|
2713
2761
|
throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
|
|
2714
2762
|
super(t, n, r);
|
|
2715
2763
|
}
|
|
2716
2764
|
}
|
|
2717
|
-
function
|
|
2765
|
+
function kc(e) {
|
|
2718
2766
|
return Number.isInteger(e) && e >= 1e3 && e <= 4999;
|
|
2719
2767
|
}
|
|
2720
2768
|
function ea(e) {
|
|
@@ -2723,7 +2771,7 @@ function ea(e) {
|
|
|
2723
2771
|
function vi(e) {
|
|
2724
2772
|
return typeof e == "object" && e !== null && "details" in e;
|
|
2725
2773
|
}
|
|
2726
|
-
function
|
|
2774
|
+
function Sc(e) {
|
|
2727
2775
|
try {
|
|
2728
2776
|
const t = JSON.parse(e.details);
|
|
2729
2777
|
return new vr(t.code, t.message, t.data);
|
|
@@ -2731,16 +2779,16 @@ function kc(e) {
|
|
|
2731
2779
|
return null;
|
|
2732
2780
|
}
|
|
2733
2781
|
}
|
|
2734
|
-
function
|
|
2782
|
+
function he(e, t, n) {
|
|
2735
2783
|
if (e == null)
|
|
2736
|
-
throw t ??
|
|
2784
|
+
throw t ?? k.rpc.invalidParams({
|
|
2737
2785
|
message: "value must be present",
|
|
2738
2786
|
data: e
|
|
2739
2787
|
});
|
|
2740
2788
|
}
|
|
2741
2789
|
function _e(e, t) {
|
|
2742
2790
|
if (!Array.isArray(e))
|
|
2743
|
-
throw
|
|
2791
|
+
throw k.rpc.invalidParams({
|
|
2744
2792
|
message: t ?? "value must be an array",
|
|
2745
2793
|
data: e
|
|
2746
2794
|
});
|
|
@@ -2853,7 +2901,7 @@ function Rc() {
|
|
|
2853
2901
|
const t = document.createElement("style");
|
|
2854
2902
|
t.setAttribute("base-sdk-font", na), t.textContent = Uc, document.head.appendChild(t);
|
|
2855
2903
|
}
|
|
2856
|
-
var tn, G, Ei, De, ra,
|
|
2904
|
+
var tn, G, Ei, De, ra, ki, Cn, Er, Tn, _n, ht = {}, Si = [], Nc = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, kr = Array.isArray;
|
|
2857
2905
|
function Ue(e, t) {
|
|
2858
2906
|
for (var n in t) e[n] = t[n];
|
|
2859
2907
|
return e;
|
|
@@ -2893,21 +2941,21 @@ function Ii(e) {
|
|
|
2893
2941
|
}
|
|
2894
2942
|
}
|
|
2895
2943
|
function aa(e) {
|
|
2896
|
-
(!e.__d && (e.__d = !0) && De.push(e) && !Ft.__r++ || ra !== G.debounceRendering) && ((ra = G.debounceRendering) ||
|
|
2944
|
+
(!e.__d && (e.__d = !0) && De.push(e) && !Ft.__r++ || ra !== G.debounceRendering) && ((ra = G.debounceRendering) || ki)(Ft);
|
|
2897
2945
|
}
|
|
2898
2946
|
function Ft() {
|
|
2899
2947
|
var e, t, n, r, a, i, s, o;
|
|
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),
|
|
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), Sr(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));
|
|
2901
2949
|
Ft.__r = 0;
|
|
2902
2950
|
}
|
|
2903
2951
|
function Oi(e, t, n, r, a, i, s, o, u, c, f) {
|
|
2904
|
-
var l, p, d, h, m, b = r && r.__k ||
|
|
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,
|
|
2952
|
+
var l, p, d, h, m, b = r && r.__k || Si, E = t.length;
|
|
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, Sr(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);
|
|
2906
2954
|
n.__d = u, n.__e = m;
|
|
2907
2955
|
}
|
|
2908
2956
|
function jc(e, t, n) {
|
|
2909
2957
|
var r, a, i, s, o, u = t.length, c = n.length, f = c, l = 0;
|
|
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) :
|
|
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) : kr(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;
|
|
2911
2959
|
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));
|
|
2912
2960
|
}
|
|
2913
2961
|
function Ci(e, t, n) {
|
|
@@ -2940,7 +2988,7 @@ function Dc(e, t, n, r) {
|
|
|
2940
2988
|
function ia(e, t, n) {
|
|
2941
2989
|
t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Nc.test(t) ? n : n + "px";
|
|
2942
2990
|
}
|
|
2943
|
-
function
|
|
2991
|
+
function St(e, t, n, r, a) {
|
|
2944
2992
|
var i;
|
|
2945
2993
|
e: if (t === "style") if (typeof n == "string") e.style.cssText = n;
|
|
2946
2994
|
else {
|
|
@@ -2968,7 +3016,7 @@ function sa(e) {
|
|
|
2968
3016
|
}
|
|
2969
3017
|
};
|
|
2970
3018
|
}
|
|
2971
|
-
function
|
|
3019
|
+
function Sr(e, t, n, r, a, i, s, o, u, c) {
|
|
2972
3020
|
var f, l, p, d, h, m, b, E, w, A, N, ee, ae, U, j, B, se = t.type;
|
|
2973
3021
|
if (t.constructor !== void 0) return null;
|
|
2974
3022
|
128 & n.__u && (u = !!(32 & n.__u), i = [o = t.__e = n.__e]), (f = G.__b) && f(t);
|
|
@@ -2976,8 +3024,8 @@ function kr(e, t, n, r, a, i, s, o, u, c) {
|
|
|
2976
3024
|
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);
|
|
2977
3025
|
else {
|
|
2978
3026
|
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)) {
|
|
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(
|
|
2980
|
-
|
|
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(fe) {
|
|
3028
|
+
fe && (fe.__ = t);
|
|
2981
3029
|
}), ee = 0; ee < l._sb.length; ee++) l.__h.push(l._sb[ee]);
|
|
2982
3030
|
l._sb = [], l.__h.length && s.push(l);
|
|
2983
3031
|
break e;
|
|
@@ -2992,13 +3040,13 @@ function kr(e, t, n, r, a, i, s, o, u, c) {
|
|
|
2992
3040
|
} else do
|
|
2993
3041
|
l.__d = !1, ae && ae(t), f = l.render(l.props, l.state, l.context), l.state = l.__s;
|
|
2994
3042
|
while (l.__d && ++U < 25);
|
|
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,
|
|
2996
|
-
} catch (
|
|
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, kr(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);
|
|
3044
|
+
} catch (fe) {
|
|
2997
3045
|
if (t.__v = null, u || i != null) {
|
|
2998
3046
|
for (t.__u |= u ? 160 : 32; o && o.nodeType === 8 && o.nextSibling; ) o = o.nextSibling;
|
|
2999
3047
|
i[i.indexOf(o)] = null, t.__e = o;
|
|
3000
3048
|
} else t.__e = n.__e, t.__k = n.__k;
|
|
3001
|
-
G.__e(
|
|
3049
|
+
G.__e(fe, t, n);
|
|
3002
3050
|
}
|
|
3003
3051
|
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);
|
|
3004
3052
|
(f = G.diffed) && f(t);
|
|
@@ -3035,13 +3083,13 @@ function Mc(e, t, n, r, a, i, s, o, u) {
|
|
|
3035
3083
|
if (c == "dangerouslySetInnerHTML") l = d;
|
|
3036
3084
|
else if (!(c in E)) {
|
|
3037
3085
|
if (c == "value" && "defaultValue" in E || c == "checked" && "defaultChecked" in E) continue;
|
|
3038
|
-
|
|
3086
|
+
St(e, c, null, d, a);
|
|
3039
3087
|
}
|
|
3040
3088
|
}
|
|
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 ||
|
|
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 || St(e, c, d, b[c], a);
|
|
3042
3090
|
if (f) o || l && (f.__html === l.__html || f.__html === e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
3043
|
-
else if (l && (e.innerHTML = ""), Oi(e,
|
|
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]) &&
|
|
3091
|
+
else if (l && (e.innerHTML = ""), Oi(e, kr(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]);
|
|
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]) && St(e, c, h, b[c], a), c = "checked", m !== void 0 && m !== e[c] && St(e, c, m, b[c], a));
|
|
3045
3093
|
}
|
|
3046
3094
|
return e;
|
|
3047
3095
|
}
|
|
@@ -3073,9 +3121,9 @@ function Lc(e, t, n) {
|
|
|
3073
3121
|
}
|
|
3074
3122
|
function oa(e, t, n) {
|
|
3075
3123
|
var r, a, i, s;
|
|
3076
|
-
G.__ && G.__(e, t), a = (r = !1) ? null : t.__k, i = [], s = [],
|
|
3124
|
+
G.__ && G.__(e, t), a = (r = !1) ? null : t.__k, i = [], s = [], Sr(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);
|
|
3077
3125
|
}
|
|
3078
|
-
tn =
|
|
3126
|
+
tn = Si.slice, G = { __e: function(e, t, n, r) {
|
|
3079
3127
|
for (var a, i, s; t = t.__; ) if ((a = t.__c) && !a.__) try {
|
|
3080
3128
|
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;
|
|
3081
3129
|
} catch (o) {
|
|
@@ -3087,7 +3135,7 @@ tn = ki.slice, G = { __e: function(e, t, n, r) {
|
|
|
3087
3135
|
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));
|
|
3088
3136
|
}, Nt.prototype.forceUpdate = function(e) {
|
|
3089
3137
|
this.__v && (this.__e = !0, e && this.__h.push(e), aa(this));
|
|
3090
|
-
}, Nt.prototype.render = nn, De = [],
|
|
3138
|
+
}, Nt.prototype.render = nn, De = [], ki = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Cn = function(e, t) {
|
|
3091
3139
|
return e.__v.__b - t.__v.__b;
|
|
3092
3140
|
}, Ft.__r = 0, Er = 0, Tn = sa(!1), _n = sa(!0);
|
|
3093
3141
|
var Fc = 0;
|
|
@@ -3364,7 +3412,7 @@ function ou(e) {
|
|
|
3364
3412
|
He({
|
|
3365
3413
|
dialogContext: "popup_blocked",
|
|
3366
3414
|
dialogAction: "cancel"
|
|
3367
|
-
}), i(
|
|
3415
|
+
}), i(k.rpc.internal("Popup window was blocked"));
|
|
3368
3416
|
},
|
|
3369
3417
|
actionItems: [
|
|
3370
3418
|
{
|
|
@@ -3376,7 +3424,7 @@ function ou(e) {
|
|
|
3376
3424
|
dialogAction: "confirm"
|
|
3377
3425
|
});
|
|
3378
3426
|
const s = e();
|
|
3379
|
-
s ? a(s) : i(
|
|
3427
|
+
s ? a(s) : i(k.rpc.internal("Popup window was blocked")), n.clear();
|
|
3380
3428
|
}
|
|
3381
3429
|
},
|
|
3382
3430
|
{
|
|
@@ -3386,7 +3434,7 @@ function ou(e) {
|
|
|
3386
3434
|
He({
|
|
3387
3435
|
dialogContext: "popup_blocked",
|
|
3388
3436
|
dialogAction: "cancel"
|
|
3389
|
-
}), i(
|
|
3437
|
+
}), i(k.rpc.internal("Popup window was blocked")), n.clear();
|
|
3390
3438
|
}
|
|
3391
3439
|
}
|
|
3392
3440
|
]
|
|
@@ -3430,7 +3478,7 @@ class cu {
|
|
|
3430
3478
|
*/
|
|
3431
3479
|
F(this, "disconnect", () => {
|
|
3432
3480
|
iu(this.popup), this.popup = null, this.listeners.forEach(({ reject: t }, n) => {
|
|
3433
|
-
t(
|
|
3481
|
+
t(k.provider.userRejectedRequest("Request rejected")), window.removeEventListener("message", n);
|
|
3434
3482
|
}), this.listeners.clear();
|
|
3435
3483
|
});
|
|
3436
3484
|
/**
|
|
@@ -3452,7 +3500,7 @@ class cu {
|
|
|
3452
3500
|
});
|
|
3453
3501
|
}).then(() => {
|
|
3454
3502
|
if (!this.popup)
|
|
3455
|
-
throw
|
|
3503
|
+
throw k.rpc.internal();
|
|
3456
3504
|
return _c(), this.popup;
|
|
3457
3505
|
})));
|
|
3458
3506
|
this.url = new URL(t), this.metadata = n, this.preference = r;
|
|
@@ -3550,13 +3598,13 @@ function jn(e, t = !1) {
|
|
|
3550
3598
|
if (Di.test(n))
|
|
3551
3599
|
return Gt(t ? `0x${n}` : n);
|
|
3552
3600
|
}
|
|
3553
|
-
throw
|
|
3601
|
+
throw k.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`);
|
|
3554
3602
|
}
|
|
3555
3603
|
function Eu(e, t = !1) {
|
|
3556
3604
|
let n = jn(e, !1);
|
|
3557
3605
|
return n.length % 2 === 1 && (n = Gt(`0${n}`)), t ? Gt(`0x${n}`) : n;
|
|
3558
3606
|
}
|
|
3559
|
-
function
|
|
3607
|
+
function ku(e) {
|
|
3560
3608
|
if (typeof e == "number" && Number.isInteger(e))
|
|
3561
3609
|
return yn(e);
|
|
3562
3610
|
if (typeof e == "string") {
|
|
@@ -3565,9 +3613,9 @@ function Su(e) {
|
|
|
3565
3613
|
if (xu(e))
|
|
3566
3614
|
return yn(Number(BigInt(Eu(e, !0))));
|
|
3567
3615
|
}
|
|
3568
|
-
throw
|
|
3616
|
+
throw k.rpc.invalidParams(`Not an integer: ${String(e)}`);
|
|
3569
3617
|
}
|
|
3570
|
-
const
|
|
3618
|
+
const Su = ({ method: e, correlationId: t }) => {
|
|
3571
3619
|
const n = x.subAccountsConfig.get();
|
|
3572
3620
|
Z("scw_signer.handshake.started", {
|
|
3573
3621
|
action: K.unknown,
|
|
@@ -4552,14 +4600,14 @@ function Ku(e) {
|
|
|
4552
4600
|
], [
|
|
4553
4601
|
d,
|
|
4554
4602
|
f,
|
|
4555
|
-
|
|
4556
|
-
|
|
4603
|
+
Se(N),
|
|
4604
|
+
Se(s),
|
|
4557
4605
|
o,
|
|
4558
4606
|
h,
|
|
4559
4607
|
p,
|
|
4560
4608
|
u,
|
|
4561
4609
|
c,
|
|
4562
|
-
|
|
4610
|
+
Se(l)
|
|
4563
4611
|
]);
|
|
4564
4612
|
}
|
|
4565
4613
|
if (r === "0.7") {
|
|
@@ -4578,20 +4626,20 @@ function Ku(e) {
|
|
|
4578
4626
|
], [
|
|
4579
4627
|
w.sender,
|
|
4580
4628
|
w.nonce,
|
|
4581
|
-
|
|
4582
|
-
|
|
4629
|
+
Se(w.initCode),
|
|
4630
|
+
Se(w.callData),
|
|
4583
4631
|
w.accountGasLimits,
|
|
4584
4632
|
w.preVerificationGas,
|
|
4585
4633
|
w.gasFees,
|
|
4586
|
-
|
|
4634
|
+
Se(w.paymasterAndData)
|
|
4587
4635
|
]);
|
|
4588
4636
|
}
|
|
4589
4637
|
throw new Error(`entryPointVersion "${r}" not supported.`);
|
|
4590
4638
|
})();
|
|
4591
|
-
return
|
|
4639
|
+
return Se(pt([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [Se(m), n, BigInt(t)]));
|
|
4592
4640
|
}
|
|
4593
4641
|
async function zu(e) {
|
|
4594
|
-
const { extend: t, nonceKeyManager: n =
|
|
4642
|
+
const { extend: t, nonceKeyManager: n = Ks({
|
|
4595
4643
|
source: {
|
|
4596
4644
|
get() {
|
|
4597
4645
|
return Date.now();
|
|
@@ -4616,7 +4664,7 @@ async function zu(e) {
|
|
|
4616
4664
|
client: e.client
|
|
4617
4665
|
}));
|
|
4618
4666
|
return e.getNonce ? await e.getNonce({ ...s, key: o }) : await En(e.client, {
|
|
4619
|
-
abi:
|
|
4667
|
+
abi: zs([
|
|
4620
4668
|
"function getNonce(address, uint192) pure returns (uint256)"
|
|
4621
4669
|
]),
|
|
4622
4670
|
address: e.entryPoint.address,
|
|
@@ -5268,7 +5316,7 @@ Object.defineProperty(sr, "message", {
|
|
|
5268
5316
|
});
|
|
5269
5317
|
class qu extends _ {
|
|
5270
5318
|
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 }) {
|
|
5271
|
-
const N =
|
|
5319
|
+
const N = Vs({
|
|
5272
5320
|
callData: n,
|
|
5273
5321
|
callGasLimit: r,
|
|
5274
5322
|
factory: i,
|
|
@@ -5538,7 +5586,7 @@ function Qu(e) {
|
|
|
5538
5586
|
return u[0];
|
|
5539
5587
|
const c = u.filter((f) => {
|
|
5540
5588
|
try {
|
|
5541
|
-
return !!
|
|
5589
|
+
return !!qs({
|
|
5542
5590
|
abi: f.abi,
|
|
5543
5591
|
data: n
|
|
5544
5592
|
});
|
|
@@ -5552,12 +5600,12 @@ function Qu(e) {
|
|
|
5552
5600
|
args: void 0,
|
|
5553
5601
|
to: void 0
|
|
5554
5602
|
};
|
|
5555
|
-
})(), o = n === "0x" ? new
|
|
5603
|
+
})(), o = n === "0x" ? new Zs({ functionName: a }) : new Ws({
|
|
5556
5604
|
abi: r,
|
|
5557
5605
|
data: n,
|
|
5558
5606
|
functionName: a
|
|
5559
5607
|
});
|
|
5560
|
-
return new
|
|
5608
|
+
return new Ys(o, {
|
|
5561
5609
|
abi: r,
|
|
5562
5610
|
args: i,
|
|
5563
5611
|
contractAddress: s,
|
|
@@ -5713,7 +5761,7 @@ async function Or(e, t) {
|
|
|
5713
5761
|
};
|
|
5714
5762
|
}
|
|
5715
5763
|
try {
|
|
5716
|
-
const j = o.client ?? e, B = await be(j,
|
|
5764
|
+
const j = o.client ?? e, B = await be(j, Js, "estimateFeesPerGas")({
|
|
5717
5765
|
chain: j.chain,
|
|
5718
5766
|
type: "eip1559"
|
|
5719
5767
|
});
|
|
@@ -5742,7 +5790,7 @@ async function Or(e, t) {
|
|
|
5742
5790
|
return n.authorization;
|
|
5743
5791
|
if (s.authorization && !await s.isDeployed())
|
|
5744
5792
|
return {
|
|
5745
|
-
...await
|
|
5793
|
+
...await so(s.client, s.authorization),
|
|
5746
5794
|
r: "0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",
|
|
5747
5795
|
s: "0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
5748
5796
|
yParity: 1
|
|
@@ -5820,7 +5868,7 @@ async function Ki(e, t) {
|
|
|
5820
5868
|
const { account: n = e.account, entryPointAddress: r, stateOverride: a } = t;
|
|
5821
5869
|
if (!n && !t.sender)
|
|
5822
5870
|
throw new Qt();
|
|
5823
|
-
const i = n ? mt(n) : void 0, s =
|
|
5871
|
+
const i = n ? mt(n) : void 0, s = Xs(a), o = i ? await be(e, Or, "prepareUserOperation")({
|
|
5824
5872
|
...t,
|
|
5825
5873
|
parameters: [
|
|
5826
5874
|
"authorization",
|
|
@@ -5872,7 +5920,7 @@ async function sd(e, { hash: t }) {
|
|
|
5872
5920
|
}
|
|
5873
5921
|
function od(e) {
|
|
5874
5922
|
const t = { ...e };
|
|
5875
|
-
return e.actualGasCost && (t.actualGasCost = BigInt(e.actualGasCost)), e.actualGasUsed && (t.actualGasUsed = BigInt(e.actualGasUsed)), e.logs && (t.logs = e.logs.map((n) =>
|
|
5923
|
+
return e.actualGasCost && (t.actualGasCost = BigInt(e.actualGasCost)), e.actualGasUsed && (t.actualGasUsed = BigInt(e.actualGasUsed)), e.logs && (t.logs = e.logs.map((n) => Qs(n))), e.receipt && (t.receipt = $s(t.receipt)), t;
|
|
5876
5924
|
}
|
|
5877
5925
|
async function zi(e, { hash: t }) {
|
|
5878
5926
|
const n = await e.request({
|
|
@@ -5918,10 +5966,10 @@ function ud(e, t) {
|
|
|
5918
5966
|
n
|
|
5919
5967
|
]);
|
|
5920
5968
|
return new Promise((u, c) => {
|
|
5921
|
-
const f =
|
|
5969
|
+
const f = eo(o, { resolve: u, reject: c }, (l) => {
|
|
5922
5970
|
const p = (m) => {
|
|
5923
5971
|
h(), m(), f();
|
|
5924
|
-
}, d = i ? setTimeout(() => p(() => l.reject(new wa({ hash: n }))), i) : void 0, h =
|
|
5972
|
+
}, d = i ? setTimeout(() => p(() => l.reject(new wa({ hash: n }))), i) : void 0, h = to(async () => {
|
|
5925
5973
|
a && s >= a && (clearTimeout(d), p(() => l.reject(new wa({ hash: n }))));
|
|
5926
5974
|
try {
|
|
5927
5975
|
const m = await be(e, zi, "getUserOperationReceipt")({ hash: n });
|
|
@@ -5953,7 +6001,7 @@ function dd(e) {
|
|
|
5953
6001
|
}
|
|
5954
6002
|
function ld(e) {
|
|
5955
6003
|
const { client: t, key: n = "bundler", name: r = "Bundler Client", paymaster: a, paymasterContext: i, transport: s, userOperation: o } = e;
|
|
5956
|
-
return Object.assign(
|
|
6004
|
+
return Object.assign(no({
|
|
5957
6005
|
...e,
|
|
5958
6006
|
chain: e.chain ?? (t == null ? void 0 : t.chain),
|
|
5959
6007
|
key: n,
|
|
@@ -5964,17 +6012,17 @@ function ld(e) {
|
|
|
5964
6012
|
}
|
|
5965
6013
|
const Vi = gr(() => ({})), fd = [
|
|
5966
6014
|
di,
|
|
6015
|
+
zo,
|
|
6016
|
+
Ko,
|
|
6017
|
+
Yo,
|
|
5967
6018
|
qo,
|
|
5968
6019
|
Vo,
|
|
5969
|
-
_s,
|
|
5970
|
-
Zo,
|
|
5971
|
-
Bs,
|
|
5972
6020
|
Xo,
|
|
5973
|
-
|
|
6021
|
+
Zo
|
|
5974
6022
|
], pd = [
|
|
5975
6023
|
li,
|
|
5976
6024
|
Jo,
|
|
5977
|
-
|
|
6025
|
+
Wo
|
|
5978
6026
|
], md = [
|
|
5979
6027
|
...fd,
|
|
5980
6028
|
...pd
|
|
@@ -5991,7 +6039,7 @@ function qi(e) {
|
|
|
5991
6039
|
function hd(e, t, n) {
|
|
5992
6040
|
var u, c;
|
|
5993
6041
|
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;
|
|
5994
|
-
return
|
|
6042
|
+
return de({
|
|
5995
6043
|
id: e,
|
|
5996
6044
|
name: i,
|
|
5997
6045
|
nativeCurrency: {
|
|
@@ -6024,7 +6072,7 @@ function Zi(e) {
|
|
|
6024
6072
|
const { chainId: t, rpcUrl: n, nativeCurrency: r, viemChain: a } = e, i = hd(t, n, {
|
|
6025
6073
|
viemChain: a,
|
|
6026
6074
|
nativeCurrency: r
|
|
6027
|
-
}), s =
|
|
6075
|
+
}), s = ro({
|
|
6028
6076
|
chain: i,
|
|
6029
6077
|
transport: Fr(n)
|
|
6030
6078
|
}), o = ld({
|
|
@@ -6084,15 +6132,15 @@ const Pt = gr(() => ({
|
|
|
6084
6132
|
};
|
|
6085
6133
|
function It(e) {
|
|
6086
6134
|
if (typeof e != "object" || e === null)
|
|
6087
|
-
throw
|
|
6135
|
+
throw k.rpc.internal("sub account info is not an object");
|
|
6088
6136
|
if (!("address" in e))
|
|
6089
|
-
throw
|
|
6137
|
+
throw k.rpc.internal("sub account is invalid");
|
|
6090
6138
|
if ("address" in e && typeof e.address == "string" && !Qe(e.address))
|
|
6091
|
-
throw
|
|
6139
|
+
throw k.rpc.internal("sub account address is invalid");
|
|
6092
6140
|
if ("factory" in e && typeof e.factory == "string" && !Qe(e.factory))
|
|
6093
|
-
throw
|
|
6141
|
+
throw k.rpc.internal("sub account factory address is invalid");
|
|
6094
6142
|
if ("factoryData" in e && typeof e.factoryData == "string" && !qe(e.factoryData))
|
|
6095
|
-
throw
|
|
6143
|
+
throw k.rpc.internal("sub account factory data is invalid");
|
|
6096
6144
|
}
|
|
6097
6145
|
async function gd() {
|
|
6098
6146
|
return crypto.subtle.generateKey({
|
|
@@ -6176,20 +6224,20 @@ async function lt(e, t) {
|
|
|
6176
6224
|
throw i;
|
|
6177
6225
|
return a;
|
|
6178
6226
|
}
|
|
6179
|
-
function
|
|
6227
|
+
function kd(e) {
|
|
6180
6228
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
6181
|
-
throw
|
|
6229
|
+
throw k.rpc.invalidParams({
|
|
6182
6230
|
message: "Expected a single, non-array, object argument.",
|
|
6183
6231
|
data: e
|
|
6184
6232
|
});
|
|
6185
6233
|
const { method: t, params: n } = e;
|
|
6186
6234
|
if (typeof t != "string" || t.length === 0)
|
|
6187
|
-
throw
|
|
6235
|
+
throw k.rpc.invalidParams({
|
|
6188
6236
|
message: "'args.method' must be a non-empty string.",
|
|
6189
6237
|
data: e
|
|
6190
6238
|
});
|
|
6191
6239
|
if (n !== void 0 && !Array.isArray(n) && (typeof n != "object" || n === null))
|
|
6192
|
-
throw
|
|
6240
|
+
throw k.rpc.invalidParams({
|
|
6193
6241
|
message: "'args.params' must be an object or array if provided.",
|
|
6194
6242
|
data: e
|
|
6195
6243
|
});
|
|
@@ -6198,12 +6246,12 @@ function Sd(e) {
|
|
|
6198
6246
|
case "eth_signTypedData_v2":
|
|
6199
6247
|
case "eth_subscribe":
|
|
6200
6248
|
case "eth_unsubscribe":
|
|
6201
|
-
throw
|
|
6249
|
+
throw k.provider.unsupportedMethod();
|
|
6202
6250
|
}
|
|
6203
6251
|
}
|
|
6204
|
-
const
|
|
6252
|
+
const Sd = "0.1.1";
|
|
6205
6253
|
function Ad() {
|
|
6206
|
-
return
|
|
6254
|
+
return Sd;
|
|
6207
6255
|
}
|
|
6208
6256
|
class q extends Error {
|
|
6209
6257
|
constructor(t, n = {}) {
|
|
@@ -6514,7 +6562,7 @@ function Hd(e, t, n) {
|
|
|
6514
6562
|
size: rt(e)
|
|
6515
6563
|
});
|
|
6516
6564
|
}
|
|
6517
|
-
const
|
|
6565
|
+
const ke = {
|
|
6518
6566
|
zero: 48,
|
|
6519
6567
|
nine: 57,
|
|
6520
6568
|
A: 65,
|
|
@@ -6523,12 +6571,12 @@ const Se = {
|
|
|
6523
6571
|
f: 102
|
|
6524
6572
|
};
|
|
6525
6573
|
function Ea(e) {
|
|
6526
|
-
if (e >=
|
|
6527
|
-
return e -
|
|
6528
|
-
if (e >=
|
|
6529
|
-
return e - (
|
|
6530
|
-
if (e >=
|
|
6531
|
-
return e - (
|
|
6574
|
+
if (e >= ke.zero && e <= ke.nine)
|
|
6575
|
+
return e - ke.zero;
|
|
6576
|
+
if (e >= ke.A && e <= ke.F)
|
|
6577
|
+
return e - (ke.A - 10);
|
|
6578
|
+
if (e >= ke.a && e <= ke.f)
|
|
6579
|
+
return e - (ke.a - 10);
|
|
6532
6580
|
}
|
|
6533
6581
|
function _r(e, t) {
|
|
6534
6582
|
if (je(e) > t)
|
|
@@ -6570,13 +6618,13 @@ const Vd = /* @__PURE__ */ new TextEncoder(), qd = /* @__PURE__ */ Array.from({
|
|
|
6570
6618
|
function Zd(e, t = {}) {
|
|
6571
6619
|
const { strict: n = !1 } = t;
|
|
6572
6620
|
if (!e)
|
|
6573
|
-
throw new
|
|
6621
|
+
throw new ka(e);
|
|
6574
6622
|
if (typeof e != "string")
|
|
6575
|
-
throw new Sa(e);
|
|
6576
|
-
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6577
6623
|
throw new ka(e);
|
|
6624
|
+
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6625
|
+
throw new Sa(e);
|
|
6578
6626
|
if (!e.startsWith("0x"))
|
|
6579
|
-
throw new
|
|
6627
|
+
throw new Sa(e);
|
|
6580
6628
|
}
|
|
6581
6629
|
function sn(...e) {
|
|
6582
6630
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
@@ -6618,7 +6666,7 @@ function Wd(e, t) {
|
|
|
6618
6666
|
function as(e, t) {
|
|
6619
6667
|
return ts(e, { dir: "right", size: t });
|
|
6620
6668
|
}
|
|
6621
|
-
function
|
|
6669
|
+
function me(e, t, n, r = {}) {
|
|
6622
6670
|
const { strict: a } = r;
|
|
6623
6671
|
Kd(e, t);
|
|
6624
6672
|
const i = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
|
|
@@ -6654,7 +6702,7 @@ class Xd extends q {
|
|
|
6654
6702
|
});
|
|
6655
6703
|
}
|
|
6656
6704
|
}
|
|
6657
|
-
class
|
|
6705
|
+
class ka extends q {
|
|
6658
6706
|
constructor(t) {
|
|
6659
6707
|
super(`Value \`${typeof t == "object" ? an(t) : t}\` of type \`${typeof t}\` is an invalid hex type.`, {
|
|
6660
6708
|
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
@@ -6666,7 +6714,7 @@ class Sa extends q {
|
|
|
6666
6714
|
});
|
|
6667
6715
|
}
|
|
6668
6716
|
}
|
|
6669
|
-
class
|
|
6717
|
+
class Sa extends q {
|
|
6670
6718
|
constructor(t) {
|
|
6671
6719
|
super(`Value \`${t}\` is an invalid hex value.`, {
|
|
6672
6720
|
metaMessages: [
|
|
@@ -6838,7 +6886,7 @@ function fs(e) {
|
|
|
6838
6886
|
if (e.length !== 132 && e.length !== 130 && e.length !== 68)
|
|
6839
6887
|
throw new cl({ publicKey: e });
|
|
6840
6888
|
if (e.length === 130) {
|
|
6841
|
-
const r = BigInt(
|
|
6889
|
+
const r = BigInt(me(e, 0, 32)), a = BigInt(me(e, 32, 64));
|
|
6842
6890
|
return {
|
|
6843
6891
|
prefix: 4,
|
|
6844
6892
|
x: r,
|
|
@@ -6846,14 +6894,14 @@ function fs(e) {
|
|
|
6846
6894
|
};
|
|
6847
6895
|
}
|
|
6848
6896
|
if (e.length === 132) {
|
|
6849
|
-
const r = Number(
|
|
6897
|
+
const r = Number(me(e, 0, 1)), a = BigInt(me(e, 1, 33)), i = BigInt(me(e, 33, 65));
|
|
6850
6898
|
return {
|
|
6851
6899
|
prefix: r,
|
|
6852
6900
|
x: a,
|
|
6853
6901
|
y: i
|
|
6854
6902
|
};
|
|
6855
6903
|
}
|
|
6856
|
-
const t = Number(
|
|
6904
|
+
const t = Number(me(e, 0, 1)), n = BigInt(me(e, 1, 33));
|
|
6857
6905
|
return {
|
|
6858
6906
|
prefix: t,
|
|
6859
6907
|
x: n
|
|
@@ -6951,7 +6999,7 @@ function ul(e, t = {}) {
|
|
|
6951
6999
|
function ps(e) {
|
|
6952
7000
|
if (e.length !== 130 && e.length !== 132)
|
|
6953
7001
|
throw new pl({ signature: e });
|
|
6954
|
-
const t = BigInt(
|
|
7002
|
+
const t = BigInt(me(e, 0, 32)), n = BigInt(me(e, 32, 64)), r = (() => {
|
|
6955
7003
|
const a = +`0x${e.slice(130)}`;
|
|
6956
7004
|
if (!Number.isNaN(a))
|
|
6957
7005
|
try {
|
|
@@ -7102,11 +7150,11 @@ const ms = {
|
|
|
7102
7150
|
b: BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),
|
|
7103
7151
|
Gx: BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),
|
|
7104
7152
|
Gy: BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")
|
|
7105
|
-
}, vl = ze(ms.p), xl = ze(hs.p), El = ze(ys.p),
|
|
7106
|
-
yr({ ...hs, Fp: xl, lowS: !1 },
|
|
7107
|
-
yr({ ...ys, Fp: El, lowS: !1, allowedPrivateKeyLengths: [130, 131, 132] },
|
|
7153
|
+
}, vl = ze(ms.p), xl = ze(hs.p), El = ze(ys.p), kl = yr({ ...ms, Fp: vl, lowS: !1 }, _s);
|
|
7154
|
+
yr({ ...hs, Fp: xl, lowS: !1 }, Bs);
|
|
7155
|
+
yr({ ...ys, Fp: El, lowS: !1, allowedPrivateKeyLengths: [130, 131, 132] }, Us);
|
|
7108
7156
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7109
|
-
const Ca =
|
|
7157
|
+
const Ca = kl;
|
|
7110
7158
|
Uint8Array.from([
|
|
7111
7159
|
105,
|
|
7112
7160
|
171,
|
|
@@ -7125,7 +7173,7 @@ Uint8Array.from([
|
|
|
7125
7173
|
186,
|
|
7126
7174
|
233
|
|
7127
7175
|
]);
|
|
7128
|
-
function
|
|
7176
|
+
function Sl(e = {}) {
|
|
7129
7177
|
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 });
|
|
7130
7178
|
return sn(a, i, s);
|
|
7131
7179
|
}
|
|
@@ -7140,7 +7188,7 @@ function Al(e) {
|
|
|
7140
7188
|
});
|
|
7141
7189
|
}
|
|
7142
7190
|
function Pl(e) {
|
|
7143
|
-
const { challenge: t, crossOrigin: n, extraClientData: r, flag: a, origin: i, rpId: s, signCount: o, userVerification: u = "required" } = e, c =
|
|
7191
|
+
const { challenge: t, crossOrigin: n, extraClientData: r, flag: a, origin: i, rpId: s, signCount: o, userVerification: u = "required" } = e, c = Sl({
|
|
7144
7192
|
flag: a,
|
|
7145
7193
|
rpId: s,
|
|
7146
7194
|
signCount: o
|
|
@@ -7213,7 +7261,7 @@ function Bl(e, t) {
|
|
|
7213
7261
|
}
|
|
7214
7262
|
const Ul = "base-acc-sdk", Rl = "keys", Nr = "activeId", at = Bl(Ul, Rl);
|
|
7215
7263
|
async function Nl() {
|
|
7216
|
-
const e = await Il({ extractable: !1 }), t =
|
|
7264
|
+
const e = await Il({ extractable: !1 }), t = me(Br(e.publicKey), 1);
|
|
7217
7265
|
return await at.setItem(t, e), await at.setItem(Nr, t), e;
|
|
7218
7266
|
}
|
|
7219
7267
|
async function jl() {
|
|
@@ -7226,13 +7274,13 @@ async function jl() {
|
|
|
7226
7274
|
async function Dl() {
|
|
7227
7275
|
const e = await jl();
|
|
7228
7276
|
if (!e) {
|
|
7229
|
-
const t = await Nl(), n =
|
|
7277
|
+
const t = await Nl(), n = me(Br(t.publicKey), 1);
|
|
7230
7278
|
return await at.setItem(n, t), await at.setItem(Nr, n), t;
|
|
7231
7279
|
}
|
|
7232
7280
|
return e;
|
|
7233
7281
|
}
|
|
7234
7282
|
async function Ml() {
|
|
7235
|
-
const e = await Dl(), t =
|
|
7283
|
+
const e = await Dl(), t = me(Br(e.publicKey), 1), n = async (r) => {
|
|
7236
7284
|
const { payload: a, metadata: i } = Pl({
|
|
7237
7285
|
challenge: r,
|
|
7238
7286
|
origin: "https://keys.coinbase.com",
|
|
@@ -7345,7 +7393,7 @@ function Ua(e) {
|
|
|
7345
7393
|
}
|
|
7346
7394
|
function Fl(e, t) {
|
|
7347
7395
|
if (!Array.isArray(e.params))
|
|
7348
|
-
throw
|
|
7396
|
+
throw k.rpc.invalidParams();
|
|
7349
7397
|
const n = [...e.params];
|
|
7350
7398
|
switch (e.method) {
|
|
7351
7399
|
case "eth_signTransaction":
|
|
@@ -7365,17 +7413,17 @@ function Fl(e, t) {
|
|
|
7365
7413
|
function Ra(e) {
|
|
7366
7414
|
var t;
|
|
7367
7415
|
if (!e || !Array.isArray(e) || !((t = e[0]) != null && t.chainId) || typeof e[0].chainId != "string" && typeof e[0].chainId != "number")
|
|
7368
|
-
throw
|
|
7416
|
+
throw k.rpc.invalidParams();
|
|
7369
7417
|
}
|
|
7370
7418
|
function Gl(e) {
|
|
7371
7419
|
if (!e || !Array.isArray(e) || e.length !== 1 && e.length !== 2 || typeof e[0] != "string" || !Qe(e[0]))
|
|
7372
|
-
throw
|
|
7420
|
+
throw k.rpc.invalidParams();
|
|
7373
7421
|
if (e.length === 2) {
|
|
7374
7422
|
if (!Array.isArray(e[1]))
|
|
7375
|
-
throw
|
|
7423
|
+
throw k.rpc.invalidParams();
|
|
7376
7424
|
for (const t of e[1])
|
|
7377
7425
|
if (typeof t != "string" || !t.startsWith("0x"))
|
|
7378
|
-
throw
|
|
7426
|
+
throw k.rpc.invalidParams();
|
|
7379
7427
|
}
|
|
7380
7428
|
}
|
|
7381
7429
|
function gt(e, t) {
|
|
@@ -7383,7 +7431,7 @@ function gt(e, t) {
|
|
|
7383
7431
|
if (t && e.method.startsWith("wallet_")) {
|
|
7384
7432
|
let r = ft(n, "params.0.capabilities");
|
|
7385
7433
|
if (typeof r > "u" && (r = {}), typeof r != "object")
|
|
7386
|
-
throw
|
|
7434
|
+
throw k.rpc.invalidParams();
|
|
7387
7435
|
r = {
|
|
7388
7436
|
...t,
|
|
7389
7437
|
...r
|
|
@@ -7399,7 +7447,7 @@ async function ur() {
|
|
|
7399
7447
|
if (e.creation === "on-connect") {
|
|
7400
7448
|
const { account: n } = e.toOwnerAccount ? await e.toOwnerAccount() : await cr();
|
|
7401
7449
|
if (!n)
|
|
7402
|
-
throw
|
|
7450
|
+
throw k.provider.unauthorized("No owner account found");
|
|
7403
7451
|
t.addSubAccount = {
|
|
7404
7452
|
account: {
|
|
7405
7453
|
type: "create",
|
|
@@ -7421,14 +7469,14 @@ function Hl(e) {
|
|
|
7421
7469
|
if (!(e.method === "coinbase_fetchPermissions" && e.params === void 0)) {
|
|
7422
7470
|
if (e.method === "coinbase_fetchPermissions" && Array.isArray(e.params) && e.params.length === 1 && typeof e.params[0] == "object") {
|
|
7423
7471
|
if (typeof e.params[0].account != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7424
|
-
throw
|
|
7472
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].account must be a hex string");
|
|
7425
7473
|
if (typeof e.params[0].chainId != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7426
|
-
throw
|
|
7474
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].chainId must be a hex string");
|
|
7427
7475
|
if (typeof e.params[0].spender != "string" || !e.params[0].spender.startsWith("0x"))
|
|
7428
|
-
throw
|
|
7476
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].spender must be a hex string");
|
|
7429
7477
|
return;
|
|
7430
7478
|
}
|
|
7431
|
-
throw
|
|
7479
|
+
throw k.rpc.invalidParams();
|
|
7432
7480
|
}
|
|
7433
7481
|
}
|
|
7434
7482
|
function Kl(e) {
|
|
@@ -7437,7 +7485,7 @@ function Kl(e) {
|
|
|
7437
7485
|
return e;
|
|
7438
7486
|
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;
|
|
7439
7487
|
if (!t || !r || !n)
|
|
7440
|
-
throw
|
|
7488
|
+
throw k.rpc.invalidParams("FetchPermissions - one or more of account, sub account, or chain id is missing, connect to sub account via wallet_connect first");
|
|
7441
7489
|
return {
|
|
7442
7490
|
method: "coinbase_fetchPermissions",
|
|
7443
7491
|
params: [
|
|
@@ -7456,7 +7504,7 @@ async function bs({ client: e, id: t }) {
|
|
|
7456
7504
|
});
|
|
7457
7505
|
if (n.status === "success")
|
|
7458
7506
|
return (r = n.receipts) == null ? void 0 : r[0].transactionHash;
|
|
7459
|
-
throw
|
|
7507
|
+
throw k.rpc.internal("failed to send transaction");
|
|
7460
7508
|
}
|
|
7461
7509
|
function ws({ calls: e, from: t, chainId: n, capabilities: r }) {
|
|
7462
7510
|
const a = mi.get().paymasterUrls;
|
|
@@ -7518,7 +7566,7 @@ function ql(e) {
|
|
|
7518
7566
|
return Array.isArray(e) && e.length === 1 && typeof e[0] == "object" && e[0] !== null && "to" in e[0];
|
|
7519
7567
|
}
|
|
7520
7568
|
function Zl(e) {
|
|
7521
|
-
return
|
|
7569
|
+
return Rs(Se(Oe(e)), 0, 16);
|
|
7522
7570
|
}
|
|
7523
7571
|
function Wl({ attribution: e, dappOrigin: t }) {
|
|
7524
7572
|
if (e) {
|
|
@@ -7738,7 +7786,7 @@ function $l({ webauthn: e, signature: t }) {
|
|
|
7738
7786
|
], [
|
|
7739
7787
|
{
|
|
7740
7788
|
authenticatorData: e.authenticatorData,
|
|
7741
|
-
clientDataJSON:
|
|
7789
|
+
clientDataJSON: Ns(e.clientDataJSON),
|
|
7742
7790
|
challengeIndex: BigInt(e.challengeIndex),
|
|
7743
7791
|
typeIndex: BigInt(e.typeIndex),
|
|
7744
7792
|
r: n,
|
|
@@ -7750,8 +7798,8 @@ function dt(e) {
|
|
|
7750
7798
|
const { ownerIndex: t = 0 } = e, n = (() => {
|
|
7751
7799
|
if (Da(e.signature) !== 65)
|
|
7752
7800
|
return e.signature;
|
|
7753
|
-
const r =
|
|
7754
|
-
return
|
|
7801
|
+
const r = ao(e.signature);
|
|
7802
|
+
return io(["bytes32", "bytes32", "uint8"], [r.r, r.s, r.yParity === 0 ? 27 : 28]);
|
|
7755
7803
|
})();
|
|
7756
7804
|
return pt([
|
|
7757
7805
|
{
|
|
@@ -7782,7 +7830,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7782
7830
|
factoryData: r
|
|
7783
7831
|
}, c = (p = t.chain) == null ? void 0 : p.id;
|
|
7784
7832
|
if (!c)
|
|
7785
|
-
throw
|
|
7833
|
+
throw k.rpc.internal("chainId not found");
|
|
7786
7834
|
const f = await Ql({
|
|
7787
7835
|
owner: a,
|
|
7788
7836
|
ownerIndex: i ?? 1,
|
|
@@ -7806,7 +7854,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7806
7854
|
case "eth_sendTransaction": {
|
|
7807
7855
|
_e(d.params);
|
|
7808
7856
|
const m = d.params[0];
|
|
7809
|
-
|
|
7857
|
+
he(m.to, k.rpc.invalidParams("to is required"));
|
|
7810
7858
|
const b = {
|
|
7811
7859
|
to: m.to,
|
|
7812
7860
|
data: jn(m.data ?? "0x", !0),
|
|
@@ -7826,13 +7874,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7826
7874
|
_e(d.params);
|
|
7827
7875
|
const m = ft(d.params[0], "chainId");
|
|
7828
7876
|
if (!m)
|
|
7829
|
-
throw
|
|
7877
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7830
7878
|
if (!qe(m))
|
|
7831
|
-
throw
|
|
7879
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7832
7880
|
if (!d.params[0])
|
|
7833
|
-
throw
|
|
7881
|
+
throw k.rpc.invalidParams("params are required");
|
|
7834
7882
|
if (!("calls" in d.params[0]))
|
|
7835
|
-
throw
|
|
7883
|
+
throw k.rpc.invalidParams("calls are required");
|
|
7836
7884
|
let b = {
|
|
7837
7885
|
method: "wallet_prepareCalls",
|
|
7838
7886
|
params: [
|
|
@@ -7864,7 +7912,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7864
7912
|
}));
|
|
7865
7913
|
let A;
|
|
7866
7914
|
if (!w)
|
|
7867
|
-
throw
|
|
7915
|
+
throw k.rpc.internal("signature not found");
|
|
7868
7916
|
return qe(w) ? A = {
|
|
7869
7917
|
type: "secp256k1",
|
|
7870
7918
|
data: {
|
|
@@ -7897,9 +7945,9 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7897
7945
|
_e(d.params);
|
|
7898
7946
|
const m = ft(d.params[0], "chainId");
|
|
7899
7947
|
if (!m)
|
|
7900
|
-
throw
|
|
7948
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7901
7949
|
if (!qe(m))
|
|
7902
|
-
throw
|
|
7950
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7903
7951
|
return await t.request({
|
|
7904
7952
|
method: "wallet_sendPreparedCalls",
|
|
7905
7953
|
params: d.params
|
|
@@ -7909,13 +7957,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7909
7957
|
_e(d.params);
|
|
7910
7958
|
const m = ft(d.params[0], "chainId");
|
|
7911
7959
|
if (!m)
|
|
7912
|
-
throw
|
|
7960
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7913
7961
|
if (!qe(m))
|
|
7914
|
-
throw
|
|
7962
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7915
7963
|
if (!d.params[0])
|
|
7916
|
-
throw
|
|
7964
|
+
throw k.rpc.invalidParams("params are required");
|
|
7917
7965
|
if (!ft(d.params[0], "calls"))
|
|
7918
|
-
throw
|
|
7966
|
+
throw k.rpc.invalidParams("calls are required");
|
|
7919
7967
|
const b = d.params[0];
|
|
7920
7968
|
return o && b.capabilities && !("attribution" in b.capabilities) && (b.capabilities.attribution = o), await t.request({
|
|
7921
7969
|
method: "wallet_prepareCalls",
|
|
@@ -7924,7 +7972,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7924
7972
|
}
|
|
7925
7973
|
case "personal_sign": {
|
|
7926
7974
|
if (_e(d.params), !qe(d.params[0]))
|
|
7927
|
-
throw
|
|
7975
|
+
throw k.rpc.invalidParams("message must be a hex encoded string");
|
|
7928
7976
|
const m = Kr(d.params[0]);
|
|
7929
7977
|
return f.signMessage({ message: m });
|
|
7930
7978
|
}
|
|
@@ -7938,11 +7986,11 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7938
7986
|
case "wallet_addEthereumChain":
|
|
7939
7987
|
case "wallet_switchEthereumChain":
|
|
7940
7988
|
default:
|
|
7941
|
-
throw
|
|
7989
|
+
throw k.rpc.methodNotSupported();
|
|
7942
7990
|
}
|
|
7943
7991
|
} catch (m) {
|
|
7944
7992
|
if (vi(m)) {
|
|
7945
|
-
const b =
|
|
7993
|
+
const b = Sc(m);
|
|
7946
7994
|
if (b)
|
|
7947
7995
|
throw b;
|
|
7948
7996
|
}
|
|
@@ -7960,7 +8008,7 @@ async function vs({ address: e, client: t, publicKey: n, factory: r, factoryData
|
|
|
7960
8008
|
data: a
|
|
7961
8009
|
});
|
|
7962
8010
|
if (o.functionName !== "createAccount")
|
|
7963
|
-
throw
|
|
8011
|
+
throw k.rpc.internal("unknown factory function");
|
|
7964
8012
|
const [u] = o.args;
|
|
7965
8013
|
return u.findIndex((c) => c.toLowerCase() === Na(n).toLowerCase());
|
|
7966
8014
|
}
|
|
@@ -8022,7 +8070,7 @@ async function tf() {
|
|
|
8022
8070
|
async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
8023
8071
|
var d, h;
|
|
8024
8072
|
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()));
|
|
8025
|
-
|
|
8073
|
+
he(i, k.provider.unauthorized("no global account")), he((h = r.chain) == null ? void 0 : h.id, k.provider.unauthorized("no chain id")), he(a == null ? void 0 : a.address, k.provider.unauthorized("no sub account"));
|
|
8026
8074
|
const s = [];
|
|
8027
8075
|
if (e.type === "local" && e.address && s.push({
|
|
8028
8076
|
to: a.address,
|
|
@@ -8056,19 +8104,19 @@ async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
|
8056
8104
|
]
|
|
8057
8105
|
};
|
|
8058
8106
|
if (await tf() === "cancel")
|
|
8059
|
-
throw
|
|
8107
|
+
throw k.provider.unauthorized("user cancelled");
|
|
8060
8108
|
const c = await t(o), f = Yi(r.chain.id);
|
|
8061
|
-
if (
|
|
8109
|
+
if (he(f, k.rpc.internal(`client not found for chainId ${r.chain.id}`)), (await Ga(f, {
|
|
8062
8110
|
id: c
|
|
8063
8111
|
})).status !== "success")
|
|
8064
|
-
throw
|
|
8112
|
+
throw k.rpc.internal("add owner call failed");
|
|
8065
8113
|
const p = await vs({
|
|
8066
8114
|
address: a.address,
|
|
8067
8115
|
publicKey: e.type === "local" && e.address ? e.address : e.publicKey,
|
|
8068
8116
|
client: f
|
|
8069
8117
|
});
|
|
8070
8118
|
if (p === -1)
|
|
8071
|
-
throw
|
|
8119
|
+
throw k.rpc.internal("failed to find owner index");
|
|
8072
8120
|
return p;
|
|
8073
8121
|
}
|
|
8074
8122
|
async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, client: r, globalAccountRequest: a, chainId: i, prependCalls: s }) {
|
|
@@ -8124,11 +8172,11 @@ async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, c
|
|
|
8124
8172
|
async function rf({ globalAccountAddress: e, subAccountAddress: t, client: n, request: r, globalAccountRequest: a }) {
|
|
8125
8173
|
var o;
|
|
8126
8174
|
const i = (o = n.chain) == null ? void 0 : o.id;
|
|
8127
|
-
|
|
8175
|
+
he(i, k.rpc.internal("invalid chainId"));
|
|
8128
8176
|
try {
|
|
8129
8177
|
await zl();
|
|
8130
8178
|
} catch {
|
|
8131
|
-
throw
|
|
8179
|
+
throw k.provider.userRejectedRequest({
|
|
8132
8180
|
message: "User cancelled funding"
|
|
8133
8181
|
});
|
|
8134
8182
|
}
|
|
@@ -8161,7 +8209,7 @@ class af {
|
|
|
8161
8209
|
async handshake(t) {
|
|
8162
8210
|
var r, a;
|
|
8163
8211
|
const n = Pe.get(t);
|
|
8164
|
-
|
|
8212
|
+
Su({ method: t.method, correlationId: n });
|
|
8165
8213
|
try {
|
|
8166
8214
|
await ((a = (r = this.communicator).waitForPopupLoaded) == null ? void 0 : a.call(r));
|
|
8167
8215
|
const i = await this.createRequestMessage({
|
|
@@ -8215,7 +8263,7 @@ class af {
|
|
|
8215
8263
|
case "wallet_sign":
|
|
8216
8264
|
return this.sendRequestToPopup(t);
|
|
8217
8265
|
default:
|
|
8218
|
-
throw
|
|
8266
|
+
throw k.provider.unauthorized();
|
|
8219
8267
|
}
|
|
8220
8268
|
if (this.shouldRequestUseSubAccountSigner(t)) {
|
|
8221
8269
|
const c = Pe.get(t);
|
|
@@ -8275,7 +8323,7 @@ class af {
|
|
|
8275
8323
|
subAccounts: [c]
|
|
8276
8324
|
};
|
|
8277
8325
|
if (!this.chain.rpcUrl)
|
|
8278
|
-
throw
|
|
8326
|
+
throw k.rpc.internal("No RPC URL set for chain");
|
|
8279
8327
|
const f = await lt(t, this.chain.rpcUrl);
|
|
8280
8328
|
if (_e(f.subAccounts, "subAccounts"), f.subAccounts.length > 0) {
|
|
8281
8329
|
It(f.subAccounts[0]);
|
|
@@ -8304,7 +8352,7 @@ class af {
|
|
|
8304
8352
|
}
|
|
8305
8353
|
default:
|
|
8306
8354
|
if (!this.chain.rpcUrl)
|
|
8307
|
-
throw
|
|
8355
|
+
throw k.rpc.internal("No RPC URL set for chain");
|
|
8308
8356
|
return lt(t, this.chain.rpcUrl);
|
|
8309
8357
|
}
|
|
8310
8358
|
}
|
|
@@ -8372,7 +8420,7 @@ class af {
|
|
|
8372
8420
|
*/
|
|
8373
8421
|
async handleSwitchChainRequest(t) {
|
|
8374
8422
|
Ra(t.params);
|
|
8375
|
-
const n =
|
|
8423
|
+
const n = ku(t.params[0].chainId);
|
|
8376
8424
|
if (this.updateChain(n))
|
|
8377
8425
|
return null;
|
|
8378
8426
|
const a = await this.sendRequestToPopup(t);
|
|
@@ -8382,7 +8430,7 @@ class af {
|
|
|
8382
8430
|
Gl(t.params);
|
|
8383
8431
|
const n = t.params[0], r = t.params[1];
|
|
8384
8432
|
if (!this.accounts.some((o) => La(o, n)))
|
|
8385
|
-
throw
|
|
8433
|
+
throw k.provider.unauthorized("no active account found when getting capabilities");
|
|
8386
8434
|
const a = x.getState().account.capabilities;
|
|
8387
8435
|
if (!a)
|
|
8388
8436
|
return {};
|
|
@@ -8401,7 +8449,7 @@ class af {
|
|
|
8401
8449
|
async sendEncryptedRequest(t) {
|
|
8402
8450
|
const n = await this.keyManager.getSharedSecret();
|
|
8403
8451
|
if (!n)
|
|
8404
|
-
throw
|
|
8452
|
+
throw k.provider.unauthorized("No shared secret found when encrypting request");
|
|
8405
8453
|
const r = await xd({
|
|
8406
8454
|
action: t,
|
|
8407
8455
|
chainId: this.chain.id
|
|
@@ -8425,7 +8473,7 @@ class af {
|
|
|
8425
8473
|
throw n.failure;
|
|
8426
8474
|
const r = await this.keyManager.getSharedSecret();
|
|
8427
8475
|
if (!r)
|
|
8428
|
-
throw
|
|
8476
|
+
throw k.provider.unauthorized("Invalid session: no shared secret found when decrypting response");
|
|
8429
8477
|
const a = await Ed(n.encrypted, r), i = (o = a.data) == null ? void 0 : o.chains;
|
|
8430
8478
|
if (i) {
|
|
8431
8479
|
const f = (u = a.data) == null ? void 0 : u.nativeCurrencies, l = Object.entries(i).map(([p, d]) => {
|
|
@@ -8462,7 +8510,7 @@ class af {
|
|
|
8462
8510
|
else {
|
|
8463
8511
|
const f = x.subAccountsConfig.get() ?? {}, { account: l } = f.toOwnerAccount ? await f.toOwnerAccount() : await cr();
|
|
8464
8512
|
if (!l)
|
|
8465
|
-
throw
|
|
8513
|
+
throw k.provider.unauthorized("could not get subaccount owner account when adding sub account");
|
|
8466
8514
|
c = [
|
|
8467
8515
|
{
|
|
8468
8516
|
type: l.address ? "address" : "webauthn-p256",
|
|
@@ -8482,16 +8530,16 @@ class af {
|
|
|
8482
8530
|
async sendRequestToSubAccountSigner(t) {
|
|
8483
8531
|
var m, b, E;
|
|
8484
8532
|
const n = x.subAccounts.get(), r = x.subAccountsConfig.get(), a = x.config.get();
|
|
8485
|
-
|
|
8533
|
+
he(n == null ? void 0 : n.address, k.provider.unauthorized("no active sub account when sending request to sub account signer"));
|
|
8486
8534
|
const i = r != null && r.toOwnerAccount ? await r.toOwnerAccount() : await cr();
|
|
8487
|
-
|
|
8535
|
+
he(i == null ? void 0 : i.account, k.provider.unauthorized("no active sub account owner when sending request to sub account signer")), Ua(t) === void 0 && (t = Fl(t, n.address));
|
|
8488
8536
|
const o = this.accounts.find((w) => w.toLowerCase() !== n.address.toLowerCase());
|
|
8489
|
-
|
|
8537
|
+
he(o, k.provider.unauthorized("no global account found when sending request to sub account signer"));
|
|
8490
8538
|
const u = Wl({
|
|
8491
8539
|
attribution: (m = a.preference) == null ? void 0 : m.attribution,
|
|
8492
8540
|
dappOrigin: window.location.origin
|
|
8493
8541
|
}), 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);
|
|
8494
|
-
if (
|
|
8542
|
+
if (he(l, k.rpc.internal(`client not found for chainId ${f} when sending request to sub account signer`)), ["eth_sendTransaction", "wallet_sendCalls"].includes(t.method)) {
|
|
8495
8543
|
const w = x.subAccountsConfig.get();
|
|
8496
8544
|
if ((w == null ? void 0 : w.funding) === "spend-permissions" && br.get().length === 0)
|
|
8497
8545
|
return await xs({
|
|
@@ -8525,7 +8573,7 @@ class af {
|
|
|
8525
8573
|
method: t.method,
|
|
8526
8574
|
correlationId: w,
|
|
8527
8575
|
errorMessage: Ze(A)
|
|
8528
|
-
}),
|
|
8576
|
+
}), k.provider.unauthorized("failed to add sub account owner when sending request to sub account signer");
|
|
8529
8577
|
}
|
|
8530
8578
|
}
|
|
8531
8579
|
const { request: h } = await ef({
|
|
@@ -8613,7 +8661,7 @@ class sf extends fu {
|
|
|
8613
8661
|
async _request(n) {
|
|
8614
8662
|
var r;
|
|
8615
8663
|
try {
|
|
8616
|
-
if (
|
|
8664
|
+
if (kd(n), !this.signer.isConnected)
|
|
8617
8665
|
switch (n.method) {
|
|
8618
8666
|
case "eth_requestAccounts": {
|
|
8619
8667
|
await this.signer.handshake({ method: "handshake" }), await ur(), await this.signer.request({
|
|
@@ -8649,7 +8697,7 @@ class sf extends fu {
|
|
|
8649
8697
|
case "eth_chainId":
|
|
8650
8698
|
return Mi(1);
|
|
8651
8699
|
default:
|
|
8652
|
-
throw
|
|
8700
|
+
throw k.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");
|
|
8653
8701
|
}
|
|
8654
8702
|
return await this.signer.request(n);
|
|
8655
8703
|
} catch (a) {
|
|
@@ -8658,7 +8706,7 @@ class sf extends fu {
|
|
|
8658
8706
|
}
|
|
8659
8707
|
}
|
|
8660
8708
|
async disconnect() {
|
|
8661
|
-
await this.signer.cleanup(), Pe.clear(), this.emit("disconnect",
|
|
8709
|
+
await this.signer.cleanup(), Pe.clear(), this.emit("disconnect", k.provider.disconnected("User initiated disconnection"));
|
|
8662
8710
|
}
|
|
8663
8711
|
}
|
|
8664
8712
|
const of = "isCoinbaseBrowser";
|
|
@@ -8719,7 +8767,7 @@ function hf(e) {
|
|
|
8719
8767
|
addOwner: async ({ address: c, publicKey: f, chainId: l }) => {
|
|
8720
8768
|
var m, b;
|
|
8721
8769
|
const p = x.subAccounts.get(), d = x.account.get();
|
|
8722
|
-
|
|
8770
|
+
he(d, new Error("account does not exist")), he(p == null ? void 0 : p.address, new Error("subaccount does not exist"));
|
|
8723
8771
|
const h = [];
|
|
8724
8772
|
if (f) {
|
|
8725
8773
|
const [E, w] = Ka([{ type: "bytes32" }, { type: "bytes32" }], f);
|