@pufferfinance/puffer-sdk 1.3.2 → 1.4.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/{ccip-B8cq5tOn.cjs → ccip-BReJCKwj.cjs} +2 -2
- package/dist/{ccip-B8cq5tOn.cjs.map → ccip-BReJCKwj.cjs.map} +1 -1
- package/dist/{ccip-C8BOIurD.js → ccip-uPDDvTne.js} +2 -2
- package/dist/{ccip-C8BOIurD.js.map → ccip-uPDDvTne.js.map} +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.d.ts +6484 -13882
- package/dist/contracts/handlers/puf-locker-handler.d.ts +6552 -30995
- package/dist/contracts/handlers/puf-token-handler.d.ts +6920 -0
- package/dist/contracts/handlers/puffer-depositor-handler.d.ts +6379 -9840
- package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +6460 -23018
- package/dist/contracts/handlers/puffer-vault-handler.d.ts +9030 -0
- package/dist/contracts/tokens.d.ts +9 -2
- package/dist/{main-BRWMKYb0.cjs → main-Cu9HGhDC.cjs} +16 -16
- package/dist/{main-BRWMKYb0.cjs.map → main-Cu9HGhDC.cjs.map} +1 -1
- package/dist/{main-KcfD5EJl.js → main-v18rFU-J.js} +543 -485
- package/dist/{main-KcfD5EJl.js.map → main-v18rFU-J.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ci = Object.defineProperty;
|
|
2
2
|
var di = (e, t, n) => t in e ? ci(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var L = (e, t, n) => di(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
const li = "1.0.0";
|
|
5
5
|
let ne = class kn extends Error {
|
|
6
6
|
constructor(t, n = {}) {
|
|
@@ -119,7 +119,7 @@ const Pi = /^receive\(\) external payable$/;
|
|
|
119
119
|
function Ci(e) {
|
|
120
120
|
return Pi.test(e);
|
|
121
121
|
}
|
|
122
|
-
const Ai = /* @__PURE__ */ new Set(["indexed"]),
|
|
122
|
+
const Ai = /* @__PURE__ */ new Set(["indexed"]), Rn = /* @__PURE__ */ new Set([
|
|
123
123
|
"calldata",
|
|
124
124
|
"memory",
|
|
125
125
|
"storage"
|
|
@@ -208,7 +208,7 @@ class $i extends ne {
|
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
class
|
|
211
|
+
class Ri extends ne {
|
|
212
212
|
constructor({ abiParameter: t }) {
|
|
213
213
|
super("Invalid ABI parameter.", {
|
|
214
214
|
details: JSON.stringify(t, null, 2),
|
|
@@ -233,7 +233,7 @@ class pt extends ne {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
class
|
|
236
|
+
class Oi extends ne {
|
|
237
237
|
constructor({ signature: t }) {
|
|
238
238
|
super("Unknown signature.", {
|
|
239
239
|
details: t
|
|
@@ -285,7 +285,7 @@ class Di extends ne {
|
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Hi(e, t) {
|
|
289
289
|
return t ? `${t}:${e}` : e;
|
|
290
290
|
}
|
|
291
291
|
const wn = /* @__PURE__ */ new Map([
|
|
@@ -342,7 +342,7 @@ const wn = /* @__PURE__ */ new Map([
|
|
|
342
342
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
343
343
|
]
|
|
344
344
|
]);
|
|
345
|
-
function
|
|
345
|
+
function Ui(e, t = {}) {
|
|
346
346
|
if (hi(e)) {
|
|
347
347
|
const n = gi(e);
|
|
348
348
|
if (!n)
|
|
@@ -350,7 +350,7 @@ function Hi(e, t = {}) {
|
|
|
350
350
|
const r = ie(n.parameters), a = [], s = r.length;
|
|
351
351
|
for (let o = 0; o < s; o++)
|
|
352
352
|
a.push(Ne(r[o], {
|
|
353
|
-
modifiers:
|
|
353
|
+
modifiers: Rn,
|
|
354
354
|
structs: t,
|
|
355
355
|
type: "function"
|
|
356
356
|
}));
|
|
@@ -359,7 +359,7 @@ function Hi(e, t = {}) {
|
|
|
359
359
|
const o = ie(n.returns), u = o.length;
|
|
360
360
|
for (let c = 0; c < u; c++)
|
|
361
361
|
i.push(Ne(o[c], {
|
|
362
|
-
modifiers:
|
|
362
|
+
modifiers: Rn,
|
|
363
363
|
structs: t,
|
|
364
364
|
type: "function"
|
|
365
365
|
}));
|
|
@@ -414,15 +414,15 @@ function Hi(e, t = {}) {
|
|
|
414
414
|
type: "receive",
|
|
415
415
|
stateMutability: "payable"
|
|
416
416
|
};
|
|
417
|
-
throw new
|
|
417
|
+
throw new Oi({ signature: e });
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const Li = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, ji = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, zi = /^u?int$/;
|
|
420
420
|
function Ne(e, t) {
|
|
421
421
|
var d, p;
|
|
422
|
-
const n =
|
|
422
|
+
const n = Hi(e, t == null ? void 0 : t.type);
|
|
423
423
|
if (wn.has(n))
|
|
424
424
|
return wn.get(n);
|
|
425
|
-
const r = Aa.test(e), a = $e(r ?
|
|
425
|
+
const r = Aa.test(e), a = $e(r ? ji : Li, e);
|
|
426
426
|
if (!a)
|
|
427
427
|
throw new Si({ param: e });
|
|
428
428
|
if (a.name && qi(a.name))
|
|
@@ -439,7 +439,7 @@ function Ne(e, t) {
|
|
|
439
439
|
u = "tuple", c = { components: o[a.type] };
|
|
440
440
|
else if (zi.test(a.type))
|
|
441
441
|
u = `${a.type}256`;
|
|
442
|
-
else if (u = a.type, (t == null ? void 0 : t.type) !== "struct" && !
|
|
442
|
+
else if (u = a.type, (t == null ? void 0 : t.type) !== "struct" && !Ra(u))
|
|
443
443
|
throw new Mi({ type: u });
|
|
444
444
|
if (a.modifier) {
|
|
445
445
|
if (!((p = (d = t == null ? void 0 : t.modifiers) == null ? void 0 : d.has) != null && p.call(d, a.modifier)))
|
|
@@ -448,7 +448,7 @@ function Ne(e, t) {
|
|
|
448
448
|
type: t == null ? void 0 : t.type,
|
|
449
449
|
modifier: a.modifier
|
|
450
450
|
});
|
|
451
|
-
if (
|
|
451
|
+
if (Rn.has(a.modifier) && !Gi(u, !!a.array))
|
|
452
452
|
throw new $i({
|
|
453
453
|
param: e,
|
|
454
454
|
type: t == null ? void 0 : t.type,
|
|
@@ -484,7 +484,7 @@ function ie(e, t = [], n = "", r = 0) {
|
|
|
484
484
|
throw new Di({ current: n, depth: r });
|
|
485
485
|
return t.push(n.trim()), t;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Ra(e) {
|
|
488
488
|
return e === "address" || e === "bool" || e === "function" || e === "string" || Pa.test(e) || Ca.test(e);
|
|
489
489
|
}
|
|
490
490
|
const _i = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
@@ -520,12 +520,12 @@ function Wi(e) {
|
|
|
520
520
|
const r = {}, a = Object.entries(t), s = a.length;
|
|
521
521
|
for (let i = 0; i < s; i++) {
|
|
522
522
|
const [o, u] = a[i];
|
|
523
|
-
r[o] =
|
|
523
|
+
r[o] = Oa(u, t);
|
|
524
524
|
}
|
|
525
525
|
return r;
|
|
526
526
|
}
|
|
527
527
|
const Vi = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
528
|
-
function
|
|
528
|
+
function Oa(e, t, n = /* @__PURE__ */ new Set()) {
|
|
529
529
|
const r = [], a = e.length;
|
|
530
530
|
for (let s = 0; s < a; s++) {
|
|
531
531
|
const i = e[s];
|
|
@@ -534,7 +534,7 @@ function Ra(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
534
534
|
else {
|
|
535
535
|
const u = $e(Vi, i.type);
|
|
536
536
|
if (!(u != null && u.type))
|
|
537
|
-
throw new
|
|
537
|
+
throw new Ri({ abiParameter: i });
|
|
538
538
|
const { array: c, type: l } = u;
|
|
539
539
|
if (l in t) {
|
|
540
540
|
if (n.has(l))
|
|
@@ -542,9 +542,9 @@ function Ra(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
542
542
|
r.push({
|
|
543
543
|
...i,
|
|
544
544
|
type: `tuple${c ?? ""}`,
|
|
545
|
-
components:
|
|
545
|
+
components: Oa(t[l] ?? [], t, /* @__PURE__ */ new Set([...n, l]))
|
|
546
546
|
});
|
|
547
|
-
} else if (
|
|
547
|
+
} else if (Ra(l))
|
|
548
548
|
r.push(i);
|
|
549
549
|
else
|
|
550
550
|
throw new Ii({ type: l });
|
|
@@ -556,7 +556,7 @@ function Zi(e) {
|
|
|
556
556
|
const t = Wi(e), n = [], r = e.length;
|
|
557
557
|
for (let a = 0; a < r; a++) {
|
|
558
558
|
const s = e[a];
|
|
559
|
-
ka(s) || n.push(
|
|
559
|
+
ka(s) || n.push(Ui(s, t));
|
|
560
560
|
}
|
|
561
561
|
return n;
|
|
562
562
|
}
|
|
@@ -580,7 +580,7 @@ function Ki(e, { includeName: t }) {
|
|
|
580
580
|
function ce(e, { strict: t = !0 } = {}) {
|
|
581
581
|
return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function j(e) {
|
|
584
584
|
return ce(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
|
|
585
585
|
}
|
|
586
586
|
const Yi = "2.14.0", Ji = (e) => e, rr = (e) => e, Xi = () => `viem@${Yi}`;
|
|
@@ -728,7 +728,7 @@ class eo extends v {
|
|
|
728
728
|
}
|
|
729
729
|
class to extends v {
|
|
730
730
|
constructor({ expectedSize: t, value: n }) {
|
|
731
|
-
super(`Size of bytes "${n}" (bytes${
|
|
731
|
+
super(`Size of bytes "${n}" (bytes${j(n)}) does not match expected size (bytes${t}).`), Object.defineProperty(this, "name", {
|
|
732
732
|
enumerable: !0,
|
|
733
733
|
configurable: !0,
|
|
734
734
|
writable: !0,
|
|
@@ -785,7 +785,7 @@ class ro extends v {
|
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
|
-
class
|
|
788
|
+
class Ha extends v {
|
|
789
789
|
constructor(t, { docsPath: n }) {
|
|
790
790
|
super([
|
|
791
791
|
`Encoded event signature "${t}" not found on ABI.`,
|
|
@@ -998,7 +998,7 @@ class po extends v {
|
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
class
|
|
1001
|
+
class Ua extends v {
|
|
1002
1002
|
constructor({ offset: t, position: n, size: r }) {
|
|
1003
1003
|
super(`Slice ${n === "start" ? "starting" : "ending"} at offset "${t}" is out-of-bounds (size: ${r}).`), Object.defineProperty(this, "name", {
|
|
1004
1004
|
enumerable: !0,
|
|
@@ -1008,7 +1008,7 @@ class Ha extends v {
|
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
class
|
|
1011
|
+
class La extends v {
|
|
1012
1012
|
constructor({ size: t, targetSize: n, type: r }) {
|
|
1013
1013
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`), Object.defineProperty(this, "name", {
|
|
1014
1014
|
enumerable: !0,
|
|
@@ -1036,7 +1036,7 @@ function te(e, { dir: t, size: n = 32 } = {}) {
|
|
|
1036
1036
|
return e;
|
|
1037
1037
|
const r = e.replace("0x", "");
|
|
1038
1038
|
if (r.length > n * 2)
|
|
1039
|
-
throw new
|
|
1039
|
+
throw new La({
|
|
1040
1040
|
size: Math.ceil(r.length / 2),
|
|
1041
1041
|
targetSize: n,
|
|
1042
1042
|
type: "hex"
|
|
@@ -1047,7 +1047,7 @@ function yo(e, { dir: t, size: n = 32 } = {}) {
|
|
|
1047
1047
|
if (n === null)
|
|
1048
1048
|
return e;
|
|
1049
1049
|
if (e.length > n)
|
|
1050
|
-
throw new
|
|
1050
|
+
throw new La({
|
|
1051
1051
|
size: e.length,
|
|
1052
1052
|
targetSize: n,
|
|
1053
1053
|
type: "bytes"
|
|
@@ -1096,9 +1096,9 @@ function tn(e, { dir: t = "left" } = {}) {
|
|
|
1096
1096
|
return n = t === "left" ? n.slice(r) : n.slice(0, n.length - r), typeof e == "string" ? (n.length === 1 && t === "right" && (n = `${n}0`), `0x${n.length % 2 === 1 ? `0${n}` : n}`) : n;
|
|
1097
1097
|
}
|
|
1098
1098
|
function le(e, { size: t }) {
|
|
1099
|
-
if (
|
|
1099
|
+
if (j(e) > t)
|
|
1100
1100
|
throw new bo({
|
|
1101
|
-
givenSize:
|
|
1101
|
+
givenSize: j(e),
|
|
1102
1102
|
maxSize: t
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
@@ -1115,10 +1115,10 @@ function Ae(e, t = {}) {
|
|
|
1115
1115
|
return Number(Ye(e, t));
|
|
1116
1116
|
}
|
|
1117
1117
|
const ho = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
1118
|
-
function
|
|
1119
|
-
return typeof e == "number" || typeof e == "bigint" ?
|
|
1118
|
+
function Re(e, t = {}) {
|
|
1119
|
+
return typeof e == "number" || typeof e == "bigint" ? R(e, t) : typeof e == "string" ? ar(e, t) : typeof e == "boolean" ? ja(e, t) : q(e, t);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function ja(e, t = {}) {
|
|
1122
1122
|
const n = `0x${Number(e)}`;
|
|
1123
1123
|
return typeof t.size == "number" ? (le(n, { size: t.size }), rt(n, { size: t.size })) : n;
|
|
1124
1124
|
}
|
|
@@ -1129,7 +1129,7 @@ function q(e, t = {}) {
|
|
|
1129
1129
|
const r = `0x${n}`;
|
|
1130
1130
|
return typeof t.size == "number" ? (le(r, { size: t.size }), rt(r, { dir: "right", size: t.size })) : r;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function R(e, t = {}) {
|
|
1133
1133
|
const { signed: n, size: r } = t, a = BigInt(e);
|
|
1134
1134
|
let s;
|
|
1135
1135
|
r ? n ? s = (1n << BigInt(r) * 8n - 1n) - 1n : s = 2n ** (BigInt(r) * 8n) - 1n : typeof e == "number" && (s = BigInt(Number.MAX_SAFE_INTEGER));
|
|
@@ -1154,7 +1154,7 @@ function ar(e, t = {}) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
const wo = /* @__PURE__ */ new TextEncoder();
|
|
1156
1156
|
function Ie(e, t = {}) {
|
|
1157
|
-
return typeof e == "number" || typeof e == "bigint" ? vo(e, t) : typeof e == "boolean" ? To(e, t) : ce(e) ?
|
|
1157
|
+
return typeof e == "number" || typeof e == "bigint" ? vo(e, t) : typeof e == "boolean" ? To(e, t) : ce(e) ? je(e, t) : fe(e, t);
|
|
1158
1158
|
}
|
|
1159
1159
|
function To(e, t = {}) {
|
|
1160
1160
|
const n = new Uint8Array(1);
|
|
@@ -1176,7 +1176,7 @@ function Zr(e) {
|
|
|
1176
1176
|
if (e >= pe.a && e <= pe.f)
|
|
1177
1177
|
return e - (pe.a - 10);
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function je(e, t = {}) {
|
|
1180
1180
|
let n = e;
|
|
1181
1181
|
t.size && (le(n, { size: t.size }), n = rt(n, { dir: "right", size: t.size }));
|
|
1182
1182
|
let r = n.slice(2);
|
|
@@ -1191,8 +1191,8 @@ function Le(e, t = {}) {
|
|
|
1191
1191
|
return s;
|
|
1192
1192
|
}
|
|
1193
1193
|
function vo(e, t) {
|
|
1194
|
-
const n =
|
|
1195
|
-
return
|
|
1194
|
+
const n = R(e, t);
|
|
1195
|
+
return je(n);
|
|
1196
1196
|
}
|
|
1197
1197
|
function fe(e, t = {}) {
|
|
1198
1198
|
const n = wo.encode(e);
|
|
@@ -1225,9 +1225,9 @@ function za(e, t) {
|
|
|
1225
1225
|
if (e.length < n)
|
|
1226
1226
|
throw new Error(`digestInto() expects output buffer of length at least ${n}`);
|
|
1227
1227
|
}
|
|
1228
|
-
const
|
|
1228
|
+
const Lt = /* @__PURE__ */ BigInt(2 ** 32 - 1), Kr = /* @__PURE__ */ BigInt(32);
|
|
1229
1229
|
function Eo(e, t = !1) {
|
|
1230
|
-
return t ? { h: Number(e &
|
|
1230
|
+
return t ? { h: Number(e & Lt), l: Number(e >> Kr & Lt) } : { h: Number(e >> Kr & Lt) | 0, l: Number(e & Lt) | 0 };
|
|
1231
1231
|
}
|
|
1232
1232
|
function Po(e, t = !1) {
|
|
1233
1233
|
let n = new Uint32Array(e.length), r = new Uint32Array(e.length);
|
|
@@ -1271,21 +1271,21 @@ function qa(e) {
|
|
|
1271
1271
|
const t = (r) => e().update(nn(r)).digest(), n = e();
|
|
1272
1272
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Ro(e = 32) {
|
|
1275
1275
|
if (Tn && typeof Tn.getRandomValues == "function")
|
|
1276
1276
|
return Tn.getRandomValues(new Uint8Array(e));
|
|
1277
1277
|
throw new Error("crypto.getRandomValues must be defined");
|
|
1278
1278
|
}
|
|
1279
|
-
const [Ga, Wa, Va] = [[], [], []],
|
|
1279
|
+
const [Ga, Wa, Va] = [[], [], []], Oo = /* @__PURE__ */ BigInt(0), dt = /* @__PURE__ */ BigInt(1), Fo = /* @__PURE__ */ BigInt(2), No = /* @__PURE__ */ BigInt(7), Do = /* @__PURE__ */ BigInt(256), Ho = /* @__PURE__ */ BigInt(113);
|
|
1280
1280
|
for (let e = 0, t = dt, n = 1, r = 0; e < 24; e++) {
|
|
1281
1281
|
[n, r] = [r, (2 * n + 3 * r) % 5], Ga.push(2 * (5 * r + n)), Wa.push((e + 1) * (e + 2) / 2 % 64);
|
|
1282
|
-
let a =
|
|
1282
|
+
let a = Oo;
|
|
1283
1283
|
for (let s = 0; s < 7; s++)
|
|
1284
|
-
t = (t << dt ^ (t >> No) *
|
|
1284
|
+
t = (t << dt ^ (t >> No) * Ho) % Do, t & Fo && (a ^= dt << (dt << /* @__PURE__ */ BigInt(s)) - dt);
|
|
1285
1285
|
Va.push(a);
|
|
1286
1286
|
}
|
|
1287
|
-
const [
|
|
1288
|
-
function
|
|
1287
|
+
const [Uo, Lo] = /* @__PURE__ */ Po(Va, !0), Yr = (e, t, n) => n > 32 ? Io(e, t, n) : Co(e, t, n), Jr = (e, t, n) => n > 32 ? Mo(e, t, n) : Ao(e, t, n);
|
|
1288
|
+
function jo(e, t = 24) {
|
|
1289
1289
|
const n = new Uint32Array(10);
|
|
1290
1290
|
for (let r = 24 - t; r < 24; r++) {
|
|
1291
1291
|
for (let i = 0; i < 10; i++)
|
|
@@ -1306,7 +1306,7 @@ function Lo(e, t = 24) {
|
|
|
1306
1306
|
for (let o = 0; o < 10; o++)
|
|
1307
1307
|
e[i + o] ^= ~n[(o + 2) % 10] & n[(o + 4) % 10];
|
|
1308
1308
|
}
|
|
1309
|
-
e[0] ^=
|
|
1309
|
+
e[0] ^= Uo[r], e[1] ^= Lo[r];
|
|
1310
1310
|
}
|
|
1311
1311
|
n.fill(0);
|
|
1312
1312
|
}
|
|
@@ -1318,7 +1318,7 @@ class or extends ir {
|
|
|
1318
1318
|
this.state = new Uint8Array(200), this.state32 = So(this.state);
|
|
1319
1319
|
}
|
|
1320
1320
|
keccak() {
|
|
1321
|
-
|
|
1321
|
+
jo(this.state32, this.rounds), this.posOut = 0, this.pos = 0;
|
|
1322
1322
|
}
|
|
1323
1323
|
update(t) {
|
|
1324
1324
|
Je(this);
|
|
@@ -1377,7 +1377,7 @@ class or extends ir {
|
|
|
1377
1377
|
const zo = (e, t, n) => qa(() => new or(t, e, n)), _o = /* @__PURE__ */ zo(1, 136, 256 / 8);
|
|
1378
1378
|
function Z(e, t) {
|
|
1379
1379
|
const n = t || "hex", r = _o(ce(e, { strict: !1 }) ? Ie(e) : e);
|
|
1380
|
-
return n === "bytes" ? r :
|
|
1380
|
+
return n === "bytes" ? r : Re(r);
|
|
1381
1381
|
}
|
|
1382
1382
|
const qo = (e) => Z(Ie(e));
|
|
1383
1383
|
function Go(e) {
|
|
@@ -1491,19 +1491,19 @@ function Vt(e, t, n, { strict: r } = {}) {
|
|
|
1491
1491
|
});
|
|
1492
1492
|
}
|
|
1493
1493
|
function Ya(e, t) {
|
|
1494
|
-
if (typeof t == "number" && t > 0 && t >
|
|
1495
|
-
throw new
|
|
1494
|
+
if (typeof t == "number" && t > 0 && t > j(e) - 1)
|
|
1495
|
+
throw new Ua({
|
|
1496
1496
|
offset: t,
|
|
1497
1497
|
position: "start",
|
|
1498
|
-
size:
|
|
1498
|
+
size: j(e)
|
|
1499
1499
|
});
|
|
1500
1500
|
}
|
|
1501
1501
|
function Ja(e, t, n) {
|
|
1502
|
-
if (typeof t == "number" && typeof n == "number" &&
|
|
1503
|
-
throw new
|
|
1502
|
+
if (typeof t == "number" && typeof n == "number" && j(e) !== n - t)
|
|
1503
|
+
throw new Ua({
|
|
1504
1504
|
offset: n,
|
|
1505
1505
|
position: "end",
|
|
1506
|
-
size:
|
|
1506
|
+
size: j(e)
|
|
1507
1507
|
});
|
|
1508
1508
|
}
|
|
1509
1509
|
function Xa(e, t, n, { strict: r } = {}) {
|
|
@@ -1564,13 +1564,13 @@ function lr(e) {
|
|
|
1564
1564
|
let t = 0;
|
|
1565
1565
|
for (let s = 0; s < e.length; s++) {
|
|
1566
1566
|
const { dynamic: i, encoded: o } = e[s];
|
|
1567
|
-
i ? t += 32 : t +=
|
|
1567
|
+
i ? t += 32 : t += j(o);
|
|
1568
1568
|
}
|
|
1569
1569
|
const n = [], r = [];
|
|
1570
1570
|
let a = 0;
|
|
1571
1571
|
for (let s = 0; s < e.length; s++) {
|
|
1572
1572
|
const { dynamic: i, encoded: o } = e[s];
|
|
1573
|
-
i ? (n.push(
|
|
1573
|
+
i ? (n.push(R(t + a, { size: 32 })), r.push(o), a += j(o)) : n.push(o);
|
|
1574
1574
|
}
|
|
1575
1575
|
return he([...n, ...r]);
|
|
1576
1576
|
}
|
|
@@ -1598,7 +1598,7 @@ function eu(e, { length: t, param: n }) {
|
|
|
1598
1598
|
if (r || a) {
|
|
1599
1599
|
const i = lr(s);
|
|
1600
1600
|
if (r) {
|
|
1601
|
-
const o =
|
|
1601
|
+
const o = R(s.length, { size: 32 });
|
|
1602
1602
|
return {
|
|
1603
1603
|
dynamic: !0,
|
|
1604
1604
|
encoded: s.length > 0 ? he([o, i]) : o
|
|
@@ -1613,7 +1613,7 @@ function eu(e, { length: t, param: n }) {
|
|
|
1613
1613
|
};
|
|
1614
1614
|
}
|
|
1615
1615
|
function tu(e, { param: t }) {
|
|
1616
|
-
const [, n] = t.type.split("bytes"), r =
|
|
1616
|
+
const [, n] = t.type.split("bytes"), r = j(e);
|
|
1617
1617
|
if (!n) {
|
|
1618
1618
|
let a = e;
|
|
1619
1619
|
return r % 32 !== 0 && (a = te(a, {
|
|
@@ -1621,7 +1621,7 @@ function tu(e, { param: t }) {
|
|
|
1621
1621
|
size: Math.ceil((e.length - 2) / 2 / 32) * 32
|
|
1622
1622
|
})), {
|
|
1623
1623
|
dynamic: !0,
|
|
1624
|
-
encoded: he([te(
|
|
1624
|
+
encoded: he([te(R(r, { size: 32 })), a])
|
|
1625
1625
|
};
|
|
1626
1626
|
}
|
|
1627
1627
|
if (r !== Number.parseInt(n))
|
|
@@ -1634,19 +1634,19 @@ function tu(e, { param: t }) {
|
|
|
1634
1634
|
function nu(e) {
|
|
1635
1635
|
if (typeof e != "boolean")
|
|
1636
1636
|
throw new v(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
1637
|
-
return { dynamic: !1, encoded: te(
|
|
1637
|
+
return { dynamic: !1, encoded: te(ja(e)) };
|
|
1638
1638
|
}
|
|
1639
1639
|
function ru(e, { signed: t }) {
|
|
1640
1640
|
return {
|
|
1641
1641
|
dynamic: !1,
|
|
1642
|
-
encoded:
|
|
1642
|
+
encoded: R(e, {
|
|
1643
1643
|
size: 32,
|
|
1644
1644
|
signed: t
|
|
1645
1645
|
})
|
|
1646
1646
|
};
|
|
1647
1647
|
}
|
|
1648
1648
|
function au(e) {
|
|
1649
|
-
const t = ar(e), n = Math.ceil(
|
|
1649
|
+
const t = ar(e), n = Math.ceil(j(t) / 32), r = [];
|
|
1650
1650
|
for (let a = 0; a < n; a++)
|
|
1651
1651
|
r.push(te(Vt(t, a * 32, (a + 1) * 32), {
|
|
1652
1652
|
dir: "right"
|
|
@@ -1654,7 +1654,7 @@ function au(e) {
|
|
|
1654
1654
|
return {
|
|
1655
1655
|
dynamic: !0,
|
|
1656
1656
|
encoded: he([
|
|
1657
|
-
te(
|
|
1657
|
+
te(R(j(t), { size: 32 })),
|
|
1658
1658
|
...r
|
|
1659
1659
|
])
|
|
1660
1660
|
};
|
|
@@ -1701,7 +1701,7 @@ function $t(e) {
|
|
|
1701
1701
|
continue;
|
|
1702
1702
|
if (n.every((c, l) => {
|
|
1703
1703
|
const d = "inputs" in o && o.inputs[l];
|
|
1704
|
-
return d ?
|
|
1704
|
+
return d ? On(c, d) : !1;
|
|
1705
1705
|
})) {
|
|
1706
1706
|
if (i && "inputs" in i && i.inputs) {
|
|
1707
1707
|
const c = Qa(o.inputs, i.inputs, n);
|
|
@@ -1719,7 +1719,7 @@ function $t(e) {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
return i || s[0];
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function On(e, t) {
|
|
1723
1723
|
const n = typeof e, r = t.type;
|
|
1724
1724
|
switch (r) {
|
|
1725
1725
|
case "address":
|
|
@@ -1731,7 +1731,7 @@ function Rn(e, t) {
|
|
|
1731
1731
|
case "string":
|
|
1732
1732
|
return n === "string";
|
|
1733
1733
|
default:
|
|
1734
|
-
return r === "tuple" && "components" in t ? Object.values(t.components).every((a, s) =>
|
|
1734
|
+
return r === "tuple" && "components" in t ? Object.values(t.components).every((a, s) => On(Object.values(e)[s], a)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r) ? n === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r) ? Array.isArray(e) && e.every((a) => On(a, {
|
|
1735
1735
|
...t,
|
|
1736
1736
|
// Pop off `[]` or `[M]` from end of type
|
|
1737
1737
|
type: r.replace(/(\[[0-9]{0,}\])$/, "")
|
|
@@ -1749,7 +1749,7 @@ function Qa(e, t, n) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
1751
|
const Xr = "/docs/contract/encodeEventTopics";
|
|
1752
|
-
function
|
|
1752
|
+
function Rt(e) {
|
|
1753
1753
|
var u;
|
|
1754
1754
|
const { abi: t, eventName: n, args: r } = e;
|
|
1755
1755
|
let a = t[0];
|
|
@@ -1786,7 +1786,7 @@ function an(e, { method: t }) {
|
|
|
1786
1786
|
async function fr(e, t) {
|
|
1787
1787
|
const { address: n, abi: r, args: a, eventName: s, fromBlock: i, strict: o, toBlock: u } = t, c = an(e, {
|
|
1788
1788
|
method: "eth_newFilter"
|
|
1789
|
-
}), l = s ?
|
|
1789
|
+
}), l = s ? Rt({
|
|
1790
1790
|
abi: r,
|
|
1791
1791
|
args: a,
|
|
1792
1792
|
eventName: s
|
|
@@ -1795,8 +1795,8 @@ async function fr(e, t) {
|
|
|
1795
1795
|
params: [
|
|
1796
1796
|
{
|
|
1797
1797
|
address: n,
|
|
1798
|
-
fromBlock: typeof i == "bigint" ?
|
|
1799
|
-
toBlock: typeof u == "bigint" ?
|
|
1798
|
+
fromBlock: typeof i == "bigint" ? R(i) : i,
|
|
1799
|
+
toBlock: typeof u == "bigint" ? R(u) : u,
|
|
1800
1800
|
topics: l
|
|
1801
1801
|
}
|
|
1802
1802
|
]
|
|
@@ -1835,7 +1835,7 @@ function iu(e) {
|
|
|
1835
1835
|
functionName: yr(be(a))
|
|
1836
1836
|
};
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function Oe(e) {
|
|
1839
1839
|
const { args: t } = e, { abi: n, functionName: r } = (() => {
|
|
1840
1840
|
var o;
|
|
1841
1841
|
return e.abi.length === 1 && ((o = e.functionName) != null && o.startsWith("0x")) ? e : iu(e);
|
|
@@ -2048,14 +2048,14 @@ function yu(e, t = {}) {
|
|
|
2048
2048
|
return typeof t.size < "u" && (le(n, { size: t.size }), n = tn(n, { dir: "right" })), new TextDecoder().decode(n);
|
|
2049
2049
|
}
|
|
2050
2050
|
function sn(e, t) {
|
|
2051
|
-
const n = typeof t == "string" ?
|
|
2052
|
-
if (
|
|
2051
|
+
const n = typeof t == "string" ? je(t) : t, r = ns(n);
|
|
2052
|
+
if (j(n) === 0 && e.length > 0)
|
|
2053
2053
|
throw new Qt();
|
|
2054
|
-
if (
|
|
2054
|
+
if (j(t) && j(t) < 32)
|
|
2055
2055
|
throw new Na({
|
|
2056
2056
|
data: typeof t == "string" ? t : q(t),
|
|
2057
2057
|
params: e,
|
|
2058
|
-
size:
|
|
2058
|
+
size: j(t)
|
|
2059
2059
|
});
|
|
2060
2060
|
let a = 0;
|
|
2061
2061
|
const s = [];
|
|
@@ -2278,7 +2278,7 @@ function Au(e) {
|
|
|
2278
2278
|
}, ` State Override:
|
|
2279
2279
|
`).slice(0, -1);
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function Ot(e) {
|
|
2282
2282
|
const t = Object.entries(e).map(([r, a]) => a === void 0 || a === !1 ? null : [r, a]).filter(Boolean), n = t.reduce((r, [a]) => Math.max(r, a.length), 0);
|
|
2283
2283
|
return t.map(([r, a]) => ` ${`${r}:`.padEnd(n + 1)} ${a}`).join(`
|
|
2284
2284
|
`);
|
|
@@ -2303,7 +2303,7 @@ class Mu extends v {
|
|
|
2303
2303
|
metaMessages: [
|
|
2304
2304
|
"Provided Transaction:",
|
|
2305
2305
|
"{",
|
|
2306
|
-
|
|
2306
|
+
Ot(t),
|
|
2307
2307
|
"}",
|
|
2308
2308
|
"",
|
|
2309
2309
|
"To infer the type, either provide:",
|
|
@@ -2324,7 +2324,7 @@ class Mu extends v {
|
|
|
2324
2324
|
class Su extends v {
|
|
2325
2325
|
constructor(t, { account: n, docsPath: r, chain: a, data: s, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: l, to: d, value: p }) {
|
|
2326
2326
|
var f;
|
|
2327
|
-
const b =
|
|
2327
|
+
const b = Ot({
|
|
2328
2328
|
chain: a && `${a == null ? void 0 : a.name} (id: ${a == null ? void 0 : a.id})`,
|
|
2329
2329
|
from: n == null ? void 0 : n.address,
|
|
2330
2330
|
to: d,
|
|
@@ -2392,7 +2392,7 @@ class os extends v {
|
|
|
2392
2392
|
constructor(t, { account: n, docsPath: r, chain: a, data: s, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: l, to: d, value: p, stateOverride: b }) {
|
|
2393
2393
|
var m;
|
|
2394
2394
|
const f = n ? re(n) : void 0;
|
|
2395
|
-
let y =
|
|
2395
|
+
let y = Ot({
|
|
2396
2396
|
from: f == null ? void 0 : f.address,
|
|
2397
2397
|
to: d,
|
|
2398
2398
|
value: typeof p < "u" && `${mr(p)} ${((m = a == null ? void 0 : a.nativeCurrency) == null ? void 0 : m.symbol) || "ETH"}`,
|
|
@@ -2432,7 +2432,7 @@ class Bu extends v {
|
|
|
2432
2432
|
args: r,
|
|
2433
2433
|
includeFunctionName: !1,
|
|
2434
2434
|
includeName: !1
|
|
2435
|
-
}) : void 0, l = u ? be(u, { includeName: !0 }) : void 0, d =
|
|
2435
|
+
}) : void 0, l = u ? be(u, { includeName: !0 }) : void 0, d = Ot({
|
|
2436
2436
|
address: a && Ji(a),
|
|
2437
2437
|
function: l,
|
|
2438
2438
|
args: c && c !== "()" && `${[...Array((i == null ? void 0 : i.length) ?? 0).keys()].map(() => " ").join("")}${c}`,
|
|
@@ -2674,7 +2674,7 @@ class sa extends v {
|
|
|
2674
2674
|
});
|
|
2675
2675
|
}
|
|
2676
2676
|
}
|
|
2677
|
-
const
|
|
2677
|
+
const Ru = -1;
|
|
2678
2678
|
class Y extends v {
|
|
2679
2679
|
constructor(t, { code: n, docsPath: r, metaMessages: a, shortMessage: s }) {
|
|
2680
2680
|
super(s, {
|
|
@@ -2691,7 +2691,7 @@ class Y extends v {
|
|
|
2691
2691
|
configurable: !0,
|
|
2692
2692
|
writable: !0,
|
|
2693
2693
|
value: void 0
|
|
2694
|
-
}), this.name = t.name, this.code = t instanceof us ? t.code : n ??
|
|
2694
|
+
}), this.name = t.name, this.code = t instanceof us ? t.code : n ?? Ru;
|
|
2695
2695
|
}
|
|
2696
2696
|
}
|
|
2697
2697
|
class at extends Y {
|
|
@@ -2945,10 +2945,10 @@ Object.defineProperty(Et, "code", {
|
|
|
2945
2945
|
writable: !0,
|
|
2946
2946
|
value: -32006
|
|
2947
2947
|
});
|
|
2948
|
-
class
|
|
2948
|
+
class Ue extends at {
|
|
2949
2949
|
constructor(t) {
|
|
2950
2950
|
super(t, {
|
|
2951
|
-
code:
|
|
2951
|
+
code: Ue.code,
|
|
2952
2952
|
shortMessage: "User rejected the request."
|
|
2953
2953
|
}), Object.defineProperty(this, "name", {
|
|
2954
2954
|
enumerable: !0,
|
|
@@ -2958,7 +2958,7 @@ class He extends at {
|
|
|
2958
2958
|
});
|
|
2959
2959
|
}
|
|
2960
2960
|
}
|
|
2961
|
-
Object.defineProperty(
|
|
2961
|
+
Object.defineProperty(Ue, "code", {
|
|
2962
2962
|
enumerable: !0,
|
|
2963
2963
|
configurable: !0,
|
|
2964
2964
|
writable: !0,
|
|
@@ -3059,7 +3059,7 @@ Object.defineProperty(Mt, "code", {
|
|
|
3059
3059
|
writable: !0,
|
|
3060
3060
|
value: 4902
|
|
3061
3061
|
});
|
|
3062
|
-
class
|
|
3062
|
+
class Ou extends Y {
|
|
3063
3063
|
constructor(t) {
|
|
3064
3064
|
super(t, {
|
|
3065
3065
|
shortMessage: "An unknown RPC error occurred."
|
|
@@ -3091,7 +3091,7 @@ function St(e, { abi: t, address: n, args: r, docsPath: a, functionName: s, send
|
|
|
3091
3091
|
class Nu extends v {
|
|
3092
3092
|
constructor(t, { account: n, docsPath: r, chain: a, data: s, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: l, to: d, value: p }) {
|
|
3093
3093
|
var f;
|
|
3094
|
-
const b =
|
|
3094
|
+
const b = Ot({
|
|
3095
3095
|
from: n == null ? void 0 : n.address,
|
|
3096
3096
|
to: d,
|
|
3097
3097
|
value: typeof p < "u" && `${mr(p)} ${((f = a == null ? void 0 : a.nativeCurrency) == null ? void 0 : f.symbol) || "ETH"}`,
|
|
@@ -3185,7 +3185,7 @@ Object.defineProperty(Dn, "nodeMessage", {
|
|
|
3185
3185
|
writable: !0,
|
|
3186
3186
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
3187
3187
|
});
|
|
3188
|
-
class
|
|
3188
|
+
class Hn extends v {
|
|
3189
3189
|
constructor({ cause: t, nonce: n } = {}) {
|
|
3190
3190
|
super(`Nonce provided for the transaction ${n ? `(${n}) ` : ""}is higher than the next one expected.`, { cause: t }), Object.defineProperty(this, "name", {
|
|
3191
3191
|
enumerable: !0,
|
|
@@ -3195,13 +3195,13 @@ class Un extends v {
|
|
|
3195
3195
|
});
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
|
-
Object.defineProperty(
|
|
3198
|
+
Object.defineProperty(Hn, "nodeMessage", {
|
|
3199
3199
|
enumerable: !0,
|
|
3200
3200
|
configurable: !0,
|
|
3201
3201
|
writable: !0,
|
|
3202
3202
|
value: /nonce too high/
|
|
3203
3203
|
});
|
|
3204
|
-
class
|
|
3204
|
+
class Un extends v {
|
|
3205
3205
|
constructor({ cause: t, nonce: n } = {}) {
|
|
3206
3206
|
super([
|
|
3207
3207
|
`Nonce provided for the transaction ${n ? `(${n}) ` : ""}is lower than the current nonce of the account.`,
|
|
@@ -3215,13 +3215,13 @@ class Hn extends v {
|
|
|
3215
3215
|
});
|
|
3216
3216
|
}
|
|
3217
3217
|
}
|
|
3218
|
-
Object.defineProperty(
|
|
3218
|
+
Object.defineProperty(Un, "nodeMessage", {
|
|
3219
3219
|
enumerable: !0,
|
|
3220
3220
|
configurable: !0,
|
|
3221
3221
|
writable: !0,
|
|
3222
3222
|
value: /nonce too low|transaction already imported|already known/
|
|
3223
3223
|
});
|
|
3224
|
-
class
|
|
3224
|
+
class Ln extends v {
|
|
3225
3225
|
constructor({ cause: t, nonce: n } = {}) {
|
|
3226
3226
|
super(`Nonce provided for the transaction ${n ? `(${n}) ` : ""}exceeds the maximum allowed nonce.`, { cause: t }), Object.defineProperty(this, "name", {
|
|
3227
3227
|
enumerable: !0,
|
|
@@ -3231,13 +3231,13 @@ class jn extends v {
|
|
|
3231
3231
|
});
|
|
3232
3232
|
}
|
|
3233
3233
|
}
|
|
3234
|
-
Object.defineProperty(
|
|
3234
|
+
Object.defineProperty(Ln, "nodeMessage", {
|
|
3235
3235
|
enumerable: !0,
|
|
3236
3236
|
configurable: !0,
|
|
3237
3237
|
writable: !0,
|
|
3238
3238
|
value: /nonce has max value/
|
|
3239
3239
|
});
|
|
3240
|
-
class
|
|
3240
|
+
class jn extends v {
|
|
3241
3241
|
constructor({ cause: t } = {}) {
|
|
3242
3242
|
super([
|
|
3243
3243
|
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
@@ -3262,7 +3262,7 @@ class Ln extends v {
|
|
|
3262
3262
|
});
|
|
3263
3263
|
}
|
|
3264
3264
|
}
|
|
3265
|
-
Object.defineProperty(
|
|
3265
|
+
Object.defineProperty(jn, "nodeMessage", {
|
|
3266
3266
|
enumerable: !0,
|
|
3267
3267
|
configurable: !0,
|
|
3268
3268
|
writable: !0,
|
|
@@ -3369,7 +3369,7 @@ function hr(e, t) {
|
|
|
3369
3369
|
}) : Dn.nodeMessage.test(n) ? new Dn({
|
|
3370
3370
|
cause: e,
|
|
3371
3371
|
maxFeePerGas: t == null ? void 0 : t.maxFeePerGas
|
|
3372
|
-
}) :
|
|
3372
|
+
}) : Hn.nodeMessage.test(n) ? new Hn({ cause: e, nonce: t == null ? void 0 : t.nonce }) : Un.nodeMessage.test(n) ? new Un({ cause: e, nonce: t == null ? void 0 : t.nonce }) : Ln.nodeMessage.test(n) ? new Ln({ cause: e, nonce: t == null ? void 0 : t.nonce }) : jn.nodeMessage.test(n) ? new jn({ cause: e }) : zn.nodeMessage.test(n) ? new zn({ cause: e, gas: t == null ? void 0 : t.gas }) : _n.nodeMessage.test(n) ? new _n({ cause: e, gas: t == null ? void 0 : t.gas }) : qn.nodeMessage.test(n) ? new qn({ cause: e }) : Kt.nodeMessage.test(n) ? new Kt({
|
|
3373
3373
|
cause: e,
|
|
3374
3374
|
maxFeePerGas: t == null ? void 0 : t.maxFeePerGas,
|
|
3375
3375
|
maxPriorityFeePerGas: t == null ? void 0 : t.maxPriorityFeePerGas
|
|
@@ -3399,7 +3399,7 @@ function gr(e, { format: t }) {
|
|
|
3399
3399
|
const a = t(e || {});
|
|
3400
3400
|
return r(a), n;
|
|
3401
3401
|
}
|
|
3402
|
-
const
|
|
3402
|
+
const Hu = {
|
|
3403
3403
|
legacy: "0x0",
|
|
3404
3404
|
eip2930: "0x1",
|
|
3405
3405
|
eip1559: "0x2",
|
|
@@ -3407,7 +3407,7 @@ const Uu = {
|
|
|
3407
3407
|
};
|
|
3408
3408
|
function un(e) {
|
|
3409
3409
|
const t = {};
|
|
3410
|
-
return typeof e.accessList < "u" && (t.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (t.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? t.blobs = e.blobs.map((n) => q(n)) : t.blobs = e.blobs), typeof e.data < "u" && (t.data = e.data), typeof e.from < "u" && (t.from = e.from), typeof e.gas < "u" && (t.gas =
|
|
3410
|
+
return typeof e.accessList < "u" && (t.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (t.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? t.blobs = e.blobs.map((n) => q(n)) : t.blobs = e.blobs), typeof e.data < "u" && (t.data = e.data), typeof e.from < "u" && (t.from = e.from), typeof e.gas < "u" && (t.gas = R(e.gas)), typeof e.gasPrice < "u" && (t.gasPrice = R(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (t.maxFeePerBlobGas = R(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (t.maxFeePerGas = R(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (t.maxPriorityFeePerGas = R(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (t.nonce = R(e.nonce)), typeof e.to < "u" && (t.to = e.to), typeof e.type < "u" && (t.type = Hu[e.type]), typeof e.value < "u" && (t.value = R(e.value)), t;
|
|
3411
3411
|
}
|
|
3412
3412
|
function ia(e) {
|
|
3413
3413
|
if (!(!e || e.length === 0))
|
|
@@ -3427,9 +3427,9 @@ function ia(e) {
|
|
|
3427
3427
|
return t[n] = r, t;
|
|
3428
3428
|
}, {});
|
|
3429
3429
|
}
|
|
3430
|
-
function
|
|
3430
|
+
function Uu(e) {
|
|
3431
3431
|
const { balance: t, nonce: n, state: r, stateDiff: a, code: s } = e, i = {};
|
|
3432
|
-
if (s !== void 0 && (i.code = s), t !== void 0 && (i.balance =
|
|
3432
|
+
if (s !== void 0 && (i.code = s), t !== void 0 && (i.balance = R(t)), n !== void 0 && (i.nonce = R(n)), r !== void 0 && (i.state = ia(r)), a !== void 0) {
|
|
3433
3433
|
if (i.state)
|
|
3434
3434
|
throw new Cu();
|
|
3435
3435
|
i.stateDiff = ia(a);
|
|
@@ -3445,7 +3445,7 @@ function cs(e) {
|
|
|
3445
3445
|
throw new Me({ address: n });
|
|
3446
3446
|
if (t[n])
|
|
3447
3447
|
throw new Pu({ address: n });
|
|
3448
|
-
t[n] =
|
|
3448
|
+
t[n] = Uu(r);
|
|
3449
3449
|
}
|
|
3450
3450
|
return t;
|
|
3451
3451
|
}
|
|
@@ -3462,7 +3462,7 @@ function Ft(e) {
|
|
|
3462
3462
|
if (a && r && a > r)
|
|
3463
3463
|
throw new Kt({ maxFeePerGas: r, maxPriorityFeePerGas: a });
|
|
3464
3464
|
}
|
|
3465
|
-
class
|
|
3465
|
+
class Lu extends v {
|
|
3466
3466
|
constructor() {
|
|
3467
3467
|
super("`baseFeeMultiplier` must be greater than 1."), Object.defineProperty(this, "name", {
|
|
3468
3468
|
enumerable: !0,
|
|
@@ -3482,7 +3482,7 @@ class wr extends v {
|
|
|
3482
3482
|
});
|
|
3483
3483
|
}
|
|
3484
3484
|
}
|
|
3485
|
-
class
|
|
3485
|
+
class ju extends v {
|
|
3486
3486
|
constructor({ maxPriorityFeePerGas: t }) {
|
|
3487
3487
|
super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${K(t)} gwei).`), Object.defineProperty(this, "name", {
|
|
3488
3488
|
enumerable: !0,
|
|
@@ -3564,7 +3564,7 @@ function ys(e) {
|
|
|
3564
3564
|
}
|
|
3565
3565
|
async function Se(e, { blockHash: t, blockNumber: n, blockTag: r, includeTransactions: a } = {}) {
|
|
3566
3566
|
var l, d, p;
|
|
3567
|
-
const s = r ?? "latest", i = a ?? !1, o = n !== void 0 ?
|
|
3567
|
+
const s = r ?? "latest", i = a ?? !1, o = n !== void 0 ? R(n) : void 0;
|
|
3568
3568
|
let u = null;
|
|
3569
3569
|
if (t ? u = await e.request({
|
|
3570
3570
|
method: "eth_getBlockByHash",
|
|
@@ -3628,7 +3628,7 @@ async function Gn(e, t) {
|
|
|
3628
3628
|
}) : ((y = r == null ? void 0 : r.fees) == null ? void 0 : y.baseFeeMultiplier) ?? 1.2;
|
|
3629
3629
|
})();
|
|
3630
3630
|
if (i < 1)
|
|
3631
|
-
throw new
|
|
3631
|
+
throw new Lu();
|
|
3632
3632
|
const u = 10 ** (((p = i.toString().split(".")[1]) == null ? void 0 : p.length) ?? 0), c = (f) => f * BigInt(Math.ceil(i * u)) / BigInt(u), l = n || await S(e, Se, "getBlock")({});
|
|
3633
3633
|
if (typeof ((b = r == null ? void 0 : r.fees) == null ? void 0 : b.estimateFeesPerGas) == "function") {
|
|
3634
3634
|
const f = await r.fees.estimateFeesPerGas({
|
|
@@ -3661,18 +3661,18 @@ async function Gn(e, t) {
|
|
|
3661
3661
|
async function ms(e, { address: t, blockTag: n = "latest", blockNumber: r }) {
|
|
3662
3662
|
const a = await e.request({
|
|
3663
3663
|
method: "eth_getTransactionCount",
|
|
3664
|
-
params: [t, r ?
|
|
3664
|
+
params: [t, r ? R(r) : n]
|
|
3665
3665
|
});
|
|
3666
3666
|
return Ae(a);
|
|
3667
3667
|
}
|
|
3668
3668
|
function bs(e) {
|
|
3669
|
-
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((s) =>
|
|
3669
|
+
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((s) => je(s)) : e.blobs, a = [];
|
|
3670
3670
|
for (const s of r)
|
|
3671
3671
|
a.push(Uint8Array.from(t.blobToKzgCommitment(s)));
|
|
3672
3672
|
return n === "bytes" ? a : a.map((s) => q(s));
|
|
3673
3673
|
}
|
|
3674
3674
|
function hs(e) {
|
|
3675
|
-
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((i) =>
|
|
3675
|
+
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((i) => je(i)) : e.blobs, a = typeof e.commitments[0] == "string" ? e.commitments.map((i) => je(i)) : e.commitments, s = [];
|
|
3676
3676
|
for (let i = 0; i < r.length; i++) {
|
|
3677
3677
|
const o = r[i], u = a[i];
|
|
3678
3678
|
s.push(Uint8Array.from(t.computeBlobKzgProof(o, u)));
|
|
@@ -3887,7 +3887,7 @@ class ec extends v {
|
|
|
3887
3887
|
}
|
|
3888
3888
|
}
|
|
3889
3889
|
function tc(e) {
|
|
3890
|
-
const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), n = typeof e.data == "string" ?
|
|
3890
|
+
const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), n = typeof e.data == "string" ? je(e.data) : e.data, r = j(n);
|
|
3891
3891
|
if (!r)
|
|
3892
3892
|
throw new ec();
|
|
3893
3893
|
if (r > ua)
|
|
@@ -3991,7 +3991,7 @@ async function cn(e, t) {
|
|
|
3991
3991
|
request: p
|
|
3992
3992
|
});
|
|
3993
3993
|
if (typeof t.maxPriorityFeePerGas > "u" && t.maxFeePerGas && t.maxFeePerGas < h)
|
|
3994
|
-
throw new
|
|
3994
|
+
throw new ju({
|
|
3995
3995
|
maxPriorityFeePerGas: h
|
|
3996
3996
|
});
|
|
3997
3997
|
p.maxPriorityFeePerGas = h, p.maxFeePerGas = m;
|
|
@@ -4023,11 +4023,11 @@ async function xr(e, t) {
|
|
|
4023
4023
|
// to compute them.
|
|
4024
4024
|
(r == null ? void 0 : r.type) === "local" ? void 0 : ["blobVersionedHashes"]
|
|
4025
4025
|
)
|
|
4026
|
-
}), E = (l ?
|
|
4026
|
+
}), E = (l ? R(l) : void 0) || d, M = cs(P);
|
|
4027
4027
|
Ft(t);
|
|
4028
|
-
const
|
|
4028
|
+
const k = (i = (s = (a = e.chain) == null ? void 0 : a.formatters) == null ? void 0 : s.transactionRequest) == null ? void 0 : i.format, N = (k || un)({
|
|
4029
4029
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4030
|
-
...gr(T, { format:
|
|
4030
|
+
...gr(T, { format: k }),
|
|
4031
4031
|
from: r == null ? void 0 : r.address,
|
|
4032
4032
|
accessList: o,
|
|
4033
4033
|
blobs: u,
|
|
@@ -4055,7 +4055,7 @@ async function xr(e, t) {
|
|
|
4055
4055
|
}
|
|
4056
4056
|
}
|
|
4057
4057
|
async function xs(e, t) {
|
|
4058
|
-
const { abi: n, address: r, args: a, functionName: s, ...i } = t, o =
|
|
4058
|
+
const { abi: n, address: r, args: a, functionName: s, ...i } = t, o = Oe({
|
|
4059
4059
|
abi: n,
|
|
4060
4060
|
args: a,
|
|
4061
4061
|
functionName: s
|
|
@@ -4085,7 +4085,7 @@ function Er(e) {
|
|
|
4085
4085
|
throw new ro({ docsPath: ca });
|
|
4086
4086
|
const u = t.find((y) => y.type === "event" && i === ur(be(y)));
|
|
4087
4087
|
if (!(u && "name" in u) || u.type !== "event")
|
|
4088
|
-
throw new
|
|
4088
|
+
throw new Ha(i, { docsPath: ca });
|
|
4089
4089
|
const { name: c, inputs: l } = u, d = l == null ? void 0 : l.some((y) => !("name" in y && y.name));
|
|
4090
4090
|
let p = d ? [] : {};
|
|
4091
4091
|
const b = l.filter((y) => "indexed" in y && y.indexed);
|
|
@@ -4115,7 +4115,7 @@ function Er(e) {
|
|
|
4115
4115
|
abiItem: u,
|
|
4116
4116
|
data: n,
|
|
4117
4117
|
params: f,
|
|
4118
|
-
size:
|
|
4118
|
+
size: j(n)
|
|
4119
4119
|
}) : y;
|
|
4120
4120
|
}
|
|
4121
4121
|
else if (s)
|
|
@@ -4146,7 +4146,7 @@ function Pr({ abi: e, eventName: t, logs: n, strict: r = !0 }) {
|
|
|
4146
4146
|
return t && !t.includes(i.eventName) ? null : { ...i, ...a };
|
|
4147
4147
|
} catch (i) {
|
|
4148
4148
|
let o, u;
|
|
4149
|
-
if (i instanceof
|
|
4149
|
+
if (i instanceof Ha)
|
|
4150
4150
|
return null;
|
|
4151
4151
|
if (i instanceof ft || i instanceof en) {
|
|
4152
4152
|
if (r)
|
|
@@ -4172,7 +4172,7 @@ async function Cr(e, { address: t, blockHash: n, fromBlock: r, toBlock: a, event
|
|
|
4172
4172
|
const c = u ?? !1, l = i ?? (s ? [s] : void 0);
|
|
4173
4173
|
let d = [];
|
|
4174
4174
|
l && (d = [
|
|
4175
|
-
l.flatMap((f) =>
|
|
4175
|
+
l.flatMap((f) => Rt({
|
|
4176
4176
|
abi: [f],
|
|
4177
4177
|
eventName: f.name,
|
|
4178
4178
|
args: o
|
|
@@ -4188,8 +4188,8 @@ async function Cr(e, { address: t, blockHash: n, fromBlock: r, toBlock: a, event
|
|
|
4188
4188
|
{
|
|
4189
4189
|
address: t,
|
|
4190
4190
|
topics: d,
|
|
4191
|
-
fromBlock: typeof r == "bigint" ?
|
|
4192
|
-
toBlock: typeof a == "bigint" ?
|
|
4191
|
+
fromBlock: typeof r == "bigint" ? R(r) : r,
|
|
4192
|
+
toBlock: typeof a == "bigint" ? R(a) : a
|
|
4193
4193
|
}
|
|
4194
4194
|
]
|
|
4195
4195
|
});
|
|
@@ -4565,11 +4565,11 @@ function As({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: a }) {
|
|
|
4565
4565
|
};
|
|
4566
4566
|
}
|
|
4567
4567
|
async function dn(e, t) {
|
|
4568
|
-
var E, M,
|
|
4568
|
+
var E, M, k, $;
|
|
4569
4569
|
const { account: n = e.account, batch: r = !!((E = e.batch) != null && E.multicall), blockNumber: a, blockTag: s = "latest", accessList: i, blobs: o, data: u, factory: c, factoryData: l, gas: d, gasPrice: p, maxFeePerBlobGas: b, maxFeePerGas: f, maxPriorityFeePerGas: y, nonce: m, to: h, value: g, stateOverride: w, ...x } = t, P = n ? re(n) : void 0, T = c && l && h && u, C = T ? mc({ data: u, factory: c, factoryData: l, to: h }) : u;
|
|
4570
4570
|
try {
|
|
4571
4571
|
Ft(t);
|
|
4572
|
-
const F = (a ?
|
|
4572
|
+
const F = (a ? R(a) : void 0) || s, G = cs(w), A = ($ = (k = (M = e.chain) == null ? void 0 : M.formatters) == null ? void 0 : k.transactionRequest) == null ? void 0 : $.format, O = (A || un)({
|
|
4573
4573
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4574
4574
|
...gr(x, { format: A }),
|
|
4575
4575
|
from: P == null ? void 0 : P.address,
|
|
@@ -4585,10 +4585,10 @@ async function dn(e, t) {
|
|
|
4585
4585
|
to: T ? void 0 : h,
|
|
4586
4586
|
value: g
|
|
4587
4587
|
});
|
|
4588
|
-
if (r && yc({ request:
|
|
4588
|
+
if (r && yc({ request: O }) && !G)
|
|
4589
4589
|
try {
|
|
4590
4590
|
return await fc(e, {
|
|
4591
|
-
...
|
|
4591
|
+
...O,
|
|
4592
4592
|
blockNumber: a,
|
|
4593
4593
|
blockTag: s
|
|
4594
4594
|
});
|
|
@@ -4596,17 +4596,17 @@ async function dn(e, t) {
|
|
|
4596
4596
|
if (!(D instanceof Cs) && !(D instanceof Vn))
|
|
4597
4597
|
throw D;
|
|
4598
4598
|
}
|
|
4599
|
-
const
|
|
4599
|
+
const H = await e.request({
|
|
4600
4600
|
method: "eth_call",
|
|
4601
4601
|
params: G ? [
|
|
4602
|
-
|
|
4602
|
+
O,
|
|
4603
4603
|
F,
|
|
4604
4604
|
G
|
|
4605
|
-
] : [
|
|
4605
|
+
] : [O, F]
|
|
4606
4606
|
});
|
|
4607
|
-
return
|
|
4607
|
+
return H === "0x" ? { data: void 0 } : { data: H };
|
|
4608
4608
|
} catch (N) {
|
|
4609
|
-
const F = bc(N), { offchainLookup: G, offchainLookupSignature: A } = await import("./ccip-
|
|
4609
|
+
const F = bc(N), { offchainLookup: G, offchainLookupSignature: A } = await import("./ccip-uPDDvTne.js");
|
|
4610
4610
|
if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === A && h)
|
|
4611
4611
|
return { data: await G(e, { data: F, to: h }) };
|
|
4612
4612
|
throw T && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new $u({ factory: c }) : pc(N, {
|
|
@@ -4633,7 +4633,7 @@ async function fc(e, t) {
|
|
|
4633
4633
|
contract: "multicall3"
|
|
4634
4634
|
});
|
|
4635
4635
|
}
|
|
4636
|
-
const d = (a ?
|
|
4636
|
+
const d = (a ? R(a) : void 0) || s, { schedule: p } = As({
|
|
4637
4637
|
id: `${e.uid}.${d}`,
|
|
4638
4638
|
wait: r,
|
|
4639
4639
|
shouldSplitBatch(m) {
|
|
@@ -4644,7 +4644,7 @@ async function fc(e, t) {
|
|
|
4644
4644
|
allowFailure: !0,
|
|
4645
4645
|
callData: x.data,
|
|
4646
4646
|
target: x.to
|
|
4647
|
-
})), g =
|
|
4647
|
+
})), g = Oe({
|
|
4648
4648
|
abi: Wn,
|
|
4649
4649
|
args: [h],
|
|
4650
4650
|
functionName: "aggregate3"
|
|
@@ -4689,7 +4689,7 @@ function bc(e) {
|
|
|
4689
4689
|
return typeof (t == null ? void 0 : t.data) == "object" ? (n = t.data) == null ? void 0 : n.data : t.data;
|
|
4690
4690
|
}
|
|
4691
4691
|
async function de(e, t) {
|
|
4692
|
-
const { abi: n, address: r, args: a, functionName: s, ...i } = t, o =
|
|
4692
|
+
const { abi: n, address: r, args: a, functionName: s, ...i } = t, o = Oe({
|
|
4693
4693
|
abi: n,
|
|
4694
4694
|
args: a,
|
|
4695
4695
|
functionName: s
|
|
@@ -4717,7 +4717,7 @@ async function de(e, t) {
|
|
|
4717
4717
|
}
|
|
4718
4718
|
}
|
|
4719
4719
|
async function Is(e, t) {
|
|
4720
|
-
const { abi: n, address: r, args: a, dataSuffix: s, functionName: i, ...o } = t, u = o.account ? re(o.account) : e.account, c =
|
|
4720
|
+
const { abi: n, address: r, args: a, dataSuffix: s, functionName: i, ...o } = t, u = o.account ? re(o.account) : e.account, c = Oe({ abi: n, args: a, functionName: i });
|
|
4721
4721
|
try {
|
|
4722
4722
|
const { data: l } = await S(e, dn, "call")({
|
|
4723
4723
|
batch: !1,
|
|
@@ -4827,7 +4827,7 @@ async function vc(e, { cacheKey: t, cacheTime: n = Number.POSITIVE_INFINITY }) {
|
|
|
4827
4827
|
}
|
|
4828
4828
|
}
|
|
4829
4829
|
const xc = (e) => `blockNumber.${e}`;
|
|
4830
|
-
async function
|
|
4830
|
+
async function Ht(e, { cacheTime: t = e.cacheTime } = {}) {
|
|
4831
4831
|
const n = await vc(() => e.request({
|
|
4832
4832
|
method: "eth_blockNumber"
|
|
4833
4833
|
}), { cacheKey: xc(e.uid), cacheTime: t });
|
|
@@ -4893,7 +4893,7 @@ function Ms(e, t) {
|
|
|
4893
4893
|
if (x)
|
|
4894
4894
|
E = await S(e, ln, "getFilterChanges")({ filter: x });
|
|
4895
4895
|
else {
|
|
4896
|
-
const M = await S(e,
|
|
4896
|
+
const M = await S(e, Ht, "getBlockNumber")({});
|
|
4897
4897
|
w && w !== M ? E = await S(e, Ar, "getContractEvents")({
|
|
4898
4898
|
abi: n,
|
|
4899
4899
|
address: r,
|
|
@@ -4942,34 +4942,34 @@ function Ms(e, t) {
|
|
|
4942
4942
|
return E ? E.value : e.transport;
|
|
4943
4943
|
}
|
|
4944
4944
|
return e.transport;
|
|
4945
|
-
})(), T = i ?
|
|
4945
|
+
})(), T = i ? Rt({
|
|
4946
4946
|
abi: n,
|
|
4947
4947
|
eventName: i,
|
|
4948
4948
|
args: a
|
|
4949
4949
|
}) : [], { unsubscribe: C } = await P.subscribe({
|
|
4950
4950
|
params: ["logs", { address: r, topics: T }],
|
|
4951
4951
|
onData(E) {
|
|
4952
|
-
var
|
|
4952
|
+
var k;
|
|
4953
4953
|
if (!g)
|
|
4954
4954
|
return;
|
|
4955
4955
|
const M = E.result;
|
|
4956
4956
|
try {
|
|
4957
|
-
const { eventName:
|
|
4957
|
+
const { eventName: $, args: N } = Er({
|
|
4958
4958
|
abi: n,
|
|
4959
4959
|
data: M.data,
|
|
4960
4960
|
topics: M.topics,
|
|
4961
4961
|
strict: p
|
|
4962
4962
|
}), F = Be(M, {
|
|
4963
4963
|
args: N,
|
|
4964
|
-
eventName:
|
|
4964
|
+
eventName: $
|
|
4965
4965
|
});
|
|
4966
4966
|
x.onLogs([F]);
|
|
4967
|
-
} catch (
|
|
4967
|
+
} catch ($) {
|
|
4968
4968
|
let N, F;
|
|
4969
|
-
if (
|
|
4969
|
+
if ($ instanceof ft || $ instanceof en) {
|
|
4970
4970
|
if (p)
|
|
4971
4971
|
return;
|
|
4972
|
-
N =
|
|
4972
|
+
N = $.abiItem.name, F = (k = $.abiItem.inputs) == null ? void 0 : k.some((A) => !("name" in A && A.name));
|
|
4973
4973
|
}
|
|
4974
4974
|
const G = Be(M, {
|
|
4975
4975
|
args: F ? [] : {},
|
|
@@ -5061,11 +5061,11 @@ async function Sr(e, t) {
|
|
|
5061
5061
|
to: b,
|
|
5062
5062
|
value: f,
|
|
5063
5063
|
...y
|
|
5064
|
-
}),
|
|
5065
|
-
serializer:
|
|
5064
|
+
}), k = (h = r == null ? void 0 : r.serializers) == null ? void 0 : h.transaction, $ = await m.signTransaction(M, {
|
|
5065
|
+
serializer: k
|
|
5066
5066
|
});
|
|
5067
5067
|
return await S(e, Mr, "sendRawTransaction")({
|
|
5068
|
-
serializedTransaction:
|
|
5068
|
+
serializedTransaction: $
|
|
5069
5069
|
});
|
|
5070
5070
|
}
|
|
5071
5071
|
const T = (x = (w = (g = e.chain) == null ? void 0 : g.formatters) == null ? void 0 : w.transactionRequest) == null ? void 0 : x.format, E = (T || un)({
|
|
@@ -5097,7 +5097,7 @@ async function Sr(e, t) {
|
|
|
5097
5097
|
}
|
|
5098
5098
|
}
|
|
5099
5099
|
async function Bs(e, t) {
|
|
5100
|
-
const { abi: n, address: r, args: a, dataSuffix: s, functionName: i, ...o } = t, u =
|
|
5100
|
+
const { abi: n, address: r, args: a, dataSuffix: s, functionName: i, ...o } = t, u = Oe({
|
|
5101
5101
|
abi: n,
|
|
5102
5102
|
args: a,
|
|
5103
5103
|
functionName: i
|
|
@@ -5117,7 +5117,7 @@ function ot({ abi: e, address: t, client: n }) {
|
|
|
5117
5117
|
return i && (c && (u.read = new Proxy({}, {
|
|
5118
5118
|
get(p, b) {
|
|
5119
5119
|
return (...f) => {
|
|
5120
|
-
const { args: y, options: m } =
|
|
5120
|
+
const { args: y, options: m } = jt(f);
|
|
5121
5121
|
return S(a, de, "readContract")({
|
|
5122
5122
|
abi: e,
|
|
5123
5123
|
address: t,
|
|
@@ -5130,7 +5130,7 @@ function ot({ abi: e, address: t, client: n }) {
|
|
|
5130
5130
|
})), l && (u.simulate = new Proxy({}, {
|
|
5131
5131
|
get(p, b) {
|
|
5132
5132
|
return (...f) => {
|
|
5133
|
-
const { args: y, options: m } =
|
|
5133
|
+
const { args: y, options: m } = jt(f);
|
|
5134
5134
|
return S(a, Is, "simulateContract")({
|
|
5135
5135
|
abi: e,
|
|
5136
5136
|
address: t,
|
|
@@ -5182,7 +5182,7 @@ function ot({ abi: e, address: t, client: n }) {
|
|
|
5182
5182
|
}))), o && l && (u.write = new Proxy({}, {
|
|
5183
5183
|
get(p, b) {
|
|
5184
5184
|
return (...f) => {
|
|
5185
|
-
const { args: y, options: m } =
|
|
5185
|
+
const { args: y, options: m } = jt(f);
|
|
5186
5186
|
return S(s, Bs, "writeContract")({
|
|
5187
5187
|
abi: e,
|
|
5188
5188
|
address: t,
|
|
@@ -5195,7 +5195,7 @@ function ot({ abi: e, address: t, client: n }) {
|
|
|
5195
5195
|
})), (i || o) && l && (u.estimateGas = new Proxy({}, {
|
|
5196
5196
|
get(p, b) {
|
|
5197
5197
|
return (...f) => {
|
|
5198
|
-
const { args: y, options: m } =
|
|
5198
|
+
const { args: y, options: m } = jt(f);
|
|
5199
5199
|
return S(a ?? s, xs, "estimateContractGas")({
|
|
5200
5200
|
abi: e,
|
|
5201
5201
|
address: t,
|
|
@@ -5208,7 +5208,7 @@ function ot({ abi: e, address: t, client: n }) {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
})), u.address = t, u.abi = e, u;
|
|
5210
5210
|
}
|
|
5211
|
-
function
|
|
5211
|
+
function jt(e) {
|
|
5212
5212
|
const t = e.length && Array.isArray(e[0]), n = t ? e[0] : [], r = (t ? e[1] : e[0]) ?? {};
|
|
5213
5213
|
return { args: n, options: r };
|
|
5214
5214
|
}
|
|
@@ -5284,7 +5284,7 @@ async function Ic(e, { chain: t }) {
|
|
|
5284
5284
|
method: "wallet_addEthereumChain",
|
|
5285
5285
|
params: [
|
|
5286
5286
|
{
|
|
5287
|
-
chainId:
|
|
5287
|
+
chainId: R(n),
|
|
5288
5288
|
chainName: r,
|
|
5289
5289
|
nativeCurrency: a,
|
|
5290
5290
|
rpcUrls: s.default.http,
|
|
@@ -5387,8 +5387,8 @@ function Sc(e, t = {}) {
|
|
|
5387
5387
|
throw new Qe(o);
|
|
5388
5388
|
case Et.code:
|
|
5389
5389
|
throw new Et(o);
|
|
5390
|
-
case
|
|
5391
|
-
throw new
|
|
5390
|
+
case Ue.code:
|
|
5391
|
+
throw new Ue(o);
|
|
5392
5392
|
case Pt.code:
|
|
5393
5393
|
throw new Pt(o);
|
|
5394
5394
|
case Ct.code:
|
|
@@ -5400,9 +5400,9 @@ function Sc(e, t = {}) {
|
|
|
5400
5400
|
case Mt.code:
|
|
5401
5401
|
throw new Mt(o);
|
|
5402
5402
|
case 5e3:
|
|
5403
|
-
throw new
|
|
5403
|
+
throw new Ue(o);
|
|
5404
5404
|
default:
|
|
5405
|
-
throw i instanceof v ? i : new
|
|
5405
|
+
throw i instanceof v ? i : new Ou(o);
|
|
5406
5406
|
}
|
|
5407
5407
|
}
|
|
5408
5408
|
}, {
|
|
@@ -5476,7 +5476,7 @@ function $c(e, t = {}) {
|
|
|
5476
5476
|
params: y,
|
|
5477
5477
|
transport: g,
|
|
5478
5478
|
status: "error"
|
|
5479
|
-
}),
|
|
5479
|
+
}), Rc(w) || h === d.length - 1)
|
|
5480
5480
|
throw w;
|
|
5481
5481
|
return m(h + 1);
|
|
5482
5482
|
}
|
|
@@ -5492,7 +5492,7 @@ function $c(e, t = {}) {
|
|
|
5492
5492
|
});
|
|
5493
5493
|
if (a) {
|
|
5494
5494
|
const f = typeof a == "object" ? a : {};
|
|
5495
|
-
|
|
5495
|
+
Oc({
|
|
5496
5496
|
chain: o,
|
|
5497
5497
|
interval: f.interval ?? u,
|
|
5498
5498
|
onTransports: (y) => d = y,
|
|
@@ -5505,10 +5505,10 @@ function $c(e, t = {}) {
|
|
|
5505
5505
|
return b;
|
|
5506
5506
|
};
|
|
5507
5507
|
}
|
|
5508
|
-
function
|
|
5509
|
-
return "code" in e && typeof e.code == "number" && (e.code === Xe.code || e.code ===
|
|
5508
|
+
function Rc(e) {
|
|
5509
|
+
return "code" in e && typeof e.code == "number" && (e.code === Xe.code || e.code === Ue.code || e.code === 5e3);
|
|
5510
5510
|
}
|
|
5511
|
-
function
|
|
5511
|
+
function Oc({ chain: e, interval: t = 4e3, onTransports: n, sampleCount: r = 10, timeout: a = 1e3, transports: s, weights: i = {} }) {
|
|
5512
5512
|
const { stability: o = 0.7, latency: u = 0.3 } = i, c = [], l = async () => {
|
|
5513
5513
|
const d = await Promise.all(s.map(async (f) => {
|
|
5514
5514
|
const y = f({ chain: e, retryCount: 0, timeout: a }), m = Date.now();
|
|
@@ -5570,7 +5570,7 @@ function Dc() {
|
|
|
5570
5570
|
};
|
|
5571
5571
|
}
|
|
5572
5572
|
const ya = /* @__PURE__ */ Dc();
|
|
5573
|
-
function
|
|
5573
|
+
function Hc(e, t = {}) {
|
|
5574
5574
|
return {
|
|
5575
5575
|
async request(n) {
|
|
5576
5576
|
var d;
|
|
@@ -5631,7 +5631,7 @@ function Yn(e, t = {}) {
|
|
|
5631
5631
|
const { batchSize: p = 1e3, wait: b = 0 } = typeof n == "object" ? n : {}, f = t.retryCount ?? l, y = d ?? t.timeout ?? 1e4, m = e || (c == null ? void 0 : c.rpcUrls.default.http[0]);
|
|
5632
5632
|
if (!m)
|
|
5633
5633
|
throw new Fc();
|
|
5634
|
-
const h =
|
|
5634
|
+
const h = Hc(m, {
|
|
5635
5635
|
fetchOptions: r,
|
|
5636
5636
|
onRequest: i,
|
|
5637
5637
|
onResponse: o,
|
|
@@ -5650,7 +5650,7 @@ function Yn(e, t = {}) {
|
|
|
5650
5650
|
fn: (M) => h.request({
|
|
5651
5651
|
body: M
|
|
5652
5652
|
}),
|
|
5653
|
-
sort: (M,
|
|
5653
|
+
sort: (M, k) => M.id - k.id
|
|
5654
5654
|
}), T = async (M) => n ? P(M) : [
|
|
5655
5655
|
await h.request({
|
|
5656
5656
|
body: M
|
|
@@ -5698,10 +5698,10 @@ function qt(e) {
|
|
|
5698
5698
|
}
|
|
5699
5699
|
return q(t);
|
|
5700
5700
|
}
|
|
5701
|
-
function
|
|
5701
|
+
function Uc(e) {
|
|
5702
5702
|
return `[${e.slice(2)}]`;
|
|
5703
5703
|
}
|
|
5704
|
-
function
|
|
5704
|
+
function Lc(e) {
|
|
5705
5705
|
const t = new Uint8Array(32).fill(0);
|
|
5706
5706
|
return e ? $s(e) || Z(fe(e)) : q(t);
|
|
5707
5707
|
}
|
|
@@ -5714,11 +5714,11 @@ function fn(e) {
|
|
|
5714
5714
|
const a = t.split(".");
|
|
5715
5715
|
for (let s = 0; s < a.length; s++) {
|
|
5716
5716
|
let i = fe(a[s]);
|
|
5717
|
-
i.byteLength > 255 && (i = fe(
|
|
5717
|
+
i.byteLength > 255 && (i = fe(Uc(Lc(a[s])))), n[r] = i.length, n.set(i, r + 1), r += i.length + 1;
|
|
5718
5718
|
}
|
|
5719
5719
|
return n.byteLength !== r + 1 ? n.slice(0, r + 1) : n;
|
|
5720
5720
|
}
|
|
5721
|
-
async function
|
|
5721
|
+
async function jc(e, { blockNumber: t, blockTag: n, coinType: r, name: a, gatewayUrls: s, strict: i, universalResolverAddress: o }) {
|
|
5722
5722
|
let u = o;
|
|
5723
5723
|
if (!u) {
|
|
5724
5724
|
if (!e.chain)
|
|
@@ -5730,7 +5730,7 @@ async function Lc(e, { blockNumber: t, blockTag: n, coinType: r, name: a, gatewa
|
|
|
5730
5730
|
});
|
|
5731
5731
|
}
|
|
5732
5732
|
try {
|
|
5733
|
-
const c =
|
|
5733
|
+
const c = Oe({
|
|
5734
5734
|
abi: la,
|
|
5735
5735
|
functionName: "addr",
|
|
5736
5736
|
...r != null ? { args: [qt(a), BigInt(r)] } : { args: [qt(a)] }
|
|
@@ -5738,7 +5738,7 @@ async function Lc(e, { blockNumber: t, blockTag: n, coinType: r, name: a, gatewa
|
|
|
5738
5738
|
address: u,
|
|
5739
5739
|
abi: Ps,
|
|
5740
5740
|
functionName: "resolve",
|
|
5741
|
-
args: [
|
|
5741
|
+
args: [Re(fn(a)), c],
|
|
5742
5742
|
blockNumber: t,
|
|
5743
5743
|
blockTag: n
|
|
5744
5744
|
}, d = S(e, de, "readContract"), p = s ? await d({
|
|
@@ -5831,7 +5831,7 @@ async function Zc(e) {
|
|
|
5831
5831
|
function fa(e, t) {
|
|
5832
5832
|
return e ? e.endsWith("/") ? e.slice(0, -1) : e : t;
|
|
5833
5833
|
}
|
|
5834
|
-
function
|
|
5834
|
+
function Rs({ uri: e, gatewayUrls: t }) {
|
|
5835
5835
|
const n = Wc.test(e);
|
|
5836
5836
|
if (n)
|
|
5837
5837
|
return { uri: e, isOnChain: !0, isEncoded: n };
|
|
@@ -5861,7 +5861,7 @@ function Os({ uri: e, gatewayUrls: t }) {
|
|
|
5861
5861
|
};
|
|
5862
5862
|
throw new $r({ uri: e });
|
|
5863
5863
|
}
|
|
5864
|
-
function
|
|
5864
|
+
function Os(e) {
|
|
5865
5865
|
if (typeof e != "object" || !("image" in e) && !("image_url" in e) && !("image_data" in e))
|
|
5866
5866
|
throw new zc({ data: e });
|
|
5867
5867
|
return e.image || e.image_url || e.image_data;
|
|
@@ -5869,16 +5869,16 @@ function Rs(e) {
|
|
|
5869
5869
|
async function Kc({ gatewayUrls: e, uri: t }) {
|
|
5870
5870
|
try {
|
|
5871
5871
|
const n = await fetch(t).then((a) => a.json());
|
|
5872
|
-
return await
|
|
5872
|
+
return await Rr({
|
|
5873
5873
|
gatewayUrls: e,
|
|
5874
|
-
uri:
|
|
5874
|
+
uri: Os(n)
|
|
5875
5875
|
});
|
|
5876
5876
|
} catch {
|
|
5877
5877
|
throw new $r({ uri: t });
|
|
5878
5878
|
}
|
|
5879
5879
|
}
|
|
5880
|
-
async function
|
|
5881
|
-
const { uri: n, isOnChain: r } =
|
|
5880
|
+
async function Rr({ gatewayUrls: e, uri: t }) {
|
|
5881
|
+
const { uri: n, isOnChain: r } = Rs({ uri: t, gatewayUrls: e });
|
|
5882
5882
|
if (r || await Zc(n))
|
|
5883
5883
|
return n;
|
|
5884
5884
|
throw new $r({ uri: t });
|
|
@@ -5940,10 +5940,10 @@ async function Jc(e, { nft: t }) {
|
|
|
5940
5940
|
throw new _c({ namespace: t.namespace });
|
|
5941
5941
|
}
|
|
5942
5942
|
async function Xc(e, { gatewayUrls: t, record: n }) {
|
|
5943
|
-
return /eip155:/i.test(n) ? Qc(e, { gatewayUrls: t, record: n }) :
|
|
5943
|
+
return /eip155:/i.test(n) ? Qc(e, { gatewayUrls: t, record: n }) : Rr({ uri: n, gatewayUrls: t });
|
|
5944
5944
|
}
|
|
5945
5945
|
async function Qc(e, { gatewayUrls: t, record: n }) {
|
|
5946
|
-
const r = Yc(n), a = await Jc(e, { nft: r }), { uri: s, isOnChain: i, isEncoded: o } =
|
|
5946
|
+
const r = Yc(n), a = await Jc(e, { nft: r }), { uri: s, isOnChain: i, isEncoded: o } = Rs({ uri: a, gatewayUrls: t });
|
|
5947
5947
|
if (i && (s.includes("data:application/json;base64,") || s.startsWith("{"))) {
|
|
5948
5948
|
const c = o ? (
|
|
5949
5949
|
// if it is encoded, decode it
|
|
@@ -5952,7 +5952,7 @@ async function Qc(e, { gatewayUrls: t, record: n }) {
|
|
|
5952
5952
|
// if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)
|
|
5953
5953
|
s
|
|
5954
5954
|
), l = JSON.parse(c);
|
|
5955
|
-
return
|
|
5955
|
+
return Rr({ uri: Os(l), gatewayUrls: t });
|
|
5956
5956
|
}
|
|
5957
5957
|
let u = r.tokenID;
|
|
5958
5958
|
return r.namespace === "erc1155" && (u = u.replace("0x", "").padStart(64, "0")), Kc({
|
|
@@ -5977,8 +5977,8 @@ async function Fs(e, { blockNumber: t, blockTag: n, name: r, key: a, gatewayUrls
|
|
|
5977
5977
|
abi: Ps,
|
|
5978
5978
|
functionName: "resolve",
|
|
5979
5979
|
args: [
|
|
5980
|
-
|
|
5981
|
-
|
|
5980
|
+
Re(fn(r)),
|
|
5981
|
+
Oe({
|
|
5982
5982
|
abi: da,
|
|
5983
5983
|
functionName: "text",
|
|
5984
5984
|
args: [qt(r), a]
|
|
@@ -6044,7 +6044,7 @@ async function td(e, { address: t, blockNumber: n, blockTag: r, gatewayUrls: a,
|
|
|
6044
6044
|
address: o,
|
|
6045
6045
|
abi: sc,
|
|
6046
6046
|
functionName: "reverse",
|
|
6047
|
-
args: [
|
|
6047
|
+
args: [Re(fn(u))],
|
|
6048
6048
|
blockNumber: n,
|
|
6049
6049
|
blockTag: r
|
|
6050
6050
|
}, l = S(e, de, "readContract"), [d, p] = a ? await l({
|
|
@@ -6083,7 +6083,7 @@ async function nd(e, { blockNumber: t, blockTag: n, name: r, universalResolverAd
|
|
|
6083
6083
|
}
|
|
6084
6084
|
],
|
|
6085
6085
|
functionName: "findResolver",
|
|
6086
|
-
args: [
|
|
6086
|
+
args: [Re(fn(r))],
|
|
6087
6087
|
blockNumber: t,
|
|
6088
6088
|
blockTag: n
|
|
6089
6089
|
});
|
|
@@ -6103,7 +6103,7 @@ async function Ns(e, { address: t, args: n, event: r, events: a, fromBlock: s, s
|
|
|
6103
6103
|
});
|
|
6104
6104
|
let l = [];
|
|
6105
6105
|
u && (l = [
|
|
6106
|
-
u.flatMap((p) =>
|
|
6106
|
+
u.flatMap((p) => Rt({
|
|
6107
6107
|
abi: [p],
|
|
6108
6108
|
eventName: p.name,
|
|
6109
6109
|
args: n
|
|
@@ -6114,8 +6114,8 @@ async function Ns(e, { address: t, args: n, event: r, events: a, fromBlock: s, s
|
|
|
6114
6114
|
params: [
|
|
6115
6115
|
{
|
|
6116
6116
|
address: t,
|
|
6117
|
-
fromBlock: typeof s == "bigint" ?
|
|
6118
|
-
toBlock: typeof o == "bigint" ?
|
|
6117
|
+
fromBlock: typeof s == "bigint" ? R(s) : s,
|
|
6118
|
+
toBlock: typeof o == "bigint" ? R(o) : o,
|
|
6119
6119
|
...l.length ? { topics: l } : {}
|
|
6120
6120
|
}
|
|
6121
6121
|
]
|
|
@@ -6141,7 +6141,7 @@ async function Ds(e) {
|
|
|
6141
6141
|
return { id: n, request: t(n), type: "transaction" };
|
|
6142
6142
|
}
|
|
6143
6143
|
async function ad(e, { address: t, blockNumber: n, blockTag: r = "latest" }) {
|
|
6144
|
-
const a = n ?
|
|
6144
|
+
const a = n ? R(n) : void 0, s = await e.request({
|
|
6145
6145
|
method: "eth_getBalance",
|
|
6146
6146
|
params: [t, a || r]
|
|
6147
6147
|
});
|
|
@@ -6154,7 +6154,7 @@ async function sd(e) {
|
|
|
6154
6154
|
return BigInt(t);
|
|
6155
6155
|
}
|
|
6156
6156
|
async function id(e, { blockHash: t, blockNumber: n, blockTag: r = "latest" } = {}) {
|
|
6157
|
-
const a = n !== void 0 ?
|
|
6157
|
+
const a = n !== void 0 ? R(n) : void 0;
|
|
6158
6158
|
let s;
|
|
6159
6159
|
return t ? s = await e.request({
|
|
6160
6160
|
method: "eth_getBlockTransactionCountByHash",
|
|
@@ -6165,7 +6165,7 @@ async function id(e, { blockHash: t, blockNumber: n, blockTag: r = "latest" } =
|
|
|
6165
6165
|
}), Ae(s);
|
|
6166
6166
|
}
|
|
6167
6167
|
async function od(e, { address: t, blockNumber: n, blockTag: r = "latest" }) {
|
|
6168
|
-
const a = n !== void 0 ?
|
|
6168
|
+
const a = n !== void 0 ? R(n) : void 0, s = await e.request({
|
|
6169
6169
|
method: "eth_getCode",
|
|
6170
6170
|
params: [t, a || r]
|
|
6171
6171
|
});
|
|
@@ -6182,10 +6182,10 @@ function ud(e) {
|
|
|
6182
6182
|
};
|
|
6183
6183
|
}
|
|
6184
6184
|
async function cd(e, { blockCount: t, blockNumber: n, blockTag: r = "latest", rewardPercentiles: a }) {
|
|
6185
|
-
const s = n ?
|
|
6185
|
+
const s = n ? R(n) : void 0, i = await e.request({
|
|
6186
6186
|
method: "eth_feeHistory",
|
|
6187
6187
|
params: [
|
|
6188
|
-
|
|
6188
|
+
R(t),
|
|
6189
6189
|
s || r,
|
|
6190
6190
|
a
|
|
6191
6191
|
]
|
|
@@ -6210,7 +6210,7 @@ function ld(e, t) {
|
|
|
6210
6210
|
throw new Me({ address: t });
|
|
6211
6211
|
return e.toLowerCase() === t.toLowerCase();
|
|
6212
6212
|
}
|
|
6213
|
-
function
|
|
6213
|
+
function Hs(e) {
|
|
6214
6214
|
return {
|
|
6215
6215
|
formatters: void 0,
|
|
6216
6216
|
fees: void 0,
|
|
@@ -6234,28 +6234,28 @@ function fd(e) {
|
|
|
6234
6234
|
return t && s.push(md({
|
|
6235
6235
|
domain: t,
|
|
6236
6236
|
types: a
|
|
6237
|
-
})), r !== "EIP712Domain" && s.push(
|
|
6237
|
+
})), r !== "EIP712Domain" && s.push(Us({
|
|
6238
6238
|
data: n,
|
|
6239
6239
|
primaryType: r,
|
|
6240
6240
|
types: a
|
|
6241
6241
|
})), Z(he(s));
|
|
6242
6242
|
}
|
|
6243
6243
|
function md({ domain: e, types: t }) {
|
|
6244
|
-
return
|
|
6244
|
+
return Us({
|
|
6245
6245
|
data: e,
|
|
6246
6246
|
primaryType: "EIP712Domain",
|
|
6247
6247
|
types: t
|
|
6248
6248
|
});
|
|
6249
6249
|
}
|
|
6250
|
-
function
|
|
6251
|
-
const r =
|
|
6250
|
+
function Us({ data: e, primaryType: t, types: n }) {
|
|
6251
|
+
const r = Ls({
|
|
6252
6252
|
data: e,
|
|
6253
6253
|
primaryType: t,
|
|
6254
6254
|
types: n
|
|
6255
6255
|
});
|
|
6256
6256
|
return Z(r);
|
|
6257
6257
|
}
|
|
6258
|
-
function
|
|
6258
|
+
function Ls({ data: e, primaryType: t, types: n }) {
|
|
6259
6259
|
const r = [{ type: "bytes32" }], a = [bd({ primaryType: t, types: n })];
|
|
6260
6260
|
for (const s of n[t]) {
|
|
6261
6261
|
const [i, o] = zs({
|
|
@@ -6269,37 +6269,37 @@ function js({ data: e, primaryType: t, types: n }) {
|
|
|
6269
6269
|
return kt(r, a);
|
|
6270
6270
|
}
|
|
6271
6271
|
function bd({ primaryType: e, types: t }) {
|
|
6272
|
-
const n =
|
|
6272
|
+
const n = Re(hd({ primaryType: e, types: t }));
|
|
6273
6273
|
return Z(n);
|
|
6274
6274
|
}
|
|
6275
6275
|
function hd({ primaryType: e, types: t }) {
|
|
6276
6276
|
let n = "";
|
|
6277
|
-
const r =
|
|
6277
|
+
const r = js({ primaryType: e, types: t });
|
|
6278
6278
|
r.delete(e);
|
|
6279
6279
|
const a = [e, ...Array.from(r).sort()];
|
|
6280
6280
|
for (const s of a)
|
|
6281
6281
|
n += `${s}(${t[s].map(({ name: i, type: o }) => `${o} ${i}`).join(",")})`;
|
|
6282
6282
|
return n;
|
|
6283
6283
|
}
|
|
6284
|
-
function
|
|
6284
|
+
function js({ primaryType: e, types: t }, n = /* @__PURE__ */ new Set()) {
|
|
6285
6285
|
const r = e.match(/^\w*/u), a = r == null ? void 0 : r[0];
|
|
6286
6286
|
if (n.has(a) || t[a] === void 0)
|
|
6287
6287
|
return n;
|
|
6288
6288
|
n.add(a);
|
|
6289
6289
|
for (const s of t[a])
|
|
6290
|
-
|
|
6290
|
+
js({ primaryType: s.type, types: t }, n);
|
|
6291
6291
|
return n;
|
|
6292
6292
|
}
|
|
6293
6293
|
function zs({ types: e, name: t, type: n, value: r }) {
|
|
6294
6294
|
if (e[n] !== void 0)
|
|
6295
6295
|
return [
|
|
6296
6296
|
{ type: "bytes32" },
|
|
6297
|
-
Z(
|
|
6297
|
+
Z(Ls({ data: r, primaryType: n, types: e }))
|
|
6298
6298
|
];
|
|
6299
6299
|
if (n === "bytes")
|
|
6300
6300
|
return r = `0x${(r.length % 2 ? "0" : "") + r.slice(2)}`, [{ type: "bytes32" }, Z(r)];
|
|
6301
6301
|
if (n === "string")
|
|
6302
|
-
return [{ type: "bytes32" }, Z(
|
|
6302
|
+
return [{ type: "bytes32" }, Z(Re(r))];
|
|
6303
6303
|
if (n.lastIndexOf("]") === n.length - 1) {
|
|
6304
6304
|
const a = n.slice(0, n.lastIndexOf("[")), s = r.map((i) => zs({
|
|
6305
6305
|
name: t,
|
|
@@ -6334,7 +6334,7 @@ function _s(e) {
|
|
|
6334
6334
|
const { name: c, type: l } = u, d = o[c], p = l.match(yd);
|
|
6335
6335
|
if (p && (typeof d == "number" || typeof d == "bigint")) {
|
|
6336
6336
|
const [y, m, h] = p;
|
|
6337
|
-
|
|
6337
|
+
R(d, {
|
|
6338
6338
|
signed: m === "int",
|
|
6339
6339
|
size: Number.parseInt(h) / 8
|
|
6340
6340
|
});
|
|
@@ -6344,10 +6344,10 @@ function _s(e) {
|
|
|
6344
6344
|
const b = l.match(pd);
|
|
6345
6345
|
if (b) {
|
|
6346
6346
|
const [y, m] = b;
|
|
6347
|
-
if (m &&
|
|
6347
|
+
if (m && j(d) !== Number.parseInt(m))
|
|
6348
6348
|
throw new io({
|
|
6349
6349
|
expectedSize: Number.parseInt(m),
|
|
6350
|
-
givenSize:
|
|
6350
|
+
givenSize: j(d)
|
|
6351
6351
|
});
|
|
6352
6352
|
}
|
|
6353
6353
|
const f = a[l];
|
|
@@ -6412,32 +6412,32 @@ function Ed(e) {
|
|
|
6412
6412
|
};
|
|
6413
6413
|
}
|
|
6414
6414
|
async function Pd(e, { address: t, blockNumber: n, blockTag: r, storageKeys: a }) {
|
|
6415
|
-
const s = r ?? "latest", i = n !== void 0 ?
|
|
6415
|
+
const s = r ?? "latest", i = n !== void 0 ? R(n) : void 0, o = await e.request({
|
|
6416
6416
|
method: "eth_getProof",
|
|
6417
6417
|
params: [t, a, i || s]
|
|
6418
6418
|
});
|
|
6419
6419
|
return Ed(o);
|
|
6420
6420
|
}
|
|
6421
6421
|
async function Cd(e, { address: t, blockNumber: n, blockTag: r = "latest", slot: a }) {
|
|
6422
|
-
const s = n !== void 0 ?
|
|
6422
|
+
const s = n !== void 0 ? R(n) : void 0;
|
|
6423
6423
|
return await e.request({
|
|
6424
6424
|
method: "eth_getStorageAt",
|
|
6425
6425
|
params: [t, a, s || r]
|
|
6426
6426
|
});
|
|
6427
6427
|
}
|
|
6428
|
-
async function
|
|
6428
|
+
async function Or(e, { blockHash: t, blockNumber: n, blockTag: r, hash: a, index: s }) {
|
|
6429
6429
|
var l, d, p;
|
|
6430
|
-
const i = r || "latest", o = n !== void 0 ?
|
|
6430
|
+
const i = r || "latest", o = n !== void 0 ? R(n) : void 0;
|
|
6431
6431
|
let u = null;
|
|
6432
6432
|
if (a ? u = await e.request({
|
|
6433
6433
|
method: "eth_getTransactionByHash",
|
|
6434
6434
|
params: [a]
|
|
6435
6435
|
}) : t ? u = await e.request({
|
|
6436
6436
|
method: "eth_getTransactionByBlockHashAndIndex",
|
|
6437
|
-
params: [t,
|
|
6437
|
+
params: [t, R(s)]
|
|
6438
6438
|
}) : (o || i) && (u = await e.request({
|
|
6439
6439
|
method: "eth_getTransactionByBlockNumberAndIndex",
|
|
6440
|
-
params: [o || i,
|
|
6440
|
+
params: [o || i, R(s)]
|
|
6441
6441
|
})), !u)
|
|
6442
6442
|
throw new ss({
|
|
6443
6443
|
blockHash: t,
|
|
@@ -6450,8 +6450,8 @@ async function Rr(e, { blockHash: t, blockNumber: n, blockTag: r, hash: a, index
|
|
|
6450
6450
|
}
|
|
6451
6451
|
async function Ad(e, { hash: t, transactionReceipt: n }) {
|
|
6452
6452
|
const [r, a] = await Promise.all([
|
|
6453
|
-
S(e,
|
|
6454
|
-
t ? S(e,
|
|
6453
|
+
S(e, Ht, "getBlockNumber")({}),
|
|
6454
|
+
t ? S(e, Or, "getBlockNumber")({ hash: t }) : void 0
|
|
6455
6455
|
]), s = (n == null ? void 0 : n.blockNumber) || (a == null ? void 0 : a.blockNumber);
|
|
6456
6456
|
return s ? r - s + 1n : 0n;
|
|
6457
6457
|
}
|
|
@@ -6483,7 +6483,7 @@ async function Id(e, t) {
|
|
|
6483
6483
|
for (let h = 0; h < u.length; h++) {
|
|
6484
6484
|
const { abi: g, address: w, args: x, functionName: P } = u[h];
|
|
6485
6485
|
try {
|
|
6486
|
-
const T =
|
|
6486
|
+
const T = Oe({ abi: g, args: x, functionName: P });
|
|
6487
6487
|
b += (T.length - 2) / 2, // Check if batching is enabled.
|
|
6488
6488
|
c > 0 && // Check if the current size of the batch exceeds the size limit.
|
|
6489
6489
|
b > c && // Check if the current chunk is not already empty.
|
|
@@ -6539,7 +6539,7 @@ async function Id(e, t) {
|
|
|
6539
6539
|
}
|
|
6540
6540
|
const w = g.value;
|
|
6541
6541
|
for (let x = 0; x < w.length; x++) {
|
|
6542
|
-
const { returnData: P, success: T } = w[x], { callData: C } = d[h][x], { abi: E, address: M, functionName:
|
|
6542
|
+
const { returnData: P, success: T } = w[x], { callData: C } = d[h][x], { abi: E, address: M, functionName: k, args: $ } = u[y.length];
|
|
6543
6543
|
try {
|
|
6544
6544
|
if (C === "0x")
|
|
6545
6545
|
throw new Qt();
|
|
@@ -6547,18 +6547,18 @@ async function Id(e, t) {
|
|
|
6547
6547
|
throw new br({ data: P });
|
|
6548
6548
|
const N = st({
|
|
6549
6549
|
abi: E,
|
|
6550
|
-
args:
|
|
6550
|
+
args: $,
|
|
6551
6551
|
data: P,
|
|
6552
|
-
functionName:
|
|
6552
|
+
functionName: k
|
|
6553
6553
|
});
|
|
6554
6554
|
y.push(n ? { result: N, status: "success" } : N);
|
|
6555
6555
|
} catch (N) {
|
|
6556
6556
|
const F = St(N, {
|
|
6557
6557
|
abi: E,
|
|
6558
6558
|
address: M,
|
|
6559
|
-
args:
|
|
6559
|
+
args: $,
|
|
6560
6560
|
docsPath: "/docs/contract/multicall",
|
|
6561
|
-
functionName:
|
|
6561
|
+
functionName: k
|
|
6562
6562
|
});
|
|
6563
6563
|
if (!n)
|
|
6564
6564
|
throw F;
|
|
@@ -6604,7 +6604,7 @@ function tt(e) {
|
|
|
6604
6604
|
}
|
|
6605
6605
|
return n;
|
|
6606
6606
|
}
|
|
6607
|
-
function
|
|
6607
|
+
function Le(e) {
|
|
6608
6608
|
return Fr(et(e));
|
|
6609
6609
|
}
|
|
6610
6610
|
function Nr(e) {
|
|
@@ -6666,10 +6666,10 @@ function $d(e) {
|
|
|
6666
6666
|
;
|
|
6667
6667
|
return t;
|
|
6668
6668
|
}
|
|
6669
|
-
function
|
|
6669
|
+
function Rd(e, t) {
|
|
6670
6670
|
return e >> BigInt(t) & mn;
|
|
6671
6671
|
}
|
|
6672
|
-
const
|
|
6672
|
+
const Od = (e, t, n) => e | (n ? mn : Ws) << BigInt(t), Hr = (e) => (Md << BigInt(e - 1)) - mn, Sn = (e) => new Uint8Array(e), ma = (e) => Uint8Array.from(e);
|
|
6673
6673
|
function Ks(e, t, n) {
|
|
6674
6674
|
if (typeof e != "number" || e < 2)
|
|
6675
6675
|
throw new Error("hashLen must be a number");
|
|
@@ -6713,7 +6713,7 @@ const Fd = {
|
|
|
6713
6713
|
field: (e, t) => t.Fp.isValid(e),
|
|
6714
6714
|
hash: (e) => typeof e == "function" && Number.isSafeInteger(e.outputLen)
|
|
6715
6715
|
};
|
|
6716
|
-
function
|
|
6716
|
+
function Ut(e, t, n = {}) {
|
|
6717
6717
|
const r = (a, s, i) => {
|
|
6718
6718
|
const o = Fd[s];
|
|
6719
6719
|
if (typeof o != "function")
|
|
@@ -6730,12 +6730,12 @@ function Ht(e, t, n = {}) {
|
|
|
6730
6730
|
}
|
|
6731
6731
|
const Nd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6732
6732
|
__proto__: null,
|
|
6733
|
-
bitGet:
|
|
6733
|
+
bitGet: Rd,
|
|
6734
6734
|
bitLen: $d,
|
|
6735
|
-
bitMask:
|
|
6736
|
-
bitSet:
|
|
6735
|
+
bitMask: Hr,
|
|
6736
|
+
bitSet: Od,
|
|
6737
6737
|
bytesToHex: et,
|
|
6738
|
-
bytesToNumberBE:
|
|
6738
|
+
bytesToNumberBE: Le,
|
|
6739
6739
|
bytesToNumberLE: Nr,
|
|
6740
6740
|
concatBytes: Bt,
|
|
6741
6741
|
createHmacDrbg: Ks,
|
|
@@ -6748,28 +6748,28 @@ const Nd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6748
6748
|
numberToHexUnpadded: Vs,
|
|
6749
6749
|
numberToVarBytesBE: Bd,
|
|
6750
6750
|
utf8ToBytes: kd,
|
|
6751
|
-
validateObject:
|
|
6751
|
+
validateObject: Ut
|
|
6752
6752
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6753
6753
|
function Dd(e, t) {
|
|
6754
6754
|
const n = ce(e) ? Ie(e) : e, r = ce(t) ? Ie(t) : t;
|
|
6755
6755
|
return Zs(n, r);
|
|
6756
6756
|
}
|
|
6757
6757
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
6758
|
-
const _ = BigInt(0),
|
|
6758
|
+
const _ = BigInt(0), U = BigInt(1), De = BigInt(2), Hd = BigInt(3), Xn = BigInt(4), ba = BigInt(5), ha = BigInt(8);
|
|
6759
6759
|
BigInt(9);
|
|
6760
6760
|
BigInt(16);
|
|
6761
6761
|
function V(e, t) {
|
|
6762
6762
|
const n = e % t;
|
|
6763
6763
|
return n >= _ ? n : t + n;
|
|
6764
6764
|
}
|
|
6765
|
-
function
|
|
6765
|
+
function Ud(e, t, n) {
|
|
6766
6766
|
if (n <= _ || t < _)
|
|
6767
6767
|
throw new Error("Expected power/modulo > 0");
|
|
6768
|
-
if (n ===
|
|
6768
|
+
if (n === U)
|
|
6769
6769
|
return _;
|
|
6770
|
-
let r =
|
|
6770
|
+
let r = U;
|
|
6771
6771
|
for (; t > _; )
|
|
6772
|
-
t &
|
|
6772
|
+
t & U && (r = r * e % n), e = e * e % n, t >>= U;
|
|
6773
6773
|
return r;
|
|
6774
6774
|
}
|
|
6775
6775
|
function Q(e, t, n) {
|
|
@@ -6781,24 +6781,24 @@ function Q(e, t, n) {
|
|
|
6781
6781
|
function Qn(e, t) {
|
|
6782
6782
|
if (e === _ || t <= _)
|
|
6783
6783
|
throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);
|
|
6784
|
-
let n = V(e, t), r = t, a = _, s =
|
|
6784
|
+
let n = V(e, t), r = t, a = _, s = U;
|
|
6785
6785
|
for (; n !== _; ) {
|
|
6786
6786
|
const o = r / n, u = r % n, c = a - s * o;
|
|
6787
6787
|
r = n, n = u, a = s, s = c;
|
|
6788
6788
|
}
|
|
6789
|
-
if (r !==
|
|
6789
|
+
if (r !== U)
|
|
6790
6790
|
throw new Error("invert: does not exist");
|
|
6791
6791
|
return V(a, t);
|
|
6792
6792
|
}
|
|
6793
|
-
function
|
|
6794
|
-
const t = (e -
|
|
6793
|
+
function Ld(e) {
|
|
6794
|
+
const t = (e - U) / De;
|
|
6795
6795
|
let n, r, a;
|
|
6796
|
-
for (n = e -
|
|
6796
|
+
for (n = e - U, r = 0; n % De === _; n /= De, r++)
|
|
6797
6797
|
;
|
|
6798
|
-
for (a = De; a < e &&
|
|
6798
|
+
for (a = De; a < e && Ud(a, t, e) !== e - U; a++)
|
|
6799
6799
|
;
|
|
6800
6800
|
if (r === 1) {
|
|
6801
|
-
const i = (e +
|
|
6801
|
+
const i = (e + U) / Xn;
|
|
6802
6802
|
return function(u, c) {
|
|
6803
6803
|
const l = u.pow(c, i);
|
|
6804
6804
|
if (!u.eql(u.sqr(l), c))
|
|
@@ -6806,7 +6806,7 @@ function jd(e) {
|
|
|
6806
6806
|
return l;
|
|
6807
6807
|
};
|
|
6808
6808
|
}
|
|
6809
|
-
const s = (n +
|
|
6809
|
+
const s = (n + U) / De;
|
|
6810
6810
|
return function(o, u) {
|
|
6811
6811
|
if (o.pow(u, t) === o.neg(o.ONE))
|
|
6812
6812
|
throw new Error("Cannot find square root");
|
|
@@ -6817,15 +6817,15 @@ function jd(e) {
|
|
|
6817
6817
|
let b = 1;
|
|
6818
6818
|
for (let y = o.sqr(p); b < c && !o.eql(y, o.ONE); b++)
|
|
6819
6819
|
y = o.sqr(y);
|
|
6820
|
-
const f = o.pow(l,
|
|
6820
|
+
const f = o.pow(l, U << BigInt(c - b - 1));
|
|
6821
6821
|
l = o.sqr(f), d = o.mul(d, f), p = o.mul(p, l), c = b;
|
|
6822
6822
|
}
|
|
6823
6823
|
return d;
|
|
6824
6824
|
};
|
|
6825
6825
|
}
|
|
6826
|
-
function
|
|
6827
|
-
if (e % Xn ===
|
|
6828
|
-
const t = (e +
|
|
6826
|
+
function jd(e) {
|
|
6827
|
+
if (e % Xn === Hd) {
|
|
6828
|
+
const t = (e + U) / Xn;
|
|
6829
6829
|
return function(r, a) {
|
|
6830
6830
|
const s = r.pow(a, t);
|
|
6831
6831
|
if (!r.eql(r.sqr(s), a))
|
|
@@ -6842,7 +6842,7 @@ function Ld(e) {
|
|
|
6842
6842
|
return c;
|
|
6843
6843
|
};
|
|
6844
6844
|
}
|
|
6845
|
-
return
|
|
6845
|
+
return Ld(e);
|
|
6846
6846
|
}
|
|
6847
6847
|
const zd = [
|
|
6848
6848
|
"create",
|
|
@@ -6870,18 +6870,18 @@ function _d(e) {
|
|
|
6870
6870
|
BYTES: "isSafeInteger",
|
|
6871
6871
|
BITS: "isSafeInteger"
|
|
6872
6872
|
}, n = zd.reduce((r, a) => (r[a] = "function", r), t);
|
|
6873
|
-
return
|
|
6873
|
+
return Ut(e, n);
|
|
6874
6874
|
}
|
|
6875
6875
|
function qd(e, t, n) {
|
|
6876
6876
|
if (n < _)
|
|
6877
6877
|
throw new Error("Expected power > 0");
|
|
6878
6878
|
if (n === _)
|
|
6879
6879
|
return e.ONE;
|
|
6880
|
-
if (n ===
|
|
6880
|
+
if (n === U)
|
|
6881
6881
|
return t;
|
|
6882
6882
|
let r = e.ONE, a = t;
|
|
6883
6883
|
for (; n > _; )
|
|
6884
|
-
n &
|
|
6884
|
+
n & U && (r = e.mul(r, a)), a = e.sqr(a), n >>= U;
|
|
6885
6885
|
return r;
|
|
6886
6886
|
}
|
|
6887
6887
|
function Gd(e, t) {
|
|
@@ -6898,13 +6898,13 @@ function Wd(e, t, n = !1, r = {}) {
|
|
|
6898
6898
|
const { nBitLength: a, nByteLength: s } = Ys(e, t);
|
|
6899
6899
|
if (s > 2048)
|
|
6900
6900
|
throw new Error("Field lengths over 2048 bytes are not supported");
|
|
6901
|
-
const i =
|
|
6901
|
+
const i = jd(e), o = Object.freeze({
|
|
6902
6902
|
ORDER: e,
|
|
6903
6903
|
BITS: a,
|
|
6904
6904
|
BYTES: s,
|
|
6905
|
-
MASK:
|
|
6905
|
+
MASK: Hr(a),
|
|
6906
6906
|
ZERO: _,
|
|
6907
|
-
ONE:
|
|
6907
|
+
ONE: U,
|
|
6908
6908
|
create: (u) => V(u, e),
|
|
6909
6909
|
isValid: (u) => {
|
|
6910
6910
|
if (typeof u != "bigint")
|
|
@@ -6912,7 +6912,7 @@ function Wd(e, t, n = !1, r = {}) {
|
|
|
6912
6912
|
return _ <= u && u < e;
|
|
6913
6913
|
},
|
|
6914
6914
|
is0: (u) => u === _,
|
|
6915
|
-
isOdd: (u) => (u &
|
|
6915
|
+
isOdd: (u) => (u & U) === U,
|
|
6916
6916
|
neg: (u) => V(-u, e),
|
|
6917
6917
|
eql: (u, c) => u === c,
|
|
6918
6918
|
sqr: (u) => V(u * u, e),
|
|
@@ -6936,7 +6936,7 @@ function Wd(e, t, n = !1, r = {}) {
|
|
|
6936
6936
|
fromBytes: (u) => {
|
|
6937
6937
|
if (u.length !== s)
|
|
6938
6938
|
throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);
|
|
6939
|
-
return n ? Nr(u) :
|
|
6939
|
+
return n ? Nr(u) : Le(u);
|
|
6940
6940
|
}
|
|
6941
6941
|
});
|
|
6942
6942
|
return Object.freeze(o);
|
|
@@ -6955,7 +6955,7 @@ function Vd(e, t, n = !1) {
|
|
|
6955
6955
|
const r = e.length, a = Js(t), s = Xs(t);
|
|
6956
6956
|
if (r < 16 || r < s || r > 1024)
|
|
6957
6957
|
throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);
|
|
6958
|
-
const i = n ?
|
|
6958
|
+
const i = n ? Le(e) : Nr(e), o = V(i, t - U) + U;
|
|
6959
6959
|
return n ? Dr(o, a) : nt(o, a);
|
|
6960
6960
|
}
|
|
6961
6961
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -7026,7 +7026,7 @@ function Kd(e, t) {
|
|
|
7026
7026
|
};
|
|
7027
7027
|
}
|
|
7028
7028
|
function Qs(e) {
|
|
7029
|
-
return _d(e.Fp),
|
|
7029
|
+
return _d(e.Fp), Ut(e, {
|
|
7030
7030
|
n: "bigint",
|
|
7031
7031
|
h: "bigint",
|
|
7032
7032
|
Gx: "field",
|
|
@@ -7043,7 +7043,7 @@ function Qs(e) {
|
|
|
7043
7043
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7044
7044
|
function Yd(e) {
|
|
7045
7045
|
const t = Qs(e);
|
|
7046
|
-
|
|
7046
|
+
Ut(t, {
|
|
7047
7047
|
a: "field",
|
|
7048
7048
|
b: "field"
|
|
7049
7049
|
}, {
|
|
@@ -7064,7 +7064,7 @@ function Yd(e) {
|
|
|
7064
7064
|
}
|
|
7065
7065
|
return Object.freeze({ ...t });
|
|
7066
7066
|
}
|
|
7067
|
-
const { bytesToNumberBE: Jd, hexToBytes: Xd } = Nd,
|
|
7067
|
+
const { bytesToNumberBE: Jd, hexToBytes: Xd } = Nd, He = {
|
|
7068
7068
|
// asn.1 DER encoding utils
|
|
7069
7069
|
Err: class extends Error {
|
|
7070
7070
|
constructor(t = "") {
|
|
@@ -7072,7 +7072,7 @@ const { bytesToNumberBE: Jd, hexToBytes: Xd } = Nd, Ue = {
|
|
|
7072
7072
|
}
|
|
7073
7073
|
},
|
|
7074
7074
|
_parseInt(e) {
|
|
7075
|
-
const { Err: t } =
|
|
7075
|
+
const { Err: t } = He;
|
|
7076
7076
|
if (e.length < 2 || e[0] !== 2)
|
|
7077
7077
|
throw new t("Invalid signature integer tag");
|
|
7078
7078
|
const n = e[1], r = e.subarray(2, n + 2);
|
|
@@ -7085,7 +7085,7 @@ const { bytesToNumberBE: Jd, hexToBytes: Xd } = Nd, Ue = {
|
|
|
7085
7085
|
return { d: Jd(r), l: e.subarray(n + 2) };
|
|
7086
7086
|
},
|
|
7087
7087
|
toSig(e) {
|
|
7088
|
-
const { Err: t } =
|
|
7088
|
+
const { Err: t } = He, n = typeof e == "string" ? Xd(e) : e;
|
|
7089
7089
|
if (!(n instanceof Uint8Array))
|
|
7090
7090
|
throw new Error("ui8a expected");
|
|
7091
7091
|
let r = n.length;
|
|
@@ -7093,7 +7093,7 @@ const { bytesToNumberBE: Jd, hexToBytes: Xd } = Nd, Ue = {
|
|
|
7093
7093
|
throw new t("Invalid signature tag");
|
|
7094
7094
|
if (n[1] !== r - 2)
|
|
7095
7095
|
throw new t("Invalid signature: incorrect length");
|
|
7096
|
-
const { d: a, l: s } =
|
|
7096
|
+
const { d: a, l: s } = He._parseInt(n.subarray(2)), { d: i, l: o } = He._parseInt(s);
|
|
7097
7097
|
if (o.length)
|
|
7098
7098
|
throw new t("Invalid signature: left bytes after parsing");
|
|
7099
7099
|
return { r: a, s: i };
|
|
@@ -7139,7 +7139,7 @@ function Qd(e) {
|
|
|
7139
7139
|
}
|
|
7140
7140
|
let w;
|
|
7141
7141
|
try {
|
|
7142
|
-
w = typeof f == "bigint" ? f :
|
|
7142
|
+
w = typeof f == "bigint" ? f : Le(se("private key", f, m));
|
|
7143
7143
|
} catch {
|
|
7144
7144
|
throw new Error(`private key must be ${m} bytes, hex or bigint, not ${typeof f}`);
|
|
7145
7145
|
}
|
|
@@ -7244,8 +7244,8 @@ function Qd(e) {
|
|
|
7244
7244
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
7245
7245
|
double() {
|
|
7246
7246
|
const { a: y, b: m } = t, h = n.mul(m, ga), { px: g, py: w, pz: x } = this;
|
|
7247
|
-
let P = n.ZERO, T = n.ZERO, C = n.ZERO, E = n.mul(g, g), M = n.mul(w, w),
|
|
7248
|
-
return
|
|
7247
|
+
let P = n.ZERO, T = n.ZERO, C = n.ZERO, E = n.mul(g, g), M = n.mul(w, w), k = n.mul(x, x), $ = n.mul(g, w);
|
|
7248
|
+
return $ = n.add($, $), C = n.mul(g, x), C = n.add(C, C), P = n.mul(y, C), T = n.mul(h, k), T = n.add(P, T), P = n.sub(M, T), T = n.add(M, T), T = n.mul(P, T), P = n.mul($, P), C = n.mul(h, C), k = n.mul(y, k), $ = n.sub(E, k), $ = n.mul(y, $), $ = n.add($, C), C = n.add(E, E), E = n.add(C, E), E = n.add(E, k), E = n.mul(E, $), T = n.add(T, E), k = n.mul(w, x), k = n.add(k, k), E = n.mul(k, $), P = n.sub(P, E), C = n.mul(k, M), C = n.add(C, C), C = n.add(C, C), new d(P, T, C);
|
|
7249
7249
|
}
|
|
7250
7250
|
// Renes-Costello-Batina exception-free addition formula.
|
|
7251
7251
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -7255,11 +7255,11 @@ function Qd(e) {
|
|
|
7255
7255
|
l(y);
|
|
7256
7256
|
const { px: m, py: h, pz: g } = this, { px: w, py: x, pz: P } = y;
|
|
7257
7257
|
let T = n.ZERO, C = n.ZERO, E = n.ZERO;
|
|
7258
|
-
const M = t.a,
|
|
7259
|
-
let
|
|
7260
|
-
G = n.mul(G, A), A = n.add(
|
|
7258
|
+
const M = t.a, k = n.mul(t.b, ga);
|
|
7259
|
+
let $ = n.mul(m, w), N = n.mul(h, x), F = n.mul(g, P), G = n.add(m, h), A = n.add(w, x);
|
|
7260
|
+
G = n.mul(G, A), A = n.add($, N), G = n.sub(G, A), A = n.add(m, g);
|
|
7261
7261
|
let I = n.add(w, P);
|
|
7262
|
-
return A = n.mul(A, I), I = n.add(
|
|
7262
|
+
return A = n.mul(A, I), I = n.add($, F), A = n.sub(A, I), I = n.add(h, g), T = n.add(x, P), I = n.mul(I, T), T = n.add(N, F), I = n.sub(I, T), E = n.mul(M, A), T = n.mul(k, F), E = n.add(T, E), T = n.sub(N, E), E = n.add(N, E), C = n.mul(T, E), N = n.add($, $), N = n.add(N, $), F = n.mul(M, F), A = n.mul(k, A), N = n.add(N, F), F = n.sub($, F), F = n.mul(M, F), A = n.add(A, F), $ = n.mul(N, A), C = n.add(C, $), $ = n.mul(I, A), T = n.mul(G, T), T = n.sub(T, $), $ = n.mul(G, N), E = n.mul(I, E), E = n.add(E, $), new d(T, C, E);
|
|
7263
7263
|
}
|
|
7264
7264
|
subtract(y) {
|
|
7265
7265
|
return this.add(y.negate());
|
|
@@ -7307,8 +7307,8 @@ function Qd(e) {
|
|
|
7307
7307
|
const { endo: w } = t;
|
|
7308
7308
|
if (w) {
|
|
7309
7309
|
const { k1neg: x, k1: P, k2neg: T, k2: C } = w.splitScalar(m);
|
|
7310
|
-
let { p: E, f: M } = this.wNAF(P), { p:
|
|
7311
|
-
E = b.constTimeNegate(x, E),
|
|
7310
|
+
let { p: E, f: M } = this.wNAF(P), { p: k, f: $ } = this.wNAF(C);
|
|
7311
|
+
E = b.constTimeNegate(x, E), k = b.constTimeNegate(T, k), k = new d(n.mul(k.px, w.beta), k.py, k.pz), h = E.add(k), g = M.add($);
|
|
7312
7312
|
} else {
|
|
7313
7313
|
const { p: x, f: P } = this.wNAF(m);
|
|
7314
7314
|
h = x, g = P;
|
|
@@ -7369,7 +7369,7 @@ function Qd(e) {
|
|
|
7369
7369
|
}
|
|
7370
7370
|
function el(e) {
|
|
7371
7371
|
const t = Qs(e);
|
|
7372
|
-
return
|
|
7372
|
+
return Ut(t, {
|
|
7373
7373
|
hash: "hash",
|
|
7374
7374
|
hmac: "function",
|
|
7375
7375
|
randomBytes: "function"
|
|
@@ -7392,22 +7392,22 @@ function tl(e) {
|
|
|
7392
7392
|
}
|
|
7393
7393
|
const { ProjectivePoint: c, normPrivateKeyToScalar: l, weierstrassEquation: d, isWithinCurveOrder: p } = Qd({
|
|
7394
7394
|
...t,
|
|
7395
|
-
toBytes(A, I,
|
|
7396
|
-
const
|
|
7397
|
-
return
|
|
7395
|
+
toBytes(A, I, O) {
|
|
7396
|
+
const H = I.toAffine(), D = n.toBytes(H.x), z = Bt;
|
|
7397
|
+
return O ? z(Uint8Array.from([I.hasEvenY() ? 2 : 3]), D) : z(Uint8Array.from([4]), D, n.toBytes(H.y));
|
|
7398
7398
|
},
|
|
7399
7399
|
fromBytes(A) {
|
|
7400
|
-
const I = A.length,
|
|
7401
|
-
if (I === a && (
|
|
7402
|
-
const D =
|
|
7400
|
+
const I = A.length, O = A[0], H = A.subarray(1);
|
|
7401
|
+
if (I === a && (O === 2 || O === 3)) {
|
|
7402
|
+
const D = Le(H);
|
|
7403
7403
|
if (!i(D))
|
|
7404
7404
|
throw new Error("Point is not on curve");
|
|
7405
7405
|
const z = d(D);
|
|
7406
7406
|
let J = n.sqrt(z);
|
|
7407
7407
|
const X = (J & ee) === ee;
|
|
7408
|
-
return (
|
|
7409
|
-
} else if (I === s &&
|
|
7410
|
-
const D = n.fromBytes(
|
|
7408
|
+
return (O & 1) === 1 !== X && (J = n.neg(J)), { x: D, y: J };
|
|
7409
|
+
} else if (I === s && O === 4) {
|
|
7410
|
+
const D = n.fromBytes(H.subarray(0, n.BYTES)), z = n.fromBytes(H.subarray(n.BYTES, 2 * n.BYTES));
|
|
7411
7411
|
return { x: D, y: z };
|
|
7412
7412
|
} else
|
|
7413
7413
|
throw new Error(`Point of length ${I} was invalid. Expected ${a} compressed bytes or ${s} uncompressed bytes`);
|
|
@@ -7420,21 +7420,21 @@ function tl(e) {
|
|
|
7420
7420
|
function y(A) {
|
|
7421
7421
|
return f(A) ? o(-A) : A;
|
|
7422
7422
|
}
|
|
7423
|
-
const m = (A, I,
|
|
7423
|
+
const m = (A, I, O) => Le(A.slice(I, O));
|
|
7424
7424
|
class h {
|
|
7425
|
-
constructor(I,
|
|
7426
|
-
this.r = I, this.s =
|
|
7425
|
+
constructor(I, O, H) {
|
|
7426
|
+
this.r = I, this.s = O, this.recovery = H, this.assertValidity();
|
|
7427
7427
|
}
|
|
7428
7428
|
// pair (bytes of r, bytes of s)
|
|
7429
7429
|
static fromCompact(I) {
|
|
7430
|
-
const
|
|
7431
|
-
return I = se("compactSignature", I,
|
|
7430
|
+
const O = t.nByteLength;
|
|
7431
|
+
return I = se("compactSignature", I, O * 2), new h(m(I, 0, O), m(I, O, 2 * O));
|
|
7432
7432
|
}
|
|
7433
7433
|
// DER encoded ECDSA signature
|
|
7434
7434
|
// https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
|
|
7435
7435
|
static fromDER(I) {
|
|
7436
|
-
const { r:
|
|
7437
|
-
return new h(
|
|
7436
|
+
const { r: O, s: H } = He.toSig(se("DER", I));
|
|
7437
|
+
return new h(O, H);
|
|
7438
7438
|
}
|
|
7439
7439
|
assertValidity() {
|
|
7440
7440
|
if (!p(this.r))
|
|
@@ -7446,13 +7446,13 @@ function tl(e) {
|
|
|
7446
7446
|
return new h(this.r, this.s, I);
|
|
7447
7447
|
}
|
|
7448
7448
|
recoverPublicKey(I) {
|
|
7449
|
-
const { r:
|
|
7449
|
+
const { r: O, s: H, recovery: D } = this, z = C(se("msgHash", I));
|
|
7450
7450
|
if (D == null || ![0, 1, 2, 3].includes(D))
|
|
7451
7451
|
throw new Error("recovery id invalid");
|
|
7452
|
-
const J = D === 2 || D === 3 ?
|
|
7452
|
+
const J = D === 2 || D === 3 ? O + t.n : O;
|
|
7453
7453
|
if (J >= n.ORDER)
|
|
7454
7454
|
throw new Error("recovery id 2 or 3 invalid");
|
|
7455
|
-
const X = D & 1 ? "03" : "02", we = c.fromHex(X + b(J)), Te = u(J), qe = o(-z * Te), ut = o(
|
|
7455
|
+
const X = D & 1 ? "03" : "02", we = c.fromHex(X + b(J)), Te = u(J), qe = o(-z * Te), ut = o(H * Te), ve = c.BASE.multiplyAndAddUnsafe(we, qe, ut);
|
|
7456
7456
|
if (!ve)
|
|
7457
7457
|
throw new Error("point at infinify");
|
|
7458
7458
|
return ve.assertValidity(), ve;
|
|
@@ -7469,7 +7469,7 @@ function tl(e) {
|
|
|
7469
7469
|
return tt(this.toDERHex());
|
|
7470
7470
|
}
|
|
7471
7471
|
toDERHex() {
|
|
7472
|
-
return
|
|
7472
|
+
return He.hexFromSig({ r: this.r, s: this.s });
|
|
7473
7473
|
}
|
|
7474
7474
|
// padded bytes of r, then padded bytes of s
|
|
7475
7475
|
toCompactRawBytes() {
|
|
@@ -7512,22 +7512,22 @@ function tl(e) {
|
|
|
7512
7512
|
return c.fromPrivateKey(A).toRawBytes(I);
|
|
7513
7513
|
}
|
|
7514
7514
|
function x(A) {
|
|
7515
|
-
const I = A instanceof Uint8Array,
|
|
7516
|
-
return I ?
|
|
7515
|
+
const I = A instanceof Uint8Array, O = typeof A == "string", H = (I || O) && A.length;
|
|
7516
|
+
return I ? H === a || H === s : O ? H === 2 * a || H === 2 * s : A instanceof c;
|
|
7517
7517
|
}
|
|
7518
|
-
function P(A, I,
|
|
7518
|
+
function P(A, I, O = !0) {
|
|
7519
7519
|
if (x(A))
|
|
7520
7520
|
throw new Error("first arg must be private key");
|
|
7521
7521
|
if (!x(I))
|
|
7522
7522
|
throw new Error("second arg must be public key");
|
|
7523
|
-
return c.fromHex(I).multiply(l(A)).toRawBytes(
|
|
7523
|
+
return c.fromHex(I).multiply(l(A)).toRawBytes(O);
|
|
7524
7524
|
}
|
|
7525
7525
|
const T = t.bits2int || function(A) {
|
|
7526
|
-
const I =
|
|
7527
|
-
return
|
|
7526
|
+
const I = Le(A), O = A.length * 8 - t.nBitLength;
|
|
7527
|
+
return O > 0 ? I >> BigInt(O) : I;
|
|
7528
7528
|
}, C = t.bits2int_modN || function(A) {
|
|
7529
7529
|
return o(T(A));
|
|
7530
|
-
}, E =
|
|
7530
|
+
}, E = Hr(t.nBitLength);
|
|
7531
7531
|
function M(A) {
|
|
7532
7532
|
if (typeof A != "bigint")
|
|
7533
7533
|
throw new Error("bigint expected");
|
|
@@ -7535,12 +7535,12 @@ function tl(e) {
|
|
|
7535
7535
|
throw new Error(`bigint expected < 2^${t.nBitLength}`);
|
|
7536
7536
|
return nt(A, t.nByteLength);
|
|
7537
7537
|
}
|
|
7538
|
-
function
|
|
7539
|
-
if (["recovered", "canonical"].some((Fe) => Fe in
|
|
7538
|
+
function k(A, I, O = $) {
|
|
7539
|
+
if (["recovered", "canonical"].some((Fe) => Fe in O))
|
|
7540
7540
|
throw new Error("sign() legacy options not supported");
|
|
7541
|
-
const { hash:
|
|
7542
|
-
let { lowS: z, prehash: J, extraEntropy: X } =
|
|
7543
|
-
z == null && (z = !0), A = se("msgHash", A), J && (A = se("prehashed msgHash",
|
|
7541
|
+
const { hash: H, randomBytes: D } = t;
|
|
7542
|
+
let { lowS: z, prehash: J, extraEntropy: X } = O;
|
|
7543
|
+
z == null && (z = !0), A = se("msgHash", A), J && (A = se("prehashed msgHash", H(A)));
|
|
7544
7544
|
const we = C(A), Te = l(I), qe = [M(Te), M(we)];
|
|
7545
7545
|
if (X != null) {
|
|
7546
7546
|
const Fe = X === !0 ? D(n.BYTES) : X;
|
|
@@ -7551,10 +7551,10 @@ function tl(e) {
|
|
|
7551
7551
|
const Ge = T(Fe);
|
|
7552
7552
|
if (!p(Ge))
|
|
7553
7553
|
return;
|
|
7554
|
-
const
|
|
7554
|
+
const jr = u(Ge), We = c.BASE.multiply(Ge).toAffine(), ae = o(We.x);
|
|
7555
7555
|
if (ae === ye)
|
|
7556
7556
|
return;
|
|
7557
|
-
const Ve = o(
|
|
7557
|
+
const Ve = o(jr * o(ve + ae * Te));
|
|
7558
7558
|
if (Ve === ye)
|
|
7559
7559
|
return;
|
|
7560
7560
|
let zr = (We.x === ae ? 0 : 2) | Number(We.y & ee), _r = Ve;
|
|
@@ -7562,25 +7562,25 @@ function tl(e) {
|
|
|
7562
7562
|
}
|
|
7563
7563
|
return { seed: ut, k2sig: gn };
|
|
7564
7564
|
}
|
|
7565
|
-
const
|
|
7566
|
-
function F(A, I,
|
|
7567
|
-
const { seed:
|
|
7568
|
-
return Ks(z.hash.outputLen, z.nByteLength, z.hmac)(
|
|
7565
|
+
const $ = { lowS: t.lowS, prehash: !1 }, N = { lowS: t.lowS, prehash: !1 };
|
|
7566
|
+
function F(A, I, O = $) {
|
|
7567
|
+
const { seed: H, k2sig: D } = k(A, I, O), z = t;
|
|
7568
|
+
return Ks(z.hash.outputLen, z.nByteLength, z.hmac)(H, D);
|
|
7569
7569
|
}
|
|
7570
7570
|
c.BASE._setWindowSize(8);
|
|
7571
|
-
function G(A, I,
|
|
7571
|
+
function G(A, I, O, H = N) {
|
|
7572
7572
|
var We;
|
|
7573
7573
|
const D = A;
|
|
7574
|
-
if (I = se("msgHash", I),
|
|
7574
|
+
if (I = se("msgHash", I), O = se("publicKey", O), "strict" in H)
|
|
7575
7575
|
throw new Error("options.strict was renamed to lowS");
|
|
7576
|
-
const { lowS: z, prehash: J } =
|
|
7576
|
+
const { lowS: z, prehash: J } = H;
|
|
7577
7577
|
let X, we;
|
|
7578
7578
|
try {
|
|
7579
7579
|
if (typeof D == "string" || D instanceof Uint8Array)
|
|
7580
7580
|
try {
|
|
7581
7581
|
X = h.fromDER(D);
|
|
7582
7582
|
} catch (ae) {
|
|
7583
|
-
if (!(ae instanceof
|
|
7583
|
+
if (!(ae instanceof He.Err))
|
|
7584
7584
|
throw ae;
|
|
7585
7585
|
X = h.fromCompact(D);
|
|
7586
7586
|
}
|
|
@@ -7589,7 +7589,7 @@ function tl(e) {
|
|
|
7589
7589
|
X = new h(ae, Ve);
|
|
7590
7590
|
} else
|
|
7591
7591
|
throw new Error("PARSE");
|
|
7592
|
-
we = c.fromHex(
|
|
7592
|
+
we = c.fromHex(O);
|
|
7593
7593
|
} catch (ae) {
|
|
7594
7594
|
if (ae.message === "PARSE")
|
|
7595
7595
|
throw new Error("signature must be Signature instance, Uint8Array or hex string");
|
|
@@ -7654,7 +7654,7 @@ function nl(e) {
|
|
|
7654
7654
|
return {
|
|
7655
7655
|
hash: e,
|
|
7656
7656
|
hmac: (t, ...n) => ti(e, t, $o(...n)),
|
|
7657
|
-
randomBytes:
|
|
7657
|
+
randomBytes: Ro
|
|
7658
7658
|
};
|
|
7659
7659
|
}
|
|
7660
7660
|
function rl(e, t) {
|
|
@@ -7669,7 +7669,7 @@ function sl(e) {
|
|
|
7669
7669
|
throw new Error("Cannot find square root");
|
|
7670
7670
|
return T;
|
|
7671
7671
|
}
|
|
7672
|
-
const tr = Wd(ni, void 0, void 0, { sqrt: sl }),
|
|
7672
|
+
const tr = Wd(ni, void 0, void 0, { sqrt: sl }), Ur = rl({
|
|
7673
7673
|
a: BigInt(0),
|
|
7674
7674
|
b: BigInt(7),
|
|
7675
7675
|
Fp: tr,
|
|
@@ -7698,7 +7698,7 @@ const tr = Wd(ni, void 0, void 0, { sqrt: sl }), Hr = rl({
|
|
|
7698
7698
|
}
|
|
7699
7699
|
}, gs);
|
|
7700
7700
|
BigInt(0);
|
|
7701
|
-
|
|
7701
|
+
Ur.ProjectivePoint;
|
|
7702
7702
|
function il({ r: e, s: t, v: n, yParity: r }) {
|
|
7703
7703
|
const a = (() => {
|
|
7704
7704
|
if (r === 0 || r === 1)
|
|
@@ -7707,9 +7707,9 @@ function il({ r: e, s: t, v: n, yParity: r }) {
|
|
|
7707
7707
|
return n % 2n === 0n ? 1 : 0;
|
|
7708
7708
|
throw new Error("Invalid `v` or `yParity` value");
|
|
7709
7709
|
})();
|
|
7710
|
-
return `0x${new
|
|
7710
|
+
return `0x${new Ur.Signature(Ye(e), Ye(t)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
|
|
7711
7711
|
}
|
|
7712
|
-
async function
|
|
7712
|
+
async function Lr(e, { address: t, hash: n, signature: r, ...a }) {
|
|
7713
7713
|
const s = ce(r) ? r : typeof r == "object" && "r" in r && "s" in r ? il(r) : q(r);
|
|
7714
7714
|
try {
|
|
7715
7715
|
const { data: i } = await S(e, dn, "call")({
|
|
@@ -7729,7 +7729,7 @@ async function jr(e, { address: t, hash: n, signature: r, ...a }) {
|
|
|
7729
7729
|
}
|
|
7730
7730
|
async function ol(e, { address: t, message: n, signature: r, ...a }) {
|
|
7731
7731
|
const s = Gs(n);
|
|
7732
|
-
return
|
|
7732
|
+
return Lr(e, {
|
|
7733
7733
|
address: t,
|
|
7734
7734
|
hash: s,
|
|
7735
7735
|
signature: r,
|
|
@@ -7738,7 +7738,7 @@ async function ol(e, { address: t, message: n, signature: r, ...a }) {
|
|
|
7738
7738
|
}
|
|
7739
7739
|
async function ul(e, t) {
|
|
7740
7740
|
const { address: n, signature: r, message: a, primaryType: s, types: i, domain: o, ...u } = t, c = fd({ message: a, primaryType: s, types: i, domain: o });
|
|
7741
|
-
return
|
|
7741
|
+
return Lr(e, {
|
|
7742
7742
|
address: n,
|
|
7743
7743
|
hash: c,
|
|
7744
7744
|
signature: r,
|
|
@@ -7759,7 +7759,7 @@ function ri(e, { emitOnBegin: t = !1, emitMissed: n = !1, onBlockNumber: r, onEr
|
|
|
7759
7759
|
return ke(d, { onBlockNumber: r, onError: a }, (p) => Dt(async () => {
|
|
7760
7760
|
var b;
|
|
7761
7761
|
try {
|
|
7762
|
-
const f = await S(e,
|
|
7762
|
+
const f = await S(e, Ht, "getBlockNumber")({ cacheTime: 0 });
|
|
7763
7763
|
if (u) {
|
|
7764
7764
|
if (f === u)
|
|
7765
7765
|
return;
|
|
@@ -7849,7 +7849,7 @@ async function cl(e, {
|
|
|
7849
7849
|
return;
|
|
7850
7850
|
}
|
|
7851
7851
|
if (l || (b = !0, await Kn(async () => {
|
|
7852
|
-
l = await S(e,
|
|
7852
|
+
l = await S(e, Or, "getTransaction")({ hash: n }), l.blockNumber && (P = l.blockNumber);
|
|
7853
7853
|
}, {
|
|
7854
7854
|
delay: i,
|
|
7855
7855
|
retryCount: s
|
|
@@ -7870,18 +7870,18 @@ async function cl(e, {
|
|
|
7870
7870
|
}), {
|
|
7871
7871
|
delay: i,
|
|
7872
7872
|
retryCount: s,
|
|
7873
|
-
shouldRetry: ({ error:
|
|
7873
|
+
shouldRetry: ({ error: k }) => k instanceof ds
|
|
7874
7874
|
});
|
|
7875
7875
|
b = !1;
|
|
7876
|
-
const E = C.transactions.find(({ from:
|
|
7876
|
+
const E = C.transactions.find(({ from: k, nonce: $ }) => k === d.from && $ === d.nonce);
|
|
7877
7877
|
if (!E || (p = await S(e, Jn, "getTransactionReceipt")({
|
|
7878
7878
|
hash: E.hash
|
|
7879
7879
|
}), t > 1 && (!p.blockNumber || P - p.blockNumber + 1n < t)))
|
|
7880
7880
|
return;
|
|
7881
7881
|
let M = "replaced";
|
|
7882
7882
|
E.to === d.to && E.value === d.value ? M = "repriced" : E.from === E.to && E.value === 0n && (M = "cancelled"), x(() => {
|
|
7883
|
-
var
|
|
7884
|
-
(
|
|
7883
|
+
var k;
|
|
7884
|
+
(k = h.onReplaced) == null || k.call(h, {
|
|
7885
7885
|
reason: M,
|
|
7886
7886
|
replacedTransaction: d,
|
|
7887
7887
|
transaction: E,
|
|
@@ -8015,7 +8015,7 @@ function ll(e, { address: t, args: n, batch: r = !0, event: a, events: s, fromBl
|
|
|
8015
8015
|
if (w)
|
|
8016
8016
|
C = await S(e, ln, "getFilterChanges")({ filter: w });
|
|
8017
8017
|
else {
|
|
8018
|
-
const E = await S(e,
|
|
8018
|
+
const E = await S(e, Ht, "getBlockNumber")({});
|
|
8019
8019
|
g && g !== E ? C = await S(e, Cr, "getLogs")({
|
|
8020
8020
|
address: t,
|
|
8021
8021
|
args: n,
|
|
@@ -8056,7 +8056,7 @@ function ll(e, { address: t, args: n, batch: r = !0, event: a, events: s, fromBl
|
|
|
8056
8056
|
})(), w = s ?? (a ? [a] : void 0);
|
|
8057
8057
|
let x = [];
|
|
8058
8058
|
w && (x = [
|
|
8059
|
-
w.flatMap((T) =>
|
|
8059
|
+
w.flatMap((T) => Rt({
|
|
8060
8060
|
abi: [T],
|
|
8061
8061
|
eventName: T.name,
|
|
8062
8062
|
args: n
|
|
@@ -8070,23 +8070,23 @@ function ll(e, { address: t, args: n, batch: r = !0, event: a, events: s, fromBl
|
|
|
8070
8070
|
return;
|
|
8071
8071
|
const C = T.result;
|
|
8072
8072
|
try {
|
|
8073
|
-
const { eventName: M, args:
|
|
8073
|
+
const { eventName: M, args: k } = Er({
|
|
8074
8074
|
abi: w ?? [],
|
|
8075
8075
|
data: C.data,
|
|
8076
8076
|
topics: C.topics,
|
|
8077
8077
|
strict: b
|
|
8078
|
-
}),
|
|
8079
|
-
u([
|
|
8078
|
+
}), $ = Be(C, { args: k, eventName: M });
|
|
8079
|
+
u([$]);
|
|
8080
8080
|
} catch (M) {
|
|
8081
|
-
let
|
|
8081
|
+
let k, $;
|
|
8082
8082
|
if (M instanceof ft || M instanceof en) {
|
|
8083
8083
|
if (d)
|
|
8084
8084
|
return;
|
|
8085
|
-
|
|
8085
|
+
k = M.abiItem.name, $ = (E = M.abiItem.inputs) == null ? void 0 : E.some((F) => !("name" in F && F.name));
|
|
8086
8086
|
}
|
|
8087
8087
|
const N = Be(C, {
|
|
8088
|
-
args:
|
|
8089
|
-
eventName:
|
|
8088
|
+
args: $ ? [] : {},
|
|
8089
|
+
eventName: k
|
|
8090
8090
|
});
|
|
8091
8091
|
u([N]);
|
|
8092
8092
|
}
|
|
@@ -8206,7 +8206,7 @@ async function hl(e, t) {
|
|
|
8206
8206
|
}))
|
|
8207
8207
|
return !1;
|
|
8208
8208
|
const p = Gs(a);
|
|
8209
|
-
return
|
|
8209
|
+
return Lr(e, {
|
|
8210
8210
|
address: l.address,
|
|
8211
8211
|
hash: p,
|
|
8212
8212
|
signature: o,
|
|
@@ -8225,13 +8225,13 @@ function gl(e) {
|
|
|
8225
8225
|
getBalance: (t) => ad(e, t),
|
|
8226
8226
|
getBlobBaseFee: () => sd(e),
|
|
8227
8227
|
getBlock: (t) => Se(e, t),
|
|
8228
|
-
getBlockNumber: (t) =>
|
|
8228
|
+
getBlockNumber: (t) => Ht(e, t),
|
|
8229
8229
|
getBlockTransactionCount: (t) => id(e, t),
|
|
8230
8230
|
getBytecode: (t) => od(e, t),
|
|
8231
8231
|
getChainId: () => Nt(e),
|
|
8232
8232
|
getContractEvents: (t) => Ar(e, t),
|
|
8233
8233
|
getEip712Domain: (t) => Cc(e, t),
|
|
8234
|
-
getEnsAddress: (t) =>
|
|
8234
|
+
getEnsAddress: (t) => jc(e, t),
|
|
8235
8235
|
getEnsAvatar: (t) => ed(e, t),
|
|
8236
8236
|
getEnsName: (t) => td(e, t),
|
|
8237
8237
|
getEnsResolver: (t) => nd(e, t),
|
|
@@ -8245,7 +8245,7 @@ function gl(e) {
|
|
|
8245
8245
|
getProof: (t) => Pd(e, t),
|
|
8246
8246
|
estimateMaxPriorityFeePerGas: (t) => zu(e, t),
|
|
8247
8247
|
getStorageAt: (t) => Cd(e, t),
|
|
8248
|
-
getTransaction: (t) =>
|
|
8248
|
+
getTransaction: (t) => Or(e, t),
|
|
8249
8249
|
getTransactionConfirmations: (t) => Ad(e, t),
|
|
8250
8250
|
getTransactionCount: (t) => ms(e, t),
|
|
8251
8251
|
getTransactionReceipt: (t) => Jn(e, t),
|
|
@@ -8306,7 +8306,7 @@ async function Pl(e, { account: t = e.account, message: n }) {
|
|
|
8306
8306
|
const r = re(t);
|
|
8307
8307
|
if (r.type === "local")
|
|
8308
8308
|
return r.signMessage({ message: n });
|
|
8309
|
-
const a = typeof n == "string" ? ar(n) : n.raw instanceof Uint8Array ?
|
|
8309
|
+
const a = typeof n == "string" ? ar(n) : n.raw instanceof Uint8Array ? Re(n.raw) : n.raw;
|
|
8310
8310
|
return e.request({
|
|
8311
8311
|
method: "personal_sign",
|
|
8312
8312
|
params: [a, r.address]
|
|
@@ -8338,7 +8338,7 @@ async function Cl(e, t) {
|
|
|
8338
8338
|
params: [
|
|
8339
8339
|
{
|
|
8340
8340
|
...u(a),
|
|
8341
|
-
chainId:
|
|
8341
|
+
chainId: R(i),
|
|
8342
8342
|
from: s.address
|
|
8343
8343
|
}
|
|
8344
8344
|
]
|
|
@@ -8367,7 +8367,7 @@ async function Il(e, { id: t }) {
|
|
|
8367
8367
|
method: "wallet_switchEthereumChain",
|
|
8368
8368
|
params: [
|
|
8369
8369
|
{
|
|
8370
|
-
chainId:
|
|
8370
|
+
chainId: R(t)
|
|
8371
8371
|
}
|
|
8372
8372
|
]
|
|
8373
8373
|
}, { retryCount: 0 });
|
|
@@ -8409,7 +8409,7 @@ function si(e) {
|
|
|
8409
8409
|
}).extend(Sl);
|
|
8410
8410
|
}
|
|
8411
8411
|
function Bl(e) {
|
|
8412
|
-
const { r: t, s: n } =
|
|
8412
|
+
const { r: t, s: n } = Ur.Signature.fromCompact(e.slice(2, 130)), r = +`0x${e.slice(130)}`, [a, s] = (() => {
|
|
8413
8413
|
if (r === 0 || r === 1)
|
|
8414
8414
|
return [void 0, r];
|
|
8415
8415
|
if (r === 27)
|
|
@@ -8419,17 +8419,17 @@ function Bl(e) {
|
|
|
8419
8419
|
throw new Error("Invalid yParityOrV value");
|
|
8420
8420
|
})();
|
|
8421
8421
|
return typeof a < "u" ? {
|
|
8422
|
-
r:
|
|
8423
|
-
s:
|
|
8422
|
+
r: R(t, { size: 32 }),
|
|
8423
|
+
s: R(n, { size: 32 }),
|
|
8424
8424
|
v: a,
|
|
8425
8425
|
yParity: s
|
|
8426
8426
|
} : {
|
|
8427
|
-
r:
|
|
8428
|
-
s:
|
|
8427
|
+
r: R(t, { size: 32 }),
|
|
8428
|
+
s: R(n, { size: 32 }),
|
|
8429
8429
|
yParity: s
|
|
8430
8430
|
};
|
|
8431
8431
|
}
|
|
8432
|
-
const ii = /* @__PURE__ */
|
|
8432
|
+
const ii = /* @__PURE__ */ Hs({
|
|
8433
8433
|
id: 17e3,
|
|
8434
8434
|
name: "Holesky",
|
|
8435
8435
|
nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -8459,7 +8459,7 @@ const ii = /* @__PURE__ */ Us({
|
|
|
8459
8459
|
}
|
|
8460
8460
|
},
|
|
8461
8461
|
testnet: !0
|
|
8462
|
-
}), oi = /* @__PURE__ */
|
|
8462
|
+
}), oi = /* @__PURE__ */ Hs({
|
|
8463
8463
|
id: 1,
|
|
8464
8464
|
name: "Ethereum",
|
|
8465
8465
|
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
@@ -8489,12 +8489,12 @@ const ii = /* @__PURE__ */ Us({
|
|
|
8489
8489
|
}
|
|
8490
8490
|
}
|
|
8491
8491
|
});
|
|
8492
|
-
var
|
|
8492
|
+
var B = ((e) => (e[e.Mainnet = oi.id] = "Mainnet", e[e.Holesky = ii.id] = "Holesky", e))(B || {});
|
|
8493
8493
|
const ge = {
|
|
8494
|
-
[
|
|
8495
|
-
[
|
|
8494
|
+
[B.Mainnet]: oi,
|
|
8495
|
+
[B.Holesky]: ii
|
|
8496
8496
|
}, Ce = {
|
|
8497
|
-
[
|
|
8497
|
+
[B.Mainnet]: {
|
|
8498
8498
|
PufferVault: "0xD9A442856C234a39a81a089C06451EBAa4306a72",
|
|
8499
8499
|
PufferDepositor: "0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff",
|
|
8500
8500
|
// TODO: Update the addresses once the contracts are deployed on chain.
|
|
@@ -8502,13 +8502,13 @@ const ge = {
|
|
|
8502
8502
|
PufferL2Depositor: "0x0000000000000000000000000000000000000000",
|
|
8503
8503
|
PufLocker: "0x0000000000000000000000000000000000000000"
|
|
8504
8504
|
},
|
|
8505
|
-
[
|
|
8505
|
+
[B.Holesky]: {
|
|
8506
8506
|
PufferVault: "0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9",
|
|
8507
8507
|
PufferDepositor: "0x824AC05aeb86A0aD770b8acDe0906d2d4a6c4A8c",
|
|
8508
8508
|
// TODO: Update the addresses once the contracts are deployed on chain.
|
|
8509
8509
|
// See https://dev.azure.com/pufferfi/Frontend/_workitems/edit/1797.
|
|
8510
|
-
PufferL2Depositor: "
|
|
8511
|
-
PufLocker: "
|
|
8510
|
+
PufferL2Depositor: "0x0af6998e4828ad8ef8f79a9288d0a861890f791d",
|
|
8511
|
+
PufLocker: "0xa58983ad0899a452b7420bc57228e329d7ba92b6"
|
|
8512
8512
|
}
|
|
8513
8513
|
}, kl = [
|
|
8514
8514
|
{
|
|
@@ -12151,15 +12151,15 @@ const ge = {
|
|
|
12151
12151
|
name: "WithdrawalsAreDisabled",
|
|
12152
12152
|
inputs: []
|
|
12153
12153
|
}
|
|
12154
|
-
],
|
|
12155
|
-
[
|
|
12154
|
+
], Rl = {
|
|
12155
|
+
[B.Mainnet]: {
|
|
12156
12156
|
PufferVaultV2: kl
|
|
12157
12157
|
},
|
|
12158
|
-
[
|
|
12158
|
+
[B.Holesky]: {
|
|
12159
12159
|
PufferVaultV2: $l
|
|
12160
12160
|
}
|
|
12161
12161
|
};
|
|
12162
|
-
class
|
|
12162
|
+
class Ol {
|
|
12163
12163
|
/**
|
|
12164
12164
|
* Create the handler for the `PufferVaultV2` contract exposing
|
|
12165
12165
|
* methods to interact with the contract.
|
|
@@ -12171,7 +12171,7 @@ class Rl {
|
|
|
12171
12171
|
* interactions.
|
|
12172
12172
|
*/
|
|
12173
12173
|
constructor(t, n, r) {
|
|
12174
|
-
|
|
12174
|
+
L(this, "viemChain");
|
|
12175
12175
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.viemChain = ge[t];
|
|
12176
12176
|
}
|
|
12177
12177
|
/**
|
|
@@ -12181,14 +12181,8 @@ class Rl {
|
|
|
12181
12181
|
* @returns The viem contract.
|
|
12182
12182
|
*/
|
|
12183
12183
|
getContract() {
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
abi: Ol[this.chain].PufferVaultV2,
|
|
12187
|
-
client: {
|
|
12188
|
-
wallet: this.walletClient,
|
|
12189
|
-
public: this.publicClient
|
|
12190
|
-
}
|
|
12191
|
-
});
|
|
12184
|
+
const t = Ce[this.chain].PufferVault, n = Rl[this.chain].PufferVaultV2, r = { public: this.publicClient, wallet: this.walletClient };
|
|
12185
|
+
return ot({ address: t, abi: n, client: r });
|
|
12192
12186
|
}
|
|
12193
12187
|
/**
|
|
12194
12188
|
* Deposit ETH in exchange for pufETH. This doesn't make the
|
|
@@ -12270,6 +12264,74 @@ class Rl {
|
|
|
12270
12264
|
}
|
|
12271
12265
|
) };
|
|
12272
12266
|
}
|
|
12267
|
+
/**
|
|
12268
|
+
* Preview the amount of WETH that can be redeemed for the given
|
|
12269
|
+
* amount of pufETH using the `.redeem()` method.
|
|
12270
|
+
*
|
|
12271
|
+
* @param value Value of pufETH to redeem.
|
|
12272
|
+
* @returns Preview of the amount of WETH that can be redeemed.
|
|
12273
|
+
*/
|
|
12274
|
+
previewRedeem(t) {
|
|
12275
|
+
return this.getContract().read.previewRedeem([t]);
|
|
12276
|
+
}
|
|
12277
|
+
/**
|
|
12278
|
+
* Calculates the maximum amount of pufETH shares that can be redeemed
|
|
12279
|
+
* by the owner.
|
|
12280
|
+
*
|
|
12281
|
+
* @param ownerAddress Address of the owner's wallet.
|
|
12282
|
+
* @returns Maximum amount of pufETH shares that can be redeemed.
|
|
12283
|
+
*/
|
|
12284
|
+
maxRedeem(t) {
|
|
12285
|
+
return this.getContract().read.maxRedeem([t]);
|
|
12286
|
+
}
|
|
12287
|
+
/**
|
|
12288
|
+
* Returns how many basis points of a fee there are when exiting. For
|
|
12289
|
+
* example, a 1% fee would mean 1% of the user's requested pufETH is
|
|
12290
|
+
* burned (which increases the value for all pufETH holders) before
|
|
12291
|
+
* the ETH is redeemed. i.e., you get 1% less ETH back.
|
|
12292
|
+
*
|
|
12293
|
+
* @returns Basis points of the exit fee.
|
|
12294
|
+
*/
|
|
12295
|
+
getExitFeeBasisPoints() {
|
|
12296
|
+
return this.getContract().read.getExitFeeBasisPoints();
|
|
12297
|
+
}
|
|
12298
|
+
/**
|
|
12299
|
+
* Returns how much WETH can still be withdrawn today.
|
|
12300
|
+
*
|
|
12301
|
+
* @returns Remaining WETH daily withdrawal limit.
|
|
12302
|
+
*/
|
|
12303
|
+
getRemainingAssetsDailyWithdrawalLimit() {
|
|
12304
|
+
return this.getContract().read.getRemainingAssetsDailyWithdrawalLimit();
|
|
12305
|
+
}
|
|
12306
|
+
/**
|
|
12307
|
+
* Redeems pufETH shares in exchange for WETH assets from the vault.
|
|
12308
|
+
* In the process, the pufETH shares of the owner are burned. This
|
|
12309
|
+
* doesn't make the transaction but returns two methods namely
|
|
12310
|
+
* `transact` and `estimate`.
|
|
12311
|
+
*
|
|
12312
|
+
* @param ownerAddress Address of the owner of pufETH.
|
|
12313
|
+
* @param receiverAddress Address of the receiver of WETH.
|
|
12314
|
+
* @param shares Amount of pufETH shares to redeem.
|
|
12315
|
+
* @returns `transact: (value: bigint) => Promise<Address>` - Used to
|
|
12316
|
+
* make the transaction with the given value.
|
|
12317
|
+
*
|
|
12318
|
+
* `estimate: () => Promise<bigint>` - Gas estimate of the
|
|
12319
|
+
* transaction.
|
|
12320
|
+
*/
|
|
12321
|
+
redeem(t, n, r) {
|
|
12322
|
+
return { transact: async () => await this.getContract().write.redeem(
|
|
12323
|
+
[r, n, t],
|
|
12324
|
+
{
|
|
12325
|
+
account: t,
|
|
12326
|
+
chain: this.viemChain
|
|
12327
|
+
}
|
|
12328
|
+
), estimate: async () => await this.getContract().estimateGas.redeem(
|
|
12329
|
+
[r, n, t],
|
|
12330
|
+
{
|
|
12331
|
+
account: t
|
|
12332
|
+
}
|
|
12333
|
+
) };
|
|
12334
|
+
}
|
|
12273
12335
|
}
|
|
12274
12336
|
const Fl = [
|
|
12275
12337
|
{
|
|
@@ -13311,16 +13373,16 @@ const Fl = [
|
|
|
13311
13373
|
type: "function"
|
|
13312
13374
|
}
|
|
13313
13375
|
], Dl = {
|
|
13314
|
-
[
|
|
13376
|
+
[B.Mainnet]: {
|
|
13315
13377
|
PufferDepositor: Fl
|
|
13316
13378
|
},
|
|
13317
|
-
[
|
|
13379
|
+
[B.Holesky]: {
|
|
13318
13380
|
PufferDepositor: Nl
|
|
13319
13381
|
}
|
|
13320
|
-
},
|
|
13321
|
-
[
|
|
13322
|
-
[
|
|
13323
|
-
},
|
|
13382
|
+
}, Hl = {
|
|
13383
|
+
[B.Mainnet]: { PufferL2Depositor: va },
|
|
13384
|
+
[B.Holesky]: { PufferL2Depositor: va }
|
|
13385
|
+
}, Ul = [
|
|
13324
13386
|
{
|
|
13325
13387
|
type: "function",
|
|
13326
13388
|
name: "DOMAIN_SEPARATOR",
|
|
@@ -13839,89 +13901,107 @@ const Fl = [
|
|
|
13839
13901
|
}
|
|
13840
13902
|
]
|
|
13841
13903
|
}
|
|
13842
|
-
],
|
|
13843
|
-
var Jt = /* @__PURE__ */ ((e) => (e.USDT = "USDT", e.USDC = "USDC", e.DAI = "DAI", e.ETH = "ETH", e.WETH = "WETH", e.stETH = "stETH", e.wstETH = "wstETH", e.pufETH = "pufETH", e))(Jt || {}), ui = /* @__PURE__ */ ((e) => (e.pufUSDT = "pufUSDT", e.pufUSDC = "pufUSDC", e.pufDAI = "pufDAI", e.pufpufETH = "pufpufETH", e.pufWETH = "pufWETH", e.pufstETH = "pufstETH", e.pufwstETH = "pufwstETH", e.pufALT = "pufALT", e.
|
|
13904
|
+
], Ll = Ul;
|
|
13905
|
+
var Jt = /* @__PURE__ */ ((e) => (e.USDT = "USDT", e.USDC = "USDC", e.DAI = "DAI", e.ETH = "ETH", e.WETH = "WETH", e.stETH = "stETH", e.wstETH = "wstETH", e.ALT = "ALT", e.eETH = "eETH", e.pufETHwstE = "pufETHwstE", e.pufETH = "pufETH", e))(Jt || {}), ui = /* @__PURE__ */ ((e) => (e.pufUSDT = "pufUSDT", e.pufUSDC = "pufUSDC", e.pufDAI = "pufDAI", e.pufpufETH = "pufpufETH", e.pufWETH = "pufWETH", e.pufstETH = "pufstETH", e.pufwstETH = "pufwstETH", e.pufALT = "pufALT", e.pufeETH = "pufeETH", e.pufpufETHwstE = "pufpufETHwstE", e))(ui || {});
|
|
13844
13906
|
const Jl = {
|
|
13845
13907
|
USDT: "pufUSDT",
|
|
13846
13908
|
USDC: "pufUSDC",
|
|
13847
13909
|
DAI: "pufDAI",
|
|
13848
|
-
ETH:
|
|
13910
|
+
ETH: void 0,
|
|
13849
13911
|
WETH: "pufWETH",
|
|
13850
13912
|
stETH: "pufstETH",
|
|
13851
13913
|
wstETH: "pufwstETH",
|
|
13914
|
+
ALT: "pufALT",
|
|
13915
|
+
eETH: "pufeETH",
|
|
13916
|
+
pufETHwstE: "pufpufETHwstE",
|
|
13852
13917
|
pufETH: "pufpufETH"
|
|
13853
13918
|
/* pufpufETH */
|
|
13854
13919
|
}, Pe = {
|
|
13855
13920
|
USDT: {
|
|
13856
|
-
[
|
|
13857
|
-
[
|
|
13921
|
+
[B.Mainnet]: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
13922
|
+
[B.Holesky]: "0xd5bef2c64f418fd460319521d37862327122e3bc"
|
|
13858
13923
|
},
|
|
13859
13924
|
USDC: {
|
|
13860
|
-
[
|
|
13861
|
-
[
|
|
13925
|
+
[B.Mainnet]: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
13926
|
+
[B.Holesky]: "0x64Cc0de0429bcb87e875905a0c313ec88f6d1d3E"
|
|
13862
13927
|
},
|
|
13863
13928
|
DAI: {
|
|
13864
|
-
[
|
|
13865
|
-
[
|
|
13929
|
+
[B.Mainnet]: "0x6b175474e89094c44da98b954eedeac495271d0f",
|
|
13930
|
+
[B.Holesky]: "0x4478905505ddfb7eA1c8A9f46eAEC3695cE542ac"
|
|
13866
13931
|
},
|
|
13867
13932
|
ETH: {},
|
|
13868
|
-
// WETH does not support permit signatures (ERC20Permit).
|
|
13869
13933
|
WETH: {
|
|
13870
|
-
[
|
|
13871
|
-
[
|
|
13934
|
+
[B.Mainnet]: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
13935
|
+
[B.Holesky]: "0x1d181cBd1825e9eBC6AD966878D555A7215FF4F0"
|
|
13872
13936
|
},
|
|
13873
13937
|
stETH: {
|
|
13874
|
-
[
|
|
13875
|
-
[
|
|
13938
|
+
[B.Mainnet]: "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
|
|
13939
|
+
[B.Holesky]: "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"
|
|
13876
13940
|
},
|
|
13877
13941
|
wstETH: {
|
|
13878
|
-
[
|
|
13879
|
-
[
|
|
13942
|
+
[B.Mainnet]: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
|
|
13943
|
+
[B.Holesky]: "0x8d09a4502Cc8Cf1547aD300E066060D043f6982D"
|
|
13944
|
+
},
|
|
13945
|
+
ALT: {
|
|
13946
|
+
[B.Mainnet]: "0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb",
|
|
13947
|
+
[B.Holesky]: "0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee"
|
|
13948
|
+
},
|
|
13949
|
+
eETH: {
|
|
13950
|
+
[B.Mainnet]: "0x35fa164735182de50811e8e2e824cfb9b6118ac2",
|
|
13951
|
+
[B.Holesky]: "0x7ba2ee123b5977e3da040e1eacb3a61c82c17876"
|
|
13952
|
+
},
|
|
13953
|
+
pufETHwstE: {
|
|
13954
|
+
[B.Mainnet]: "0xeeda34a377dd0ca676b9511ee1324974fa8d980d",
|
|
13955
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13880
13956
|
},
|
|
13881
13957
|
pufETH: {
|
|
13882
|
-
[
|
|
13883
|
-
[
|
|
13958
|
+
[B.Mainnet]: "0xd9a442856c234a39a81a089c06451ebaa4306a72",
|
|
13959
|
+
[B.Holesky]: "0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"
|
|
13884
13960
|
},
|
|
13885
13961
|
// TODO: Update the addresses once the contracts are deployed on chain.
|
|
13886
13962
|
// See https://dev.azure.com/pufferfi/Frontend/_workitems/edit/1797.
|
|
13887
13963
|
// Wrapped PufTokens.
|
|
13888
13964
|
pufUSDT: {
|
|
13889
|
-
[
|
|
13890
|
-
[
|
|
13965
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13966
|
+
[B.Holesky]: "0x61e7C87c387178D6e0aE6c04748b7FF753fC9b81"
|
|
13891
13967
|
},
|
|
13892
13968
|
pufUSDC: {
|
|
13893
|
-
[
|
|
13894
|
-
[
|
|
13969
|
+
[B.Mainnet]: "0x2f0d8e30df0c598b90b34cd68b5e3981b7af3881",
|
|
13970
|
+
[B.Holesky]: "0x6D900a9f5784A2cA0004B5c3D3e08D7A9cE4A1b3"
|
|
13895
13971
|
},
|
|
13896
13972
|
pufDAI: {
|
|
13897
|
-
[
|
|
13898
|
-
[
|
|
13899
|
-
},
|
|
13900
|
-
pufEETH: {
|
|
13901
|
-
[$.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13902
|
-
[$.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13973
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13974
|
+
[B.Holesky]: "0x2D6B705e118198A02F00490BA323B17eC5D58109"
|
|
13903
13975
|
},
|
|
13904
13976
|
pufWETH: {
|
|
13905
|
-
[
|
|
13906
|
-
[
|
|
13977
|
+
[B.Mainnet]: "0x2b36f6bfd223f460e7e43ef49bc487481648948c",
|
|
13978
|
+
[B.Holesky]: "0x5335f231C22d472Ab31CC2690A2247d25efd76a5"
|
|
13907
13979
|
},
|
|
13908
13980
|
pufstETH: {
|
|
13909
|
-
[
|
|
13910
|
-
[
|
|
13981
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13982
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13911
13983
|
},
|
|
13912
13984
|
pufwstETH: {
|
|
13913
|
-
[
|
|
13914
|
-
[
|
|
13985
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13986
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13915
13987
|
},
|
|
13916
13988
|
pufALT: {
|
|
13917
|
-
[
|
|
13918
|
-
[
|
|
13989
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13990
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13991
|
+
},
|
|
13992
|
+
pufeETH: {
|
|
13993
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
13994
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13995
|
+
},
|
|
13996
|
+
pufpufETHwstE: {
|
|
13997
|
+
[B.Mainnet]: "0xf374014f6fa86bad50d52e6240a117b0830663cb",
|
|
13998
|
+
[B.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
13919
13999
|
},
|
|
13920
14000
|
pufpufETH: {
|
|
13921
|
-
[
|
|
13922
|
-
[
|
|
14001
|
+
[B.Mainnet]: "0x0000000000000000000000000000000000000000",
|
|
14002
|
+
[B.Holesky]: "0x638fd1Fe8205285E8497Eb8E6037c8254EDdB0ae"
|
|
13923
14003
|
}
|
|
13924
|
-
},
|
|
14004
|
+
}, jl = {
|
|
13925
14005
|
USDT: "2",
|
|
13926
14006
|
// USDC does not support permit signatures (ERC20Permit).
|
|
13927
14007
|
USDC: "",
|
|
@@ -13933,16 +14013,23 @@ const Jl = {
|
|
|
13933
14013
|
stETH: "2",
|
|
13934
14014
|
// Puffer Quest v1 uses version 1 for wstETH.
|
|
13935
14015
|
wstETH: "1",
|
|
14016
|
+
ALT: "1",
|
|
14017
|
+
// https://github.com/etherfi-protocol/smart-contracts/blob/7c66e571df4fe7ec502a3c325b623bc52349ef9d/src/EETH.sol#L55
|
|
14018
|
+
eETH: "1",
|
|
14019
|
+
// https://etherscan.io/address/0xeeda34a377dd0ca676b9511ee1324974fa8d980d#code#L216
|
|
14020
|
+
// See line 216: `version: public(constant(String[8])) = "v7.0.0"`
|
|
14021
|
+
pufETHwstE: "v7.0.0",
|
|
13936
14022
|
pufETH: "1",
|
|
13937
14023
|
// Wrapped PufTokens
|
|
13938
14024
|
pufUSDT: "1",
|
|
13939
14025
|
pufUSDC: "1",
|
|
13940
14026
|
pufDAI: "1",
|
|
13941
|
-
pufEETH: "1",
|
|
13942
14027
|
pufWETH: "1",
|
|
13943
14028
|
pufstETH: "1",
|
|
13944
14029
|
pufwstETH: "1",
|
|
13945
14030
|
pufALT: "1",
|
|
14031
|
+
pufeETH: "1",
|
|
14032
|
+
pufpufETHwstE: "1",
|
|
13946
14033
|
pufpufETH: "1"
|
|
13947
14034
|
}, zl = () => Math.floor(Date.now() / 1e3);
|
|
13948
14035
|
class hn {
|
|
@@ -13956,8 +14043,8 @@ class hn {
|
|
|
13956
14043
|
* interactions.
|
|
13957
14044
|
*/
|
|
13958
14045
|
constructor(t, n, r) {
|
|
13959
|
-
|
|
13960
|
-
|
|
14046
|
+
L(this, "viemChain");
|
|
14047
|
+
L(this, "token");
|
|
13961
14048
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.viemChain = ge[t], this.token = Jt.ETH;
|
|
13962
14049
|
}
|
|
13963
14050
|
/**
|
|
@@ -13976,14 +14063,8 @@ class hn {
|
|
|
13976
14063
|
* @returns The viem contract.
|
|
13977
14064
|
*/
|
|
13978
14065
|
getContract() {
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
abi: jl,
|
|
13982
|
-
client: {
|
|
13983
|
-
wallet: this.walletClient,
|
|
13984
|
-
public: this.publicClient
|
|
13985
|
-
}
|
|
13986
|
-
});
|
|
14066
|
+
const t = Pe[this.token][this.chain], n = Ll, r = { public: this.publicClient, wallet: this.walletClient };
|
|
14067
|
+
return ot({ address: t, abi: n, client: r });
|
|
13987
14068
|
}
|
|
13988
14069
|
/**
|
|
13989
14070
|
* Process and get permit signature for the given token to perform
|
|
@@ -14024,7 +14105,7 @@ class hn {
|
|
|
14024
14105
|
return { ...Bl(l), deadline: c };
|
|
14025
14106
|
}
|
|
14026
14107
|
getPermitVersion(t) {
|
|
14027
|
-
return
|
|
14108
|
+
return jl[t];
|
|
14028
14109
|
}
|
|
14029
14110
|
/**
|
|
14030
14111
|
* Approve transaction for the spender to spend the owner's tokens.
|
|
@@ -14053,8 +14134,8 @@ class _l {
|
|
|
14053
14134
|
* interactions.
|
|
14054
14135
|
*/
|
|
14055
14136
|
constructor(t, n, r) {
|
|
14056
|
-
|
|
14057
|
-
|
|
14137
|
+
L(this, "viemChain");
|
|
14138
|
+
L(this, "erc20PermitHandler");
|
|
14058
14139
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.viemChain = ge[t], this.erc20PermitHandler = new hn(
|
|
14059
14140
|
t,
|
|
14060
14141
|
n,
|
|
@@ -14068,14 +14149,8 @@ class _l {
|
|
|
14068
14149
|
* @returns The viem contract.
|
|
14069
14150
|
*/
|
|
14070
14151
|
getContract() {
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
abi: Dl[this.chain].PufferDepositor,
|
|
14074
|
-
client: {
|
|
14075
|
-
wallet: this.walletClient,
|
|
14076
|
-
public: this.publicClient
|
|
14077
|
-
}
|
|
14078
|
-
});
|
|
14152
|
+
const t = Ce[this.chain].PufferDepositor, n = Dl[this.chain].PufferDepositor, r = { public: this.publicClient, wallet: this.walletClient };
|
|
14153
|
+
return ot({ address: t, abi: n, client: r });
|
|
14079
14154
|
}
|
|
14080
14155
|
/**
|
|
14081
14156
|
* Deposit stETH in exchange for pufETH. This doesn't make the
|
|
@@ -15026,8 +15101,8 @@ const xa = [
|
|
|
15026
15101
|
inputs: []
|
|
15027
15102
|
}
|
|
15028
15103
|
], ql = {
|
|
15029
|
-
[
|
|
15030
|
-
[
|
|
15104
|
+
[B.Mainnet]: { PufToken: xa },
|
|
15105
|
+
[B.Holesky]: { PufToken: xa }
|
|
15031
15106
|
};
|
|
15032
15107
|
class Gl {
|
|
15033
15108
|
/**
|
|
@@ -15041,8 +15116,8 @@ class Gl {
|
|
|
15041
15116
|
* interactions.
|
|
15042
15117
|
*/
|
|
15043
15118
|
constructor(t, n, r) {
|
|
15044
|
-
|
|
15045
|
-
|
|
15119
|
+
L(this, "viemChain");
|
|
15120
|
+
L(this, "pufToken");
|
|
15046
15121
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.pufToken = ui.pufWETH, this.viemChain = ge[t];
|
|
15047
15122
|
}
|
|
15048
15123
|
/**
|
|
@@ -15061,14 +15136,8 @@ class Gl {
|
|
|
15061
15136
|
* @returns The viem contract.
|
|
15062
15137
|
*/
|
|
15063
15138
|
getContract() {
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
abi: ql[this.chain].PufToken,
|
|
15067
|
-
client: {
|
|
15068
|
-
wallet: this.walletClient,
|
|
15069
|
-
public: this.publicClient
|
|
15070
|
-
}
|
|
15071
|
-
});
|
|
15139
|
+
const t = Pe[this.pufToken][this.chain], n = ql[this.chain].PufToken, r = { public: this.publicClient, wallet: this.walletClient };
|
|
15140
|
+
return ot({ address: t, abi: n, client: r });
|
|
15072
15141
|
}
|
|
15073
15142
|
/**
|
|
15074
15143
|
* Check the wrapped token (PufToken) balance of the wallet.
|
|
@@ -15210,8 +15279,8 @@ class Wl {
|
|
|
15210
15279
|
* interactions.
|
|
15211
15280
|
*/
|
|
15212
15281
|
constructor(t, n, r) {
|
|
15213
|
-
|
|
15214
|
-
|
|
15282
|
+
L(this, "viemChain");
|
|
15283
|
+
L(this, "erc20PermitHandler");
|
|
15215
15284
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.viemChain = ge[t], this.erc20PermitHandler = new hn(
|
|
15216
15285
|
t,
|
|
15217
15286
|
n,
|
|
@@ -15225,14 +15294,8 @@ class Wl {
|
|
|
15225
15294
|
* @returns The viem contract.
|
|
15226
15295
|
*/
|
|
15227
15296
|
getContract() {
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
abi: Ul[this.chain].PufferL2Depositor,
|
|
15231
|
-
client: {
|
|
15232
|
-
wallet: this.walletClient,
|
|
15233
|
-
public: this.publicClient
|
|
15234
|
-
}
|
|
15235
|
-
});
|
|
15297
|
+
const t = Ce[this.chain].PufferL2Depositor, n = Hl[this.chain].PufferL2Depositor, r = { public: this.publicClient, wallet: this.walletClient };
|
|
15298
|
+
return ot({ address: t, abi: n, client: r });
|
|
15236
15299
|
}
|
|
15237
15300
|
/**
|
|
15238
15301
|
* Deposit the given token in exchange for the wrapped PufToken. This
|
|
@@ -15661,8 +15724,8 @@ const Ea = [
|
|
|
15661
15724
|
type: "function"
|
|
15662
15725
|
}
|
|
15663
15726
|
], Vl = {
|
|
15664
|
-
[
|
|
15665
|
-
[
|
|
15727
|
+
[B.Mainnet]: { PufLocker: Ea },
|
|
15728
|
+
[B.Holesky]: { PufLocker: Ea }
|
|
15666
15729
|
};
|
|
15667
15730
|
class Zl {
|
|
15668
15731
|
/**
|
|
@@ -15676,8 +15739,8 @@ class Zl {
|
|
|
15676
15739
|
* interactions.
|
|
15677
15740
|
*/
|
|
15678
15741
|
constructor(t, n, r) {
|
|
15679
|
-
|
|
15680
|
-
|
|
15742
|
+
L(this, "viemChain");
|
|
15743
|
+
L(this, "erc20PermitHandler");
|
|
15681
15744
|
this.chain = t, this.walletClient = n, this.publicClient = r, this.viemChain = ge[t], this.erc20PermitHandler = new hn(
|
|
15682
15745
|
t,
|
|
15683
15746
|
n,
|
|
@@ -15691,14 +15754,8 @@ class Zl {
|
|
|
15691
15754
|
* @returns The viem contract.
|
|
15692
15755
|
*/
|
|
15693
15756
|
getContract() {
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
abi: Vl[this.chain].PufLocker,
|
|
15697
|
-
client: {
|
|
15698
|
-
wallet: this.walletClient,
|
|
15699
|
-
public: this.publicClient
|
|
15700
|
-
}
|
|
15701
|
-
});
|
|
15757
|
+
const t = Ce[this.chain].PufLocker, n = Vl[this.chain].PufLocker, r = { public: this.publicClient, wallet: this.walletClient };
|
|
15758
|
+
return ot({ address: t, abi: n, client: r });
|
|
15702
15759
|
}
|
|
15703
15760
|
/**
|
|
15704
15761
|
* Get all deposits of the given account address.
|
|
@@ -15746,6 +15803,7 @@ class Zl {
|
|
|
15746
15803
|
*
|
|
15747
15804
|
* @param depositParams.pufToken PufToken to deposit.
|
|
15748
15805
|
* @param depositParams.account Wallet address of the depositor.
|
|
15806
|
+
* @param depositParams.recipient Recipient of the deposit.
|
|
15749
15807
|
* @param depositParams.value Amount of the deposit.
|
|
15750
15808
|
* @param depositParams.lockPeriod The period for the deposit in
|
|
15751
15809
|
* seconds.
|
|
@@ -15835,21 +15893,21 @@ class Xl {
|
|
|
15835
15893
|
* interactions.
|
|
15836
15894
|
*/
|
|
15837
15895
|
constructor(t, n, r) {
|
|
15838
|
-
|
|
15839
|
-
|
|
15896
|
+
L(this, "walletClient");
|
|
15897
|
+
L(this, "publicClient");
|
|
15840
15898
|
// Contract Handlers
|
|
15841
15899
|
/** Handler for the `ERC20Permit` contract. */
|
|
15842
|
-
|
|
15900
|
+
L(this, "erc20Permit");
|
|
15843
15901
|
/** Handler for the `PufferVaultV2` contract. */
|
|
15844
|
-
|
|
15902
|
+
L(this, "vault");
|
|
15845
15903
|
/** Handler for the `PufferDepositor` contract. */
|
|
15846
|
-
|
|
15904
|
+
L(this, "depositor");
|
|
15847
15905
|
/** Handler for the `PufferL2Depositor` contract. */
|
|
15848
|
-
|
|
15906
|
+
L(this, "l2Depositor");
|
|
15849
15907
|
/** Handler for the `PufToken` contract. */
|
|
15850
|
-
|
|
15908
|
+
L(this, "pufToken");
|
|
15851
15909
|
/** Handler for the `PufLocker` contract. */
|
|
15852
|
-
|
|
15910
|
+
L(this, "pufLocker");
|
|
15853
15911
|
const a = ge[t];
|
|
15854
15912
|
this.walletClient = n ?? si({
|
|
15855
15913
|
chain: a,
|
|
@@ -15861,7 +15919,7 @@ class Xl {
|
|
|
15861
15919
|
t,
|
|
15862
15920
|
this.walletClient,
|
|
15863
15921
|
this.publicClient
|
|
15864
|
-
), this.vault = new
|
|
15922
|
+
), this.vault = new Ol(
|
|
15865
15923
|
t,
|
|
15866
15924
|
this.walletClient,
|
|
15867
15925
|
this.publicClient
|
|
@@ -15925,7 +15983,7 @@ class nr {
|
|
|
15925
15983
|
}
|
|
15926
15984
|
export {
|
|
15927
15985
|
v as B,
|
|
15928
|
-
|
|
15986
|
+
B as C,
|
|
15929
15987
|
yt as H,
|
|
15930
15988
|
Xl as P,
|
|
15931
15989
|
Jt as T,
|
|
@@ -15941,8 +15999,8 @@ export {
|
|
|
15941
15999
|
ld as i,
|
|
15942
16000
|
Jl as j,
|
|
15943
16001
|
Pe as k,
|
|
15944
|
-
|
|
16002
|
+
jl as l,
|
|
15945
16003
|
Ce as m,
|
|
15946
16004
|
W as s
|
|
15947
16005
|
};
|
|
15948
|
-
//# sourceMappingURL=main-
|
|
16006
|
+
//# sourceMappingURL=main-v18rFU-J.js.map
|