react-web3-storage 1.1.1 → 2.0.0
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-rozpLDQ6.mjs → ReownAuthentication-BTdnSW4c.mjs} +5 -5
- package/dist/{ReownAuthentication-CkX14Xfd.js → ReownAuthentication-Bi7oHuGf.js} +1 -1
- package/dist/{SwapController-C66V0rVR.mjs → SwapController-CVrVI6fw.mjs} +16 -16
- package/dist/{SwapController-C0lcb4dr.js → SwapController-PZ_cUWEW.js} +1 -1
- package/dist/{ccip-xFSfjuKI.mjs → ccip-ClSy32fL.mjs} +6 -6
- package/dist/{ccip-D6WomuwB.js → ccip-TDUuVnsR.js} +1 -1
- package/dist/{data-capture-BYKIrIja.mjs → data-capture-nJm8flD0.mjs} +5 -5
- package/dist/{data-capture-CP13n9fb.js → data-capture-plL1YmV9.js} +1 -1
- package/dist/{email-CvIbIml_.mjs → email-BIEjMkdp.mjs} +9 -9
- package/dist/{email-BibSsCO-.js → email-Bb8TiksZ.js} +1 -1
- package/dist/{embedded-wallet-DIT5Vzub.mjs → embedded-wallet-BwfuLzcy.mjs} +22 -22
- package/dist/{embedded-wallet-CwgWQ8kQ.js → embedded-wallet-Do1h12oF.js} +1 -1
- package/dist/{features-bl28WolR.js → features-3qQZVoJ9.js} +1 -1
- package/dist/{features-YJ0rTENv.mjs → features-WgJ1ccjE.mjs} +1 -1
- package/dist/{index-CMnK65pZ.js → index-1uaRGfNG.js} +1 -1
- package/dist/{index-Cfjd14Kv.mjs → index-BDYtVois.mjs} +2 -2
- package/dist/{index-Bti_FBX-.js → index-BF0RE6hb.js} +1 -1
- package/dist/{index-DU63Au14.mjs → index-BKdw_1qM.mjs} +9670 -9637
- package/dist/{index-DJctlCkS.js → index-BTAZoMiJ.js} +350 -350
- package/dist/{index-BaS7nzVY.js → index-BokidQQq.js} +1 -1
- package/dist/{index-CxhLrSqT.mjs → index-ByBvGUl7.mjs} +334 -309
- package/dist/{index-8cMgucfC.js → index-C4JlHMgz.js} +8 -8
- package/dist/{index-dIeRRHJf.js → index-CEc0pV8L.js} +1 -1
- package/dist/{index-DW4KJRJ_.mjs → index-CWqapSt6.mjs} +5 -5
- package/dist/{index-CVLPbCgj.mjs → index-Cx78ifGT.mjs} +1 -1
- package/dist/{index-Ddf7iO74.mjs → index-DMRaSYeI.mjs} +1 -1
- package/dist/{index-B9d0G-kv.js → index-DWz-QLrM.js} +1 -1
- package/dist/{index-BrhPiy1z.mjs → index-DuGTguVW.mjs} +1 -1
- package/dist/{index-CZtn1nZp.js → index-GJ5DCZOU.js} +1 -1
- package/dist/index-NFI34NW-.js +1 -0
- package/dist/index-ROIgf72J.mjs +267 -0
- package/dist/{index-Ct_f7SNN.mjs → index-mid89FTV.mjs} +15 -15
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -7
- package/dist/{onramp-C3OJ2N2j.js → onramp-B6w59Uog.js} +1 -1
- package/dist/{onramp-mOdzMn0D.mjs → onramp-C_QGimJZ.mjs} +31 -31
- package/dist/{parseSignature-e1W7IUis.mjs → parseSignature-BopOK20t.mjs} +74 -56
- package/dist/{parseSignature-D6edqaKK.js → parseSignature-USiYfXGb.js} +6 -6
- package/dist/{pay-with-exchange-DB9Vv8TQ.mjs → pay-with-exchange-CBeg2Hon.mjs} +2 -2
- package/dist/{pay-with-exchange-CKOEUpq0.js → pay-with-exchange-CU_wbxzI.js} +1 -1
- package/dist/{receive-D68MZgmT.js → receive-DI_BR-Kp.js} +1 -1
- package/dist/{receive-BtIALFd9.mjs → receive-DzQ1FR7M.mjs} +1 -1
- package/dist/{send-DfhBol7S.js → send-B3h0xUoI.js} +1 -1
- package/dist/{send-Cyb_Tke_.mjs → send-DiU2PdFv.mjs} +21 -21
- package/dist/{socials-BUj-Nme_.js → socials-Cu_B8mCk.js} +1 -1
- package/dist/{socials-B_mJLGn6.mjs → socials-iVCbnmhq.mjs} +13 -13
- package/dist/{swaps-Cb6kLYI8.js → swaps-C9PoDZOv.js} +1 -1
- package/dist/{swaps-e1Q0ocau.mjs → swaps-DSWXYO4B.mjs} +3 -3
- package/dist/{transactions-Cie_fOwl.js → transactions-Clw8oIVh.js} +1 -1
- package/dist/{transactions-SDKIQbj7.mjs → transactions-vROLnPws.mjs} +1 -1
- package/dist/{w3m-modal-CCqPFd4u.js → w3m-modal-DagyNV6w.js} +1 -1
- package/dist/{w3m-modal-9y4rG4BA.mjs → w3m-modal-E2ouyDlT.mjs} +18 -18
- package/package.json +1 -1
- package/dist/index-B1Lgc_3a.js +0 -1
- package/dist/index-Bmu2ovAI.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-BKdw_1qM.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-BopOK20t.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 oo(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 go = [
|
|
|
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 xo(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;
|
|
@@ -528,8 +528,8 @@ function ko(e, t, n, r) {
|
|
|
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 Po(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 Io(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 To(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 To(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 To(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 To(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 To(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()`. */
|
|
@@ -875,7 +875,7 @@ function To(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 To(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 To(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 To(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,
|
|
927
|
+
let y, S;
|
|
928
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.
|
|
@@ -951,14 +951,14 @@ function To(e, t = {}) {
|
|
|
951
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
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.
|
|
@@ -1011,14 +1011,14 @@ function To(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, fe = new
|
|
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 _o(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 _o(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 Bo(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 Bo(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 Bo(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 Bo(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 Bo(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
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 Bo(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
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 Bo(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 Bo(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 Uo(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 Ro(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 Do = {
|
|
|
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 Do = {
|
|
|
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 Go(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 Ko(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__ */ le({
|
|
|
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 qo = /* @__PURE__ */ le({
|
|
|
1616
1641
|
blockCreated: 14353601
|
|
1617
1642
|
}
|
|
1618
1643
|
}
|
|
1619
|
-
}), ct = 1, Zo = /* @__PURE__ */
|
|
1644
|
+
}), ct = 1, Zo = /* @__PURE__ */ de({
|
|
1620
1645
|
...Ee,
|
|
1621
1646
|
id: 10,
|
|
1622
1647
|
name: "OP Mainnet",
|
|
@@ -1661,7 +1686,7 @@ const qo = /* @__PURE__ */ le({
|
|
|
1661
1686
|
}
|
|
1662
1687
|
},
|
|
1663
1688
|
sourceId: ct
|
|
1664
|
-
}), ut = 11155111, Wo = /* @__PURE__ */
|
|
1689
|
+
}), ut = 11155111, Wo = /* @__PURE__ */ de({
|
|
1665
1690
|
...Ee,
|
|
1666
1691
|
id: 11155420,
|
|
1667
1692
|
name: "OP Sepolia",
|
|
@@ -1707,7 +1732,7 @@ const qo = /* @__PURE__ */ le({
|
|
|
1707
1732
|
},
|
|
1708
1733
|
testnet: !0,
|
|
1709
1734
|
sourceId: ut
|
|
1710
|
-
}), Yo = /* @__PURE__ */
|
|
1735
|
+
}), Yo = /* @__PURE__ */ de({
|
|
1711
1736
|
id: 137,
|
|
1712
1737
|
name: "Polygon",
|
|
1713
1738
|
blockTime: 2e3,
|
|
@@ -1730,7 +1755,7 @@ const qo = /* @__PURE__ */ le({
|
|
|
1730
1755
|
blockCreated: 25770160
|
|
1731
1756
|
}
|
|
1732
1757
|
}
|
|
1733
|
-
}), Jo = /* @__PURE__ */
|
|
1758
|
+
}), Jo = /* @__PURE__ */ de({
|
|
1734
1759
|
id: 11155111,
|
|
1735
1760
|
name: "Sepolia",
|
|
1736
1761
|
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -1757,7 +1782,7 @@ const qo = /* @__PURE__ */ le({
|
|
|
1757
1782
|
}
|
|
1758
1783
|
},
|
|
1759
1784
|
testnet: !0
|
|
1760
|
-
}),
|
|
1785
|
+
}), kt = 1, Xo = /* @__PURE__ */ de({
|
|
1761
1786
|
...Ee,
|
|
1762
1787
|
id: 7777777,
|
|
1763
1788
|
name: "Zora",
|
|
@@ -1782,7 +1807,7 @@ const qo = /* @__PURE__ */ le({
|
|
|
1782
1807
|
contracts: {
|
|
1783
1808
|
...Ee.contracts,
|
|
1784
1809
|
l2OutputOracle: {
|
|
1785
|
-
[
|
|
1810
|
+
[kt]: {
|
|
1786
1811
|
address: "0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"
|
|
1787
1812
|
}
|
|
1788
1813
|
},
|
|
@@ -1791,17 +1816,17 @@ const qo = /* @__PURE__ */ le({
|
|
|
1791
1816
|
blockCreated: 5882
|
|
1792
1817
|
},
|
|
1793
1818
|
portal: {
|
|
1794
|
-
[
|
|
1819
|
+
[kt]: {
|
|
1795
1820
|
address: "0x1a0ad011913A150f69f6A19DF447A0CfD9551054"
|
|
1796
1821
|
}
|
|
1797
1822
|
},
|
|
1798
1823
|
l1StandardBridge: {
|
|
1799
|
-
[
|
|
1824
|
+
[kt]: {
|
|
1800
1825
|
address: "0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"
|
|
1801
1826
|
}
|
|
1802
1827
|
}
|
|
1803
1828
|
},
|
|
1804
|
-
sourceId:
|
|
1829
|
+
sourceId: kt
|
|
1805
1830
|
}), Qo = "@base-org/account", $o = "2.4.0", fi = {
|
|
1806
1831
|
name: Qo,
|
|
1807
1832
|
version: $o
|
|
@@ -2654,7 +2679,7 @@ function On(e, t) {
|
|
|
2654
2679
|
function $r(e, t) {
|
|
2655
2680
|
return typeof e == "object" && e !== null && t in e && typeof e[t] == "string";
|
|
2656
2681
|
}
|
|
2657
|
-
const
|
|
2682
|
+
const k = {
|
|
2658
2683
|
rpc: {
|
|
2659
2684
|
parse: (e) => pe(X.rpc.parse, e),
|
|
2660
2685
|
invalidRequest: (e) => pe(X.rpc.invalidRequest, e),
|
|
@@ -2732,12 +2757,12 @@ class wi extends vr {
|
|
|
2732
2757
|
* `code` must be an integer in the 1000 <= 4999 range.
|
|
2733
2758
|
*/
|
|
2734
2759
|
constructor(t, n, r) {
|
|
2735
|
-
if (!
|
|
2760
|
+
if (!kc(t))
|
|
2736
2761
|
throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
|
|
2737
2762
|
super(t, n, r);
|
|
2738
2763
|
}
|
|
2739
2764
|
}
|
|
2740
|
-
function
|
|
2765
|
+
function kc(e) {
|
|
2741
2766
|
return Number.isInteger(e) && e >= 1e3 && e <= 4999;
|
|
2742
2767
|
}
|
|
2743
2768
|
function ea(e) {
|
|
@@ -2746,7 +2771,7 @@ function ea(e) {
|
|
|
2746
2771
|
function vi(e) {
|
|
2747
2772
|
return typeof e == "object" && e !== null && "details" in e;
|
|
2748
2773
|
}
|
|
2749
|
-
function
|
|
2774
|
+
function Sc(e) {
|
|
2750
2775
|
try {
|
|
2751
2776
|
const t = JSON.parse(e.details);
|
|
2752
2777
|
return new vr(t.code, t.message, t.data);
|
|
@@ -2756,14 +2781,14 @@ function kc(e) {
|
|
|
2756
2781
|
}
|
|
2757
2782
|
function he(e, t, n) {
|
|
2758
2783
|
if (e == null)
|
|
2759
|
-
throw t ??
|
|
2784
|
+
throw t ?? k.rpc.invalidParams({
|
|
2760
2785
|
message: "value must be present",
|
|
2761
2786
|
data: e
|
|
2762
2787
|
});
|
|
2763
2788
|
}
|
|
2764
2789
|
function _e(e, t) {
|
|
2765
2790
|
if (!Array.isArray(e))
|
|
2766
|
-
throw
|
|
2791
|
+
throw k.rpc.invalidParams({
|
|
2767
2792
|
message: t ?? "value must be an array",
|
|
2768
2793
|
data: e
|
|
2769
2794
|
});
|
|
@@ -2876,7 +2901,7 @@ function Rc() {
|
|
|
2876
2901
|
const t = document.createElement("style");
|
|
2877
2902
|
t.setAttribute("base-sdk-font", na), t.textContent = Uc, document.head.appendChild(t);
|
|
2878
2903
|
}
|
|
2879
|
-
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;
|
|
2880
2905
|
function Ue(e, t) {
|
|
2881
2906
|
for (var n in t) e[n] = t[n];
|
|
2882
2907
|
return e;
|
|
@@ -2916,21 +2941,21 @@ function Ii(e) {
|
|
|
2916
2941
|
}
|
|
2917
2942
|
}
|
|
2918
2943
|
function aa(e) {
|
|
2919
|
-
(!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);
|
|
2920
2945
|
}
|
|
2921
2946
|
function Ft() {
|
|
2922
2947
|
var e, t, n, r, a, i, s, o;
|
|
2923
|
-
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));
|
|
2924
2949
|
Ft.__r = 0;
|
|
2925
2950
|
}
|
|
2926
2951
|
function Oi(e, t, n, r, a, i, s, o, u, c, f) {
|
|
2927
|
-
var l, p, d, h, m, b = r && r.__k ||
|
|
2928
|
-
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);
|
|
2929
2954
|
n.__d = u, n.__e = m;
|
|
2930
2955
|
}
|
|
2931
2956
|
function jc(e, t, n) {
|
|
2932
2957
|
var r, a, i, s, o, u = t.length, c = n.length, f = c, l = 0;
|
|
2933
|
-
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;
|
|
2934
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));
|
|
2935
2960
|
}
|
|
2936
2961
|
function Ci(e, t, n) {
|
|
@@ -2963,7 +2988,7 @@ function Dc(e, t, n, r) {
|
|
|
2963
2988
|
function ia(e, t, n) {
|
|
2964
2989
|
t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Nc.test(t) ? n : n + "px";
|
|
2965
2990
|
}
|
|
2966
|
-
function
|
|
2991
|
+
function St(e, t, n, r, a) {
|
|
2967
2992
|
var i;
|
|
2968
2993
|
e: if (t === "style") if (typeof n == "string") e.style.cssText = n;
|
|
2969
2994
|
else {
|
|
@@ -2991,7 +3016,7 @@ function sa(e) {
|
|
|
2991
3016
|
}
|
|
2992
3017
|
};
|
|
2993
3018
|
}
|
|
2994
|
-
function
|
|
3019
|
+
function Sr(e, t, n, r, a, i, s, o, u, c) {
|
|
2995
3020
|
var f, l, p, d, h, m, b, E, w, A, N, ee, ae, U, j, B, se = t.type;
|
|
2996
3021
|
if (t.constructor !== void 0) return null;
|
|
2997
3022
|
128 & n.__u && (u = !!(32 & n.__u), i = [o = t.__e = n.__e]), (f = G.__b) && f(t);
|
|
@@ -3015,7 +3040,7 @@ function kr(e, t, n, r, a, i, s, o, u, c) {
|
|
|
3015
3040
|
} else do
|
|
3016
3041
|
l.__d = !1, ae && ae(t), f = l.render(l.props, l.state, l.context), l.state = l.__s;
|
|
3017
3042
|
while (l.__d && ++U < 25);
|
|
3018
|
-
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,
|
|
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);
|
|
3019
3044
|
} catch (fe) {
|
|
3020
3045
|
if (t.__v = null, u || i != null) {
|
|
3021
3046
|
for (t.__u |= u ? 160 : 32; o && o.nodeType === 8 && o.nextSibling; ) o = o.nextSibling;
|
|
@@ -3058,13 +3083,13 @@ function Mc(e, t, n, r, a, i, s, o, u) {
|
|
|
3058
3083
|
if (c == "dangerouslySetInnerHTML") l = d;
|
|
3059
3084
|
else if (!(c in E)) {
|
|
3060
3085
|
if (c == "value" && "defaultValue" in E || c == "checked" && "defaultChecked" in E) continue;
|
|
3061
|
-
|
|
3086
|
+
St(e, c, null, d, a);
|
|
3062
3087
|
}
|
|
3063
3088
|
}
|
|
3064
|
-
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);
|
|
3065
3090
|
if (f) o || l && (f.__html === l.__html || f.__html === e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
3066
|
-
else if (l && (e.innerHTML = ""), Oi(e,
|
|
3067
|
-
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));
|
|
3068
3093
|
}
|
|
3069
3094
|
return e;
|
|
3070
3095
|
}
|
|
@@ -3096,9 +3121,9 @@ function Lc(e, t, n) {
|
|
|
3096
3121
|
}
|
|
3097
3122
|
function oa(e, t, n) {
|
|
3098
3123
|
var r, a, i, s;
|
|
3099
|
-
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);
|
|
3100
3125
|
}
|
|
3101
|
-
tn =
|
|
3126
|
+
tn = Si.slice, G = { __e: function(e, t, n, r) {
|
|
3102
3127
|
for (var a, i, s; t = t.__; ) if ((a = t.__c) && !a.__) try {
|
|
3103
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;
|
|
3104
3129
|
} catch (o) {
|
|
@@ -3110,7 +3135,7 @@ tn = ki.slice, G = { __e: function(e, t, n, r) {
|
|
|
3110
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));
|
|
3111
3136
|
}, Nt.prototype.forceUpdate = function(e) {
|
|
3112
3137
|
this.__v && (this.__e = !0, e && this.__h.push(e), aa(this));
|
|
3113
|
-
}, 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) {
|
|
3114
3139
|
return e.__v.__b - t.__v.__b;
|
|
3115
3140
|
}, Ft.__r = 0, Er = 0, Tn = sa(!1), _n = sa(!0);
|
|
3116
3141
|
var Fc = 0;
|
|
@@ -3387,7 +3412,7 @@ function ou(e) {
|
|
|
3387
3412
|
He({
|
|
3388
3413
|
dialogContext: "popup_blocked",
|
|
3389
3414
|
dialogAction: "cancel"
|
|
3390
|
-
}), i(
|
|
3415
|
+
}), i(k.rpc.internal("Popup window was blocked"));
|
|
3391
3416
|
},
|
|
3392
3417
|
actionItems: [
|
|
3393
3418
|
{
|
|
@@ -3399,7 +3424,7 @@ function ou(e) {
|
|
|
3399
3424
|
dialogAction: "confirm"
|
|
3400
3425
|
});
|
|
3401
3426
|
const s = e();
|
|
3402
|
-
s ? a(s) : i(
|
|
3427
|
+
s ? a(s) : i(k.rpc.internal("Popup window was blocked")), n.clear();
|
|
3403
3428
|
}
|
|
3404
3429
|
},
|
|
3405
3430
|
{
|
|
@@ -3409,7 +3434,7 @@ function ou(e) {
|
|
|
3409
3434
|
He({
|
|
3410
3435
|
dialogContext: "popup_blocked",
|
|
3411
3436
|
dialogAction: "cancel"
|
|
3412
|
-
}), i(
|
|
3437
|
+
}), i(k.rpc.internal("Popup window was blocked")), n.clear();
|
|
3413
3438
|
}
|
|
3414
3439
|
}
|
|
3415
3440
|
]
|
|
@@ -3453,7 +3478,7 @@ class cu {
|
|
|
3453
3478
|
*/
|
|
3454
3479
|
F(this, "disconnect", () => {
|
|
3455
3480
|
iu(this.popup), this.popup = null, this.listeners.forEach(({ reject: t }, n) => {
|
|
3456
|
-
t(
|
|
3481
|
+
t(k.provider.userRejectedRequest("Request rejected")), window.removeEventListener("message", n);
|
|
3457
3482
|
}), this.listeners.clear();
|
|
3458
3483
|
});
|
|
3459
3484
|
/**
|
|
@@ -3475,7 +3500,7 @@ class cu {
|
|
|
3475
3500
|
});
|
|
3476
3501
|
}).then(() => {
|
|
3477
3502
|
if (!this.popup)
|
|
3478
|
-
throw
|
|
3503
|
+
throw k.rpc.internal();
|
|
3479
3504
|
return _c(), this.popup;
|
|
3480
3505
|
})));
|
|
3481
3506
|
this.url = new URL(t), this.metadata = n, this.preference = r;
|
|
@@ -3573,13 +3598,13 @@ function jn(e, t = !1) {
|
|
|
3573
3598
|
if (Di.test(n))
|
|
3574
3599
|
return Gt(t ? `0x${n}` : n);
|
|
3575
3600
|
}
|
|
3576
|
-
throw
|
|
3601
|
+
throw k.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`);
|
|
3577
3602
|
}
|
|
3578
3603
|
function Eu(e, t = !1) {
|
|
3579
3604
|
let n = jn(e, !1);
|
|
3580
3605
|
return n.length % 2 === 1 && (n = Gt(`0${n}`)), t ? Gt(`0x${n}`) : n;
|
|
3581
3606
|
}
|
|
3582
|
-
function
|
|
3607
|
+
function ku(e) {
|
|
3583
3608
|
if (typeof e == "number" && Number.isInteger(e))
|
|
3584
3609
|
return yn(e);
|
|
3585
3610
|
if (typeof e == "string") {
|
|
@@ -3588,9 +3613,9 @@ function Su(e) {
|
|
|
3588
3613
|
if (xu(e))
|
|
3589
3614
|
return yn(Number(BigInt(Eu(e, !0))));
|
|
3590
3615
|
}
|
|
3591
|
-
throw
|
|
3616
|
+
throw k.rpc.invalidParams(`Not an integer: ${String(e)}`);
|
|
3592
3617
|
}
|
|
3593
|
-
const
|
|
3618
|
+
const Su = ({ method: e, correlationId: t }) => {
|
|
3594
3619
|
const n = x.subAccountsConfig.get();
|
|
3595
3620
|
Z("scw_signer.handshake.started", {
|
|
3596
3621
|
action: K.unknown,
|
|
@@ -4575,14 +4600,14 @@ function Ku(e) {
|
|
|
4575
4600
|
], [
|
|
4576
4601
|
d,
|
|
4577
4602
|
f,
|
|
4578
|
-
|
|
4579
|
-
|
|
4603
|
+
Se(N),
|
|
4604
|
+
Se(s),
|
|
4580
4605
|
o,
|
|
4581
4606
|
h,
|
|
4582
4607
|
p,
|
|
4583
4608
|
u,
|
|
4584
4609
|
c,
|
|
4585
|
-
|
|
4610
|
+
Se(l)
|
|
4586
4611
|
]);
|
|
4587
4612
|
}
|
|
4588
4613
|
if (r === "0.7") {
|
|
@@ -4601,20 +4626,20 @@ function Ku(e) {
|
|
|
4601
4626
|
], [
|
|
4602
4627
|
w.sender,
|
|
4603
4628
|
w.nonce,
|
|
4604
|
-
|
|
4605
|
-
|
|
4629
|
+
Se(w.initCode),
|
|
4630
|
+
Se(w.callData),
|
|
4606
4631
|
w.accountGasLimits,
|
|
4607
4632
|
w.preVerificationGas,
|
|
4608
4633
|
w.gasFees,
|
|
4609
|
-
|
|
4634
|
+
Se(w.paymasterAndData)
|
|
4610
4635
|
]);
|
|
4611
4636
|
}
|
|
4612
4637
|
throw new Error(`entryPointVersion "${r}" not supported.`);
|
|
4613
4638
|
})();
|
|
4614
|
-
return
|
|
4639
|
+
return Se(pt([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [Se(m), n, BigInt(t)]));
|
|
4615
4640
|
}
|
|
4616
4641
|
async function zu(e) {
|
|
4617
|
-
const { extend: t, nonceKeyManager: n =
|
|
4642
|
+
const { extend: t, nonceKeyManager: n = Ks({
|
|
4618
4643
|
source: {
|
|
4619
4644
|
get() {
|
|
4620
4645
|
return Date.now();
|
|
@@ -4639,7 +4664,7 @@ async function zu(e) {
|
|
|
4639
4664
|
client: e.client
|
|
4640
4665
|
}));
|
|
4641
4666
|
return e.getNonce ? await e.getNonce({ ...s, key: o }) : await En(e.client, {
|
|
4642
|
-
abi:
|
|
4667
|
+
abi: zs([
|
|
4643
4668
|
"function getNonce(address, uint192) pure returns (uint256)"
|
|
4644
4669
|
]),
|
|
4645
4670
|
address: e.entryPoint.address,
|
|
@@ -5291,7 +5316,7 @@ Object.defineProperty(sr, "message", {
|
|
|
5291
5316
|
});
|
|
5292
5317
|
class qu extends _ {
|
|
5293
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 }) {
|
|
5294
|
-
const N =
|
|
5319
|
+
const N = Vs({
|
|
5295
5320
|
callData: n,
|
|
5296
5321
|
callGasLimit: r,
|
|
5297
5322
|
factory: i,
|
|
@@ -5561,7 +5586,7 @@ function Qu(e) {
|
|
|
5561
5586
|
return u[0];
|
|
5562
5587
|
const c = u.filter((f) => {
|
|
5563
5588
|
try {
|
|
5564
|
-
return !!
|
|
5589
|
+
return !!qs({
|
|
5565
5590
|
abi: f.abi,
|
|
5566
5591
|
data: n
|
|
5567
5592
|
});
|
|
@@ -5575,12 +5600,12 @@ function Qu(e) {
|
|
|
5575
5600
|
args: void 0,
|
|
5576
5601
|
to: void 0
|
|
5577
5602
|
};
|
|
5578
|
-
})(), o = n === "0x" ? new
|
|
5603
|
+
})(), o = n === "0x" ? new Zs({ functionName: a }) : new Ws({
|
|
5579
5604
|
abi: r,
|
|
5580
5605
|
data: n,
|
|
5581
5606
|
functionName: a
|
|
5582
5607
|
});
|
|
5583
|
-
return new
|
|
5608
|
+
return new Ys(o, {
|
|
5584
5609
|
abi: r,
|
|
5585
5610
|
args: i,
|
|
5586
5611
|
contractAddress: s,
|
|
@@ -5736,7 +5761,7 @@ async function Or(e, t) {
|
|
|
5736
5761
|
};
|
|
5737
5762
|
}
|
|
5738
5763
|
try {
|
|
5739
|
-
const j = o.client ?? e, B = await be(j,
|
|
5764
|
+
const j = o.client ?? e, B = await be(j, Js, "estimateFeesPerGas")({
|
|
5740
5765
|
chain: j.chain,
|
|
5741
5766
|
type: "eip1559"
|
|
5742
5767
|
});
|
|
@@ -5765,7 +5790,7 @@ async function Or(e, t) {
|
|
|
5765
5790
|
return n.authorization;
|
|
5766
5791
|
if (s.authorization && !await s.isDeployed())
|
|
5767
5792
|
return {
|
|
5768
|
-
...await
|
|
5793
|
+
...await so(s.client, s.authorization),
|
|
5769
5794
|
r: "0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",
|
|
5770
5795
|
s: "0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
5771
5796
|
yParity: 1
|
|
@@ -5843,7 +5868,7 @@ async function Ki(e, t) {
|
|
|
5843
5868
|
const { account: n = e.account, entryPointAddress: r, stateOverride: a } = t;
|
|
5844
5869
|
if (!n && !t.sender)
|
|
5845
5870
|
throw new Qt();
|
|
5846
|
-
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")({
|
|
5847
5872
|
...t,
|
|
5848
5873
|
parameters: [
|
|
5849
5874
|
"authorization",
|
|
@@ -5895,7 +5920,7 @@ async function sd(e, { hash: t }) {
|
|
|
5895
5920
|
}
|
|
5896
5921
|
function od(e) {
|
|
5897
5922
|
const t = { ...e };
|
|
5898
|
-
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;
|
|
5899
5924
|
}
|
|
5900
5925
|
async function zi(e, { hash: t }) {
|
|
5901
5926
|
const n = await e.request({
|
|
@@ -5941,10 +5966,10 @@ function ud(e, t) {
|
|
|
5941
5966
|
n
|
|
5942
5967
|
]);
|
|
5943
5968
|
return new Promise((u, c) => {
|
|
5944
|
-
const f =
|
|
5969
|
+
const f = eo(o, { resolve: u, reject: c }, (l) => {
|
|
5945
5970
|
const p = (m) => {
|
|
5946
5971
|
h(), m(), f();
|
|
5947
|
-
}, 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 () => {
|
|
5948
5973
|
a && s >= a && (clearTimeout(d), p(() => l.reject(new wa({ hash: n }))));
|
|
5949
5974
|
try {
|
|
5950
5975
|
const m = await be(e, zi, "getUserOperationReceipt")({ hash: n });
|
|
@@ -5976,7 +6001,7 @@ function dd(e) {
|
|
|
5976
6001
|
}
|
|
5977
6002
|
function ld(e) {
|
|
5978
6003
|
const { client: t, key: n = "bundler", name: r = "Bundler Client", paymaster: a, paymasterContext: i, transport: s, userOperation: o } = e;
|
|
5979
|
-
return Object.assign(
|
|
6004
|
+
return Object.assign(no({
|
|
5980
6005
|
...e,
|
|
5981
6006
|
chain: e.chain ?? (t == null ? void 0 : t.chain),
|
|
5982
6007
|
key: n,
|
|
@@ -5987,11 +6012,11 @@ function ld(e) {
|
|
|
5987
6012
|
}
|
|
5988
6013
|
const Vi = gr(() => ({})), fd = [
|
|
5989
6014
|
di,
|
|
5990
|
-
Vo,
|
|
5991
6015
|
zo,
|
|
6016
|
+
Ko,
|
|
5992
6017
|
Yo,
|
|
5993
6018
|
qo,
|
|
5994
|
-
|
|
6019
|
+
Vo,
|
|
5995
6020
|
Xo,
|
|
5996
6021
|
Zo
|
|
5997
6022
|
], pd = [
|
|
@@ -6014,7 +6039,7 @@ function qi(e) {
|
|
|
6014
6039
|
function hd(e, t, n) {
|
|
6015
6040
|
var u, c;
|
|
6016
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;
|
|
6017
|
-
return
|
|
6042
|
+
return de({
|
|
6018
6043
|
id: e,
|
|
6019
6044
|
name: i,
|
|
6020
6045
|
nativeCurrency: {
|
|
@@ -6047,7 +6072,7 @@ function Zi(e) {
|
|
|
6047
6072
|
const { chainId: t, rpcUrl: n, nativeCurrency: r, viemChain: a } = e, i = hd(t, n, {
|
|
6048
6073
|
viemChain: a,
|
|
6049
6074
|
nativeCurrency: r
|
|
6050
|
-
}), s =
|
|
6075
|
+
}), s = ro({
|
|
6051
6076
|
chain: i,
|
|
6052
6077
|
transport: Fr(n)
|
|
6053
6078
|
}), o = ld({
|
|
@@ -6107,15 +6132,15 @@ const Pt = gr(() => ({
|
|
|
6107
6132
|
};
|
|
6108
6133
|
function It(e) {
|
|
6109
6134
|
if (typeof e != "object" || e === null)
|
|
6110
|
-
throw
|
|
6135
|
+
throw k.rpc.internal("sub account info is not an object");
|
|
6111
6136
|
if (!("address" in e))
|
|
6112
|
-
throw
|
|
6137
|
+
throw k.rpc.internal("sub account is invalid");
|
|
6113
6138
|
if ("address" in e && typeof e.address == "string" && !Qe(e.address))
|
|
6114
|
-
throw
|
|
6139
|
+
throw k.rpc.internal("sub account address is invalid");
|
|
6115
6140
|
if ("factory" in e && typeof e.factory == "string" && !Qe(e.factory))
|
|
6116
|
-
throw
|
|
6141
|
+
throw k.rpc.internal("sub account factory address is invalid");
|
|
6117
6142
|
if ("factoryData" in e && typeof e.factoryData == "string" && !qe(e.factoryData))
|
|
6118
|
-
throw
|
|
6143
|
+
throw k.rpc.internal("sub account factory data is invalid");
|
|
6119
6144
|
}
|
|
6120
6145
|
async function gd() {
|
|
6121
6146
|
return crypto.subtle.generateKey({
|
|
@@ -6199,20 +6224,20 @@ async function lt(e, t) {
|
|
|
6199
6224
|
throw i;
|
|
6200
6225
|
return a;
|
|
6201
6226
|
}
|
|
6202
|
-
function
|
|
6227
|
+
function kd(e) {
|
|
6203
6228
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
6204
|
-
throw
|
|
6229
|
+
throw k.rpc.invalidParams({
|
|
6205
6230
|
message: "Expected a single, non-array, object argument.",
|
|
6206
6231
|
data: e
|
|
6207
6232
|
});
|
|
6208
6233
|
const { method: t, params: n } = e;
|
|
6209
6234
|
if (typeof t != "string" || t.length === 0)
|
|
6210
|
-
throw
|
|
6235
|
+
throw k.rpc.invalidParams({
|
|
6211
6236
|
message: "'args.method' must be a non-empty string.",
|
|
6212
6237
|
data: e
|
|
6213
6238
|
});
|
|
6214
6239
|
if (n !== void 0 && !Array.isArray(n) && (typeof n != "object" || n === null))
|
|
6215
|
-
throw
|
|
6240
|
+
throw k.rpc.invalidParams({
|
|
6216
6241
|
message: "'args.params' must be an object or array if provided.",
|
|
6217
6242
|
data: e
|
|
6218
6243
|
});
|
|
@@ -6221,12 +6246,12 @@ function Sd(e) {
|
|
|
6221
6246
|
case "eth_signTypedData_v2":
|
|
6222
6247
|
case "eth_subscribe":
|
|
6223
6248
|
case "eth_unsubscribe":
|
|
6224
|
-
throw
|
|
6249
|
+
throw k.provider.unsupportedMethod();
|
|
6225
6250
|
}
|
|
6226
6251
|
}
|
|
6227
|
-
const
|
|
6252
|
+
const Sd = "0.1.1";
|
|
6228
6253
|
function Ad() {
|
|
6229
|
-
return
|
|
6254
|
+
return Sd;
|
|
6230
6255
|
}
|
|
6231
6256
|
class q extends Error {
|
|
6232
6257
|
constructor(t, n = {}) {
|
|
@@ -6537,7 +6562,7 @@ function Hd(e, t, n) {
|
|
|
6537
6562
|
size: rt(e)
|
|
6538
6563
|
});
|
|
6539
6564
|
}
|
|
6540
|
-
const
|
|
6565
|
+
const ke = {
|
|
6541
6566
|
zero: 48,
|
|
6542
6567
|
nine: 57,
|
|
6543
6568
|
A: 65,
|
|
@@ -6546,12 +6571,12 @@ const Se = {
|
|
|
6546
6571
|
f: 102
|
|
6547
6572
|
};
|
|
6548
6573
|
function Ea(e) {
|
|
6549
|
-
if (e >=
|
|
6550
|
-
return e -
|
|
6551
|
-
if (e >=
|
|
6552
|
-
return e - (
|
|
6553
|
-
if (e >=
|
|
6554
|
-
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);
|
|
6555
6580
|
}
|
|
6556
6581
|
function _r(e, t) {
|
|
6557
6582
|
if (je(e) > t)
|
|
@@ -6593,13 +6618,13 @@ const Vd = /* @__PURE__ */ new TextEncoder(), qd = /* @__PURE__ */ Array.from({
|
|
|
6593
6618
|
function Zd(e, t = {}) {
|
|
6594
6619
|
const { strict: n = !1 } = t;
|
|
6595
6620
|
if (!e)
|
|
6596
|
-
throw new
|
|
6621
|
+
throw new ka(e);
|
|
6597
6622
|
if (typeof e != "string")
|
|
6598
|
-
throw new Sa(e);
|
|
6599
|
-
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6600
6623
|
throw new ka(e);
|
|
6624
|
+
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
6625
|
+
throw new Sa(e);
|
|
6601
6626
|
if (!e.startsWith("0x"))
|
|
6602
|
-
throw new
|
|
6627
|
+
throw new Sa(e);
|
|
6603
6628
|
}
|
|
6604
6629
|
function sn(...e) {
|
|
6605
6630
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
@@ -6677,7 +6702,7 @@ class Xd extends q {
|
|
|
6677
6702
|
});
|
|
6678
6703
|
}
|
|
6679
6704
|
}
|
|
6680
|
-
class
|
|
6705
|
+
class ka extends q {
|
|
6681
6706
|
constructor(t) {
|
|
6682
6707
|
super(`Value \`${typeof t == "object" ? an(t) : t}\` of type \`${typeof t}\` is an invalid hex type.`, {
|
|
6683
6708
|
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
@@ -6689,7 +6714,7 @@ class Sa extends q {
|
|
|
6689
6714
|
});
|
|
6690
6715
|
}
|
|
6691
6716
|
}
|
|
6692
|
-
class
|
|
6717
|
+
class Sa extends q {
|
|
6693
6718
|
constructor(t) {
|
|
6694
6719
|
super(`Value \`${t}\` is an invalid hex value.`, {
|
|
6695
6720
|
metaMessages: [
|
|
@@ -7125,11 +7150,11 @@ const ms = {
|
|
|
7125
7150
|
b: BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),
|
|
7126
7151
|
Gx: BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),
|
|
7127
7152
|
Gy: BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")
|
|
7128
|
-
}, vl = ze(ms.p), xl = ze(hs.p), El = ze(ys.p),
|
|
7129
|
-
yr({ ...hs, Fp: xl, lowS: !1 },
|
|
7130
|
-
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);
|
|
7131
7156
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7132
|
-
const Ca =
|
|
7157
|
+
const Ca = kl;
|
|
7133
7158
|
Uint8Array.from([
|
|
7134
7159
|
105,
|
|
7135
7160
|
171,
|
|
@@ -7148,7 +7173,7 @@ Uint8Array.from([
|
|
|
7148
7173
|
186,
|
|
7149
7174
|
233
|
|
7150
7175
|
]);
|
|
7151
|
-
function
|
|
7176
|
+
function Sl(e = {}) {
|
|
7152
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 });
|
|
7153
7178
|
return sn(a, i, s);
|
|
7154
7179
|
}
|
|
@@ -7163,7 +7188,7 @@ function Al(e) {
|
|
|
7163
7188
|
});
|
|
7164
7189
|
}
|
|
7165
7190
|
function Pl(e) {
|
|
7166
|
-
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({
|
|
7167
7192
|
flag: a,
|
|
7168
7193
|
rpId: s,
|
|
7169
7194
|
signCount: o
|
|
@@ -7368,7 +7393,7 @@ function Ua(e) {
|
|
|
7368
7393
|
}
|
|
7369
7394
|
function Fl(e, t) {
|
|
7370
7395
|
if (!Array.isArray(e.params))
|
|
7371
|
-
throw
|
|
7396
|
+
throw k.rpc.invalidParams();
|
|
7372
7397
|
const n = [...e.params];
|
|
7373
7398
|
switch (e.method) {
|
|
7374
7399
|
case "eth_signTransaction":
|
|
@@ -7388,17 +7413,17 @@ function Fl(e, t) {
|
|
|
7388
7413
|
function Ra(e) {
|
|
7389
7414
|
var t;
|
|
7390
7415
|
if (!e || !Array.isArray(e) || !((t = e[0]) != null && t.chainId) || typeof e[0].chainId != "string" && typeof e[0].chainId != "number")
|
|
7391
|
-
throw
|
|
7416
|
+
throw k.rpc.invalidParams();
|
|
7392
7417
|
}
|
|
7393
7418
|
function Gl(e) {
|
|
7394
7419
|
if (!e || !Array.isArray(e) || e.length !== 1 && e.length !== 2 || typeof e[0] != "string" || !Qe(e[0]))
|
|
7395
|
-
throw
|
|
7420
|
+
throw k.rpc.invalidParams();
|
|
7396
7421
|
if (e.length === 2) {
|
|
7397
7422
|
if (!Array.isArray(e[1]))
|
|
7398
|
-
throw
|
|
7423
|
+
throw k.rpc.invalidParams();
|
|
7399
7424
|
for (const t of e[1])
|
|
7400
7425
|
if (typeof t != "string" || !t.startsWith("0x"))
|
|
7401
|
-
throw
|
|
7426
|
+
throw k.rpc.invalidParams();
|
|
7402
7427
|
}
|
|
7403
7428
|
}
|
|
7404
7429
|
function gt(e, t) {
|
|
@@ -7406,7 +7431,7 @@ function gt(e, t) {
|
|
|
7406
7431
|
if (t && e.method.startsWith("wallet_")) {
|
|
7407
7432
|
let r = ft(n, "params.0.capabilities");
|
|
7408
7433
|
if (typeof r > "u" && (r = {}), typeof r != "object")
|
|
7409
|
-
throw
|
|
7434
|
+
throw k.rpc.invalidParams();
|
|
7410
7435
|
r = {
|
|
7411
7436
|
...t,
|
|
7412
7437
|
...r
|
|
@@ -7422,7 +7447,7 @@ async function ur() {
|
|
|
7422
7447
|
if (e.creation === "on-connect") {
|
|
7423
7448
|
const { account: n } = e.toOwnerAccount ? await e.toOwnerAccount() : await cr();
|
|
7424
7449
|
if (!n)
|
|
7425
|
-
throw
|
|
7450
|
+
throw k.provider.unauthorized("No owner account found");
|
|
7426
7451
|
t.addSubAccount = {
|
|
7427
7452
|
account: {
|
|
7428
7453
|
type: "create",
|
|
@@ -7444,14 +7469,14 @@ function Hl(e) {
|
|
|
7444
7469
|
if (!(e.method === "coinbase_fetchPermissions" && e.params === void 0)) {
|
|
7445
7470
|
if (e.method === "coinbase_fetchPermissions" && Array.isArray(e.params) && e.params.length === 1 && typeof e.params[0] == "object") {
|
|
7446
7471
|
if (typeof e.params[0].account != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7447
|
-
throw
|
|
7472
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].account must be a hex string");
|
|
7448
7473
|
if (typeof e.params[0].chainId != "string" || !e.params[0].chainId.startsWith("0x"))
|
|
7449
|
-
throw
|
|
7474
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].chainId must be a hex string");
|
|
7450
7475
|
if (typeof e.params[0].spender != "string" || !e.params[0].spender.startsWith("0x"))
|
|
7451
|
-
throw
|
|
7476
|
+
throw k.rpc.invalidParams("FetchPermissions - Invalid params: params[0].spender must be a hex string");
|
|
7452
7477
|
return;
|
|
7453
7478
|
}
|
|
7454
|
-
throw
|
|
7479
|
+
throw k.rpc.invalidParams();
|
|
7455
7480
|
}
|
|
7456
7481
|
}
|
|
7457
7482
|
function Kl(e) {
|
|
@@ -7460,7 +7485,7 @@ function Kl(e) {
|
|
|
7460
7485
|
return e;
|
|
7461
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;
|
|
7462
7487
|
if (!t || !r || !n)
|
|
7463
|
-
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");
|
|
7464
7489
|
return {
|
|
7465
7490
|
method: "coinbase_fetchPermissions",
|
|
7466
7491
|
params: [
|
|
@@ -7479,7 +7504,7 @@ async function bs({ client: e, id: t }) {
|
|
|
7479
7504
|
});
|
|
7480
7505
|
if (n.status === "success")
|
|
7481
7506
|
return (r = n.receipts) == null ? void 0 : r[0].transactionHash;
|
|
7482
|
-
throw
|
|
7507
|
+
throw k.rpc.internal("failed to send transaction");
|
|
7483
7508
|
}
|
|
7484
7509
|
function ws({ calls: e, from: t, chainId: n, capabilities: r }) {
|
|
7485
7510
|
const a = mi.get().paymasterUrls;
|
|
@@ -7541,7 +7566,7 @@ function ql(e) {
|
|
|
7541
7566
|
return Array.isArray(e) && e.length === 1 && typeof e[0] == "object" && e[0] !== null && "to" in e[0];
|
|
7542
7567
|
}
|
|
7543
7568
|
function Zl(e) {
|
|
7544
|
-
return
|
|
7569
|
+
return Rs(Se(Oe(e)), 0, 16);
|
|
7545
7570
|
}
|
|
7546
7571
|
function Wl({ attribution: e, dappOrigin: t }) {
|
|
7547
7572
|
if (e) {
|
|
@@ -7761,7 +7786,7 @@ function $l({ webauthn: e, signature: t }) {
|
|
|
7761
7786
|
], [
|
|
7762
7787
|
{
|
|
7763
7788
|
authenticatorData: e.authenticatorData,
|
|
7764
|
-
clientDataJSON:
|
|
7789
|
+
clientDataJSON: Ns(e.clientDataJSON),
|
|
7765
7790
|
challengeIndex: BigInt(e.challengeIndex),
|
|
7766
7791
|
typeIndex: BigInt(e.typeIndex),
|
|
7767
7792
|
r: n,
|
|
@@ -7773,8 +7798,8 @@ function dt(e) {
|
|
|
7773
7798
|
const { ownerIndex: t = 0 } = e, n = (() => {
|
|
7774
7799
|
if (Da(e.signature) !== 65)
|
|
7775
7800
|
return e.signature;
|
|
7776
|
-
const r =
|
|
7777
|
-
return
|
|
7801
|
+
const r = ao(e.signature);
|
|
7802
|
+
return io(["bytes32", "bytes32", "uint8"], [r.r, r.s, r.yParity === 0 ? 27 : 28]);
|
|
7778
7803
|
})();
|
|
7779
7804
|
return pt([
|
|
7780
7805
|
{
|
|
@@ -7805,7 +7830,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7805
7830
|
factoryData: r
|
|
7806
7831
|
}, c = (p = t.chain) == null ? void 0 : p.id;
|
|
7807
7832
|
if (!c)
|
|
7808
|
-
throw
|
|
7833
|
+
throw k.rpc.internal("chainId not found");
|
|
7809
7834
|
const f = await Ql({
|
|
7810
7835
|
owner: a,
|
|
7811
7836
|
ownerIndex: i ?? 1,
|
|
@@ -7829,7 +7854,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7829
7854
|
case "eth_sendTransaction": {
|
|
7830
7855
|
_e(d.params);
|
|
7831
7856
|
const m = d.params[0];
|
|
7832
|
-
he(m.to,
|
|
7857
|
+
he(m.to, k.rpc.invalidParams("to is required"));
|
|
7833
7858
|
const b = {
|
|
7834
7859
|
to: m.to,
|
|
7835
7860
|
data: jn(m.data ?? "0x", !0),
|
|
@@ -7849,13 +7874,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7849
7874
|
_e(d.params);
|
|
7850
7875
|
const m = ft(d.params[0], "chainId");
|
|
7851
7876
|
if (!m)
|
|
7852
|
-
throw
|
|
7877
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7853
7878
|
if (!qe(m))
|
|
7854
|
-
throw
|
|
7879
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7855
7880
|
if (!d.params[0])
|
|
7856
|
-
throw
|
|
7881
|
+
throw k.rpc.invalidParams("params are required");
|
|
7857
7882
|
if (!("calls" in d.params[0]))
|
|
7858
|
-
throw
|
|
7883
|
+
throw k.rpc.invalidParams("calls are required");
|
|
7859
7884
|
let b = {
|
|
7860
7885
|
method: "wallet_prepareCalls",
|
|
7861
7886
|
params: [
|
|
@@ -7887,7 +7912,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7887
7912
|
}));
|
|
7888
7913
|
let A;
|
|
7889
7914
|
if (!w)
|
|
7890
|
-
throw
|
|
7915
|
+
throw k.rpc.internal("signature not found");
|
|
7891
7916
|
return qe(w) ? A = {
|
|
7892
7917
|
type: "secp256k1",
|
|
7893
7918
|
data: {
|
|
@@ -7920,9 +7945,9 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7920
7945
|
_e(d.params);
|
|
7921
7946
|
const m = ft(d.params[0], "chainId");
|
|
7922
7947
|
if (!m)
|
|
7923
|
-
throw
|
|
7948
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7924
7949
|
if (!qe(m))
|
|
7925
|
-
throw
|
|
7950
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7926
7951
|
return await t.request({
|
|
7927
7952
|
method: "wallet_sendPreparedCalls",
|
|
7928
7953
|
params: d.params
|
|
@@ -7932,13 +7957,13 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7932
7957
|
_e(d.params);
|
|
7933
7958
|
const m = ft(d.params[0], "chainId");
|
|
7934
7959
|
if (!m)
|
|
7935
|
-
throw
|
|
7960
|
+
throw k.rpc.invalidParams("chainId is required");
|
|
7936
7961
|
if (!qe(m))
|
|
7937
|
-
throw
|
|
7962
|
+
throw k.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
7938
7963
|
if (!d.params[0])
|
|
7939
|
-
throw
|
|
7964
|
+
throw k.rpc.invalidParams("params are required");
|
|
7940
7965
|
if (!ft(d.params[0], "calls"))
|
|
7941
|
-
throw
|
|
7966
|
+
throw k.rpc.invalidParams("calls are required");
|
|
7942
7967
|
const b = d.params[0];
|
|
7943
7968
|
return o && b.capabilities && !("attribution" in b.capabilities) && (b.capabilities.attribution = o), await t.request({
|
|
7944
7969
|
method: "wallet_prepareCalls",
|
|
@@ -7947,7 +7972,7 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7947
7972
|
}
|
|
7948
7973
|
case "personal_sign": {
|
|
7949
7974
|
if (_e(d.params), !qe(d.params[0]))
|
|
7950
|
-
throw
|
|
7975
|
+
throw k.rpc.invalidParams("message must be a hex encoded string");
|
|
7951
7976
|
const m = Kr(d.params[0]);
|
|
7952
7977
|
return f.signMessage({ message: m });
|
|
7953
7978
|
}
|
|
@@ -7961,11 +7986,11 @@ async function ef({ address: e, client: t, factory: n, factoryData: r, owner: a,
|
|
|
7961
7986
|
case "wallet_addEthereumChain":
|
|
7962
7987
|
case "wallet_switchEthereumChain":
|
|
7963
7988
|
default:
|
|
7964
|
-
throw
|
|
7989
|
+
throw k.rpc.methodNotSupported();
|
|
7965
7990
|
}
|
|
7966
7991
|
} catch (m) {
|
|
7967
7992
|
if (vi(m)) {
|
|
7968
|
-
const b =
|
|
7993
|
+
const b = Sc(m);
|
|
7969
7994
|
if (b)
|
|
7970
7995
|
throw b;
|
|
7971
7996
|
}
|
|
@@ -7983,7 +8008,7 @@ async function vs({ address: e, client: t, publicKey: n, factory: r, factoryData
|
|
|
7983
8008
|
data: a
|
|
7984
8009
|
});
|
|
7985
8010
|
if (o.functionName !== "createAccount")
|
|
7986
|
-
throw
|
|
8011
|
+
throw k.rpc.internal("unknown factory function");
|
|
7987
8012
|
const [u] = o.args;
|
|
7988
8013
|
return u.findIndex((c) => c.toLowerCase() === Na(n).toLowerCase());
|
|
7989
8014
|
}
|
|
@@ -8045,7 +8070,7 @@ async function tf() {
|
|
|
8045
8070
|
async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
8046
8071
|
var d, h;
|
|
8047
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()));
|
|
8048
|
-
he(i,
|
|
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"));
|
|
8049
8074
|
const s = [];
|
|
8050
8075
|
if (e.type === "local" && e.address && s.push({
|
|
8051
8076
|
to: a.address,
|
|
@@ -8079,19 +8104,19 @@ async function nf({ ownerAccount: e, globalAccountRequest: t, chainId: n }) {
|
|
|
8079
8104
|
]
|
|
8080
8105
|
};
|
|
8081
8106
|
if (await tf() === "cancel")
|
|
8082
|
-
throw
|
|
8107
|
+
throw k.provider.unauthorized("user cancelled");
|
|
8083
8108
|
const c = await t(o), f = Yi(r.chain.id);
|
|
8084
|
-
if (he(f,
|
|
8109
|
+
if (he(f, k.rpc.internal(`client not found for chainId ${r.chain.id}`)), (await Ga(f, {
|
|
8085
8110
|
id: c
|
|
8086
8111
|
})).status !== "success")
|
|
8087
|
-
throw
|
|
8112
|
+
throw k.rpc.internal("add owner call failed");
|
|
8088
8113
|
const p = await vs({
|
|
8089
8114
|
address: a.address,
|
|
8090
8115
|
publicKey: e.type === "local" && e.address ? e.address : e.publicKey,
|
|
8091
8116
|
client: f
|
|
8092
8117
|
});
|
|
8093
8118
|
if (p === -1)
|
|
8094
|
-
throw
|
|
8119
|
+
throw k.rpc.internal("failed to find owner index");
|
|
8095
8120
|
return p;
|
|
8096
8121
|
}
|
|
8097
8122
|
async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, client: r, globalAccountRequest: a, chainId: i, prependCalls: s }) {
|
|
@@ -8147,11 +8172,11 @@ async function xs({ request: e, globalAccountAddress: t, subAccountAddress: n, c
|
|
|
8147
8172
|
async function rf({ globalAccountAddress: e, subAccountAddress: t, client: n, request: r, globalAccountRequest: a }) {
|
|
8148
8173
|
var o;
|
|
8149
8174
|
const i = (o = n.chain) == null ? void 0 : o.id;
|
|
8150
|
-
he(i,
|
|
8175
|
+
he(i, k.rpc.internal("invalid chainId"));
|
|
8151
8176
|
try {
|
|
8152
8177
|
await zl();
|
|
8153
8178
|
} catch {
|
|
8154
|
-
throw
|
|
8179
|
+
throw k.provider.userRejectedRequest({
|
|
8155
8180
|
message: "User cancelled funding"
|
|
8156
8181
|
});
|
|
8157
8182
|
}
|
|
@@ -8184,7 +8209,7 @@ class af {
|
|
|
8184
8209
|
async handshake(t) {
|
|
8185
8210
|
var r, a;
|
|
8186
8211
|
const n = Pe.get(t);
|
|
8187
|
-
|
|
8212
|
+
Su({ method: t.method, correlationId: n });
|
|
8188
8213
|
try {
|
|
8189
8214
|
await ((a = (r = this.communicator).waitForPopupLoaded) == null ? void 0 : a.call(r));
|
|
8190
8215
|
const i = await this.createRequestMessage({
|
|
@@ -8238,7 +8263,7 @@ class af {
|
|
|
8238
8263
|
case "wallet_sign":
|
|
8239
8264
|
return this.sendRequestToPopup(t);
|
|
8240
8265
|
default:
|
|
8241
|
-
throw
|
|
8266
|
+
throw k.provider.unauthorized();
|
|
8242
8267
|
}
|
|
8243
8268
|
if (this.shouldRequestUseSubAccountSigner(t)) {
|
|
8244
8269
|
const c = Pe.get(t);
|
|
@@ -8298,7 +8323,7 @@ class af {
|
|
|
8298
8323
|
subAccounts: [c]
|
|
8299
8324
|
};
|
|
8300
8325
|
if (!this.chain.rpcUrl)
|
|
8301
|
-
throw
|
|
8326
|
+
throw k.rpc.internal("No RPC URL set for chain");
|
|
8302
8327
|
const f = await lt(t, this.chain.rpcUrl);
|
|
8303
8328
|
if (_e(f.subAccounts, "subAccounts"), f.subAccounts.length > 0) {
|
|
8304
8329
|
It(f.subAccounts[0]);
|
|
@@ -8327,7 +8352,7 @@ class af {
|
|
|
8327
8352
|
}
|
|
8328
8353
|
default:
|
|
8329
8354
|
if (!this.chain.rpcUrl)
|
|
8330
|
-
throw
|
|
8355
|
+
throw k.rpc.internal("No RPC URL set for chain");
|
|
8331
8356
|
return lt(t, this.chain.rpcUrl);
|
|
8332
8357
|
}
|
|
8333
8358
|
}
|
|
@@ -8395,7 +8420,7 @@ class af {
|
|
|
8395
8420
|
*/
|
|
8396
8421
|
async handleSwitchChainRequest(t) {
|
|
8397
8422
|
Ra(t.params);
|
|
8398
|
-
const n =
|
|
8423
|
+
const n = ku(t.params[0].chainId);
|
|
8399
8424
|
if (this.updateChain(n))
|
|
8400
8425
|
return null;
|
|
8401
8426
|
const a = await this.sendRequestToPopup(t);
|
|
@@ -8405,7 +8430,7 @@ class af {
|
|
|
8405
8430
|
Gl(t.params);
|
|
8406
8431
|
const n = t.params[0], r = t.params[1];
|
|
8407
8432
|
if (!this.accounts.some((o) => La(o, n)))
|
|
8408
|
-
throw
|
|
8433
|
+
throw k.provider.unauthorized("no active account found when getting capabilities");
|
|
8409
8434
|
const a = x.getState().account.capabilities;
|
|
8410
8435
|
if (!a)
|
|
8411
8436
|
return {};
|
|
@@ -8424,7 +8449,7 @@ class af {
|
|
|
8424
8449
|
async sendEncryptedRequest(t) {
|
|
8425
8450
|
const n = await this.keyManager.getSharedSecret();
|
|
8426
8451
|
if (!n)
|
|
8427
|
-
throw
|
|
8452
|
+
throw k.provider.unauthorized("No shared secret found when encrypting request");
|
|
8428
8453
|
const r = await xd({
|
|
8429
8454
|
action: t,
|
|
8430
8455
|
chainId: this.chain.id
|
|
@@ -8448,7 +8473,7 @@ class af {
|
|
|
8448
8473
|
throw n.failure;
|
|
8449
8474
|
const r = await this.keyManager.getSharedSecret();
|
|
8450
8475
|
if (!r)
|
|
8451
|
-
throw
|
|
8476
|
+
throw k.provider.unauthorized("Invalid session: no shared secret found when decrypting response");
|
|
8452
8477
|
const a = await Ed(n.encrypted, r), i = (o = a.data) == null ? void 0 : o.chains;
|
|
8453
8478
|
if (i) {
|
|
8454
8479
|
const f = (u = a.data) == null ? void 0 : u.nativeCurrencies, l = Object.entries(i).map(([p, d]) => {
|
|
@@ -8485,7 +8510,7 @@ class af {
|
|
|
8485
8510
|
else {
|
|
8486
8511
|
const f = x.subAccountsConfig.get() ?? {}, { account: l } = f.toOwnerAccount ? await f.toOwnerAccount() : await cr();
|
|
8487
8512
|
if (!l)
|
|
8488
|
-
throw
|
|
8513
|
+
throw k.provider.unauthorized("could not get subaccount owner account when adding sub account");
|
|
8489
8514
|
c = [
|
|
8490
8515
|
{
|
|
8491
8516
|
type: l.address ? "address" : "webauthn-p256",
|
|
@@ -8505,16 +8530,16 @@ class af {
|
|
|
8505
8530
|
async sendRequestToSubAccountSigner(t) {
|
|
8506
8531
|
var m, b, E;
|
|
8507
8532
|
const n = x.subAccounts.get(), r = x.subAccountsConfig.get(), a = x.config.get();
|
|
8508
|
-
he(n == null ? void 0 : n.address,
|
|
8533
|
+
he(n == null ? void 0 : n.address, k.provider.unauthorized("no active sub account when sending request to sub account signer"));
|
|
8509
8534
|
const i = r != null && r.toOwnerAccount ? await r.toOwnerAccount() : await cr();
|
|
8510
|
-
he(i == null ? void 0 : i.account,
|
|
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));
|
|
8511
8536
|
const o = this.accounts.find((w) => w.toLowerCase() !== n.address.toLowerCase());
|
|
8512
|
-
he(o,
|
|
8537
|
+
he(o, k.provider.unauthorized("no global account found when sending request to sub account signer"));
|
|
8513
8538
|
const u = Wl({
|
|
8514
8539
|
attribution: (m = a.preference) == null ? void 0 : m.attribution,
|
|
8515
8540
|
dappOrigin: window.location.origin
|
|
8516
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);
|
|
8517
|
-
if (he(l,
|
|
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)) {
|
|
8518
8543
|
const w = x.subAccountsConfig.get();
|
|
8519
8544
|
if ((w == null ? void 0 : w.funding) === "spend-permissions" && br.get().length === 0)
|
|
8520
8545
|
return await xs({
|
|
@@ -8548,7 +8573,7 @@ class af {
|
|
|
8548
8573
|
method: t.method,
|
|
8549
8574
|
correlationId: w,
|
|
8550
8575
|
errorMessage: Ze(A)
|
|
8551
|
-
}),
|
|
8576
|
+
}), k.provider.unauthorized("failed to add sub account owner when sending request to sub account signer");
|
|
8552
8577
|
}
|
|
8553
8578
|
}
|
|
8554
8579
|
const { request: h } = await ef({
|
|
@@ -8636,7 +8661,7 @@ class sf extends fu {
|
|
|
8636
8661
|
async _request(n) {
|
|
8637
8662
|
var r;
|
|
8638
8663
|
try {
|
|
8639
|
-
if (
|
|
8664
|
+
if (kd(n), !this.signer.isConnected)
|
|
8640
8665
|
switch (n.method) {
|
|
8641
8666
|
case "eth_requestAccounts": {
|
|
8642
8667
|
await this.signer.handshake({ method: "handshake" }), await ur(), await this.signer.request({
|
|
@@ -8672,7 +8697,7 @@ class sf extends fu {
|
|
|
8672
8697
|
case "eth_chainId":
|
|
8673
8698
|
return Mi(1);
|
|
8674
8699
|
default:
|
|
8675
|
-
throw
|
|
8700
|
+
throw k.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");
|
|
8676
8701
|
}
|
|
8677
8702
|
return await this.signer.request(n);
|
|
8678
8703
|
} catch (a) {
|
|
@@ -8681,7 +8706,7 @@ class sf extends fu {
|
|
|
8681
8706
|
}
|
|
8682
8707
|
}
|
|
8683
8708
|
async disconnect() {
|
|
8684
|
-
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"));
|
|
8685
8710
|
}
|
|
8686
8711
|
}
|
|
8687
8712
|
const of = "isCoinbaseBrowser";
|