@gardenfi/core 2.1.3-beta.44 → 2.1.3-beta.45
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-CvElG6nD.js → ccip-BQ2SmYhi.js} +1 -1
- package/dist/{ccip-CP_8Dw5B.cjs → ccip-DWt0iM5p.cjs} +1 -1
- package/dist/{index-DX2aorDe.js → index-7EmN20ut.js} +603 -590
- package/dist/{index-DRMi2irD.cjs → index-CpT0ssxQ.cjs} +22 -22
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{secp256k1-CYp-t-jb.js → secp256k1-COkOPbFq.js} +1 -1
- package/dist/{secp256k1-B5eOuBnI.cjs → secp256k1-Cbj-hmMq.cjs} +1 -1
- package/package.json +3 -3
|
@@ -2,15 +2,15 @@ var Zl = Object.defineProperty;
|
|
|
2
2
|
var Ql = (e, t, r) => t in e ? Zl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Vr = (e, t, r) => Ql(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { ArbitrumLocalnet as eh, EthereumLocalnet as th, isEVM as rh, isEvmNativeToken as nh, Orderbook as ih, isMainnet as $i, getTimeLock as sh, isBitcoin as co, getBlockchainType as uo, BlockchainType as Ct } from "@gardenfi/orderbook";
|
|
5
|
-
import { Environment as St, Ok as rn, Err as Se, Url as Pt, Network as hs, EventBroker as of, with0x as Jr, checkAllowanceAndApprove as oh, sleep as
|
|
6
|
-
import { BitcoinNetwork as
|
|
7
|
-
import * as
|
|
5
|
+
import { Environment as St, Ok as rn, Err as Se, Url as Pt, Network as hs, EventBroker as of, with0x as Jr, checkAllowanceAndApprove as oh, sleep as ea, hexToU32Array as ps, DigestKey as Tc, Siwe as Ic } from "@gardenfi/utils";
|
|
6
|
+
import { BitcoinNetwork as kc, Urgency as Bc, BitcoinProvider as ah, BitcoinWallet as ch } from "@catalogfi/wallets";
|
|
7
|
+
import * as Cc from "varuint-bitcoin";
|
|
8
8
|
import uh from "varuint-bitcoin";
|
|
9
9
|
import * as Cr from "tiny-secp256k1";
|
|
10
10
|
import * as ae from "bitcoinjs-lib";
|
|
11
11
|
import { crypto as fh } from "bitcoinjs-lib";
|
|
12
12
|
import dh from "bignumber.js";
|
|
13
|
-
import { cairo as Vn, uint256 as af, TransactionExecutionStatus as cf, Contract as
|
|
13
|
+
import { cairo as Vn, uint256 as af, TransactionExecutionStatus as cf, Contract as La, RpcProvider as uf, num as ff, TypedDataRevision as lh, shortString as hh, CallData as Oc } from "starknet";
|
|
14
14
|
var df = (e, t, r) => {
|
|
15
15
|
if (!t.has(e))
|
|
16
16
|
throw TypeError("Cannot " + r);
|
|
@@ -67,7 +67,7 @@ class Mt {
|
|
|
67
67
|
}
|
|
68
68
|
return await this.parse(s);
|
|
69
69
|
} catch (s) {
|
|
70
|
-
n =
|
|
70
|
+
n = Rc(s);
|
|
71
71
|
continue;
|
|
72
72
|
}
|
|
73
73
|
throw new Error(n || "All APIs failed");
|
|
@@ -95,7 +95,7 @@ class Mt {
|
|
|
95
95
|
}
|
|
96
96
|
return await this.parse(s);
|
|
97
97
|
} catch (s) {
|
|
98
|
-
n =
|
|
98
|
+
n = Rc(s);
|
|
99
99
|
continue;
|
|
100
100
|
}
|
|
101
101
|
throw new Error(n || "All APIs failed");
|
|
@@ -152,12 +152,12 @@ class Mt {
|
|
|
152
152
|
throw new Error(r);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Rc(e) {
|
|
156
156
|
return (e == null ? void 0 : e.message) || (e == null ? void 0 : e.toString()) || "unknown error";
|
|
157
157
|
}
|
|
158
158
|
const Mi = (e) => new yh((e == null ? void 0 : e.retryCount) ?? 2, (e == null ? void 0 : e.retryDelay) ?? 1e3), sn = (e) => e.startsWith("0x") ? e : `0x${e}`, Tr = (e) => e.startsWith("0x") ? e.slice(2) : e;
|
|
159
159
|
var ts, rs, ns;
|
|
160
|
-
let
|
|
160
|
+
let ta = class {
|
|
161
161
|
constructor(t, r, n = void 0) {
|
|
162
162
|
lo(this, ts, void 0), lo(this, rs, void 0), lo(this, ns, void 0), ho(this, ts, t), ho(this, ns, n), ho(this, rs, r);
|
|
163
163
|
}
|
|
@@ -172,7 +172,7 @@ let Qo = class {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
ts = /* @__PURE__ */ new WeakMap(), rs = /* @__PURE__ */ new WeakMap(), ns = /* @__PURE__ */ new WeakMap();
|
|
175
|
-
const ne = (e) => new
|
|
175
|
+
const ne = (e) => new ta(!0, e), j = (e, ...t) => {
|
|
176
176
|
if (typeof e == "string" && t && t.length > 0) {
|
|
177
177
|
let r = [e, ...t].map((n) => {
|
|
178
178
|
if (n) {
|
|
@@ -184,20 +184,20 @@ const ne = (e) => new Qo(!0, e), G = (e, ...t) => {
|
|
|
184
184
|
return n.toString();
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
return new
|
|
187
|
+
return new ta(
|
|
188
188
|
!1,
|
|
189
189
|
null,
|
|
190
190
|
r.filter((n) => n !== void 0).join(" ")
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
-
return new
|
|
193
|
+
return new ta(!1, null, e);
|
|
194
194
|
};
|
|
195
195
|
var Ce = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.Initiate = "Initiate", e.Redeem = "Redeem", e.Refund = "Refund", e))(Ce || {});
|
|
196
196
|
const bh = "1.0.8";
|
|
197
|
-
let dt = class
|
|
197
|
+
let dt = class ra extends Error {
|
|
198
198
|
constructor(t, r = {}) {
|
|
199
199
|
var o;
|
|
200
|
-
const n = r.cause instanceof
|
|
200
|
+
const n = r.cause instanceof ra ? r.cause.details : (o = r.cause) != null && o.message ? r.cause.message : r.details, i = r.cause instanceof ra && r.cause.docsPath || r.docsPath, s = [
|
|
201
201
|
t || "An error occurred.",
|
|
202
202
|
"",
|
|
203
203
|
...r.metaMessages ? [...r.metaMessages, ""] : [],
|
|
@@ -238,18 +238,18 @@ function Yt(e, t) {
|
|
|
238
238
|
const r = e.exec(t);
|
|
239
239
|
return r == null ? void 0 : r.groups;
|
|
240
240
|
}
|
|
241
|
-
const lf = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, hf = /^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)?$/, pf = /^\(.+?\).*?$/,
|
|
242
|
-
function
|
|
241
|
+
const lf = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, hf = /^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)?$/, pf = /^\(.+?\).*?$/, Lc = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
242
|
+
function na(e) {
|
|
243
243
|
let t = e.type;
|
|
244
|
-
if (
|
|
244
|
+
if (Lc.test(e.type) && "components" in e) {
|
|
245
245
|
t = "(";
|
|
246
246
|
const r = e.components.length;
|
|
247
247
|
for (let i = 0; i < r; i++) {
|
|
248
248
|
const s = e.components[i];
|
|
249
|
-
t +=
|
|
249
|
+
t += na(s), i < r - 1 && (t += ", ");
|
|
250
250
|
}
|
|
251
|
-
const n = Yt(
|
|
252
|
-
return t += `)${(n == null ? void 0 : n.array) ?? ""}`,
|
|
251
|
+
const n = Yt(Lc, e.type);
|
|
252
|
+
return t += `)${(n == null ? void 0 : n.array) ?? ""}`, na({
|
|
253
253
|
...e,
|
|
254
254
|
type: t
|
|
255
255
|
});
|
|
@@ -261,7 +261,7 @@ function Tn(e) {
|
|
|
261
261
|
const r = e.length;
|
|
262
262
|
for (let n = 0; n < r; n++) {
|
|
263
263
|
const i = e[n];
|
|
264
|
-
t +=
|
|
264
|
+
t += na(i), n !== r - 1 && (t += ", ");
|
|
265
265
|
}
|
|
266
266
|
return t;
|
|
267
267
|
}
|
|
@@ -315,7 +315,7 @@ const Bh = /^receive\(\) external payable$/;
|
|
|
315
315
|
function Ch(e) {
|
|
316
316
|
return Bh.test(e);
|
|
317
317
|
}
|
|
318
|
-
const Oh = /* @__PURE__ */ new Set(["indexed"]),
|
|
318
|
+
const Oh = /* @__PURE__ */ new Set(["indexed"]), ia = /* @__PURE__ */ new Set([
|
|
319
319
|
"calldata",
|
|
320
320
|
"memory",
|
|
321
321
|
"storage"
|
|
@@ -573,7 +573,7 @@ function Vh(e, t = {}) {
|
|
|
573
573
|
const n = pt(r.parameters), i = [], s = n.length;
|
|
574
574
|
for (let a = 0; a < s; a++)
|
|
575
575
|
i.push(Or(n[a], {
|
|
576
|
-
modifiers:
|
|
576
|
+
modifiers: ia,
|
|
577
577
|
structs: t,
|
|
578
578
|
type: "function"
|
|
579
579
|
}));
|
|
@@ -582,7 +582,7 @@ function Vh(e, t = {}) {
|
|
|
582
582
|
const a = pt(r.returns), c = a.length;
|
|
583
583
|
for (let f = 0; f < c; f++)
|
|
584
584
|
o.push(Or(a[f], {
|
|
585
|
-
modifiers:
|
|
585
|
+
modifiers: ia,
|
|
586
586
|
structs: t,
|
|
587
587
|
type: "function"
|
|
588
588
|
}));
|
|
@@ -671,7 +671,7 @@ function Or(e, t) {
|
|
|
671
671
|
type: t == null ? void 0 : t.type,
|
|
672
672
|
modifier: i.modifier
|
|
673
673
|
});
|
|
674
|
-
if (
|
|
674
|
+
if (ia.has(i.modifier) && !r0(c, !!i.array))
|
|
675
675
|
throw new $h({
|
|
676
676
|
param: e,
|
|
677
677
|
type: t == null ? void 0 : t.type,
|
|
@@ -878,7 +878,7 @@ class o0 extends $ {
|
|
|
878
878
|
});
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
class
|
|
881
|
+
class Uc extends $ {
|
|
882
882
|
constructor({ docsPath: t }) {
|
|
883
883
|
super([
|
|
884
884
|
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
@@ -917,7 +917,7 @@ class Tf extends $ {
|
|
|
917
917
|
}), this.data = t, this.params = r, this.size = n;
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
class
|
|
920
|
+
class Ua extends $ {
|
|
921
921
|
constructor() {
|
|
922
922
|
super('Cannot decode zero data ("0x") with ABI parameters.', {
|
|
923
923
|
name: "AbiDecodingZeroDataError"
|
|
@@ -1013,7 +1013,7 @@ class kf extends $ {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
class
|
|
1016
|
+
class Nc extends $ {
|
|
1017
1017
|
constructor(t, { docsPath: r } = {}) {
|
|
1018
1018
|
super([
|
|
1019
1019
|
`Event ${t ? `"${t}" ` : ""}not found on ABI.`,
|
|
@@ -1118,7 +1118,7 @@ class ms extends $ {
|
|
|
1118
1118
|
}), this.abiItem = t, this.data = r, this.params = n, this.size = i;
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
|
-
class
|
|
1121
|
+
class Na extends $ {
|
|
1122
1122
|
constructor({ abiItem: t, param: r }) {
|
|
1123
1123
|
super([
|
|
1124
1124
|
`Expected a topic for indexed event parameter${r.name ? ` "${r.name}"` : ""} on event "${jt(t, { includeName: !0 })}".`
|
|
@@ -1183,7 +1183,7 @@ class Cf extends $ {
|
|
|
1183
1183
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
class
|
|
1186
|
+
class Fc extends $ {
|
|
1187
1187
|
constructor({ size: t, targetSize: r, type: n }) {
|
|
1188
1188
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`, { name: "InvalidBytesLengthError" });
|
|
1189
1189
|
}
|
|
@@ -1315,7 +1315,7 @@ const Ot = {
|
|
|
1315
1315
|
a: 97,
|
|
1316
1316
|
f: 102
|
|
1317
1317
|
};
|
|
1318
|
-
function
|
|
1318
|
+
function $c(e) {
|
|
1319
1319
|
if (e >= Ot.zero && e <= Ot.nine)
|
|
1320
1320
|
return e - Ot.zero;
|
|
1321
1321
|
if (e >= Ot.A && e <= Ot.F)
|
|
@@ -1330,7 +1330,7 @@ function zt(e, t = {}) {
|
|
|
1330
1330
|
n.length % 2 && (n = `0${n}`);
|
|
1331
1331
|
const i = n.length / 2, s = new Uint8Array(i);
|
|
1332
1332
|
for (let o = 0, a = 0; o < i; o++) {
|
|
1333
|
-
const c =
|
|
1333
|
+
const c = $c(n.charCodeAt(a++)), f = $c(n.charCodeAt(a++));
|
|
1334
1334
|
if (c === void 0 || f === void 0)
|
|
1335
1335
|
throw new $(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
|
|
1336
1336
|
s[o] = c * 16 + f;
|
|
@@ -1375,9 +1375,9 @@ function Uf(e, t) {
|
|
|
1375
1375
|
if (e.length < r)
|
|
1376
1376
|
throw new Error("digestInto() expects output buffer of length at least " + r);
|
|
1377
1377
|
}
|
|
1378
|
-
const Hi = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
1378
|
+
const Hi = /* @__PURE__ */ BigInt(2 ** 32 - 1), Mc = /* @__PURE__ */ BigInt(32);
|
|
1379
1379
|
function I0(e, t = !1) {
|
|
1380
|
-
return t ? { h: Number(e & Hi), l: Number(e >>
|
|
1380
|
+
return t ? { h: Number(e & Hi), l: Number(e >> Mc & Hi) } : { h: Number(e >> Mc & Hi) | 0, l: Number(e & Hi) | 0 };
|
|
1381
1381
|
}
|
|
1382
1382
|
function k0(e, t = !1) {
|
|
1383
1383
|
let r = new Uint32Array(e.length), n = new Uint32Array(e.length);
|
|
@@ -1398,11 +1398,11 @@ function yo(e) {
|
|
|
1398
1398
|
function mt(e, t) {
|
|
1399
1399
|
return e << 32 - t | e >>> t;
|
|
1400
1400
|
}
|
|
1401
|
-
const
|
|
1401
|
+
const Hc = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1402
1402
|
function U0(e) {
|
|
1403
1403
|
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1405
|
+
function Dc(e) {
|
|
1406
1406
|
for (let t = 0; t < e.length; t++)
|
|
1407
1407
|
e[t] = U0(e[t]);
|
|
1408
1408
|
}
|
|
@@ -1412,7 +1412,7 @@ function N0(e) {
|
|
|
1412
1412
|
throw new Error("utf8ToBytes expected string, got " + typeof e);
|
|
1413
1413
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Fa(e) {
|
|
1416
1416
|
return typeof e == "string" && (e = N0(e)), Cs(e), e;
|
|
1417
1417
|
}
|
|
1418
1418
|
function Q_(...e) {
|
|
@@ -1435,7 +1435,7 @@ let Nf = class {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
1437
|
function Ff(e) {
|
|
1438
|
-
const t = (n) => e().update(
|
|
1438
|
+
const t = (n) => e().update(Fa(n)).digest(), r = e();
|
|
1439
1439
|
return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t;
|
|
1440
1440
|
}
|
|
1441
1441
|
function tv(e = 32) {
|
|
@@ -1453,20 +1453,20 @@ for (let e = 0, t = kn, r = 1, n = 0; e < 24; e++) {
|
|
|
1453
1453
|
t = (t << kn ^ (t >> M0) * D0) % H0, t & $0 && (i ^= kn << (kn << /* @__PURE__ */ BigInt(s)) - kn);
|
|
1454
1454
|
Hf.push(i);
|
|
1455
1455
|
}
|
|
1456
|
-
const [j0, G0] = /* @__PURE__ */ k0(Hf, !0),
|
|
1456
|
+
const [j0, G0] = /* @__PURE__ */ k0(Hf, !0), jc = (e, t, r) => r > 32 ? O0(e, t, r) : B0(e, t, r), Gc = (e, t, r) => r > 32 ? R0(e, t, r) : C0(e, t, r);
|
|
1457
1457
|
function z0(e, t = 24) {
|
|
1458
1458
|
const r = new Uint32Array(10);
|
|
1459
1459
|
for (let n = 24 - t; n < 24; n++) {
|
|
1460
1460
|
for (let o = 0; o < 10; o++)
|
|
1461
1461
|
r[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
|
|
1462
1462
|
for (let o = 0; o < 10; o += 2) {
|
|
1463
|
-
const a = (o + 8) % 10, c = (o + 2) % 10, f = r[c], l = r[c + 1], h =
|
|
1463
|
+
const a = (o + 8) % 10, c = (o + 2) % 10, f = r[c], l = r[c + 1], h = jc(f, l, 1) ^ r[a], m = Gc(f, l, 1) ^ r[a + 1];
|
|
1464
1464
|
for (let p = 0; p < 50; p += 10)
|
|
1465
1465
|
e[o + p] ^= h, e[o + p + 1] ^= m;
|
|
1466
1466
|
}
|
|
1467
1467
|
let i = e[2], s = e[3];
|
|
1468
1468
|
for (let o = 0; o < 24; o++) {
|
|
1469
|
-
const a = Mf[o], c =
|
|
1469
|
+
const a = Mf[o], c = jc(i, s, a), f = Gc(i, s, a), l = $f[o];
|
|
1470
1470
|
i = e[l], s = e[l + 1], e[l] = c, e[l + 1] = f;
|
|
1471
1471
|
}
|
|
1472
1472
|
for (let o = 0; o < 50; o += 10) {
|
|
@@ -1479,7 +1479,7 @@ function z0(e, t = 24) {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
r.fill(0);
|
|
1481
1481
|
}
|
|
1482
|
-
class
|
|
1482
|
+
class $a extends Nf {
|
|
1483
1483
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1484
1484
|
constructor(t, r, n, i = !1, s = 24) {
|
|
1485
1485
|
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = r, this.outputLen = n, this.enableXOF = i, this.rounds = s, bs(n), 0 >= this.blockLen || this.blockLen >= 200)
|
|
@@ -1487,12 +1487,12 @@ class Na extends Nf {
|
|
|
1487
1487
|
this.state = new Uint8Array(200), this.state32 = L0(this.state);
|
|
1488
1488
|
}
|
|
1489
1489
|
keccak() {
|
|
1490
|
-
|
|
1490
|
+
Hc || Dc(this.state32), z0(this.state32, this.rounds), Hc || Dc(this.state32), this.posOut = 0, this.pos = 0;
|
|
1491
1491
|
}
|
|
1492
1492
|
update(t) {
|
|
1493
1493
|
gs(this);
|
|
1494
1494
|
const { blockLen: r, state: n } = this;
|
|
1495
|
-
t =
|
|
1495
|
+
t = Fa(t);
|
|
1496
1496
|
const i = t.length;
|
|
1497
1497
|
for (let s = 0; s < i; ) {
|
|
1498
1498
|
const o = Math.min(r - this.pos, i - s);
|
|
@@ -1540,10 +1540,10 @@ class Na extends Nf {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
_cloneInto(t) {
|
|
1542
1542
|
const { blockLen: r, suffix: n, outputLen: i, rounds: s, enableXOF: o } = this;
|
|
1543
|
-
return t || (t = new
|
|
1543
|
+
return t || (t = new $a(r, n, i, o, s)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = s, t.suffix = n, t.outputLen = i, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
1544
1544
|
}
|
|
1545
1545
|
}
|
|
1546
|
-
const q0 = (e, t, r) => Ff(() => new
|
|
1546
|
+
const q0 = (e, t, r) => Ff(() => new $a(t, e, r)), V0 = /* @__PURE__ */ q0(1, 136, 256 / 8);
|
|
1547
1547
|
function En(e, t) {
|
|
1548
1548
|
const r = t || "hex", n = V0(hr(e, { strict: !1 }) ? xi(e) : e);
|
|
1549
1549
|
return r === "bytes" ? n : X(n);
|
|
@@ -1690,7 +1690,7 @@ function ep(e, t, r, { strict: n } = {}) {
|
|
|
1690
1690
|
return n && Gf(i, t, r), i;
|
|
1691
1691
|
}
|
|
1692
1692
|
const tp = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, qf = /^(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)?$/;
|
|
1693
|
-
function
|
|
1693
|
+
function Ma(e, t) {
|
|
1694
1694
|
if (e.length !== t.length)
|
|
1695
1695
|
throw new u0({
|
|
1696
1696
|
expectedLength: e.length,
|
|
@@ -1699,17 +1699,17 @@ function Fa(e, t) {
|
|
|
1699
1699
|
const r = rp({
|
|
1700
1700
|
params: e,
|
|
1701
1701
|
values: t
|
|
1702
|
-
}), n =
|
|
1702
|
+
}), n = Da(r);
|
|
1703
1703
|
return n.length === 0 ? "0x" : n;
|
|
1704
1704
|
}
|
|
1705
1705
|
function rp({ params: e, values: t }) {
|
|
1706
1706
|
const r = [];
|
|
1707
1707
|
for (let n = 0; n < e.length; n++)
|
|
1708
|
-
r.push(
|
|
1708
|
+
r.push(Ha({ param: e[n], value: t[n] }));
|
|
1709
1709
|
return r;
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1712
|
-
const r =
|
|
1711
|
+
function Ha({ param: e, value: t }) {
|
|
1712
|
+
const r = ja(e.type);
|
|
1713
1713
|
if (r) {
|
|
1714
1714
|
const [n, i] = r;
|
|
1715
1715
|
return ip(t, { length: n, param: { ...e, type: i } });
|
|
@@ -1737,7 +1737,7 @@ function $a({ param: e, value: t }) {
|
|
|
1737
1737
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
1738
1738
|
});
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function Da(e) {
|
|
1741
1741
|
let t = 0;
|
|
1742
1742
|
for (let s = 0; s < e.length; s++) {
|
|
1743
1743
|
const { dynamic: o, encoded: a } = e[s];
|
|
@@ -1769,11 +1769,11 @@ function ip(e, { length: t, param: r }) {
|
|
|
1769
1769
|
let i = !1;
|
|
1770
1770
|
const s = [];
|
|
1771
1771
|
for (let o = 0; o < e.length; o++) {
|
|
1772
|
-
const a =
|
|
1772
|
+
const a = Ha({ param: r, value: e[o] });
|
|
1773
1773
|
a.dynamic && (i = !0), s.push(a);
|
|
1774
1774
|
}
|
|
1775
1775
|
if (n || i) {
|
|
1776
|
-
const o =
|
|
1776
|
+
const o = Da(s);
|
|
1777
1777
|
if (n) {
|
|
1778
1778
|
const a = J(s.length, { size: 32 });
|
|
1779
1779
|
return {
|
|
@@ -1851,7 +1851,7 @@ function up(e, { param: t }) {
|
|
|
1851
1851
|
let r = !1;
|
|
1852
1852
|
const n = [];
|
|
1853
1853
|
for (let i = 0; i < t.components.length; i++) {
|
|
1854
|
-
const s = t.components[i], o = Array.isArray(e) ? i : s.name, a =
|
|
1854
|
+
const s = t.components[i], o = Array.isArray(e) ? i : s.name, a = Ha({
|
|
1855
1855
|
param: s,
|
|
1856
1856
|
value: e[o]
|
|
1857
1857
|
});
|
|
@@ -1859,19 +1859,19 @@ function up(e, { param: t }) {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
return {
|
|
1861
1861
|
dynamic: r,
|
|
1862
|
-
encoded: r ?
|
|
1862
|
+
encoded: r ? Da(n) : ln(n.map(({ encoded: i }) => i))
|
|
1863
1863
|
};
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function ja(e) {
|
|
1866
1866
|
const t = e.match(/^(.*)\[(\d+)?\]$/);
|
|
1867
1867
|
return t ? (
|
|
1868
1868
|
// Return `null` if the array is dynamic.
|
|
1869
1869
|
[t[2] ? Number(t[2]) : null, t[1]]
|
|
1870
1870
|
) : void 0;
|
|
1871
1871
|
}
|
|
1872
|
-
const
|
|
1872
|
+
const Ga = (e) => Xn(Df(e), 0, 4);
|
|
1873
1873
|
function Si(e) {
|
|
1874
|
-
const { abi: t, args: r = [], name: n } = e, i = hr(n, { strict: !1 }), s = t.filter((a) => i ? a.type === "function" ?
|
|
1874
|
+
const { abi: t, args: r = [], name: n } = e, i = hr(n, { strict: !1 }), s = t.filter((a) => i ? a.type === "function" ? Ga(a) === n : a.type === "event" ? Os(a) === n : !1 : "name" in a && a.name === n);
|
|
1875
1875
|
if (s.length === 0)
|
|
1876
1876
|
return;
|
|
1877
1877
|
if (s.length === 1)
|
|
@@ -1889,7 +1889,7 @@ function Si(e) {
|
|
|
1889
1889
|
continue;
|
|
1890
1890
|
if (r.every((f, l) => {
|
|
1891
1891
|
const h = "inputs" in a && a.inputs[l];
|
|
1892
|
-
return h ?
|
|
1892
|
+
return h ? sa(f, h) : !1;
|
|
1893
1893
|
})) {
|
|
1894
1894
|
if (o && "inputs" in o && o.inputs) {
|
|
1895
1895
|
const f = Vf(a.inputs, o.inputs, r);
|
|
@@ -1907,7 +1907,7 @@ function Si(e) {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
return o || s[0];
|
|
1909
1909
|
}
|
|
1910
|
-
function
|
|
1910
|
+
function sa(e, t) {
|
|
1911
1911
|
const r = typeof e, n = t.type;
|
|
1912
1912
|
switch (n) {
|
|
1913
1913
|
case "address":
|
|
@@ -1919,7 +1919,7 @@ function na(e, t) {
|
|
|
1919
1919
|
case "string":
|
|
1920
1920
|
return r === "string";
|
|
1921
1921
|
default:
|
|
1922
|
-
return n === "tuple" && "components" in t ? Object.values(t.components).every((i, s) =>
|
|
1922
|
+
return n === "tuple" && "components" in t ? Object.values(t.components).every((i, s) => sa(Object.values(e)[s], i)) : /^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(n) ? r === "number" || r === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n) ? r === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n) ? Array.isArray(e) && e.every((i) => sa(i, {
|
|
1923
1923
|
...t,
|
|
1924
1924
|
// Pop off `[]` or `[M]` from end of type
|
|
1925
1925
|
type: n.replace(/(\[[0-9]{0,}\])$/, "")
|
|
@@ -1936,33 +1936,33 @@ function Vf(e, t, r) {
|
|
|
1936
1936
|
return o;
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
|
-
const
|
|
1940
|
-
function
|
|
1939
|
+
const zc = "/docs/contract/encodeEventTopics";
|
|
1940
|
+
function za(e) {
|
|
1941
1941
|
var c;
|
|
1942
1942
|
const { abi: t, eventName: r, args: n } = e;
|
|
1943
1943
|
let i = t[0];
|
|
1944
1944
|
if (r) {
|
|
1945
1945
|
const f = Si({ abi: t, name: r });
|
|
1946
1946
|
if (!f)
|
|
1947
|
-
throw new
|
|
1947
|
+
throw new Nc(r, { docsPath: zc });
|
|
1948
1948
|
i = f;
|
|
1949
1949
|
}
|
|
1950
1950
|
if (i.type !== "event")
|
|
1951
|
-
throw new
|
|
1951
|
+
throw new Nc(void 0, { docsPath: zc });
|
|
1952
1952
|
const s = jt(i), o = Os(s);
|
|
1953
1953
|
let a = [];
|
|
1954
1954
|
if (n && "inputs" in i) {
|
|
1955
1955
|
const f = (c = i.inputs) == null ? void 0 : c.filter((h) => "indexed" in h && h.indexed), l = Array.isArray(n) ? n : Object.values(n).length > 0 ? (f == null ? void 0 : f.map((h) => n[h.name])) ?? [] : [];
|
|
1956
|
-
l.length > 0 && (a = (f == null ? void 0 : f.map((h, m) => Array.isArray(l[m]) ? l[m].map((p, g) =>
|
|
1956
|
+
l.length > 0 && (a = (f == null ? void 0 : f.map((h, m) => Array.isArray(l[m]) ? l[m].map((p, g) => qc({ param: h, value: l[m][g] })) : typeof l[m] < "u" && l[m] !== null ? qc({ param: h, value: l[m] }) : null)) ?? []);
|
|
1957
1957
|
}
|
|
1958
1958
|
return [o, ...a];
|
|
1959
1959
|
}
|
|
1960
|
-
function
|
|
1960
|
+
function qc({ param: e, value: t }) {
|
|
1961
1961
|
if (e.type === "string" || e.type === "bytes")
|
|
1962
1962
|
return En(xi(t));
|
|
1963
1963
|
if (e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/))
|
|
1964
1964
|
throw new g0(e.type);
|
|
1965
|
-
return
|
|
1965
|
+
return Ma([e], [t]);
|
|
1966
1966
|
}
|
|
1967
1967
|
function fp(e, { method: t }) {
|
|
1968
1968
|
var n, i;
|
|
@@ -1974,7 +1974,7 @@ function fp(e, { method: t }) {
|
|
|
1974
1974
|
async function Wf(e, t) {
|
|
1975
1975
|
const { address: r, abi: n, args: i, eventName: s, fromBlock: o, strict: a, toBlock: c } = t, f = fp(e, {
|
|
1976
1976
|
method: "eth_newFilter"
|
|
1977
|
-
}), l = s ?
|
|
1977
|
+
}), l = s ? za({
|
|
1978
1978
|
abi: n,
|
|
1979
1979
|
args: i,
|
|
1980
1980
|
eventName: s
|
|
@@ -2002,7 +2002,7 @@ async function Wf(e, t) {
|
|
|
2002
2002
|
function Le(e) {
|
|
2003
2003
|
return typeof e == "string" ? { address: e, type: "json-rpc" } : e;
|
|
2004
2004
|
}
|
|
2005
|
-
const
|
|
2005
|
+
const Vc = "/docs/contract/encodeFunctionData";
|
|
2006
2006
|
function dp(e) {
|
|
2007
2007
|
const { abi: t, args: r, functionName: n } = e;
|
|
2008
2008
|
let i = t[0];
|
|
@@ -2013,21 +2013,21 @@ function dp(e) {
|
|
|
2013
2013
|
name: n
|
|
2014
2014
|
});
|
|
2015
2015
|
if (!s)
|
|
2016
|
-
throw new ys(n, { docsPath:
|
|
2016
|
+
throw new ys(n, { docsPath: Vc });
|
|
2017
2017
|
i = s;
|
|
2018
2018
|
}
|
|
2019
2019
|
if (i.type !== "function")
|
|
2020
|
-
throw new ys(void 0, { docsPath:
|
|
2020
|
+
throw new ys(void 0, { docsPath: Vc });
|
|
2021
2021
|
return {
|
|
2022
2022
|
abi: [i],
|
|
2023
|
-
functionName:
|
|
2023
|
+
functionName: Ga(jt(i))
|
|
2024
2024
|
};
|
|
2025
2025
|
}
|
|
2026
2026
|
function xn(e) {
|
|
2027
2027
|
const { args: t } = e, { abi: r, functionName: n } = (() => {
|
|
2028
2028
|
var a;
|
|
2029
2029
|
return e.abi.length === 1 && ((a = e.functionName) != null && a.startsWith("0x")) ? e : dp(e);
|
|
2030
|
-
})(), i = r[0], s = n, o = "inputs" in i && i.inputs ?
|
|
2030
|
+
})(), i = r[0], s = n, o = "inputs" in i && i.inputs ? Ma(i.inputs, t ?? []) : void 0;
|
|
2031
2031
|
return Xt([s, o ?? "0x"]);
|
|
2032
2032
|
}
|
|
2033
2033
|
const lp = {
|
|
@@ -2059,7 +2059,7 @@ const lp = {
|
|
|
2059
2059
|
name: "Panic",
|
|
2060
2060
|
type: "error"
|
|
2061
2061
|
};
|
|
2062
|
-
class
|
|
2062
|
+
class Wc extends $ {
|
|
2063
2063
|
constructor({ offset: t }) {
|
|
2064
2064
|
super(`Offset \`${t}\` cannot be negative.`, {
|
|
2065
2065
|
name: "NegativeOffsetError"
|
|
@@ -2099,7 +2099,7 @@ const mp = {
|
|
|
2099
2099
|
},
|
|
2100
2100
|
decrementPosition(e) {
|
|
2101
2101
|
if (e < 0)
|
|
2102
|
-
throw new
|
|
2102
|
+
throw new Wc({ offset: e });
|
|
2103
2103
|
const t = this.position - e;
|
|
2104
2104
|
this.assertPosition(t), this.position = t;
|
|
2105
2105
|
},
|
|
@@ -2108,7 +2108,7 @@ const mp = {
|
|
|
2108
2108
|
},
|
|
2109
2109
|
incrementPosition(e) {
|
|
2110
2110
|
if (e < 0)
|
|
2111
|
-
throw new
|
|
2111
|
+
throw new Wc({ offset: e });
|
|
2112
2112
|
const t = this.position + e;
|
|
2113
2113
|
this.assertPosition(t), this.position = t;
|
|
2114
2114
|
},
|
|
@@ -2198,7 +2198,7 @@ const mp = {
|
|
|
2198
2198
|
this.positionReadCount.set(this.position, e + 1), e > 0 && this.recursiveReadCount++;
|
|
2199
2199
|
}
|
|
2200
2200
|
};
|
|
2201
|
-
function
|
|
2201
|
+
function qa(e, { recursiveReadLimit: t = 8192 } = {}) {
|
|
2202
2202
|
const r = Object.create(mp);
|
|
2203
2203
|
return r.bytes = e, r.dataView = new DataView(e.buffer, e.byteOffset, e.byteLength), r.positionReadCount = /* @__PURE__ */ new Map(), r.recursiveReadLimit = t, r;
|
|
2204
2204
|
}
|
|
@@ -2223,9 +2223,9 @@ function wp(e, t = {}) {
|
|
|
2223
2223
|
return typeof t.size < "u" && (It(r, { size: t.size }), r = Rr(r, { dir: "right" })), new TextDecoder().decode(r);
|
|
2224
2224
|
}
|
|
2225
2225
|
function Ls(e, t) {
|
|
2226
|
-
const r = typeof t == "string" ? zt(t) : t, n =
|
|
2226
|
+
const r = typeof t == "string" ? zt(t) : t, n = qa(r);
|
|
2227
2227
|
if (Ie(r) === 0 && e.length > 0)
|
|
2228
|
-
throw new
|
|
2228
|
+
throw new Ua();
|
|
2229
2229
|
if (Ie(t) && Ie(t) < 32)
|
|
2230
2230
|
throw new Tf({
|
|
2231
2231
|
data: typeof t == "string" ? t : Je(t),
|
|
@@ -2245,7 +2245,7 @@ function Ls(e, t) {
|
|
|
2245
2245
|
return s;
|
|
2246
2246
|
}
|
|
2247
2247
|
function on(e, t, { staticPosition: r }) {
|
|
2248
|
-
const n =
|
|
2248
|
+
const n = ja(t.type);
|
|
2249
2249
|
if (n) {
|
|
2250
2250
|
const [i, s] = n;
|
|
2251
2251
|
return vp(e, { ...t, type: s }, { length: i, staticPosition: r });
|
|
@@ -2266,16 +2266,16 @@ function on(e, t, { staticPosition: r }) {
|
|
|
2266
2266
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
2267
2267
|
});
|
|
2268
2268
|
}
|
|
2269
|
-
const
|
|
2269
|
+
const Kc = 32, oa = 32;
|
|
2270
2270
|
function _p(e) {
|
|
2271
2271
|
const t = e.readBytes(32);
|
|
2272
2272
|
return [Ai(Je(zf(t, -20))), 32];
|
|
2273
2273
|
}
|
|
2274
2274
|
function vp(e, t, { length: r, staticPosition: n }) {
|
|
2275
2275
|
if (!r) {
|
|
2276
|
-
const o = Ht(e.readBytes(
|
|
2276
|
+
const o = Ht(e.readBytes(oa)), a = n + o, c = a + Kc;
|
|
2277
2277
|
e.setPosition(a);
|
|
2278
|
-
const f = Ht(e.readBytes(
|
|
2278
|
+
const f = Ht(e.readBytes(Kc)), l = Jn(t);
|
|
2279
2279
|
let h = 0;
|
|
2280
2280
|
const m = [];
|
|
2281
2281
|
for (let p = 0; p < f; ++p) {
|
|
@@ -2288,7 +2288,7 @@ function vp(e, t, { length: r, staticPosition: n }) {
|
|
|
2288
2288
|
return e.setPosition(n + 32), [m, 32];
|
|
2289
2289
|
}
|
|
2290
2290
|
if (Jn(t)) {
|
|
2291
|
-
const o = Ht(e.readBytes(
|
|
2291
|
+
const o = Ht(e.readBytes(oa)), a = n + o, c = [];
|
|
2292
2292
|
for (let f = 0; f < r; ++f) {
|
|
2293
2293
|
e.setPosition(a + f * 32);
|
|
2294
2294
|
const [l] = on(e, t, {
|
|
@@ -2335,7 +2335,7 @@ function Sp(e, t, { staticPosition: r }) {
|
|
|
2335
2335
|
const n = t.components.length === 0 || t.components.some(({ name: o }) => !o), i = n ? [] : {};
|
|
2336
2336
|
let s = 0;
|
|
2337
2337
|
if (Jn(t)) {
|
|
2338
|
-
const o = Ht(e.readBytes(
|
|
2338
|
+
const o = Ht(e.readBytes(oa)), a = r + o;
|
|
2339
2339
|
for (let c = 0; c < t.components.length; ++c) {
|
|
2340
2340
|
const f = t.components[c];
|
|
2341
2341
|
e.setPosition(a + s);
|
|
@@ -2370,14 +2370,14 @@ function Jn(e) {
|
|
|
2370
2370
|
return !0;
|
|
2371
2371
|
if (t === "tuple")
|
|
2372
2372
|
return (n = e.components) == null ? void 0 : n.some(Jn);
|
|
2373
|
-
const r =
|
|
2373
|
+
const r = ja(e.type);
|
|
2374
2374
|
return !!(r && Jn({ ...e, type: r[1] }));
|
|
2375
2375
|
}
|
|
2376
2376
|
function Tp(e) {
|
|
2377
2377
|
const { abi: t, data: r } = e, n = Xn(r, 0, 4);
|
|
2378
2378
|
if (n === "0x")
|
|
2379
|
-
throw new
|
|
2380
|
-
const s = [...t || [], hp, pp].find((o) => o.type === "error" && n ===
|
|
2379
|
+
throw new Ua();
|
|
2380
|
+
const s = [...t || [], hp, pp].find((o) => o.type === "error" && n === Ga(jt(o)));
|
|
2381
2381
|
if (!s)
|
|
2382
2382
|
throw new If(n, {
|
|
2383
2383
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
@@ -2410,7 +2410,7 @@ function Xf(e, t) {
|
|
|
2410
2410
|
];
|
|
2411
2411
|
return s = s.replace(/(0+)$/, ""), `${n ? "-" : ""}${i || "0"}${s ? `.${s}` : ""}`;
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function Va(e, t = "wei") {
|
|
2414
2414
|
return Xf(e, Ip[t]);
|
|
2415
2415
|
}
|
|
2416
2416
|
function et(e, t = "wei") {
|
|
@@ -2430,7 +2430,7 @@ class Cp extends $ {
|
|
|
2430
2430
|
});
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2433
|
+
function Yc(e) {
|
|
2434
2434
|
return e.reduce((t, { slot: r, value: n }) => `${t} ${r}: ${n}
|
|
2435
2435
|
`, "");
|
|
2436
2436
|
}
|
|
@@ -2442,8 +2442,8 @@ function Op(e) {
|
|
|
2442
2442
|
`), n.balance && (i += ` balance: ${n.balance}
|
|
2443
2443
|
`), n.code && (i += ` code: ${n.code}
|
|
2444
2444
|
`), n.state && (i += ` state:
|
|
2445
|
-
`, i +=
|
|
2446
|
-
`, i +=
|
|
2445
|
+
`, i += Yc(n.state)), n.stateDiff && (i += ` stateDiff:
|
|
2446
|
+
`, i += Yc(n.stateDiff)), i;
|
|
2447
2447
|
}, ` State Override:
|
|
2448
2448
|
`).slice(0, -1);
|
|
2449
2449
|
}
|
|
@@ -2501,7 +2501,7 @@ class Fp extends $ {
|
|
|
2501
2501
|
chain: i && `${i == null ? void 0 : i.name} (id: ${i == null ? void 0 : i.id})`,
|
|
2502
2502
|
from: r == null ? void 0 : r.address,
|
|
2503
2503
|
to: h,
|
|
2504
|
-
value: typeof m < "u" && `${
|
|
2504
|
+
value: typeof m < "u" && `${Va(m)} ${((g = i == null ? void 0 : i.nativeCurrency) == null ? void 0 : g.symbol) || "ETH"}`,
|
|
2505
2505
|
data: s,
|
|
2506
2506
|
gas: o,
|
|
2507
2507
|
gasPrice: typeof a < "u" && `${et(a)} gwei`,
|
|
@@ -2534,7 +2534,7 @@ class Mp extends $ {
|
|
|
2534
2534
|
let v = Pi({
|
|
2535
2535
|
from: g == null ? void 0 : g.address,
|
|
2536
2536
|
to: h,
|
|
2537
|
-
value: typeof m < "u" && `${
|
|
2537
|
+
value: typeof m < "u" && `${Va(m)} ${((x = i == null ? void 0 : i.nativeCurrency) == null ? void 0 : x.symbol) || "ETH"}`,
|
|
2538
2538
|
data: s,
|
|
2539
2539
|
gas: o,
|
|
2540
2540
|
gasPrice: typeof a < "u" && `${et(a)} gwei`,
|
|
@@ -3202,7 +3202,7 @@ class qp extends tt {
|
|
|
3202
3202
|
}
|
|
3203
3203
|
const Vp = 3;
|
|
3204
3204
|
function Us(e, { abi: t, address: r, args: n, docsPath: i, functionName: s, sender: o }) {
|
|
3205
|
-
const a = e instanceof Zf ? e : e instanceof $ ? e.walk((g) => "data" in g) || e.walk() : {}, { code: c, data: f, details: l, message: h, shortMessage: m } = a, p = e instanceof
|
|
3205
|
+
const a = e instanceof Zf ? e : e instanceof $ ? e.walk((g) => "data" in g) || e.walk() : {}, { code: c, data: f, details: l, message: h, shortMessage: m } = a, p = e instanceof Ua ? new jp({ functionName: s }) : [Vp, Lr.code].includes(c) && (f || l || h || m) ? new Dp({
|
|
3206
3206
|
abi: t,
|
|
3207
3207
|
data: typeof f == "object" ? f.data : f,
|
|
3208
3208
|
functionName: s,
|
|
@@ -3222,17 +3222,17 @@ function Wp(e) {
|
|
|
3222
3222
|
return Ai(`0x${t}`);
|
|
3223
3223
|
}
|
|
3224
3224
|
async function Kp({ hash: e, signature: t }) {
|
|
3225
|
-
const r = hr(e) ? e : X(e), { secp256k1: n } = await import("./secp256k1-
|
|
3225
|
+
const r = hr(e) ? e : X(e), { secp256k1: n } = await import("./secp256k1-COkOPbFq.js");
|
|
3226
3226
|
return `0x${(() => {
|
|
3227
3227
|
if (typeof t == "object" && "r" in t && "s" in t) {
|
|
3228
|
-
const { r: f, s: l, v: h, yParity: m } = t, p = Number(m ?? h), g =
|
|
3228
|
+
const { r: f, s: l, v: h, yParity: m } = t, p = Number(m ?? h), g = Xc(p);
|
|
3229
3229
|
return new n.Signature(ft(f), ft(l)).addRecoveryBit(g);
|
|
3230
3230
|
}
|
|
3231
|
-
const o = hr(t) ? t : X(t), a = Gt(`0x${o.slice(130)}`), c =
|
|
3231
|
+
const o = hr(t) ? t : X(t), a = Gt(`0x${o.slice(130)}`), c = Xc(a);
|
|
3232
3232
|
return n.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(c);
|
|
3233
3233
|
})().recoverPublicKey(r.substring(2)).toHex(!1)}`;
|
|
3234
3234
|
}
|
|
3235
|
-
function
|
|
3235
|
+
function Xc(e) {
|
|
3236
3236
|
if (e === 0 || e === 1)
|
|
3237
3237
|
return e;
|
|
3238
3238
|
if (e === 27)
|
|
@@ -3245,7 +3245,7 @@ async function Yp({ hash: e, signature: t }) {
|
|
|
3245
3245
|
return Wp(await Kp({ hash: e, signature: t }));
|
|
3246
3246
|
}
|
|
3247
3247
|
function pr(e, t = "hex") {
|
|
3248
|
-
const r = td(e), n =
|
|
3248
|
+
const r = td(e), n = qa(new Uint8Array(r.length));
|
|
3249
3249
|
return r.encode(n), t === "hex" ? Je(n.bytes) : n.bytes;
|
|
3250
3250
|
}
|
|
3251
3251
|
function td(e) {
|
|
@@ -3306,7 +3306,7 @@ class Qp extends $ {
|
|
|
3306
3306
|
const p = Pi({
|
|
3307
3307
|
from: r == null ? void 0 : r.address,
|
|
3308
3308
|
to: h,
|
|
3309
|
-
value: typeof m < "u" && `${
|
|
3309
|
+
value: typeof m < "u" && `${Va(m)} ${((g = i == null ? void 0 : i.nativeCurrency) == null ? void 0 : g.symbol) || "ETH"}`,
|
|
3310
3310
|
data: s,
|
|
3311
3311
|
gas: o,
|
|
3312
3312
|
gasPrice: typeof a < "u" && `${et(a)} gwei`,
|
|
@@ -3367,7 +3367,7 @@ Object.defineProperty(Ur, "nodeMessage", {
|
|
|
3367
3367
|
writable: !0,
|
|
3368
3368
|
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
3369
3369
|
});
|
|
3370
|
-
class
|
|
3370
|
+
class aa extends $ {
|
|
3371
3371
|
constructor({ cause: t, maxFeePerGas: r } = {}) {
|
|
3372
3372
|
super(`The fee cap (\`maxFeePerGas\`${r ? ` = ${et(r)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
3373
3373
|
cause: t,
|
|
@@ -3375,24 +3375,24 @@ class sa extends $ {
|
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
3377
|
}
|
|
3378
|
-
Object.defineProperty(
|
|
3378
|
+
Object.defineProperty(aa, "nodeMessage", {
|
|
3379
3379
|
enumerable: !0,
|
|
3380
3380
|
configurable: !0,
|
|
3381
3381
|
writable: !0,
|
|
3382
3382
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
3383
3383
|
});
|
|
3384
|
-
class
|
|
3384
|
+
class ca extends $ {
|
|
3385
3385
|
constructor({ cause: t, nonce: r } = {}) {
|
|
3386
3386
|
super(`Nonce provided for the transaction ${r ? `(${r}) ` : ""}is higher than the next one expected.`, { cause: t, name: "NonceTooHighError" });
|
|
3387
3387
|
}
|
|
3388
3388
|
}
|
|
3389
|
-
Object.defineProperty(
|
|
3389
|
+
Object.defineProperty(ca, "nodeMessage", {
|
|
3390
3390
|
enumerable: !0,
|
|
3391
3391
|
configurable: !0,
|
|
3392
3392
|
writable: !0,
|
|
3393
3393
|
value: /nonce too high/
|
|
3394
3394
|
});
|
|
3395
|
-
class
|
|
3395
|
+
class ua extends $ {
|
|
3396
3396
|
constructor({ cause: t, nonce: r } = {}) {
|
|
3397
3397
|
super([
|
|
3398
3398
|
`Nonce provided for the transaction ${r ? `(${r}) ` : ""}is lower than the current nonce of the account.`,
|
|
@@ -3401,24 +3401,24 @@ class aa extends $ {
|
|
|
3401
3401
|
`), { cause: t, name: "NonceTooLowError" });
|
|
3402
3402
|
}
|
|
3403
3403
|
}
|
|
3404
|
-
Object.defineProperty(
|
|
3404
|
+
Object.defineProperty(ua, "nodeMessage", {
|
|
3405
3405
|
enumerable: !0,
|
|
3406
3406
|
configurable: !0,
|
|
3407
3407
|
writable: !0,
|
|
3408
3408
|
value: /nonce too low|transaction already imported|already known/
|
|
3409
3409
|
});
|
|
3410
|
-
class
|
|
3410
|
+
class fa extends $ {
|
|
3411
3411
|
constructor({ cause: t, nonce: r } = {}) {
|
|
3412
3412
|
super(`Nonce provided for the transaction ${r ? `(${r}) ` : ""}exceeds the maximum allowed nonce.`, { cause: t, name: "NonceMaxValueError" });
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
|
-
Object.defineProperty(
|
|
3415
|
+
Object.defineProperty(fa, "nodeMessage", {
|
|
3416
3416
|
enumerable: !0,
|
|
3417
3417
|
configurable: !0,
|
|
3418
3418
|
writable: !0,
|
|
3419
3419
|
value: /nonce has max value/
|
|
3420
3420
|
});
|
|
3421
|
-
class
|
|
3421
|
+
class da extends $ {
|
|
3422
3422
|
constructor({ cause: t } = {}) {
|
|
3423
3423
|
super([
|
|
3424
3424
|
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
@@ -3439,13 +3439,13 @@ class ua extends $ {
|
|
|
3439
3439
|
});
|
|
3440
3440
|
}
|
|
3441
3441
|
}
|
|
3442
|
-
Object.defineProperty(
|
|
3442
|
+
Object.defineProperty(da, "nodeMessage", {
|
|
3443
3443
|
enumerable: !0,
|
|
3444
3444
|
configurable: !0,
|
|
3445
3445
|
writable: !0,
|
|
3446
3446
|
value: /insufficient funds|exceeds transaction sender account balance/
|
|
3447
3447
|
});
|
|
3448
|
-
class
|
|
3448
|
+
class la extends $ {
|
|
3449
3449
|
constructor({ cause: t, gas: r } = {}) {
|
|
3450
3450
|
super(`The amount of gas ${r ? `(${r}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
3451
3451
|
cause: t,
|
|
@@ -3453,13 +3453,13 @@ class fa extends $ {
|
|
|
3453
3453
|
});
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
|
-
Object.defineProperty(
|
|
3456
|
+
Object.defineProperty(la, "nodeMessage", {
|
|
3457
3457
|
enumerable: !0,
|
|
3458
3458
|
configurable: !0,
|
|
3459
3459
|
writable: !0,
|
|
3460
3460
|
value: /intrinsic gas too high|gas limit reached/
|
|
3461
3461
|
});
|
|
3462
|
-
class
|
|
3462
|
+
class ha extends $ {
|
|
3463
3463
|
constructor({ cause: t, gas: r } = {}) {
|
|
3464
3464
|
super(`The amount of gas ${r ? `(${r}) ` : ""}provided for the transaction is too low.`, {
|
|
3465
3465
|
cause: t,
|
|
@@ -3467,13 +3467,13 @@ class da extends $ {
|
|
|
3467
3467
|
});
|
|
3468
3468
|
}
|
|
3469
3469
|
}
|
|
3470
|
-
Object.defineProperty(
|
|
3470
|
+
Object.defineProperty(ha, "nodeMessage", {
|
|
3471
3471
|
enumerable: !0,
|
|
3472
3472
|
configurable: !0,
|
|
3473
3473
|
writable: !0,
|
|
3474
3474
|
value: /intrinsic gas too low/
|
|
3475
3475
|
});
|
|
3476
|
-
class
|
|
3476
|
+
class pa extends $ {
|
|
3477
3477
|
constructor({ cause: t }) {
|
|
3478
3478
|
super("The transaction type is not supported for this chain.", {
|
|
3479
3479
|
cause: t,
|
|
@@ -3481,7 +3481,7 @@ class la extends $ {
|
|
|
3481
3481
|
});
|
|
3482
3482
|
}
|
|
3483
3483
|
}
|
|
3484
|
-
Object.defineProperty(
|
|
3484
|
+
Object.defineProperty(pa, "nodeMessage", {
|
|
3485
3485
|
enumerable: !0,
|
|
3486
3486
|
configurable: !0,
|
|
3487
3487
|
writable: !0,
|
|
@@ -3512,7 +3512,7 @@ class Ns extends $ {
|
|
|
3512
3512
|
});
|
|
3513
3513
|
}
|
|
3514
3514
|
}
|
|
3515
|
-
function
|
|
3515
|
+
function Wa(e, t) {
|
|
3516
3516
|
const r = (e.details || "").toLowerCase(), n = e instanceof $ ? e.walk((i) => (i == null ? void 0 : i.code) === nn.code) : e;
|
|
3517
3517
|
return n instanceof $ ? new nn({
|
|
3518
3518
|
cause: e,
|
|
@@ -3523,10 +3523,10 @@ function qa(e, t) {
|
|
|
3523
3523
|
}) : Ur.nodeMessage.test(r) ? new Ur({
|
|
3524
3524
|
cause: e,
|
|
3525
3525
|
maxFeePerGas: t == null ? void 0 : t.maxFeePerGas
|
|
3526
|
-
}) :
|
|
3526
|
+
}) : aa.nodeMessage.test(r) ? new aa({
|
|
3527
3527
|
cause: e,
|
|
3528
3528
|
maxFeePerGas: t == null ? void 0 : t.maxFeePerGas
|
|
3529
|
-
}) :
|
|
3529
|
+
}) : ca.nodeMessage.test(r) ? new ca({ cause: e, nonce: t == null ? void 0 : t.nonce }) : ua.nodeMessage.test(r) ? new ua({ cause: e, nonce: t == null ? void 0 : t.nonce }) : fa.nodeMessage.test(r) ? new fa({ cause: e, nonce: t == null ? void 0 : t.nonce }) : da.nodeMessage.test(r) ? new da({ cause: e }) : la.nodeMessage.test(r) ? new la({ cause: e, gas: t == null ? void 0 : t.gas }) : ha.nodeMessage.test(r) ? new ha({ cause: e, gas: t == null ? void 0 : t.gas }) : pa.nodeMessage.test(r) ? new pa({ cause: e }) : gi.nodeMessage.test(r) ? new gi({
|
|
3530
3530
|
cause: e,
|
|
3531
3531
|
maxFeePerGas: t == null ? void 0 : t.maxFeePerGas,
|
|
3532
3532
|
maxPriorityFeePerGas: t == null ? void 0 : t.maxPriorityFeePerGas
|
|
@@ -3536,7 +3536,7 @@ function qa(e, t) {
|
|
|
3536
3536
|
}
|
|
3537
3537
|
function ey(e, { docsPath: t, ...r }) {
|
|
3538
3538
|
const n = (() => {
|
|
3539
|
-
const i =
|
|
3539
|
+
const i = Wa(e, r);
|
|
3540
3540
|
return i instanceof Ns ? e : i;
|
|
3541
3541
|
})();
|
|
3542
3542
|
return new Qp(n, {
|
|
@@ -3544,7 +3544,7 @@ function ey(e, { docsPath: t, ...r }) {
|
|
|
3544
3544
|
...r
|
|
3545
3545
|
});
|
|
3546
3546
|
}
|
|
3547
|
-
function
|
|
3547
|
+
function Ka(e, { format: t }) {
|
|
3548
3548
|
if (!t)
|
|
3549
3549
|
return {};
|
|
3550
3550
|
const r = {};
|
|
@@ -3556,7 +3556,7 @@ function Va(e, { format: t }) {
|
|
|
3556
3556
|
const i = t(e || {});
|
|
3557
3557
|
return n(i), r;
|
|
3558
3558
|
}
|
|
3559
|
-
function
|
|
3559
|
+
function Ya(e, t) {
|
|
3560
3560
|
return ({ exclude: r, format: n }) => ({
|
|
3561
3561
|
exclude: r,
|
|
3562
3562
|
format: (i) => {
|
|
@@ -3594,17 +3594,17 @@ function ry(e) {
|
|
|
3594
3594
|
...typeof t.v < "u" && typeof t.yParity > "u" ? { v: J(t.v) } : {}
|
|
3595
3595
|
}));
|
|
3596
3596
|
}
|
|
3597
|
-
function
|
|
3597
|
+
function Jc(e) {
|
|
3598
3598
|
if (!(!e || e.length === 0))
|
|
3599
3599
|
return e.reduce((t, { slot: r, value: n }) => {
|
|
3600
3600
|
if (r.length !== 66)
|
|
3601
|
-
throw new
|
|
3601
|
+
throw new Fc({
|
|
3602
3602
|
size: r.length,
|
|
3603
3603
|
targetSize: 66,
|
|
3604
3604
|
type: "hex"
|
|
3605
3605
|
});
|
|
3606
3606
|
if (n.length !== 66)
|
|
3607
|
-
throw new
|
|
3607
|
+
throw new Fc({
|
|
3608
3608
|
size: n.length,
|
|
3609
3609
|
targetSize: 66,
|
|
3610
3610
|
type: "hex"
|
|
@@ -3614,10 +3614,10 @@ function Yc(e) {
|
|
|
3614
3614
|
}
|
|
3615
3615
|
function ny(e) {
|
|
3616
3616
|
const { balance: t, nonce: r, state: n, stateDiff: i, code: s } = e, o = {};
|
|
3617
|
-
if (s !== void 0 && (o.code = s), t !== void 0 && (o.balance = J(t)), r !== void 0 && (o.nonce = J(r)), n !== void 0 && (o.state =
|
|
3617
|
+
if (s !== void 0 && (o.code = s), t !== void 0 && (o.balance = J(t)), r !== void 0 && (o.nonce = J(r)), n !== void 0 && (o.state = Jc(n)), i !== void 0) {
|
|
3618
3618
|
if (o.state)
|
|
3619
3619
|
throw new Cp();
|
|
3620
|
-
o.stateDiff =
|
|
3620
|
+
o.stateDiff = Jc(i);
|
|
3621
3621
|
}
|
|
3622
3622
|
return o;
|
|
3623
3623
|
}
|
|
@@ -3655,7 +3655,7 @@ class iy extends $ {
|
|
|
3655
3655
|
});
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
|
-
class
|
|
3658
|
+
class Xa extends $ {
|
|
3659
3659
|
constructor() {
|
|
3660
3660
|
super("Chain does not support EIP-1559 fees.", {
|
|
3661
3661
|
name: "Eip1559FeesNotSupportedError"
|
|
@@ -3680,7 +3680,7 @@ const sd = {
|
|
|
3680
3680
|
"0x3": "eip4844",
|
|
3681
3681
|
"0x4": "eip7702"
|
|
3682
3682
|
};
|
|
3683
|
-
function
|
|
3683
|
+
function Ja(e) {
|
|
3684
3684
|
const t = {
|
|
3685
3685
|
...e,
|
|
3686
3686
|
blockHash: e.blockHash ? e.blockHash : null,
|
|
@@ -3712,7 +3712,7 @@ function Ya(e) {
|
|
|
3712
3712
|
}
|
|
3713
3713
|
})(), t.type === "legacy" && (delete t.accessList, delete t.maxFeePerBlobGas, delete t.maxFeePerGas, delete t.maxPriorityFeePerGas, delete t.yParity), t.type === "eip2930" && (delete t.maxFeePerBlobGas, delete t.maxFeePerGas, delete t.maxPriorityFeePerGas), t.type === "eip1559" && delete t.maxFeePerBlobGas, t;
|
|
3714
3714
|
}
|
|
3715
|
-
const ay = /* @__PURE__ */
|
|
3715
|
+
const ay = /* @__PURE__ */ Ya("transaction", Ja);
|
|
3716
3716
|
function cy(e) {
|
|
3717
3717
|
return e.map((t) => ({
|
|
3718
3718
|
address: t.address,
|
|
@@ -3724,7 +3724,7 @@ function cy(e) {
|
|
|
3724
3724
|
}));
|
|
3725
3725
|
}
|
|
3726
3726
|
function od(e) {
|
|
3727
|
-
const t = (e.transactions ?? []).map((r) => typeof r == "string" ? r :
|
|
3727
|
+
const t = (e.transactions ?? []).map((r) => typeof r == "string" ? r : Ja(r));
|
|
3728
3728
|
return {
|
|
3729
3729
|
...e,
|
|
3730
3730
|
baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
|
|
@@ -3743,7 +3743,7 @@ function od(e) {
|
|
|
3743
3743
|
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
3744
3744
|
};
|
|
3745
3745
|
}
|
|
3746
|
-
const uy = /* @__PURE__ */
|
|
3746
|
+
const uy = /* @__PURE__ */ Ya("block", od);
|
|
3747
3747
|
async function ws(e, { blockHash: t, blockNumber: r, blockTag: n, includeTransactions: i } = {}) {
|
|
3748
3748
|
var l, h, m;
|
|
3749
3749
|
const s = n ?? "latest", o = i ?? !1, a = r !== void 0 ? J(r) : void 0;
|
|
@@ -3791,12 +3791,12 @@ async function fy(e, t) {
|
|
|
3791
3791
|
se(e, ad, "getGasPrice")({})
|
|
3792
3792
|
]);
|
|
3793
3793
|
if (typeof a.baseFeePerGas != "bigint")
|
|
3794
|
-
throw new
|
|
3794
|
+
throw new Xa();
|
|
3795
3795
|
const f = c - a.baseFeePerGas;
|
|
3796
3796
|
return f < 0n ? 0n : f;
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
3799
|
-
async function
|
|
3799
|
+
async function Zc(e, t) {
|
|
3800
3800
|
var m, p;
|
|
3801
3801
|
const { block: r, chain: n = e.chain, request: i, type: s = "eip1559" } = t || {}, o = await (async () => {
|
|
3802
3802
|
var g, v;
|
|
@@ -3822,7 +3822,7 @@ async function Xc(e, t) {
|
|
|
3822
3822
|
}
|
|
3823
3823
|
if (s === "eip1559") {
|
|
3824
3824
|
if (typeof l.baseFeePerGas != "bigint")
|
|
3825
|
-
throw new
|
|
3825
|
+
throw new Xa();
|
|
3826
3826
|
const g = typeof (i == null ? void 0 : i.maxPriorityFeePerGas) == "bigint" ? i.maxPriorityFeePerGas : await fy(e, {
|
|
3827
3827
|
block: l,
|
|
3828
3828
|
chain: n,
|
|
@@ -3844,13 +3844,13 @@ async function cd(e, { address: t, blockTag: r = "latest", blockNumber: n }) {
|
|
|
3844
3844
|
}, { dedupe: !!n });
|
|
3845
3845
|
return Gt(i);
|
|
3846
3846
|
}
|
|
3847
|
-
function
|
|
3847
|
+
function Za(e) {
|
|
3848
3848
|
const { kzg: t } = e, r = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), n = typeof e.blobs[0] == "string" ? e.blobs.map((s) => zt(s)) : e.blobs, i = [];
|
|
3849
3849
|
for (const s of n)
|
|
3850
3850
|
i.push(Uint8Array.from(t.blobToKzgCommitment(s)));
|
|
3851
3851
|
return r === "bytes" ? i : i.map((s) => Je(s));
|
|
3852
3852
|
}
|
|
3853
|
-
function
|
|
3853
|
+
function Qa(e) {
|
|
3854
3854
|
const { kzg: t } = e, r = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), n = typeof e.blobs[0] == "string" ? e.blobs.map((o) => zt(o)) : e.blobs, i = typeof e.commitments[0] == "string" ? e.commitments.map((o) => zt(o)) : e.commitments, s = [];
|
|
3855
3855
|
for (let o = 0; o < n.length; o++) {
|
|
3856
3856
|
const a = n[o], c = i[o];
|
|
@@ -3877,7 +3877,7 @@ let py = class extends Nf {
|
|
|
3877
3877
|
update(t) {
|
|
3878
3878
|
gs(this);
|
|
3879
3879
|
const { view: r, buffer: n, blockLen: i } = this;
|
|
3880
|
-
t =
|
|
3880
|
+
t = Fa(t);
|
|
3881
3881
|
const s = t.length;
|
|
3882
3882
|
for (let o = 0; o < s; ) {
|
|
3883
3883
|
const a = Math.min(i - this.pos, s - o);
|
|
@@ -4047,9 +4047,9 @@ function ud(e) {
|
|
|
4047
4047
|
}));
|
|
4048
4048
|
return i;
|
|
4049
4049
|
}
|
|
4050
|
-
const
|
|
4050
|
+
const Qc = 6, fd = 32, ec = 4096, dd = fd * ec, eu = dd * Qc - // terminator byte (0x80).
|
|
4051
4051
|
1 - // zero byte (0x00) appended to each field element.
|
|
4052
|
-
1 *
|
|
4052
|
+
1 * ec * Qc, ld = 1;
|
|
4053
4053
|
class wy extends $ {
|
|
4054
4054
|
constructor({ maxSize: t, size: r }) {
|
|
4055
4055
|
super("Blob size is too large.", {
|
|
@@ -4086,17 +4086,17 @@ function Ey(e) {
|
|
|
4086
4086
|
const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), r = typeof e.data == "string" ? zt(e.data) : e.data, n = Ie(r);
|
|
4087
4087
|
if (!n)
|
|
4088
4088
|
throw new hd();
|
|
4089
|
-
if (n >
|
|
4089
|
+
if (n > eu)
|
|
4090
4090
|
throw new wy({
|
|
4091
|
-
maxSize:
|
|
4091
|
+
maxSize: eu,
|
|
4092
4092
|
size: n
|
|
4093
4093
|
});
|
|
4094
4094
|
const i = [];
|
|
4095
4095
|
let s = !0, o = 0;
|
|
4096
4096
|
for (; s; ) {
|
|
4097
|
-
const a =
|
|
4097
|
+
const a = qa(new Uint8Array(dd));
|
|
4098
4098
|
let c = 0;
|
|
4099
|
-
for (; c <
|
|
4099
|
+
for (; c < ec; ) {
|
|
4100
4100
|
const f = r.slice(o, o + (fd - 1));
|
|
4101
4101
|
if (a.pushByte(0), a.pushBytes(f), f.length < 31) {
|
|
4102
4102
|
a.pushByte(128), s = !1;
|
|
@@ -4109,7 +4109,7 @@ function Ey(e) {
|
|
|
4109
4109
|
return t === "bytes" ? i.map((a) => a.bytes) : i.map((a) => Je(a.bytes));
|
|
4110
4110
|
}
|
|
4111
4111
|
function pd(e) {
|
|
4112
|
-
const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Ey({ data: t, to: n }), s = e.commitments ??
|
|
4112
|
+
const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Ey({ data: t, to: n }), s = e.commitments ?? Za({ blobs: i, kzg: r, to: n }), o = e.proofs ?? Qa({ blobs: i, commitments: s, kzg: r, to: n }), a = [];
|
|
4113
4113
|
for (let c = 0; c < i.length; c++)
|
|
4114
4114
|
a.push({
|
|
4115
4115
|
blob: i[c],
|
|
@@ -4144,8 +4144,8 @@ const md = [
|
|
|
4144
4144
|
"gas",
|
|
4145
4145
|
"nonce",
|
|
4146
4146
|
"type"
|
|
4147
|
-
],
|
|
4148
|
-
async function
|
|
4147
|
+
], tu = /* @__PURE__ */ new Map();
|
|
4148
|
+
async function tc(e, t) {
|
|
4149
4149
|
const { account: r = e.account, blobs: n, chain: i, gas: s, kzg: o, nonce: a, nonceManager: c, parameters: f = md, type: l } = t, h = r && Le(r), m = { ...t, ...h ? { from: h == null ? void 0 : h.address } : {} };
|
|
4150
4150
|
let p;
|
|
4151
4151
|
async function g() {
|
|
@@ -4169,7 +4169,7 @@ async function Qa(e, t) {
|
|
|
4169
4169
|
blockTag: "pending"
|
|
4170
4170
|
});
|
|
4171
4171
|
if ((f.includes("blobVersionedHashes") || f.includes("sidecars")) && n && o) {
|
|
4172
|
-
const k =
|
|
4172
|
+
const k = Za({ blobs: n, kzg: o });
|
|
4173
4173
|
if (f.includes("blobVersionedHashes")) {
|
|
4174
4174
|
const I = ud({
|
|
4175
4175
|
commitments: k,
|
|
@@ -4178,7 +4178,7 @@ async function Qa(e, t) {
|
|
|
4178
4178
|
m.blobVersionedHashes = I;
|
|
4179
4179
|
}
|
|
4180
4180
|
if (f.includes("sidecars")) {
|
|
4181
|
-
const I =
|
|
4181
|
+
const I = Qa({ blobs: n, commitments: k, kzg: o }), A = pd({
|
|
4182
4182
|
blobs: n,
|
|
4183
4183
|
commitments: k,
|
|
4184
4184
|
proofs: I,
|
|
@@ -4191,17 +4191,17 @@ async function Qa(e, t) {
|
|
|
4191
4191
|
try {
|
|
4192
4192
|
m.type = yd(m);
|
|
4193
4193
|
} catch {
|
|
4194
|
-
let k =
|
|
4194
|
+
let k = tu.get(e.uid);
|
|
4195
4195
|
if (typeof k > "u") {
|
|
4196
4196
|
const I = await g();
|
|
4197
|
-
k = typeof (I == null ? void 0 : I.baseFeePerGas) == "bigint",
|
|
4197
|
+
k = typeof (I == null ? void 0 : I.baseFeePerGas) == "bigint", tu.set(e.uid, k);
|
|
4198
4198
|
}
|
|
4199
4199
|
m.type = k ? "eip1559" : "legacy";
|
|
4200
4200
|
}
|
|
4201
4201
|
if (f.includes("fees"))
|
|
4202
4202
|
if (m.type !== "legacy" && m.type !== "eip2930") {
|
|
4203
4203
|
if (typeof m.maxFeePerGas > "u" || typeof m.maxPriorityFeePerGas > "u") {
|
|
4204
|
-
const k = await g(), { maxFeePerGas: I, maxPriorityFeePerGas: A } = await
|
|
4204
|
+
const k = await g(), { maxFeePerGas: I, maxPriorityFeePerGas: A } = await Zc(e, {
|
|
4205
4205
|
block: k,
|
|
4206
4206
|
chain: i,
|
|
4207
4207
|
request: m
|
|
@@ -4214,9 +4214,9 @@ async function Qa(e, t) {
|
|
|
4214
4214
|
}
|
|
4215
4215
|
} else {
|
|
4216
4216
|
if (typeof t.maxFeePerGas < "u" || typeof t.maxPriorityFeePerGas < "u")
|
|
4217
|
-
throw new
|
|
4217
|
+
throw new Xa();
|
|
4218
4218
|
if (typeof t.gasPrice > "u") {
|
|
4219
|
-
const k = await g(), { gasPrice: I } = await
|
|
4219
|
+
const k = await g(), { gasPrice: I } = await Zc(e, {
|
|
4220
4220
|
block: k,
|
|
4221
4221
|
chain: i,
|
|
4222
4222
|
request: m,
|
|
@@ -4248,7 +4248,7 @@ async function bd(e, t) {
|
|
|
4248
4248
|
params: Pe ? [be, le ?? "latest", Pe] : le ? [be, le] : [be]
|
|
4249
4249
|
});
|
|
4250
4250
|
};
|
|
4251
|
-
const { accessList: a, authorizationList: c, blobs: f, blobVersionedHashes: l, blockNumber: h, blockTag: m, data: p, gas: g, gasPrice: v, maxFeePerBlobGas: x, maxFeePerGas: k, maxPriorityFeePerGas: I, nonce: A, value: E, stateOverride: T, ...S } = await
|
|
4251
|
+
const { accessList: a, authorizationList: c, blobs: f, blobVersionedHashes: l, blockNumber: h, blockTag: m, data: p, gas: g, gasPrice: v, maxFeePerBlobGas: x, maxFeePerGas: k, maxPriorityFeePerGas: I, nonce: A, value: E, stateOverride: T, ...S } = await tc(e, {
|
|
4252
4252
|
...t,
|
|
4253
4253
|
parameters: (
|
|
4254
4254
|
// Some RPC Providers do not compute versioned hashes from blobs. We will need
|
|
@@ -4266,9 +4266,9 @@ async function bd(e, t) {
|
|
|
4266
4266
|
});
|
|
4267
4267
|
})();
|
|
4268
4268
|
Ti(t);
|
|
4269
|
-
const L = (o = (s = (i = e.chain) == null ? void 0 : i.formatters) == null ? void 0 : s.transactionRequest) == null ? void 0 : o.format,
|
|
4269
|
+
const L = (o = (s = (i = e.chain) == null ? void 0 : i.formatters) == null ? void 0 : s.transactionRequest) == null ? void 0 : o.format, G = (L || Fs)({
|
|
4270
4270
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4271
|
-
...
|
|
4271
|
+
...Ka(S, { format: L }),
|
|
4272
4272
|
from: n == null ? void 0 : n.address,
|
|
4273
4273
|
accessList: a,
|
|
4274
4274
|
authorizationList: c,
|
|
@@ -4284,9 +4284,9 @@ async function bd(e, t) {
|
|
|
4284
4284
|
to: V,
|
|
4285
4285
|
value: E
|
|
4286
4286
|
});
|
|
4287
|
-
let Y = BigInt(await q({ block: M, request:
|
|
4287
|
+
let Y = BigInt(await q({ block: M, request: G, rpcStateOverride: B }));
|
|
4288
4288
|
if (c) {
|
|
4289
|
-
const re = await xy(e, { address:
|
|
4289
|
+
const re = await xy(e, { address: G.from }), le = await Promise.all(c.map(async (be) => {
|
|
4290
4290
|
const { address: Pe } = be, qe = await q({
|
|
4291
4291
|
block: M,
|
|
4292
4292
|
request: {
|
|
@@ -4342,21 +4342,21 @@ function gd(e, t) {
|
|
|
4342
4342
|
throw new Ze({ address: t });
|
|
4343
4343
|
return e.toLowerCase() === t.toLowerCase();
|
|
4344
4344
|
}
|
|
4345
|
-
const
|
|
4345
|
+
const ru = "/docs/contract/decodeEventLog";
|
|
4346
4346
|
function wd(e) {
|
|
4347
4347
|
const { abi: t, data: r, strict: n, topics: i } = e, s = n ?? !0, [o, ...a] = i;
|
|
4348
4348
|
if (!o)
|
|
4349
|
-
throw new f0({ docsPath:
|
|
4349
|
+
throw new f0({ docsPath: ru });
|
|
4350
4350
|
const c = t.length === 1 ? t[0] : t.find((v) => v.type === "event" && o === Os(jt(v)));
|
|
4351
4351
|
if (!(c && "name" in c) || c.type !== "event")
|
|
4352
|
-
throw new kf(o, { docsPath:
|
|
4352
|
+
throw new kf(o, { docsPath: ru });
|
|
4353
4353
|
const { name: f, inputs: l } = c, h = l == null ? void 0 : l.some((v) => !("name" in v && v.name));
|
|
4354
4354
|
let m = h ? [] : {};
|
|
4355
4355
|
const p = l.filter((v) => "indexed" in v && v.indexed);
|
|
4356
4356
|
for (let v = 0; v < p.length; v++) {
|
|
4357
4357
|
const x = p[v], k = a[v];
|
|
4358
4358
|
if (!k)
|
|
4359
|
-
throw new
|
|
4359
|
+
throw new Na({
|
|
4360
4360
|
abiItem: c,
|
|
4361
4361
|
param: x
|
|
4362
4362
|
});
|
|
@@ -4423,7 +4423,7 @@ function _d(e) {
|
|
|
4423
4423
|
let f, l;
|
|
4424
4424
|
if (c instanceof kf)
|
|
4425
4425
|
return null;
|
|
4426
|
-
if (c instanceof ms || c instanceof
|
|
4426
|
+
if (c instanceof ms || c instanceof Na) {
|
|
4427
4427
|
if (i)
|
|
4428
4428
|
return null;
|
|
4429
4429
|
f = c.abiItem.name, l = (a = c.abiItem.inputs) == null ? void 0 : a.some((h) => !("name" in h && h.name));
|
|
@@ -4471,7 +4471,7 @@ function wi(e, { args: t, eventName: r } = {}) {
|
|
|
4471
4471
|
async function Ty(e, { address: t, blockHash: r, fromBlock: n, toBlock: i, event: s, events: o, args: a, strict: c } = {}) {
|
|
4472
4472
|
const f = c ?? !1, l = o ?? (s ? [s] : void 0);
|
|
4473
4473
|
let h = [];
|
|
4474
|
-
l && (h = [l.flatMap((v) =>
|
|
4474
|
+
l && (h = [l.flatMap((v) => za({
|
|
4475
4475
|
abi: [v],
|
|
4476
4476
|
eventName: v.name,
|
|
4477
4477
|
args: o ? void 0 : a
|
|
@@ -4513,7 +4513,7 @@ async function vd(e, t) {
|
|
|
4513
4513
|
});
|
|
4514
4514
|
}
|
|
4515
4515
|
const go = "/docs/contract/decodeFunctionResult";
|
|
4516
|
-
function
|
|
4516
|
+
function rc(e) {
|
|
4517
4517
|
const { abi: t, args: r, functionName: n, data: i } = e;
|
|
4518
4518
|
let s = t[0];
|
|
4519
4519
|
if (n) {
|
|
@@ -4532,7 +4532,7 @@ function ec(e) {
|
|
|
4532
4532
|
if (o && o.length === 1)
|
|
4533
4533
|
return o[0];
|
|
4534
4534
|
}
|
|
4535
|
-
const
|
|
4535
|
+
const nu = [
|
|
4536
4536
|
{
|
|
4537
4537
|
inputs: [
|
|
4538
4538
|
{
|
|
@@ -4625,7 +4625,7 @@ const tu = [
|
|
|
4625
4625
|
]
|
|
4626
4626
|
}
|
|
4627
4627
|
], Iy = "0x82ad56cb", ky = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", By = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
4628
|
-
class
|
|
4628
|
+
class ya extends $ {
|
|
4629
4629
|
constructor({ blockNumber: t, chain: r, contract: n }) {
|
|
4630
4630
|
super(`Chain "${r.name}" does not support contract "${n.name}".`, {
|
|
4631
4631
|
metaMessages: [
|
|
@@ -4675,7 +4675,7 @@ class Ms extends $ {
|
|
|
4675
4675
|
}
|
|
4676
4676
|
}
|
|
4677
4677
|
const wo = "/docs/contract/encodeDeployData";
|
|
4678
|
-
function
|
|
4678
|
+
function nc(e) {
|
|
4679
4679
|
const { abi: t, args: r, bytecode: n } = e;
|
|
4680
4680
|
if (!r || r.length === 0)
|
|
4681
4681
|
return n;
|
|
@@ -4683,22 +4683,22 @@ function tc(e) {
|
|
|
4683
4683
|
if (!i)
|
|
4684
4684
|
throw new o0({ docsPath: wo });
|
|
4685
4685
|
if (!("inputs" in i))
|
|
4686
|
-
throw new
|
|
4686
|
+
throw new Uc({ docsPath: wo });
|
|
4687
4687
|
if (!i.inputs || i.inputs.length === 0)
|
|
4688
|
-
throw new
|
|
4689
|
-
const s =
|
|
4688
|
+
throw new Uc({ docsPath: wo });
|
|
4689
|
+
const s = Ma(i.inputs, r);
|
|
4690
4690
|
return Xt([n, s]);
|
|
4691
4691
|
}
|
|
4692
4692
|
function Ry({ blockNumber: e, chain: t, contract: r }) {
|
|
4693
4693
|
var i;
|
|
4694
4694
|
const n = (i = t == null ? void 0 : t.contracts) == null ? void 0 : i[r];
|
|
4695
4695
|
if (!n)
|
|
4696
|
-
throw new
|
|
4696
|
+
throw new ya({
|
|
4697
4697
|
chain: t,
|
|
4698
4698
|
contract: { name: r }
|
|
4699
4699
|
});
|
|
4700
4700
|
if (e && n.blockCreated && n.blockCreated > e)
|
|
4701
|
-
throw new
|
|
4701
|
+
throw new ya({
|
|
4702
4702
|
blockNumber: e,
|
|
4703
4703
|
chain: t,
|
|
4704
4704
|
contract: {
|
|
@@ -4710,7 +4710,7 @@ function Ry({ blockNumber: e, chain: t, contract: r }) {
|
|
|
4710
4710
|
}
|
|
4711
4711
|
function Ly(e, { docsPath: t, ...r }) {
|
|
4712
4712
|
const n = (() => {
|
|
4713
|
-
const i =
|
|
4713
|
+
const i = Wa(e, r);
|
|
4714
4714
|
return i instanceof Ns ? e : i;
|
|
4715
4715
|
})();
|
|
4716
4716
|
return new Mp(n, {
|
|
@@ -4754,7 +4754,7 @@ function Uy({ fn: e, id: t, shouldSplitBatch: r, wait: n = 0, sort: i }) {
|
|
|
4754
4754
|
};
|
|
4755
4755
|
}
|
|
4756
4756
|
async function Ad(e, t) {
|
|
4757
|
-
var L, D,
|
|
4757
|
+
var L, D, G, q;
|
|
4758
4758
|
const { account: r = e.account, batch: n = !!((L = e.batch) != null && L.multicall), blockNumber: i, blockTag: s = "latest", accessList: o, blobs: a, code: c, data: f, factory: l, factoryData: h, gas: m, gasPrice: p, maxFeePerBlobGas: g, maxFeePerGas: v, maxPriorityFeePerGas: x, nonce: k, to: I, value: A, stateOverride: E, ...T } = t, S = r ? Le(r) : void 0;
|
|
4759
4759
|
if (c && (l || h))
|
|
4760
4760
|
throw new $("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
@@ -4771,9 +4771,9 @@ async function Ad(e, t) {
|
|
|
4771
4771
|
}) : f;
|
|
4772
4772
|
try {
|
|
4773
4773
|
Ti(t);
|
|
4774
|
-
const re = (i ? J(i) : void 0) || s, le = id(E), be = (q = (
|
|
4774
|
+
const re = (i ? J(i) : void 0) || s, le = id(E), be = (q = (G = (D = e.chain) == null ? void 0 : D.formatters) == null ? void 0 : G.transactionRequest) == null ? void 0 : q.format, qe = (be || Fs)({
|
|
4775
4775
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4776
|
-
...
|
|
4776
|
+
...Ka(T, { format: be }),
|
|
4777
4777
|
from: S == null ? void 0 : S.address,
|
|
4778
4778
|
accessList: o,
|
|
4779
4779
|
blobs: a,
|
|
@@ -4795,7 +4795,7 @@ async function Ad(e, t) {
|
|
|
4795
4795
|
blockTag: s
|
|
4796
4796
|
});
|
|
4797
4797
|
} catch (pe) {
|
|
4798
|
-
if (!(pe instanceof Ed) && !(pe instanceof
|
|
4798
|
+
if (!(pe instanceof Ed) && !(pe instanceof ya))
|
|
4799
4799
|
throw pe;
|
|
4800
4800
|
}
|
|
4801
4801
|
const ue = await e.request({
|
|
@@ -4808,7 +4808,7 @@ async function Ad(e, t) {
|
|
|
4808
4808
|
});
|
|
4809
4809
|
return ue === "0x" ? { data: void 0 } : { data: ue };
|
|
4810
4810
|
} catch (Y) {
|
|
4811
|
-
const re = Hy(Y), { offchainLookup: le, offchainLookupSignature: be } = await import("./ccip-
|
|
4811
|
+
const re = Hy(Y), { offchainLookup: le, offchainLookupSignature: be } = await import("./ccip-BQ2SmYhi.js");
|
|
4812
4812
|
if (e.ccipRead !== !1 && (re == null ? void 0 : re.slice(0, 10)) === be && I)
|
|
4813
4813
|
return { data: await le(e, { data: re, to: I }) };
|
|
4814
4814
|
throw B && (re == null ? void 0 : re.slice(0, 10)) === "0x101bb98d" ? new Gp({ factory: l }) : Ly(Y, {
|
|
@@ -4847,7 +4847,7 @@ async function Fy(e, t) {
|
|
|
4847
4847
|
callData: E.data,
|
|
4848
4848
|
target: E.to
|
|
4849
4849
|
})), I = xn({
|
|
4850
|
-
abi:
|
|
4850
|
+
abi: nu,
|
|
4851
4851
|
args: [k],
|
|
4852
4852
|
functionName: "aggregate3"
|
|
4853
4853
|
}), A = await e.request({
|
|
@@ -4860,8 +4860,8 @@ async function Fy(e, t) {
|
|
|
4860
4860
|
h
|
|
4861
4861
|
]
|
|
4862
4862
|
});
|
|
4863
|
-
return
|
|
4864
|
-
abi:
|
|
4863
|
+
return rc({
|
|
4864
|
+
abi: nu,
|
|
4865
4865
|
args: [k],
|
|
4866
4866
|
functionName: "aggregate3",
|
|
4867
4867
|
data: A || "0x"
|
|
@@ -4874,7 +4874,7 @@ async function Fy(e, t) {
|
|
|
4874
4874
|
}
|
|
4875
4875
|
function $y(e) {
|
|
4876
4876
|
const { code: t, data: r } = e;
|
|
4877
|
-
return
|
|
4877
|
+
return nc({
|
|
4878
4878
|
abi: Af(["constructor(bytes, bytes)"]),
|
|
4879
4879
|
bytecode: ky,
|
|
4880
4880
|
args: [t, r]
|
|
@@ -4882,7 +4882,7 @@ function $y(e) {
|
|
|
4882
4882
|
}
|
|
4883
4883
|
function My(e) {
|
|
4884
4884
|
const { data: t, factory: r, factoryData: n, to: i } = e;
|
|
4885
|
-
return
|
|
4885
|
+
return nc({
|
|
4886
4886
|
abi: Af(["constructor(address, bytes, address, bytes)"]),
|
|
4887
4887
|
bytecode: By,
|
|
4888
4888
|
args: [i, t, r, n]
|
|
@@ -4907,7 +4907,7 @@ async function Dy(e, t) {
|
|
|
4907
4907
|
data: a,
|
|
4908
4908
|
to: n
|
|
4909
4909
|
});
|
|
4910
|
-
return
|
|
4910
|
+
return rc({
|
|
4911
4911
|
abi: r,
|
|
4912
4912
|
args: i,
|
|
4913
4913
|
functionName: s,
|
|
@@ -4932,7 +4932,7 @@ async function jy(e, t) {
|
|
|
4932
4932
|
to: n,
|
|
4933
4933
|
...a,
|
|
4934
4934
|
account: c
|
|
4935
|
-
}), h =
|
|
4935
|
+
}), h = rc({
|
|
4936
4936
|
abi: r,
|
|
4937
4937
|
args: i,
|
|
4938
4938
|
functionName: o,
|
|
@@ -4961,9 +4961,9 @@ async function jy(e, t) {
|
|
|
4961
4961
|
});
|
|
4962
4962
|
}
|
|
4963
4963
|
}
|
|
4964
|
-
const vo = /* @__PURE__ */ new Map(),
|
|
4964
|
+
const vo = /* @__PURE__ */ new Map(), iu = /* @__PURE__ */ new Map();
|
|
4965
4965
|
let Gy = 0;
|
|
4966
|
-
function
|
|
4966
|
+
function ma(e, t, r) {
|
|
4967
4967
|
const n = ++Gy, i = () => vo.get(e) || [], s = () => {
|
|
4968
4968
|
const l = i();
|
|
4969
4969
|
vo.set(e, l.filter((h) => h.id !== n));
|
|
@@ -4971,7 +4971,7 @@ function pa(e, t, r) {
|
|
|
4971
4971
|
const l = i();
|
|
4972
4972
|
if (!l.some((m) => m.id === n))
|
|
4973
4973
|
return;
|
|
4974
|
-
const h =
|
|
4974
|
+
const h = iu.get(e);
|
|
4975
4975
|
l.length === 1 && h && h(), s();
|
|
4976
4976
|
}, a = i();
|
|
4977
4977
|
if (vo.set(e, [
|
|
@@ -4989,9 +4989,9 @@ function pa(e, t, r) {
|
|
|
4989
4989
|
(g = (p = v.fns)[l]) == null || g.call(p, ...h);
|
|
4990
4990
|
};
|
|
4991
4991
|
const f = r(c);
|
|
4992
|
-
return typeof f == "function" &&
|
|
4992
|
+
return typeof f == "function" && iu.set(e, f), o;
|
|
4993
4993
|
}
|
|
4994
|
-
async function
|
|
4994
|
+
async function ba(e) {
|
|
4995
4995
|
return new Promise((t) => setTimeout(t, e));
|
|
4996
4996
|
}
|
|
4997
4997
|
function Sd(e, { emitOnBegin: t, initialWaitTime: r, interval: n }) {
|
|
@@ -5001,9 +5001,9 @@ function Sd(e, { emitOnBegin: t, initialWaitTime: r, interval: n }) {
|
|
|
5001
5001
|
let a;
|
|
5002
5002
|
a = await e({ unpoll: s });
|
|
5003
5003
|
const c = await (r == null ? void 0 : r(a)) ?? n;
|
|
5004
|
-
await
|
|
5004
|
+
await ba(c);
|
|
5005
5005
|
const f = async () => {
|
|
5006
|
-
i && (await e({ unpoll: s }), await
|
|
5006
|
+
i && (await e({ unpoll: s }), await ba(n), f());
|
|
5007
5007
|
};
|
|
5008
5008
|
f();
|
|
5009
5009
|
})(), s;
|
|
@@ -5077,7 +5077,7 @@ function Zy(e, t) {
|
|
|
5077
5077
|
x,
|
|
5078
5078
|
a
|
|
5079
5079
|
]);
|
|
5080
|
-
return
|
|
5080
|
+
return ma(k, { onLogs: f, onError: c }, (I) => {
|
|
5081
5081
|
let A;
|
|
5082
5082
|
a !== void 0 && (A = a - 1n);
|
|
5083
5083
|
let E, T = !1;
|
|
@@ -5144,7 +5144,7 @@ function Zy(e, t) {
|
|
|
5144
5144
|
x
|
|
5145
5145
|
]);
|
|
5146
5146
|
let I = !0, A = () => I = !1;
|
|
5147
|
-
return
|
|
5147
|
+
return ma(k, { onLogs: f, onError: c }, (E) => ((async () => {
|
|
5148
5148
|
try {
|
|
5149
5149
|
const T = (() => {
|
|
5150
5150
|
if (e.transport.type === "fallback") {
|
|
@@ -5152,7 +5152,7 @@ function Zy(e, t) {
|
|
|
5152
5152
|
return M ? M.value : e.transport;
|
|
5153
5153
|
}
|
|
5154
5154
|
return e.transport;
|
|
5155
|
-
})(), S = o ?
|
|
5155
|
+
})(), S = o ? za({
|
|
5156
5156
|
abi: r,
|
|
5157
5157
|
eventName: o,
|
|
5158
5158
|
args: i
|
|
@@ -5169,20 +5169,20 @@ function Zy(e, t) {
|
|
|
5169
5169
|
data: B.data,
|
|
5170
5170
|
topics: B.topics,
|
|
5171
5171
|
strict: m
|
|
5172
|
-
}),
|
|
5172
|
+
}), G = wi(B, {
|
|
5173
5173
|
args: D,
|
|
5174
5174
|
eventName: L
|
|
5175
5175
|
});
|
|
5176
|
-
E.onLogs([
|
|
5176
|
+
E.onLogs([G]);
|
|
5177
5177
|
} catch (L) {
|
|
5178
|
-
let D,
|
|
5179
|
-
if (L instanceof ms || L instanceof
|
|
5178
|
+
let D, G;
|
|
5179
|
+
if (L instanceof ms || L instanceof Na) {
|
|
5180
5180
|
if (m)
|
|
5181
5181
|
return;
|
|
5182
|
-
D = L.abiItem.name,
|
|
5182
|
+
D = L.abiItem.name, G = (V = L.abiItem.inputs) == null ? void 0 : V.some((Y) => !("name" in Y && Y.name));
|
|
5183
5183
|
}
|
|
5184
5184
|
const q = wi(B, {
|
|
5185
|
-
args:
|
|
5185
|
+
args: G ? [] : {},
|
|
5186
5186
|
eventName: D
|
|
5187
5187
|
});
|
|
5188
5188
|
E.onLogs([q]);
|
|
@@ -5230,7 +5230,7 @@ function Pd({ chain: e, currentChainId: t }) {
|
|
|
5230
5230
|
}
|
|
5231
5231
|
function Td(e, { docsPath: t, ...r }) {
|
|
5232
5232
|
const n = (() => {
|
|
5233
|
-
const i =
|
|
5233
|
+
const i = Wa(e, r);
|
|
5234
5234
|
return i instanceof Ns ? e : i;
|
|
5235
5235
|
})();
|
|
5236
5236
|
return new Fp(n, {
|
|
@@ -5245,7 +5245,7 @@ async function Id(e, { serializedTransaction: t }) {
|
|
|
5245
5245
|
}, { retryCount: 0 });
|
|
5246
5246
|
}
|
|
5247
5247
|
const Eo = new Rs(128);
|
|
5248
|
-
async function
|
|
5248
|
+
async function ic(e, t) {
|
|
5249
5249
|
var k, I, A, E;
|
|
5250
5250
|
const { account: r = e.account, chain: n = e.chain, accessList: i, authorizationList: s, blobs: o, data: a, gas: c, gasPrice: f, maxFeePerBlobGas: l, maxFeePerGas: h, maxPriorityFeePerGas: m, nonce: p, value: g, ...v } = t;
|
|
5251
5251
|
if (typeof r > "u")
|
|
@@ -5273,7 +5273,7 @@ async function rc(e, t) {
|
|
|
5273
5273
|
}));
|
|
5274
5274
|
const N = (A = (I = (k = e.chain) == null ? void 0 : k.formatters) == null ? void 0 : I.transactionRequest) == null ? void 0 : A.format, B = (N || Fs)({
|
|
5275
5275
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
5276
|
-
...
|
|
5276
|
+
...Ka(v, { format: N }),
|
|
5277
5277
|
accessList: i,
|
|
5278
5278
|
authorizationList: s,
|
|
5279
5279
|
blobs: o,
|
|
@@ -5297,20 +5297,20 @@ async function rc(e, t) {
|
|
|
5297
5297
|
} catch (D) {
|
|
5298
5298
|
if (V === !1)
|
|
5299
5299
|
throw D;
|
|
5300
|
-
const
|
|
5301
|
-
if (
|
|
5300
|
+
const G = D;
|
|
5301
|
+
if (G.name === "InvalidInputRpcError" || G.name === "InvalidParamsRpcError" || G.name === "MethodNotFoundRpcError" || G.name === "MethodNotSupportedRpcError")
|
|
5302
5302
|
return await e.request({
|
|
5303
5303
|
method: "wallet_sendTransaction",
|
|
5304
5304
|
params: [B]
|
|
5305
5305
|
}, { retryCount: 0 }).then((q) => (Eo.set(e.uid, !0), q)).catch((q) => {
|
|
5306
5306
|
const Y = q;
|
|
5307
|
-
throw Y.name === "MethodNotFoundRpcError" || Y.name === "MethodNotSupportedRpcError" ? (Eo.set(e.uid, !1),
|
|
5307
|
+
throw Y.name === "MethodNotFoundRpcError" || Y.name === "MethodNotSupportedRpcError" ? (Eo.set(e.uid, !1), G) : Y;
|
|
5308
5308
|
});
|
|
5309
|
-
throw
|
|
5309
|
+
throw G;
|
|
5310
5310
|
}
|
|
5311
5311
|
}
|
|
5312
5312
|
if ((x == null ? void 0 : x.type) === "local") {
|
|
5313
|
-
const S = await se(e,
|
|
5313
|
+
const S = await se(e, tc, "prepareTransactionRequest")({
|
|
5314
5314
|
account: x,
|
|
5315
5315
|
accessList: i,
|
|
5316
5316
|
authorizationList: s,
|
|
@@ -5365,7 +5365,7 @@ async function kd(e, t) {
|
|
|
5365
5365
|
functionName: a
|
|
5366
5366
|
});
|
|
5367
5367
|
try {
|
|
5368
|
-
return await se(e,
|
|
5368
|
+
return await se(e, ic, "sendTransaction")({
|
|
5369
5369
|
data: `${l}${o ? o.replace("0x", "") : ""}`,
|
|
5370
5370
|
to: i,
|
|
5371
5371
|
account: f,
|
|
@@ -5512,7 +5512,7 @@ function Qy(e) {
|
|
|
5512
5512
|
};
|
|
5513
5513
|
return e.blobGasPrice && (t.blobGasPrice = BigInt(e.blobGasPrice)), e.blobGasUsed && (t.blobGasUsed = BigInt(e.blobGasUsed)), t;
|
|
5514
5514
|
}
|
|
5515
|
-
const em = /* @__PURE__ */
|
|
5515
|
+
const em = /* @__PURE__ */ Ya("transactionReceipt", Qy);
|
|
5516
5516
|
async function Cd(e, t) {
|
|
5517
5517
|
const { atomic: r = !1, chainId: n, receipts: i, version: s = "2.0.0", ...o } = await e.request({
|
|
5518
5518
|
method: "wallet_getCallsStatus",
|
|
@@ -5540,7 +5540,7 @@ async function Cd(e, t) {
|
|
|
5540
5540
|
async function tm(e, t) {
|
|
5541
5541
|
const { id: r, pollingInterval: n = e.pollingInterval, status: i = ({ statusCode: m }) => m >= 200, timeout: s = 6e4 } = t, o = qt(["waitForCallsStatus", e.uid, r]), { promise: a, resolve: c, reject: f } = xd();
|
|
5542
5542
|
let l;
|
|
5543
|
-
const h =
|
|
5543
|
+
const h = ma(o, { resolve: c, reject: f }, (m) => {
|
|
5544
5544
|
const p = Sd(async () => {
|
|
5545
5545
|
const g = (v) => {
|
|
5546
5546
|
clearTimeout(l), p(), v(), h();
|
|
@@ -5568,12 +5568,12 @@ class rm extends $ {
|
|
|
5568
5568
|
super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`, { name: "WaitForCallsStatusTimeoutError" });
|
|
5569
5569
|
}
|
|
5570
5570
|
}
|
|
5571
|
-
const
|
|
5572
|
-
let ji =
|
|
5571
|
+
const ga = 256;
|
|
5572
|
+
let ji = ga, Gi;
|
|
5573
5573
|
function Od(e = 11) {
|
|
5574
|
-
if (!Gi || ji + e >
|
|
5574
|
+
if (!Gi || ji + e > ga * 2) {
|
|
5575
5575
|
Gi = "", ji = 0;
|
|
5576
|
-
for (let t = 0; t <
|
|
5576
|
+
for (let t = 0; t < ga; t++)
|
|
5577
5577
|
Gi += (256 + Math.random() * 256 | 0).toString(16).substring(1);
|
|
5578
5578
|
}
|
|
5579
5579
|
return Gi.substring(ji, ji++ + e);
|
|
@@ -5621,7 +5621,7 @@ function sm(e, { delay: t = 100, retryCount: r = 2, shouldRetry: n = () => !0 }
|
|
|
5621
5621
|
const o = async ({ count: a = 0 } = {}) => {
|
|
5622
5622
|
const c = async ({ error: f }) => {
|
|
5623
5623
|
const l = typeof t == "function" ? t({ count: a, error: f }) : t;
|
|
5624
|
-
l && await
|
|
5624
|
+
l && await ba(l), o({ count: a + 1 });
|
|
5625
5625
|
};
|
|
5626
5626
|
try {
|
|
5627
5627
|
const f = await e();
|
|
@@ -5750,7 +5750,7 @@ function cm({ key: e, methods: t, name: r, request: n, retryCount: i = 3, retryD
|
|
|
5750
5750
|
value: c
|
|
5751
5751
|
};
|
|
5752
5752
|
}
|
|
5753
|
-
function
|
|
5753
|
+
function So(e, t = {}) {
|
|
5754
5754
|
const { key: r = "custom", methods: n, name: i = "Custom Provider", retryDelay: s } = t;
|
|
5755
5755
|
return ({ retryCount: o }) => cm({
|
|
5756
5756
|
key: r,
|
|
@@ -5873,7 +5873,7 @@ function mm(e) {
|
|
|
5873
5873
|
if (n < 0)
|
|
5874
5874
|
throw new Ms({ chainId: n });
|
|
5875
5875
|
}
|
|
5876
|
-
|
|
5876
|
+
sc(e);
|
|
5877
5877
|
}
|
|
5878
5878
|
function bm(e) {
|
|
5879
5879
|
const { blobVersionedHashes: t } = e;
|
|
@@ -5891,9 +5891,9 @@ function bm(e) {
|
|
|
5891
5891
|
});
|
|
5892
5892
|
}
|
|
5893
5893
|
}
|
|
5894
|
-
|
|
5894
|
+
sc(e);
|
|
5895
5895
|
}
|
|
5896
|
-
function
|
|
5896
|
+
function sc(e) {
|
|
5897
5897
|
const { chainId: t, maxPriorityFeePerGas: r, maxFeePerGas: n, to: i } = e;
|
|
5898
5898
|
if (t <= 0)
|
|
5899
5899
|
throw new Ms({ chainId: t });
|
|
@@ -5971,14 +5971,14 @@ function Em(e, t) {
|
|
|
5971
5971
|
bm(e);
|
|
5972
5972
|
let m = e.blobVersionedHashes, p = e.sidecars;
|
|
5973
5973
|
if (e.blobs && (typeof m > "u" || typeof p > "u")) {
|
|
5974
|
-
const A = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((S) => Je(S)), E = e.kzg, T =
|
|
5974
|
+
const A = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((S) => Je(S)), E = e.kzg, T = Za({
|
|
5975
5975
|
blobs: A,
|
|
5976
5976
|
kzg: E
|
|
5977
5977
|
});
|
|
5978
5978
|
if (typeof m > "u" && (m = ud({
|
|
5979
5979
|
commitments: T
|
|
5980
5980
|
})), typeof p > "u") {
|
|
5981
|
-
const S =
|
|
5981
|
+
const S = Qa({ blobs: A, commitments: T, kzg: E });
|
|
5982
5982
|
p = pd({ blobs: A, commitments: T, proofs: S });
|
|
5983
5983
|
}
|
|
5984
5984
|
}
|
|
@@ -6009,7 +6009,7 @@ function Em(e, t) {
|
|
|
6009
6009
|
}
|
|
6010
6010
|
function xm(e, t) {
|
|
6011
6011
|
const { chainId: r, gas: n, nonce: i, to: s, value: o, maxFeePerGas: a, maxPriorityFeePerGas: c, accessList: f, data: l } = e;
|
|
6012
|
-
|
|
6012
|
+
sc(e);
|
|
6013
6013
|
const h = Hs(f), m = [
|
|
6014
6014
|
X(r),
|
|
6015
6015
|
i ? X(i) : "0x",
|
|
@@ -6117,7 +6117,7 @@ function Rd(e, ...t) {
|
|
|
6117
6117
|
if (t.length > 0 && !t.includes(e.length))
|
|
6118
6118
|
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
6119
6119
|
}
|
|
6120
|
-
function
|
|
6120
|
+
function su(e, t = !0) {
|
|
6121
6121
|
if (e.destroyed)
|
|
6122
6122
|
throw new Error("Hash instance has been destroyed");
|
|
6123
6123
|
if (t && e.finished)
|
|
@@ -6130,7 +6130,7 @@ function Im(e, t) {
|
|
|
6130
6130
|
throw new Error("digestInto() expects output buffer of length at least " + r);
|
|
6131
6131
|
}
|
|
6132
6132
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
6133
|
-
function
|
|
6133
|
+
function Po(e) {
|
|
6134
6134
|
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
6135
6135
|
}
|
|
6136
6136
|
function bt(e, t) {
|
|
@@ -6153,7 +6153,7 @@ let Bm = class {
|
|
|
6153
6153
|
return this._cloneInto();
|
|
6154
6154
|
}
|
|
6155
6155
|
};
|
|
6156
|
-
function
|
|
6156
|
+
function oc(e) {
|
|
6157
6157
|
const t = (n) => e().update(Ld(n)).digest(), r = e();
|
|
6158
6158
|
return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t;
|
|
6159
6159
|
}
|
|
@@ -6171,17 +6171,17 @@ function Rm(e, t, r) {
|
|
|
6171
6171
|
}
|
|
6172
6172
|
let Ud = class extends Bm {
|
|
6173
6173
|
constructor(t, r, n, i) {
|
|
6174
|
-
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view =
|
|
6174
|
+
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = Po(this.buffer);
|
|
6175
6175
|
}
|
|
6176
6176
|
update(t) {
|
|
6177
|
-
|
|
6177
|
+
su(this);
|
|
6178
6178
|
const { view: r, buffer: n, blockLen: i } = this;
|
|
6179
6179
|
t = Ld(t);
|
|
6180
6180
|
const s = t.length;
|
|
6181
6181
|
for (let o = 0; o < s; ) {
|
|
6182
6182
|
const a = Math.min(i - this.pos, s - o);
|
|
6183
6183
|
if (a === i) {
|
|
6184
|
-
const c =
|
|
6184
|
+
const c = Po(t);
|
|
6185
6185
|
for (; i <= s - o; o += i)
|
|
6186
6186
|
this.process(c, o);
|
|
6187
6187
|
continue;
|
|
@@ -6191,14 +6191,14 @@ let Ud = class extends Bm {
|
|
|
6191
6191
|
return this.length += t.length, this.roundClean(), this;
|
|
6192
6192
|
}
|
|
6193
6193
|
digestInto(t) {
|
|
6194
|
-
|
|
6194
|
+
su(this), Im(t, this), this.finished = !0;
|
|
6195
6195
|
const { buffer: r, view: n, blockLen: i, isLE: s } = this;
|
|
6196
6196
|
let { pos: o } = this;
|
|
6197
6197
|
r[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > i - o && (this.process(n, 0), o = 0);
|
|
6198
6198
|
for (let h = o; h < i; h++)
|
|
6199
6199
|
r[h] = 0;
|
|
6200
6200
|
Cm(n, i - 8, BigInt(this.length * 8), s), this.process(n, 0);
|
|
6201
|
-
const a =
|
|
6201
|
+
const a = Po(t), c = this.outputLen;
|
|
6202
6202
|
if (c % 4)
|
|
6203
6203
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
6204
6204
|
const f = c / 4, l = this.get();
|
|
@@ -6220,9 +6220,9 @@ let Ud = class extends Bm {
|
|
|
6220
6220
|
}
|
|
6221
6221
|
};
|
|
6222
6222
|
const Lm = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]), Nd = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((e, t) => t)), Um = /* @__PURE__ */ Nd.map((e) => (9 * e + 5) % 16);
|
|
6223
|
-
let
|
|
6223
|
+
let ac = [Nd], cc = [Um];
|
|
6224
6224
|
for (let e = 0; e < 4; e++)
|
|
6225
|
-
for (let t of [
|
|
6225
|
+
for (let t of [ac, cc])
|
|
6226
6226
|
t.push(t[e].map((r) => Lm[r]));
|
|
6227
6227
|
const Fd = /* @__PURE__ */ [
|
|
6228
6228
|
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
@@ -6230,7 +6230,7 @@ const Fd = /* @__PURE__ */ [
|
|
|
6230
6230
|
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
6231
6231
|
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
6232
6232
|
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
6233
|
-
].map((e) => new Uint8Array(e)), Nm = /* @__PURE__ */
|
|
6233
|
+
].map((e) => new Uint8Array(e)), Nm = /* @__PURE__ */ ac.map((e, t) => e.map((r) => Fd[t][r])), Fm = /* @__PURE__ */ cc.map((e, t) => e.map((r) => Fd[t][r])), $m = /* @__PURE__ */ new Uint32Array([
|
|
6234
6234
|
0,
|
|
6235
6235
|
1518500249,
|
|
6236
6236
|
1859775393,
|
|
@@ -6243,7 +6243,7 @@ const Fd = /* @__PURE__ */ [
|
|
|
6243
6243
|
2053994217,
|
|
6244
6244
|
0
|
|
6245
6245
|
]);
|
|
6246
|
-
function
|
|
6246
|
+
function ou(e, t, r, n) {
|
|
6247
6247
|
return e === 0 ? t ^ r ^ n : e === 1 ? t & r | ~t & n : e === 2 ? (t | ~r) ^ n : e === 3 ? t & n | r & ~n : t ^ (r | ~n);
|
|
6248
6248
|
}
|
|
6249
6249
|
const Vi = /* @__PURE__ */ new Uint32Array(16);
|
|
@@ -6263,13 +6263,13 @@ let $d = class extends Ud {
|
|
|
6263
6263
|
Vi[p] = t.getUint32(r, !0);
|
|
6264
6264
|
let n = this.h0 | 0, i = n, s = this.h1 | 0, o = s, a = this.h2 | 0, c = a, f = this.h3 | 0, l = f, h = this.h4 | 0, m = h;
|
|
6265
6265
|
for (let p = 0; p < 5; p++) {
|
|
6266
|
-
const g = 4 - p, v = $m[p], x = Mm[p], k =
|
|
6266
|
+
const g = 4 - p, v = $m[p], x = Mm[p], k = ac[p], I = cc[p], A = Nm[p], E = Fm[p];
|
|
6267
6267
|
for (let T = 0; T < 16; T++) {
|
|
6268
|
-
const S = qi(n +
|
|
6268
|
+
const S = qi(n + ou(p, s, a, f) + Vi[k[T]] + v, A[T]) + h | 0;
|
|
6269
6269
|
n = h, h = f, f = qi(a, 10) | 0, a = s, s = S;
|
|
6270
6270
|
}
|
|
6271
6271
|
for (let T = 0; T < 16; T++) {
|
|
6272
|
-
const S = qi(i +
|
|
6272
|
+
const S = qi(i + ou(g, o, c, l) + Vi[I[T]] + x, E[T]) + m | 0;
|
|
6273
6273
|
i = m, m = l, l = qi(c, 10) | 0, c = o, o = S;
|
|
6274
6274
|
}
|
|
6275
6275
|
}
|
|
@@ -6282,7 +6282,7 @@ let $d = class extends Ud {
|
|
|
6282
6282
|
this.destroyed = !0, this.buffer.fill(0), this.set(0, 0, 0, 0, 0);
|
|
6283
6283
|
}
|
|
6284
6284
|
};
|
|
6285
|
-
const Hm = /* @__PURE__ */
|
|
6285
|
+
const Hm = /* @__PURE__ */ oc(() => new $d()), Dm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6286
6286
|
__proto__: null,
|
|
6287
6287
|
RIPEMD160: $d,
|
|
6288
6288
|
ripemd160: Hm
|
|
@@ -6361,7 +6361,7 @@ const Hm = /* @__PURE__ */ ic(() => new $d()), Dm = /* @__PURE__ */ Object.freez
|
|
|
6361
6361
|
528734635,
|
|
6362
6362
|
1541459225
|
|
6363
6363
|
]), nr = /* @__PURE__ */ new Uint32Array(64);
|
|
6364
|
-
class
|
|
6364
|
+
class uc extends Ud {
|
|
6365
6365
|
constructor() {
|
|
6366
6366
|
super(64, 32, 8, !1), this.A = rr[0] | 0, this.B = rr[1] | 0, this.C = rr[2] | 0, this.D = rr[3] | 0, this.E = rr[4] | 0, this.F = rr[5] | 0, this.G = rr[6] | 0, this.H = rr[7] | 0;
|
|
6367
6367
|
}
|
|
@@ -6394,14 +6394,14 @@ class ac extends Ud {
|
|
|
6394
6394
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
|
|
6395
6395
|
}
|
|
6396
6396
|
}
|
|
6397
|
-
class Gm extends
|
|
6397
|
+
class Gm extends uc {
|
|
6398
6398
|
constructor() {
|
|
6399
6399
|
super(), this.A = -1056596264, this.B = 914150663, this.C = 812702999, this.D = -150054599, this.E = -4191439, this.F = 1750603025, this.G = 1694076839, this.H = -1090891868, this.outputLen = 28;
|
|
6400
6400
|
}
|
|
6401
6401
|
}
|
|
6402
|
-
const zm = /* @__PURE__ */
|
|
6402
|
+
const zm = /* @__PURE__ */ oc(() => new uc()), qm = /* @__PURE__ */ oc(() => new Gm()), Vm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6403
6403
|
__proto__: null,
|
|
6404
|
-
SHA256:
|
|
6404
|
+
SHA256: uc,
|
|
6405
6405
|
sha224: qm,
|
|
6406
6406
|
sha256: zm
|
|
6407
6407
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -6421,8 +6421,8 @@ async function Wm(e, { chain: t }) {
|
|
|
6421
6421
|
}, { dedupe: !0, retryCount: 0 });
|
|
6422
6422
|
}
|
|
6423
6423
|
function Km(e, t) {
|
|
6424
|
-
const { abi: r, args: n, bytecode: i, ...s } = t, o =
|
|
6425
|
-
return
|
|
6424
|
+
const { abi: r, args: n, bytecode: i, ...s } = t, o = nc({ abi: r, args: n, bytecode: i });
|
|
6425
|
+
return ic(e, {
|
|
6426
6426
|
...s,
|
|
6427
6427
|
...s.authorizationList ? { to: null } : {},
|
|
6428
6428
|
data: o
|
|
@@ -6630,12 +6630,12 @@ function cb(e) {
|
|
|
6630
6630
|
getChainId: () => Ii(e),
|
|
6631
6631
|
getPermissions: () => Jm(e),
|
|
6632
6632
|
prepareAuthorization: (t) => Md(e, t),
|
|
6633
|
-
prepareTransactionRequest: (t) =>
|
|
6633
|
+
prepareTransactionRequest: (t) => tc(e, t),
|
|
6634
6634
|
requestAddresses: () => Zm(e),
|
|
6635
6635
|
requestPermissions: (t) => Qm(e, t),
|
|
6636
6636
|
sendCalls: (t) => eb(e, t),
|
|
6637
6637
|
sendRawTransaction: (t) => Id(e, t),
|
|
6638
|
-
sendTransaction: (t) =>
|
|
6638
|
+
sendTransaction: (t) => ic(e, t),
|
|
6639
6639
|
showCallsStatus: (t) => tb(e, t),
|
|
6640
6640
|
signAuthorization: (t) => rb(e, t),
|
|
6641
6641
|
signMessage: (t) => nb(e, t),
|
|
@@ -6647,7 +6647,7 @@ function cb(e) {
|
|
|
6647
6647
|
writeContract: (t) => kd(e, t)
|
|
6648
6648
|
};
|
|
6649
6649
|
}
|
|
6650
|
-
function
|
|
6650
|
+
function To(e) {
|
|
6651
6651
|
const { key: t = "wallet", name: r = "Wallet Client", transport: n } = e;
|
|
6652
6652
|
return nm({
|
|
6653
6653
|
...e,
|
|
@@ -6657,7 +6657,7 @@ function ou(e) {
|
|
|
6657
6657
|
type: "walletClient"
|
|
6658
6658
|
}).extend(cb);
|
|
6659
6659
|
}
|
|
6660
|
-
function
|
|
6660
|
+
function wa(e) {
|
|
6661
6661
|
return typeof e == "string" && (e = Buffer.from(e, "hex")), e.length === 32 ? e : e.subarray(1, 33);
|
|
6662
6662
|
}
|
|
6663
6663
|
function Ar(e, t) {
|
|
@@ -6670,8 +6670,8 @@ function ub(e) {
|
|
|
6670
6670
|
]);
|
|
6671
6671
|
}
|
|
6672
6672
|
function fb(e) {
|
|
6673
|
-
const t =
|
|
6674
|
-
return
|
|
6673
|
+
const t = Cc.encodingLength(e.length), r = Buffer.allocUnsafe(t);
|
|
6674
|
+
return Cc.encode(e.length, r), Buffer.concat([r, e]);
|
|
6675
6675
|
}
|
|
6676
6676
|
function db(e, t) {
|
|
6677
6677
|
if (e.compare(t) > 0) {
|
|
@@ -6703,9 +6703,9 @@ function cv(e, t) {
|
|
|
6703
6703
|
const pb = (e) => {
|
|
6704
6704
|
switch (e) {
|
|
6705
6705
|
case St.MAINNET:
|
|
6706
|
-
return
|
|
6706
|
+
return kc.Mainnet;
|
|
6707
6707
|
case St.TESTNET:
|
|
6708
|
-
return
|
|
6708
|
+
return kc.Testnet;
|
|
6709
6709
|
default:
|
|
6710
6710
|
throw new Error(`Invalid bitcoin network ${e}`);
|
|
6711
6711
|
}
|
|
@@ -6804,13 +6804,13 @@ function vb() {
|
|
|
6804
6804
|
throw new Error(cu.failedToCreateInternalPubkey);
|
|
6805
6805
|
const r = Cr.pointAdd(_b, t);
|
|
6806
6806
|
if (!r) throw new Error(cu.failedToCreateInternalPubkey);
|
|
6807
|
-
return
|
|
6807
|
+
return wa(Buffer.from(r));
|
|
6808
6808
|
}
|
|
6809
6809
|
var yr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6810
6810
|
function Eb(e) {
|
|
6811
6811
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6812
6812
|
}
|
|
6813
|
-
function
|
|
6813
|
+
function fc(e) {
|
|
6814
6814
|
if (e.__esModule) return e;
|
|
6815
6815
|
var t = e.default;
|
|
6816
6816
|
if (typeof t == "function") {
|
|
@@ -6833,9 +6833,9 @@ var Ee = {}, ze = {}, Jt = {}, Ds = {};
|
|
|
6833
6833
|
Ds.byteLength = Sb;
|
|
6834
6834
|
Ds.toByteArray = Tb;
|
|
6835
6835
|
Ds.fromByteArray = Bb;
|
|
6836
|
-
var Tt = [], ut = [], xb = typeof Uint8Array < "u" ? Uint8Array : Array,
|
|
6837
|
-
for (var Kr = 0, Ab =
|
|
6838
|
-
Tt[Kr] =
|
|
6836
|
+
var Tt = [], ut = [], xb = typeof Uint8Array < "u" ? Uint8Array : Array, Io = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6837
|
+
for (var Kr = 0, Ab = Io.length; Kr < Ab; ++Kr)
|
|
6838
|
+
Tt[Kr] = Io[Kr], ut[Io.charCodeAt(Kr)] = Kr;
|
|
6839
6839
|
ut[45] = 62;
|
|
6840
6840
|
ut[95] = 63;
|
|
6841
6841
|
function Gd(e) {
|
|
@@ -6877,9 +6877,9 @@ function Bb(e) {
|
|
|
6877
6877
|
Tt[t >> 10] + Tt[t >> 4 & 63] + Tt[t << 2 & 63] + "="
|
|
6878
6878
|
)), i.join("");
|
|
6879
6879
|
}
|
|
6880
|
-
var
|
|
6880
|
+
var dc = {};
|
|
6881
6881
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
6882
|
-
|
|
6882
|
+
dc.read = function(e, t, r, n, i) {
|
|
6883
6883
|
var s, o, a = i * 8 - n - 1, c = (1 << a) - 1, f = c >> 1, l = -7, h = r ? i - 1 : 0, m = r ? -1 : 1, p = e[t + h];
|
|
6884
6884
|
for (h += m, s = p & (1 << -l) - 1, p >>= -l, l += a; l > 0; s = s * 256 + e[t + h], h += m, l -= 8)
|
|
6885
6885
|
;
|
|
@@ -6894,7 +6894,7 @@ uc.read = function(e, t, r, n, i) {
|
|
|
6894
6894
|
}
|
|
6895
6895
|
return (p ? -1 : 1) * o * Math.pow(2, s - n);
|
|
6896
6896
|
};
|
|
6897
|
-
|
|
6897
|
+
dc.write = function(e, t, r, n, i, s) {
|
|
6898
6898
|
var o, a, c, f = s * 8 - i - 1, l = (1 << f) - 1, h = l >> 1, m = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : s - 1, g = n ? 1 : -1, v = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
6899
6899
|
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, o = l) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = Math.pow(2, -o)) < 1 && (o--, c *= 2), o + h >= 1 ? t += m / c : t += m * Math.pow(2, 1 - h), t * c >= 2 && (o++, c /= 2), o + h >= l ? (a = 0, o = l) : o + h >= 1 ? (a = (t * c - 1) * Math.pow(2, i), o = o + h) : (a = t * Math.pow(2, h - 1) * Math.pow(2, i), o = 0)); i >= 8; e[r + p] = a & 255, p += g, a /= 256, i -= 8)
|
|
6900
6900
|
;
|
|
@@ -6909,7 +6909,7 @@ uc.write = function(e, t, r, n, i, s) {
|
|
|
6909
6909
|
* @license MIT
|
|
6910
6910
|
*/
|
|
6911
6911
|
(function(e) {
|
|
6912
|
-
const t = Ds, r =
|
|
6912
|
+
const t = Ds, r = dc, n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
6913
6913
|
e.Buffer = a, e.SlowBuffer = I, e.INSPECT_MAX_BYTES = 50;
|
|
6914
6914
|
const i = 2147483647;
|
|
6915
6915
|
e.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -7164,7 +7164,7 @@ uc.write = function(e, t, r, n, i, s) {
|
|
|
7164
7164
|
case "binary":
|
|
7165
7165
|
return be(this, u, d);
|
|
7166
7166
|
case "base64":
|
|
7167
|
-
return
|
|
7167
|
+
return G(this, u, d);
|
|
7168
7168
|
case "ucs2":
|
|
7169
7169
|
case "ucs-2":
|
|
7170
7170
|
case "utf16le":
|
|
@@ -7355,7 +7355,7 @@ uc.write = function(e, t, r, n, i, s) {
|
|
|
7355
7355
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
7356
7356
|
};
|
|
7357
7357
|
};
|
|
7358
|
-
function
|
|
7358
|
+
function G(y, u, d) {
|
|
7359
7359
|
return u === 0 && d === y.length ? t.fromByteArray(y) : t.fromByteArray(y.slice(u, d));
|
|
7360
7360
|
}
|
|
7361
7361
|
function q(y, u, d) {
|
|
@@ -7877,17 +7877,17 @@ for (var uu in _i)
|
|
|
7877
7877
|
_i[uu].toJSON = (function(e) {
|
|
7878
7878
|
return e;
|
|
7879
7879
|
}).bind(null, uu);
|
|
7880
|
-
var
|
|
7880
|
+
var lc = _i, kr = lc;
|
|
7881
7881
|
function zd(e) {
|
|
7882
7882
|
return e.name || e.toString().match(/function (.*?)\s*\(/)[1];
|
|
7883
7883
|
}
|
|
7884
|
-
function
|
|
7884
|
+
function hc(e) {
|
|
7885
7885
|
return kr.Nil(e) ? "" : zd(e.constructor);
|
|
7886
7886
|
}
|
|
7887
7887
|
function Cb(e) {
|
|
7888
7888
|
return kr.Function(e) ? "" : kr.String(e) ? JSON.stringify(e) : e && kr.Object(e) ? "" : e;
|
|
7889
7889
|
}
|
|
7890
|
-
function
|
|
7890
|
+
function pc(e, t) {
|
|
7891
7891
|
Error.captureStackTrace && Error.captureStackTrace(e, t);
|
|
7892
7892
|
}
|
|
7893
7893
|
function vs(e) {
|
|
@@ -7898,7 +7898,7 @@ function qd(e, t, r) {
|
|
|
7898
7898
|
return "Expected " + vs(e) + ", got" + (r !== "" ? " " + r : "") + (n !== "" ? " " + n : "");
|
|
7899
7899
|
}
|
|
7900
7900
|
function Vt(e, t, r) {
|
|
7901
|
-
r = r ||
|
|
7901
|
+
r = r || hc(t), this.message = qd(e, t, r), pc(this, Vt), this.__type = e, this.__value = t, this.__valueTypeName = r;
|
|
7902
7902
|
}
|
|
7903
7903
|
Vt.prototype = Object.create(Error.prototype);
|
|
7904
7904
|
Vt.prototype.constructor = Vt;
|
|
@@ -7907,7 +7907,7 @@ function Ob(e, t, r, n, i) {
|
|
|
7907
7907
|
return t === "key" && (s = '" with key type '), qd('property "' + vs(r) + s + vs(e), n, i);
|
|
7908
7908
|
}
|
|
7909
7909
|
function cn(e, t, r, n, i) {
|
|
7910
|
-
e ? (i = i ||
|
|
7910
|
+
e ? (i = i || hc(n), this.message = Ob(e, r, t, n, i)) : this.message = 'Unexpected property "' + t + '"', pc(this, Vt), this.__label = r, this.__property = t, this.__type = e, this.__value = n, this.__valueTypeName = i;
|
|
7911
7911
|
}
|
|
7912
7912
|
cn.prototype = Object.create(Error.prototype);
|
|
7913
7913
|
cn.prototype.constructor = Vt;
|
|
@@ -7927,7 +7927,7 @@ function Lb(e, t, r) {
|
|
|
7927
7927
|
r,
|
|
7928
7928
|
e.__value,
|
|
7929
7929
|
e.__valueTypeName
|
|
7930
|
-
)),
|
|
7930
|
+
)), pc(e), e;
|
|
7931
7931
|
}
|
|
7932
7932
|
var Vd = {
|
|
7933
7933
|
TfTypeError: Vt,
|
|
@@ -7935,12 +7935,12 @@ var Vd = {
|
|
|
7935
7935
|
tfCustomError: Rb,
|
|
7936
7936
|
tfSubError: Lb,
|
|
7937
7937
|
tfJSON: vs,
|
|
7938
|
-
getValueTypeName:
|
|
7939
|
-
},
|
|
7938
|
+
getValueTypeName: hc
|
|
7939
|
+
}, ko, fu;
|
|
7940
7940
|
function Ub() {
|
|
7941
|
-
if (fu) return
|
|
7941
|
+
if (fu) return ko;
|
|
7942
7942
|
fu = 1;
|
|
7943
|
-
var e =
|
|
7943
|
+
var e = lc, t = Vd;
|
|
7944
7944
|
function r(S) {
|
|
7945
7945
|
return Buffer.isBuffer(S);
|
|
7946
7946
|
}
|
|
@@ -8018,9 +8018,9 @@ function Ub() {
|
|
|
8018
8018
|
E[T].toJSON = (function(S) {
|
|
8019
8019
|
return S;
|
|
8020
8020
|
}).bind(null, T);
|
|
8021
|
-
return
|
|
8021
|
+
return ko = E, ko;
|
|
8022
8022
|
}
|
|
8023
|
-
var Bi = Vd, Ne =
|
|
8023
|
+
var Bi = Vd, Ne = lc, Rt = Bi.tfJSON, Wd = Bi.TfTypeError, Kd = Bi.TfPropertyTypeError, Bn = Bi.tfSubError, Nb = Bi.getValueTypeName, $t = {
|
|
8024
8024
|
arrayOf: function(t, r) {
|
|
8025
8025
|
t = xt(t), r = r || {};
|
|
8026
8026
|
function n(i, s) {
|
|
@@ -8264,9 +8264,9 @@ function $b(e) {
|
|
|
8264
8264
|
return e.copy(t), t;
|
|
8265
8265
|
}
|
|
8266
8266
|
Fe.cloneBuffer = $b;
|
|
8267
|
-
class
|
|
8267
|
+
class yc {
|
|
8268
8268
|
static withCapacity(t) {
|
|
8269
|
-
return new
|
|
8269
|
+
return new yc(Buffer.alloc(t));
|
|
8270
8270
|
}
|
|
8271
8271
|
constructor(t, r = 0) {
|
|
8272
8272
|
this.buffer = t, this.offset = r, Xd(Br.tuple(Br.Buffer, Br.UInt32), [t, r]);
|
|
@@ -8303,7 +8303,7 @@ class hc {
|
|
|
8303
8303
|
throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`);
|
|
8304
8304
|
}
|
|
8305
8305
|
}
|
|
8306
|
-
Fe.BufferWriter =
|
|
8306
|
+
Fe.BufferWriter = yc;
|
|
8307
8307
|
class Mb {
|
|
8308
8308
|
constructor(t, r = 0) {
|
|
8309
8309
|
this.buffer = t, this.offset = r, Xd(Br.tuple(Br.Buffer, Br.UInt32), [t, r]);
|
|
@@ -8345,15 +8345,15 @@ class Mb {
|
|
|
8345
8345
|
}
|
|
8346
8346
|
Fe.BufferReader = Mb;
|
|
8347
8347
|
var gr = {};
|
|
8348
|
-
const Hb = /* @__PURE__ */
|
|
8348
|
+
const Hb = /* @__PURE__ */ fc(Dm);
|
|
8349
8349
|
var yn = {}, Mr = {}, wr = {};
|
|
8350
8350
|
Object.defineProperty(wr, "__esModule", { value: !0 });
|
|
8351
|
-
wr.anumber =
|
|
8351
|
+
wr.anumber = _a;
|
|
8352
8352
|
wr.abytes = el;
|
|
8353
8353
|
wr.ahash = jb;
|
|
8354
8354
|
wr.aexists = Gb;
|
|
8355
8355
|
wr.aoutput = zb;
|
|
8356
|
-
function
|
|
8356
|
+
function _a(e) {
|
|
8357
8357
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
8358
8358
|
throw new Error("positive integer expected, got " + e);
|
|
8359
8359
|
}
|
|
@@ -8369,7 +8369,7 @@ function el(e, ...t) {
|
|
|
8369
8369
|
function jb(e) {
|
|
8370
8370
|
if (typeof e != "function" || typeof e.create != "function")
|
|
8371
8371
|
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
8372
|
-
|
|
8372
|
+
_a(e.outputLen), _a(e.blockLen);
|
|
8373
8373
|
}
|
|
8374
8374
|
function Gb(e, t = !0) {
|
|
8375
8375
|
if (e.destroyed)
|
|
@@ -8383,7 +8383,7 @@ function zb(e, t) {
|
|
|
8383
8383
|
if (e.length < r)
|
|
8384
8384
|
throw new Error("digestInto() expects output buffer of length at least " + r);
|
|
8385
8385
|
}
|
|
8386
|
-
var
|
|
8386
|
+
var mc = {}, js = {};
|
|
8387
8387
|
Object.defineProperty(js, "__esModule", { value: !0 });
|
|
8388
8388
|
js.crypto = void 0;
|
|
8389
8389
|
js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
@@ -8422,8 +8422,8 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8422
8422
|
function m(L) {
|
|
8423
8423
|
(0, r.abytes)(L);
|
|
8424
8424
|
let D = "";
|
|
8425
|
-
for (let
|
|
8426
|
-
D += h[L[
|
|
8425
|
+
for (let G = 0; G < L.length; G++)
|
|
8426
|
+
D += h[L[G]];
|
|
8427
8427
|
return D;
|
|
8428
8428
|
}
|
|
8429
8429
|
const p = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
@@ -8438,11 +8438,11 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8438
8438
|
function v(L) {
|
|
8439
8439
|
if (typeof L != "string")
|
|
8440
8440
|
throw new Error("hex string expected, got " + typeof L);
|
|
8441
|
-
const D = L.length,
|
|
8441
|
+
const D = L.length, G = D / 2;
|
|
8442
8442
|
if (D % 2)
|
|
8443
8443
|
throw new Error("hex string expected, got unpadded hex of length " + D);
|
|
8444
|
-
const q = new Uint8Array(
|
|
8445
|
-
for (let Y = 0, re = 0; Y <
|
|
8444
|
+
const q = new Uint8Array(G);
|
|
8445
|
+
for (let Y = 0, re = 0; Y < G; Y++, re += 2) {
|
|
8446
8446
|
const le = g(L.charCodeAt(re)), be = g(L.charCodeAt(re + 1));
|
|
8447
8447
|
if (le === void 0 || be === void 0) {
|
|
8448
8448
|
const Pe = L[re] + L[re + 1];
|
|
@@ -8455,10 +8455,10 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8455
8455
|
const x = async () => {
|
|
8456
8456
|
};
|
|
8457
8457
|
e.nextTick = x;
|
|
8458
|
-
async function k(L, D,
|
|
8458
|
+
async function k(L, D, G) {
|
|
8459
8459
|
let q = Date.now();
|
|
8460
8460
|
for (let Y = 0; Y < L; Y++) {
|
|
8461
|
-
|
|
8461
|
+
G(Y);
|
|
8462
8462
|
const re = Date.now() - q;
|
|
8463
8463
|
re >= 0 && re < D || (await (0, e.nextTick)(), q += re);
|
|
8464
8464
|
}
|
|
@@ -8477,12 +8477,12 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8477
8477
|
const Y = L[q];
|
|
8478
8478
|
(0, r.abytes)(Y), D += Y.length;
|
|
8479
8479
|
}
|
|
8480
|
-
const
|
|
8480
|
+
const G = new Uint8Array(D);
|
|
8481
8481
|
for (let q = 0, Y = 0; q < L.length; q++) {
|
|
8482
8482
|
const re = L[q];
|
|
8483
|
-
|
|
8483
|
+
G.set(re, Y), Y += re.length;
|
|
8484
8484
|
}
|
|
8485
|
-
return
|
|
8485
|
+
return G;
|
|
8486
8486
|
}
|
|
8487
8487
|
class T {
|
|
8488
8488
|
// Safe version that clones internal state
|
|
@@ -8497,16 +8497,16 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8497
8497
|
return Object.assign(L, D);
|
|
8498
8498
|
}
|
|
8499
8499
|
function N(L) {
|
|
8500
|
-
const D = (q) => L().update(A(q)).digest(),
|
|
8501
|
-
return D.outputLen =
|
|
8500
|
+
const D = (q) => L().update(A(q)).digest(), G = L();
|
|
8501
|
+
return D.outputLen = G.outputLen, D.blockLen = G.blockLen, D.create = () => L(), D;
|
|
8502
8502
|
}
|
|
8503
8503
|
function M(L) {
|
|
8504
|
-
const D = (q, Y) => L(Y).update(A(q)).digest(),
|
|
8505
|
-
return D.outputLen =
|
|
8504
|
+
const D = (q, Y) => L(Y).update(A(q)).digest(), G = L({});
|
|
8505
|
+
return D.outputLen = G.outputLen, D.blockLen = G.blockLen, D.create = (q) => L(q), D;
|
|
8506
8506
|
}
|
|
8507
8507
|
function B(L) {
|
|
8508
|
-
const D = (q, Y) => L(Y).update(A(q)).digest(),
|
|
8509
|
-
return D.outputLen =
|
|
8508
|
+
const D = (q, Y) => L(Y).update(A(q)).digest(), G = L({});
|
|
8509
|
+
return D.outputLen = G.outputLen, D.blockLen = G.blockLen, D.create = (q) => L(q), D;
|
|
8510
8510
|
}
|
|
8511
8511
|
function V(L = 32) {
|
|
8512
8512
|
if (t.crypto && typeof t.crypto.getRandomValues == "function")
|
|
@@ -8515,13 +8515,13 @@ js.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
8515
8515
|
return t.crypto.randomBytes(L);
|
|
8516
8516
|
throw new Error("crypto.getRandomValues must be defined");
|
|
8517
8517
|
}
|
|
8518
|
-
})(
|
|
8518
|
+
})(mc);
|
|
8519
8519
|
Object.defineProperty(Mr, "__esModule", { value: !0 });
|
|
8520
8520
|
Mr.HashMD = void 0;
|
|
8521
8521
|
Mr.setBigUint64 = tl;
|
|
8522
8522
|
Mr.Chi = qb;
|
|
8523
8523
|
Mr.Maj = Vb;
|
|
8524
|
-
const
|
|
8524
|
+
const Bo = wr, Cn = mc;
|
|
8525
8525
|
function tl(e, t, r, n) {
|
|
8526
8526
|
if (typeof e.setBigUint64 == "function")
|
|
8527
8527
|
return e.setBigUint64(t, r, n);
|
|
@@ -8539,7 +8539,7 @@ class Wb extends Cn.Hash {
|
|
|
8539
8539
|
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Cn.createView)(this.buffer);
|
|
8540
8540
|
}
|
|
8541
8541
|
update(t) {
|
|
8542
|
-
(0,
|
|
8542
|
+
(0, Bo.aexists)(this);
|
|
8543
8543
|
const { view: r, buffer: n, blockLen: i } = this;
|
|
8544
8544
|
t = (0, Cn.toBytes)(t);
|
|
8545
8545
|
const s = t.length;
|
|
@@ -8556,7 +8556,7 @@ class Wb extends Cn.Hash {
|
|
|
8556
8556
|
return this.length += t.length, this.roundClean(), this;
|
|
8557
8557
|
}
|
|
8558
8558
|
digestInto(t) {
|
|
8559
|
-
(0,
|
|
8559
|
+
(0, Bo.aexists)(this), (0, Bo.aoutput)(t, this), this.finished = !0;
|
|
8560
8560
|
const { buffer: r, view: n, blockLen: i, isLE: s } = this;
|
|
8561
8561
|
let { pos: o } = this;
|
|
8562
8562
|
r[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > i - o && (this.process(n, 0), o = 0);
|
|
@@ -8587,14 +8587,14 @@ class Wb extends Cn.Hash {
|
|
|
8587
8587
|
Mr.HashMD = Wb;
|
|
8588
8588
|
Object.defineProperty(yn, "__esModule", { value: !0 });
|
|
8589
8589
|
yn.sha1 = yn.SHA1 = void 0;
|
|
8590
|
-
const
|
|
8590
|
+
const Co = Mr, ss = mc, On = /* @__PURE__ */ new Uint32Array([
|
|
8591
8591
|
1732584193,
|
|
8592
8592
|
4023233417,
|
|
8593
8593
|
2562383102,
|
|
8594
8594
|
271733878,
|
|
8595
8595
|
3285377520
|
|
8596
8596
|
]), ir = /* @__PURE__ */ new Uint32Array(80);
|
|
8597
|
-
class rl extends
|
|
8597
|
+
class rl extends Co.HashMD {
|
|
8598
8598
|
constructor() {
|
|
8599
8599
|
super(64, 20, 8, !1), this.A = On[0] | 0, this.B = On[1] | 0, this.C = On[2] | 0, this.D = On[3] | 0, this.E = On[4] | 0;
|
|
8600
8600
|
}
|
|
@@ -8613,7 +8613,7 @@ class rl extends ko.HashMD {
|
|
|
8613
8613
|
let { A: n, B: i, C: s, D: o, E: a } = this;
|
|
8614
8614
|
for (let c = 0; c < 80; c++) {
|
|
8615
8615
|
let f, l;
|
|
8616
|
-
c < 20 ? (f = (0,
|
|
8616
|
+
c < 20 ? (f = (0, Co.Chi)(i, s, o), l = 1518500249) : c < 40 ? (f = i ^ s ^ o, l = 1859775393) : c < 60 ? (f = (0, Co.Maj)(i, s, o), l = 2400959708) : (f = i ^ s ^ o, l = 3395469782);
|
|
8617
8617
|
const h = (0, ss.rotl)(n, 5) + f + a + l + ir[c] | 0;
|
|
8618
8618
|
a = o, o = s, s = (0, ss.rotl)(i, 30), i = n, n = h;
|
|
8619
8619
|
}
|
|
@@ -8628,7 +8628,7 @@ class rl extends ko.HashMD {
|
|
|
8628
8628
|
}
|
|
8629
8629
|
yn.SHA1 = rl;
|
|
8630
8630
|
yn.sha1 = (0, ss.wrapConstructor)(() => new rl());
|
|
8631
|
-
const nl = /* @__PURE__ */
|
|
8631
|
+
const nl = /* @__PURE__ */ fc(Vm);
|
|
8632
8632
|
(function(e) {
|
|
8633
8633
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.taggedHash = e.TAGGED_HASH_PREFIXES = e.TAGS = e.hash256 = e.hash160 = e.sha256 = e.sha1 = e.ripemd160 = void 0;
|
|
8634
8634
|
const t = Hb, r = yn, n = nl;
|
|
@@ -9266,7 +9266,7 @@ const nl = /* @__PURE__ */ cc(Vm);
|
|
|
9266
9266
|
}
|
|
9267
9267
|
e.taggedHash = f;
|
|
9268
9268
|
})(gr);
|
|
9269
|
-
var
|
|
9269
|
+
var Oo = {}, Dt = {};
|
|
9270
9270
|
Object.defineProperty(Dt, "__esModule", { value: !0 });
|
|
9271
9271
|
Dt.encode = Dt.decode = Dt.check = void 0;
|
|
9272
9272
|
function Kb(e) {
|
|
@@ -9322,7 +9322,7 @@ Dt.encode = Xb;
|
|
|
9322
9322
|
var Nr = {};
|
|
9323
9323
|
Object.defineProperty(Nr, "__esModule", { value: !0 });
|
|
9324
9324
|
Nr.REVERSE_OPS = Nr.OPS = void 0;
|
|
9325
|
-
const
|
|
9325
|
+
const va = {
|
|
9326
9326
|
OP_FALSE: 0,
|
|
9327
9327
|
OP_0: 0,
|
|
9328
9328
|
OP_PUSHDATA1: 76,
|
|
@@ -9443,11 +9443,11 @@ const wa = {
|
|
|
9443
9443
|
OP_PUBKEY: 254,
|
|
9444
9444
|
OP_INVALIDOPCODE: 255
|
|
9445
9445
|
};
|
|
9446
|
-
Nr.OPS =
|
|
9446
|
+
Nr.OPS = va;
|
|
9447
9447
|
const il = {};
|
|
9448
9448
|
Nr.REVERSE_OPS = il;
|
|
9449
|
-
for (const e of Object.keys(
|
|
9450
|
-
const t =
|
|
9449
|
+
for (const e of Object.keys(va)) {
|
|
9450
|
+
const t = va[e];
|
|
9451
9451
|
il[t] = e;
|
|
9452
9452
|
}
|
|
9453
9453
|
var lr = {};
|
|
@@ -9601,18 +9601,18 @@ function ot() {
|
|
|
9601
9601
|
function k(B) {
|
|
9602
9602
|
if (g(B)) return B;
|
|
9603
9603
|
a(o.Array, B);
|
|
9604
|
-
const V = B.reduce((
|
|
9604
|
+
const V = B.reduce((G, q) => x(q) ? q.length === 1 && p(q) !== void 0 ? G + 1 : G + n.encodingLength(q.length) + q.length : G + 1, 0), L = Buffer.allocUnsafe(V);
|
|
9605
9605
|
let D = 0;
|
|
9606
|
-
if (B.forEach((
|
|
9607
|
-
if (x(
|
|
9608
|
-
const q = p(
|
|
9606
|
+
if (B.forEach((G) => {
|
|
9607
|
+
if (x(G)) {
|
|
9608
|
+
const q = p(G);
|
|
9609
9609
|
if (q !== void 0) {
|
|
9610
9610
|
L.writeUInt8(q, D), D += 1;
|
|
9611
9611
|
return;
|
|
9612
9612
|
}
|
|
9613
|
-
D += n.encode(L,
|
|
9613
|
+
D += n.encode(L, G.length, D), G.copy(L, D), D += G.length;
|
|
9614
9614
|
} else
|
|
9615
|
-
L.writeUInt8(
|
|
9615
|
+
L.writeUInt8(G, D), D += 1;
|
|
9616
9616
|
}), D !== L.length) throw new Error("Could not decode chunks");
|
|
9617
9617
|
return L;
|
|
9618
9618
|
}
|
|
@@ -9625,10 +9625,10 @@ function ot() {
|
|
|
9625
9625
|
for (; L < B.length; ) {
|
|
9626
9626
|
const D = B[L];
|
|
9627
9627
|
if (D > r.OPS.OP_0 && D <= r.OPS.OP_PUSHDATA4) {
|
|
9628
|
-
const
|
|
9629
|
-
if (
|
|
9630
|
-
const q = B.slice(L, L +
|
|
9631
|
-
L +=
|
|
9628
|
+
const G = n.decode(B, L);
|
|
9629
|
+
if (G === null || (L += G.size, L + G.number > B.length)) return null;
|
|
9630
|
+
const q = B.slice(L, L + G.number);
|
|
9631
|
+
L += G.number;
|
|
9632
9632
|
const Y = p(q);
|
|
9633
9633
|
Y !== void 0 ? V.push(Y) : V.push(q);
|
|
9634
9634
|
} else
|
|
@@ -9673,7 +9673,7 @@ function ot() {
|
|
|
9673
9673
|
return !Buffer.isBuffer(B) || !N(B[B.length - 1]) ? !1 : t.check(B.slice(0, -1));
|
|
9674
9674
|
}
|
|
9675
9675
|
e.isCanonicalScriptSignature = M, e.number = i, e.signature = s;
|
|
9676
|
-
}(
|
|
9676
|
+
}(Oo)), Oo;
|
|
9677
9677
|
}
|
|
9678
9678
|
Object.defineProperty(Ci, "__esModule", { value: !0 });
|
|
9679
9679
|
Ci.Transaction = void 0;
|
|
@@ -9686,7 +9686,7 @@ function ig(e) {
|
|
|
9686
9686
|
const t = e.length;
|
|
9687
9687
|
return ke.varuint.encodingLength(t) + e.reduce((r, n) => r + vt(n), 0);
|
|
9688
9688
|
}
|
|
9689
|
-
const cr = Buffer.allocUnsafe(0),
|
|
9689
|
+
const cr = Buffer.allocUnsafe(0), Ro = [], Lo = Buffer.from(
|
|
9690
9690
|
"0000000000000000000000000000000000000000000000000000000000000000",
|
|
9691
9691
|
"hex"
|
|
9692
9692
|
), yu = Buffer.from(
|
|
@@ -9716,7 +9716,7 @@ class ee {
|
|
|
9716
9716
|
index: n.readUInt32(),
|
|
9717
9717
|
script: n.readVarSlice(),
|
|
9718
9718
|
sequence: n.readUInt32(),
|
|
9719
|
-
witness:
|
|
9719
|
+
witness: Ro
|
|
9720
9720
|
});
|
|
9721
9721
|
const f = n.readVarInt();
|
|
9722
9722
|
for (let l = 0; l < f; ++l)
|
|
@@ -9761,7 +9761,7 @@ class ee {
|
|
|
9761
9761
|
index: r,
|
|
9762
9762
|
script: i || cr,
|
|
9763
9763
|
sequence: n,
|
|
9764
|
-
witness:
|
|
9764
|
+
witness: Ro
|
|
9765
9765
|
}) - 1;
|
|
9766
9766
|
}
|
|
9767
9767
|
addOutput(t, r) {
|
|
@@ -9775,7 +9775,7 @@ class ee {
|
|
|
9775
9775
|
}
|
|
9776
9776
|
stripWitnesses() {
|
|
9777
9777
|
this.ins.forEach((t) => {
|
|
9778
|
-
t.witness =
|
|
9778
|
+
t.witness = Ro;
|
|
9779
9779
|
});
|
|
9780
9780
|
}
|
|
9781
9781
|
weight() {
|
|
@@ -9906,7 +9906,7 @@ class ee {
|
|
|
9906
9906
|
ie.tuple(ie.UInt32, ie.Buffer, ie.Satoshi, ie.UInt32),
|
|
9907
9907
|
arguments
|
|
9908
9908
|
);
|
|
9909
|
-
let s = Buffer.from([]), o, a =
|
|
9909
|
+
let s = Buffer.from([]), o, a = Lo, c = Lo, f = Lo;
|
|
9910
9910
|
if (i & ee.SIGHASH_ANYONECANPAY || (s = Buffer.allocUnsafe(36 * this.ins.length), o = new ke.BufferWriter(s, 0), this.ins.forEach((h) => {
|
|
9911
9911
|
o.writeSlice(h.hash), o.writeUInt32(h.index);
|
|
9912
9912
|
}), c = Ve.hash256(s)), !(i & ee.SIGHASH_ANYONECANPAY) && (i & 31) !== ee.SIGHASH_SINGLE && (i & 31) !== ee.SIGHASH_NONE && (s = Buffer.allocUnsafe(4 * this.ins.length), o = new ke.BufferWriter(s, 0), this.ins.forEach((h) => {
|
|
@@ -9975,12 +9975,12 @@ ee.ADVANCED_TRANSACTION_FLAG = 1;
|
|
|
9975
9975
|
var de = {}, Oi = {};
|
|
9976
9976
|
Object.defineProperty(Oi, "__esModule", { value: !0 });
|
|
9977
9977
|
const cg = 9007199254740991;
|
|
9978
|
-
function
|
|
9978
|
+
function bc(e) {
|
|
9979
9979
|
if (e < 0 || e > cg || e % 1 !== 0)
|
|
9980
9980
|
throw new RangeError("value out of range");
|
|
9981
9981
|
}
|
|
9982
9982
|
function zn(e, t, r) {
|
|
9983
|
-
if (
|
|
9983
|
+
if (bc(e), t || (t = Buffer.allocUnsafe(ol(e))), !Buffer.isBuffer(t))
|
|
9984
9984
|
throw new TypeError("buffer must be a Buffer instance");
|
|
9985
9985
|
return r || (r = 0), e < 253 ? (t.writeUInt8(e, r), Object.assign(zn, { bytes: 1 })) : e <= 65535 ? (t.writeUInt8(253, r), t.writeUInt16LE(e, r + 1), Object.assign(zn, { bytes: 3 })) : e <= 4294967295 ? (t.writeUInt8(254, r), t.writeUInt32LE(e, r + 1), Object.assign(zn, { bytes: 5 })) : (t.writeUInt8(255, r), t.writeUInt32LE(e >>> 0, r + 1), t.writeUInt32LE(e / 4294967296 | 0, r + 5), Object.assign(zn, { bytes: 9 })), t;
|
|
9986
9986
|
}
|
|
@@ -9999,15 +9999,15 @@ function qn(e, t) {
|
|
|
9999
9999
|
{
|
|
10000
10000
|
Object.assign(qn, { bytes: 9 });
|
|
10001
10001
|
const n = e.readUInt32LE(t + 1), s = e.readUInt32LE(t + 5) * 4294967296 + n;
|
|
10002
|
-
return
|
|
10002
|
+
return bc(s), s;
|
|
10003
10003
|
}
|
|
10004
10004
|
}
|
|
10005
10005
|
Oi.decode = qn;
|
|
10006
10006
|
function ol(e) {
|
|
10007
|
-
return
|
|
10007
|
+
return bc(e), e < 253 ? 1 : e <= 65535 ? 3 : e <= 4294967295 ? 5 : 9;
|
|
10008
10008
|
}
|
|
10009
10009
|
Oi.encodingLength = ol;
|
|
10010
|
-
var
|
|
10010
|
+
var Uo = {}, Gs = {}, Ge = {};
|
|
10011
10011
|
Object.defineProperty(Ge, "__esModule", { value: !0 });
|
|
10012
10012
|
Ge.testnet = Ge.regtest = Ge.bitcoin = void 0;
|
|
10013
10013
|
Ge.bitcoin = {
|
|
@@ -10360,10 +10360,10 @@ function bg(e) {
|
|
|
10360
10360
|
}
|
|
10361
10361
|
var gg = bg;
|
|
10362
10362
|
const wg = gg, _g = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
10363
|
-
var vg = wg(_g),
|
|
10363
|
+
var vg = wg(_g), No = vg, Eg = function(e) {
|
|
10364
10364
|
function t(s) {
|
|
10365
10365
|
var o = Uint8Array.from(s), a = e(o), c = o.length + 4, f = new Uint8Array(c);
|
|
10366
|
-
return f.set(o, 0), f.set(a.subarray(0, 4), o.length),
|
|
10366
|
+
return f.set(o, 0), f.set(a.subarray(0, 4), o.length), No.encode(f, c);
|
|
10367
10367
|
}
|
|
10368
10368
|
function r(s) {
|
|
10369
10369
|
var o = s.slice(0, -4), a = s.slice(-4), c = e(o);
|
|
@@ -10371,12 +10371,12 @@ var vg = wg(_g), Lo = vg, Eg = function(e) {
|
|
|
10371
10371
|
return o;
|
|
10372
10372
|
}
|
|
10373
10373
|
function n(s) {
|
|
10374
|
-
var o =
|
|
10374
|
+
var o = No.decodeUnsafe(s);
|
|
10375
10375
|
if (o)
|
|
10376
10376
|
return r(o);
|
|
10377
10377
|
}
|
|
10378
10378
|
function i(s) {
|
|
10379
|
-
var o =
|
|
10379
|
+
var o = No.decode(s), a = r(o);
|
|
10380
10380
|
if (!a) throw new Error("Invalid checksum");
|
|
10381
10381
|
return a;
|
|
10382
10382
|
}
|
|
@@ -10389,10 +10389,10 @@ var vg = wg(_g), Lo = vg, Eg = function(e) {
|
|
|
10389
10389
|
function Ag(e) {
|
|
10390
10390
|
return wu(wu(e));
|
|
10391
10391
|
}
|
|
10392
|
-
var
|
|
10392
|
+
var gc = xg(Ag);
|
|
10393
10393
|
Object.defineProperty(Vs, "__esModule", { value: !0 });
|
|
10394
10394
|
Vs.p2pkh = void 0;
|
|
10395
|
-
const
|
|
10395
|
+
const Fo = gr, Sg = Ge, tn = ot(), We = ze, Lt = it, _u = gc, or = tn.OPS;
|
|
10396
10396
|
function Pg(e, t) {
|
|
10397
10397
|
if (!e.address && !e.hash && !e.output && !e.pubkey && !e.input)
|
|
10398
10398
|
throw new TypeError("Not enough data");
|
|
@@ -10419,7 +10419,7 @@ function Pg(e, t) {
|
|
|
10419
10419
|
}), Lt.prop(s, "hash", () => {
|
|
10420
10420
|
if (e.output) return e.output.slice(3, 23);
|
|
10421
10421
|
if (e.address) return r().hash;
|
|
10422
|
-
if (e.pubkey || s.pubkey) return
|
|
10422
|
+
if (e.pubkey || s.pubkey) return Fo.hash160(e.pubkey || s.pubkey);
|
|
10423
10423
|
}), Lt.prop(s, "output", () => {
|
|
10424
10424
|
if (s.hash)
|
|
10425
10425
|
return tn.compile([
|
|
@@ -10463,7 +10463,7 @@ function Pg(e, t) {
|
|
|
10463
10463
|
o = a;
|
|
10464
10464
|
}
|
|
10465
10465
|
if (e.pubkey) {
|
|
10466
|
-
const a =
|
|
10466
|
+
const a = Fo.hash160(e.pubkey);
|
|
10467
10467
|
if (o.length > 0 && !o.equals(a))
|
|
10468
10468
|
throw new TypeError("Hash mismatch");
|
|
10469
10469
|
o = a;
|
|
@@ -10479,7 +10479,7 @@ function Pg(e, t) {
|
|
|
10479
10479
|
throw new TypeError("Signature mismatch");
|
|
10480
10480
|
if (e.pubkey && !e.pubkey.equals(a[1]))
|
|
10481
10481
|
throw new TypeError("Pubkey mismatch");
|
|
10482
|
-
const c =
|
|
10482
|
+
const c = Fo.hash160(a[1]);
|
|
10483
10483
|
if (o.length > 0 && !o.equals(c))
|
|
10484
10484
|
throw new TypeError("Hash mismatch");
|
|
10485
10485
|
}
|
|
@@ -10490,7 +10490,7 @@ Vs.p2pkh = Pg;
|
|
|
10490
10490
|
var Ws = {};
|
|
10491
10491
|
Object.defineProperty(Ws, "__esModule", { value: !0 });
|
|
10492
10492
|
Ws.p2sh = void 0;
|
|
10493
|
-
const vu = gr, Tg = Ge, Et = ot(), ye = ze, _t = it, Eu =
|
|
10493
|
+
const vu = gr, Tg = Ge, Et = ot(), ye = ze, _t = it, Eu = gc, Rn = Et.OPS;
|
|
10494
10494
|
function Ig(e, t) {
|
|
10495
10495
|
if (!e.address && !e.hash && !e.output && !e.redeem && !e.input)
|
|
10496
10496
|
throw new TypeError("Not enough data");
|
|
@@ -10657,7 +10657,7 @@ function xu(e) {
|
|
|
10657
10657
|
}
|
|
10658
10658
|
return t;
|
|
10659
10659
|
}
|
|
10660
|
-
function
|
|
10660
|
+
function wc(e, t, r, n) {
|
|
10661
10661
|
let i = 0, s = 0;
|
|
10662
10662
|
const o = (1 << r) - 1, a = [];
|
|
10663
10663
|
for (let c = 0; c < e.length; ++c)
|
|
@@ -10674,15 +10674,15 @@ function bc(e, t, r, n) {
|
|
|
10674
10674
|
return a;
|
|
10675
10675
|
}
|
|
10676
10676
|
function kg(e) {
|
|
10677
|
-
return
|
|
10677
|
+
return wc(e, 8, 5, !0);
|
|
10678
10678
|
}
|
|
10679
10679
|
function Bg(e) {
|
|
10680
|
-
const t =
|
|
10680
|
+
const t = wc(e, 5, 8, !1);
|
|
10681
10681
|
if (Array.isArray(t))
|
|
10682
10682
|
return t;
|
|
10683
10683
|
}
|
|
10684
10684
|
function Cg(e) {
|
|
10685
|
-
const t =
|
|
10685
|
+
const t = wc(e, 5, 8, !1);
|
|
10686
10686
|
if (Array.isArray(t))
|
|
10687
10687
|
return t;
|
|
10688
10688
|
throw new Error(t);
|
|
@@ -10766,7 +10766,7 @@ Wt.bech32 = cl("bech32");
|
|
|
10766
10766
|
Wt.bech32m = cl("bech32m");
|
|
10767
10767
|
Object.defineProperty(Ks, "__esModule", { value: !0 });
|
|
10768
10768
|
Ks.p2wpkh = void 0;
|
|
10769
|
-
const
|
|
10769
|
+
const $o = gr, Og = Ge, as = ot(), Be = ze, ar = it, Ki = Wt, Au = as.OPS, Rg = Buffer.alloc(0);
|
|
10770
10770
|
function Lg(e, t) {
|
|
10771
10771
|
if (!e.address && !e.hash && !e.output && !e.pubkey && !e.witness)
|
|
10772
10772
|
throw new TypeError("Not enough data");
|
|
@@ -10800,7 +10800,7 @@ function Lg(e, t) {
|
|
|
10800
10800
|
}), ar.prop(i, "hash", () => {
|
|
10801
10801
|
if (e.output) return e.output.slice(2, 22);
|
|
10802
10802
|
if (e.address) return r().data;
|
|
10803
|
-
if (e.pubkey || i.pubkey) return
|
|
10803
|
+
if (e.pubkey || i.pubkey) return $o.hash160(e.pubkey || i.pubkey);
|
|
10804
10804
|
}), ar.prop(i, "output", () => {
|
|
10805
10805
|
if (i.hash)
|
|
10806
10806
|
return as.compile([Au.OP_0, i.hash]);
|
|
@@ -10841,7 +10841,7 @@ function Lg(e, t) {
|
|
|
10841
10841
|
s = e.output.slice(2);
|
|
10842
10842
|
}
|
|
10843
10843
|
if (e.pubkey) {
|
|
10844
|
-
const o =
|
|
10844
|
+
const o = $o.hash160(e.pubkey);
|
|
10845
10845
|
if (s.length > 0 && !s.equals(o))
|
|
10846
10846
|
throw new TypeError("Hash mismatch");
|
|
10847
10847
|
if (s = o, !(0, Be.isPoint)(e.pubkey) || e.pubkey.length !== 33)
|
|
@@ -10857,7 +10857,7 @@ function Lg(e, t) {
|
|
|
10857
10857
|
throw new TypeError("Signature mismatch");
|
|
10858
10858
|
if (e.pubkey && !e.pubkey.equals(e.witness[1]))
|
|
10859
10859
|
throw new TypeError("Pubkey mismatch");
|
|
10860
|
-
const o =
|
|
10860
|
+
const o = $o.hash160(e.witness[1]);
|
|
10861
10861
|
if (s.length > 0 && !s.equals(o))
|
|
10862
10862
|
throw new TypeError("Hash mismatch");
|
|
10863
10863
|
}
|
|
@@ -10868,7 +10868,7 @@ Ks.p2wpkh = Lg;
|
|
|
10868
10868
|
var Ys = {};
|
|
10869
10869
|
Object.defineProperty(Ys, "__esModule", { value: !0 });
|
|
10870
10870
|
Ys.p2wsh = void 0;
|
|
10871
|
-
const Su = gr, Ug = Ge, Ft = ot(), he = ze, Ut = it, Yi = Wt, Pu = Ft.OPS,
|
|
10871
|
+
const Su = gr, Ug = Ge, Ft = ot(), he = ze, Ut = it, Yi = Wt, Pu = Ft.OPS, Mo = Buffer.alloc(0);
|
|
10872
10872
|
function Xi(e) {
|
|
10873
10873
|
return !!(Buffer.isBuffer(e) && e.length === 65 && e[0] === 4 && (0, he.isPoint)(e));
|
|
10874
10874
|
}
|
|
@@ -10922,16 +10922,16 @@ function Ng(e, t) {
|
|
|
10922
10922
|
if (e.witness)
|
|
10923
10923
|
return {
|
|
10924
10924
|
output: e.witness[e.witness.length - 1],
|
|
10925
|
-
input:
|
|
10925
|
+
input: Mo,
|
|
10926
10926
|
witness: e.witness.slice(0, -1)
|
|
10927
10927
|
};
|
|
10928
10928
|
}), Ut.prop(s, "input", () => {
|
|
10929
10929
|
if (s.witness)
|
|
10930
|
-
return
|
|
10930
|
+
return Mo;
|
|
10931
10931
|
}), Ut.prop(s, "witness", () => {
|
|
10932
10932
|
if (e.redeem && e.redeem.input && e.redeem.input.length > 0 && e.redeem.output && e.redeem.output.length > 0) {
|
|
10933
10933
|
const o = Ft.toStack(n());
|
|
10934
|
-
return s.redeem = Object.assign({ witness: o }, e.redeem), s.redeem.input =
|
|
10934
|
+
return s.redeem = Object.assign({ witness: o }, e.redeem), s.redeem.input = Mo, [].concat(o, e.redeem.output);
|
|
10935
10935
|
}
|
|
10936
10936
|
if (e.redeem && e.redeem.output && e.redeem.witness)
|
|
10937
10937
|
return [].concat(e.redeem.witness, e.redeem.output);
|
|
@@ -11076,7 +11076,7 @@ const Hg = [
|
|
|
11076
11076
|
result: "9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"
|
|
11077
11077
|
}
|
|
11078
11078
|
];
|
|
11079
|
-
var
|
|
11079
|
+
var _c = {};
|
|
11080
11080
|
(function(e) {
|
|
11081
11081
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tweakKey = e.tapTweakHash = e.tapleafHash = e.findScriptPath = e.toHashTree = e.rootHashFromPath = e.MAX_TAPTREE_DEPTH = e.LEAF_VERSION_TAPSCRIPT = void 0;
|
|
11082
11082
|
const t = Jt, r = Fr, n = gr, i = Fe, s = ze;
|
|
@@ -11153,12 +11153,12 @@ var gc = {};
|
|
|
11153
11153
|
const x = i.varuint.encodingLength(v.length), k = t.Buffer.allocUnsafe(x);
|
|
11154
11154
|
return i.varuint.encode(v.length, k), t.Buffer.concat([k, v]);
|
|
11155
11155
|
}
|
|
11156
|
-
})(
|
|
11156
|
+
})(_c);
|
|
11157
11157
|
var Ke = {}, Tu;
|
|
11158
11158
|
function Dg() {
|
|
11159
11159
|
if (Tu) return Ke;
|
|
11160
11160
|
Tu = 1, Object.defineProperty(Ke, "__esModule", { value: !0 }), Ke.toOutputScript = Ke.fromOutputScript = Ke.toBech32 = Ke.toBase58Check = Ke.fromBech32 = Ke.fromBase58Check = void 0;
|
|
11161
|
-
const e = Ge, t =
|
|
11161
|
+
const e = Ge, t = vc(), r = ot(), n = ze, i = Wt, s = gc, o = 40, a = 2, c = 16, f = 2, l = 80, h = "WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";
|
|
11162
11162
|
function m(A, E) {
|
|
11163
11163
|
const T = A.slice(2);
|
|
11164
11164
|
if (T.length < a || T.length > o)
|
|
@@ -11281,7 +11281,7 @@ var Iu;
|
|
|
11281
11281
|
function jg() {
|
|
11282
11282
|
if (Iu) return Ln;
|
|
11283
11283
|
Iu = 1, Object.defineProperty(Ln, "__esModule", { value: !0 }), Ln.p2tr = void 0;
|
|
11284
|
-
const e = Jt, t = Ge, r = ot(), n = ze, i = Fr, s =
|
|
11284
|
+
const e = Jt, t = Ge, r = ot(), n = ze, i = Fr, s = _c, o = it, a = Wt, c = Dg(), f = r.OPS, l = 1, h = 80;
|
|
11285
11285
|
function m(p, g) {
|
|
11286
11286
|
if (!p.address && !p.output && !p.pubkey && !p.internalPubkey && !(p.witness && p.witness.length > 1))
|
|
11287
11287
|
throw new TypeError("Not enough data");
|
|
@@ -11469,7 +11469,7 @@ function jg() {
|
|
|
11469
11469
|
const V = N[0] & n.TAPLEAF_VERSION_MASK, L = S[S.length - 2], D = (0, s.tapleafHash)({
|
|
11470
11470
|
output: L,
|
|
11471
11471
|
version: V
|
|
11472
|
-
}),
|
|
11472
|
+
}), G = (0, s.rootHashFromPath)(N, D), q = (0, s.tweakKey)(B, G);
|
|
11473
11473
|
if (!q)
|
|
11474
11474
|
throw new TypeError("Invalid outputKey for p2tr witness");
|
|
11475
11475
|
if (E.length && !E.equals(q.x))
|
|
@@ -11483,7 +11483,7 @@ function jg() {
|
|
|
11483
11483
|
return Ln.p2tr = m, Ln;
|
|
11484
11484
|
}
|
|
11485
11485
|
var ku;
|
|
11486
|
-
function
|
|
11486
|
+
function vc() {
|
|
11487
11487
|
return ku || (ku = 1, function(e) {
|
|
11488
11488
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.p2tr = e.p2wsh = e.p2wpkh = e.p2sh = e.p2pkh = e.p2pk = e.p2ms = e.embed = void 0;
|
|
11489
11489
|
const t = Gs;
|
|
@@ -11542,11 +11542,11 @@ function wc() {
|
|
|
11542
11542
|
return c.p2tr;
|
|
11543
11543
|
}
|
|
11544
11544
|
});
|
|
11545
|
-
}(
|
|
11545
|
+
}(Uo)), Uo;
|
|
11546
11546
|
}
|
|
11547
11547
|
Object.defineProperty(de, "__esModule", { value: !0 });
|
|
11548
11548
|
de.signatureBlocksAction = de.checkInputForSig = de.pubkeyInScript = de.pubkeyPositionInScript = de.witnessStackToScriptWitness = de.isP2TR = de.isP2SHScript = de.isP2WSHScript = de.isP2WPKH = de.isP2PKH = de.isP2PK = de.isP2MS = void 0;
|
|
11549
|
-
const Bu = Oi, Kn = ot(), Ji = Ci, Gg = gr, Hr =
|
|
11549
|
+
const Bu = Oi, Kn = ot(), Ji = Ci, Gg = gr, Hr = vc();
|
|
11550
11550
|
function Dr(e) {
|
|
11551
11551
|
return (t) => {
|
|
11552
11552
|
try {
|
|
@@ -11625,7 +11625,7 @@ function Kg(e) {
|
|
|
11625
11625
|
}
|
|
11626
11626
|
Object.defineProperty(Ee, "__esModule", { value: !0 });
|
|
11627
11627
|
Ee.checkTaprootInputForSigs = Ee.tapTreeFromList = Ee.tapTreeToList = Ee.tweakInternalPubKey = Ee.checkTaprootOutputFields = Ee.checkTaprootInputFields = Ee.isTaprootOutput = Ee.isTaprootInput = cs = Ee.serializeTaprootSignature = Ee.tapScriptFinalizer = Ee.toXOnly = void 0;
|
|
11628
|
-
const
|
|
11628
|
+
const Ec = ze, Yg = Ci, Xs = de, mr = _c, Xg = vc(), Jg = de, Zg = (e) => e.length === 32 ? e : e.slice(1, 33);
|
|
11629
11629
|
Ee.toXOnly = Zg;
|
|
11630
11630
|
function Qg(e, t, r) {
|
|
11631
11631
|
const n = b1(
|
|
@@ -11690,11 +11690,11 @@ function s1(e, t) {
|
|
|
11690
11690
|
}
|
|
11691
11691
|
Ee.tweakInternalPubKey = s1;
|
|
11692
11692
|
function o1(e) {
|
|
11693
|
-
if (!(0,
|
|
11693
|
+
if (!(0, Ec.isTaptree)(e))
|
|
11694
11694
|
throw new Error(
|
|
11695
11695
|
"Cannot convert taptree to tapleaf list. Expecting a tapree structure."
|
|
11696
11696
|
);
|
|
11697
|
-
return
|
|
11697
|
+
return Ea(e);
|
|
11698
11698
|
}
|
|
11699
11699
|
Ee.tapTreeToList = o1;
|
|
11700
11700
|
function dl(e = []) {
|
|
@@ -11729,22 +11729,22 @@ function f1(e) {
|
|
|
11729
11729
|
const t = e.slice(2);
|
|
11730
11730
|
if (t.length === 64 || t.length === 65) return t;
|
|
11731
11731
|
}
|
|
11732
|
-
function
|
|
11732
|
+
function Ea(e, t = [], r = 0) {
|
|
11733
11733
|
if (r > mr.MAX_TAPTREE_DEPTH)
|
|
11734
11734
|
throw new Error("Max taptree depth exceeded.");
|
|
11735
|
-
return e ? (0,
|
|
11735
|
+
return e ? (0, Ec.isTapleaf)(e) ? (t.push({
|
|
11736
11736
|
depth: r,
|
|
11737
11737
|
leafVersion: e.version || mr.LEAF_VERSION_TAPSCRIPT,
|
|
11738
11738
|
script: e.output
|
|
11739
|
-
}), t) : (e[0] &&
|
|
11739
|
+
}), t) : (e[0] && Ea(e[0], t, r + 1), e[1] && Ea(e[1], t, r + 1), t) : [];
|
|
11740
11740
|
}
|
|
11741
11741
|
function d1(e) {
|
|
11742
11742
|
let t;
|
|
11743
11743
|
for (const r of e)
|
|
11744
|
-
if (t =
|
|
11744
|
+
if (t = xa(r, t), !t) throw new Error("No room left to insert tapleaf in tree");
|
|
11745
11745
|
return t;
|
|
11746
11746
|
}
|
|
11747
|
-
function
|
|
11747
|
+
function xa(e, t, r = 0) {
|
|
11748
11748
|
if (r > mr.MAX_TAPTREE_DEPTH)
|
|
11749
11749
|
throw new Error("Max taptree depth exceeded.");
|
|
11750
11750
|
if (e.depth === r)
|
|
@@ -11752,10 +11752,10 @@ function va(e, t, r = 0) {
|
|
|
11752
11752
|
output: e.script,
|
|
11753
11753
|
version: e.leafVersion
|
|
11754
11754
|
};
|
|
11755
|
-
if ((0,
|
|
11756
|
-
const n =
|
|
11755
|
+
if ((0, Ec.isTapleaf)(t)) return;
|
|
11756
|
+
const n = xa(e, t && t[0], r + 1);
|
|
11757
11757
|
if (n) return [n, t && t[1]];
|
|
11758
|
-
const i =
|
|
11758
|
+
const i = xa(e, t && t[1], r + 1);
|
|
11759
11759
|
if (i) return [t && t[0], i];
|
|
11760
11760
|
}
|
|
11761
11761
|
function l1(e, t, r) {
|
|
@@ -11775,22 +11775,22 @@ function h1(e, t, r) {
|
|
|
11775
11775
|
function p1(e, t, r) {
|
|
11776
11776
|
if (t.tapMerkleRoot) {
|
|
11777
11777
|
const n = (t.tapLeafScript || []).every(
|
|
11778
|
-
(s) =>
|
|
11778
|
+
(s) => Ho(s, t.tapMerkleRoot)
|
|
11779
11779
|
), i = (e.tapLeafScript || []).every(
|
|
11780
|
-
(s) =>
|
|
11780
|
+
(s) => Ho(s, t.tapMerkleRoot)
|
|
11781
11781
|
);
|
|
11782
11782
|
if (!n || !i)
|
|
11783
11783
|
throw new Error(
|
|
11784
11784
|
`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`
|
|
11785
11785
|
);
|
|
11786
11786
|
} else if (e.tapMerkleRoot && !(t.tapLeafScript || []).every(
|
|
11787
|
-
(i) =>
|
|
11787
|
+
(i) => Ho(i, e.tapMerkleRoot)
|
|
11788
11788
|
))
|
|
11789
11789
|
throw new Error(
|
|
11790
11790
|
`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`
|
|
11791
11791
|
);
|
|
11792
11792
|
}
|
|
11793
|
-
function
|
|
11793
|
+
function Ho(e, t) {
|
|
11794
11794
|
if (!t) return !0;
|
|
11795
11795
|
const r = (0, mr.tapleafHash)({
|
|
11796
11796
|
output: e.script,
|
|
@@ -11891,8 +11891,8 @@ class Yn {
|
|
|
11891
11891
|
t,
|
|
11892
11892
|
r,
|
|
11893
11893
|
n,
|
|
11894
|
-
|
|
11895
|
-
|
|
11894
|
+
wa(s).toString("hex"),
|
|
11895
|
+
wa(i).toString("hex"),
|
|
11896
11896
|
o,
|
|
11897
11897
|
c,
|
|
11898
11898
|
a
|
|
@@ -11940,7 +11940,7 @@ class Yn {
|
|
|
11940
11940
|
if (a === 0) throw new Error(`${i} ${Ue.notFunded}`);
|
|
11941
11941
|
for (let c = 0; c < o.length; c++)
|
|
11942
11942
|
n.addInput(Buffer.from(o[c].txid, "hex").reverse(), o[c].vout);
|
|
11943
|
-
return r ?? (r = await s.suggestFee(i, a,
|
|
11943
|
+
return r ?? (r = await s.suggestFee(i, a, Bc.MEDIUM)), n.addOutput(
|
|
11944
11944
|
ae.address.toOutputScript(t, this.network),
|
|
11945
11945
|
a - r
|
|
11946
11946
|
), { tx: n, usedUtxos: o };
|
|
@@ -11995,7 +11995,7 @@ class Yn {
|
|
|
11995
11995
|
return t ?? (t = await (await this.signer.getProvider()).suggestFee(
|
|
11996
11996
|
await this.signer.getAddress(),
|
|
11997
11997
|
this.initiateAmount,
|
|
11998
|
-
|
|
11998
|
+
Bc.MEDIUM
|
|
11999
11999
|
)), await this.signer.send(this.address(), this.initiateAmount, t);
|
|
12000
12000
|
}
|
|
12001
12001
|
async generateRedeemSACP(t, r, n) {
|
|
@@ -12426,7 +12426,7 @@ class v1 {
|
|
|
12426
12426
|
const t = await Mt.get(this.url);
|
|
12427
12427
|
return ne(t);
|
|
12428
12428
|
} catch (t) {
|
|
12429
|
-
return
|
|
12429
|
+
return j("Failed to fetch block numbers", t);
|
|
12430
12430
|
}
|
|
12431
12431
|
}
|
|
12432
12432
|
}
|
|
@@ -12455,7 +12455,7 @@ const Qi = {
|
|
|
12455
12455
|
evmRelay: "",
|
|
12456
12456
|
starknetRelay: ""
|
|
12457
12457
|
}
|
|
12458
|
-
},
|
|
12458
|
+
}, Aa = {
|
|
12459
12459
|
[hs.MAINNET]: {
|
|
12460
12460
|
chainId: "0x534e5f4d41494e",
|
|
12461
12461
|
nodeUrl: "https://starknet-mainnet.public.blastapi.io/rpc/v0_8"
|
|
@@ -12479,9 +12479,9 @@ class E1 {
|
|
|
12479
12479
|
retryCount: 0,
|
|
12480
12480
|
...i
|
|
12481
12481
|
});
|
|
12482
|
-
return o.error ?
|
|
12482
|
+
return o.error ? j(o.error) : o.result ? ne(o.result) : j("GetQuote: Unexpected error, result is undefined");
|
|
12483
12483
|
} catch (s) {
|
|
12484
|
-
return
|
|
12484
|
+
return j("GetQuote:", String(s));
|
|
12485
12485
|
}
|
|
12486
12486
|
}
|
|
12487
12487
|
async getAttestedQuote(t) {
|
|
@@ -12492,9 +12492,9 @@ class E1 {
|
|
|
12492
12492
|
"Content-Type": "application/json"
|
|
12493
12493
|
}
|
|
12494
12494
|
});
|
|
12495
|
-
return r.error ?
|
|
12495
|
+
return r.error ? j(r.error) : r.result ? ne(r.result) : j("GetAttestedQuote: Unexpected error, result is undefined");
|
|
12496
12496
|
} catch (r) {
|
|
12497
|
-
return console.log("error :", r),
|
|
12497
|
+
return console.log("error :", r), j("GetAttestedQuote:", String(r));
|
|
12498
12498
|
}
|
|
12499
12499
|
}
|
|
12500
12500
|
async getStrategies() {
|
|
@@ -12502,9 +12502,9 @@ class E1 {
|
|
|
12502
12502
|
const t = await Mt.get(
|
|
12503
12503
|
this.quoteUrl.endpoint("/strategies")
|
|
12504
12504
|
);
|
|
12505
|
-
if (t.error) return
|
|
12505
|
+
if (t.error) return j(t.error);
|
|
12506
12506
|
if (!t.result)
|
|
12507
|
-
return
|
|
12507
|
+
return j("GetStrategies: Unexpected error, result is undefined");
|
|
12508
12508
|
const r = {};
|
|
12509
12509
|
for (const n of Object.values(t.result)) {
|
|
12510
12510
|
const i = hb(
|
|
@@ -12522,7 +12522,7 @@ class E1 {
|
|
|
12522
12522
|
}
|
|
12523
12523
|
return ne(r);
|
|
12524
12524
|
} catch (t) {
|
|
12525
|
-
return
|
|
12525
|
+
return j("GetStrategies:", String(t));
|
|
12526
12526
|
}
|
|
12527
12527
|
}
|
|
12528
12528
|
}
|
|
@@ -12569,7 +12569,7 @@ var hl = {};
|
|
|
12569
12569
|
wif: e.typeforce.UInt8
|
|
12570
12570
|
}), e.Buffer256bit = e.typeforce.BufferN(32), e.Array = e.typeforce.Array, e.Boolean = e.typeforce.Boolean, e.maybe = e.typeforce.maybe;
|
|
12571
12571
|
})(hl);
|
|
12572
|
-
var
|
|
12572
|
+
var Sa = { exports: {} }, Pa = { exports: {} };
|
|
12573
12573
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
12574
12574
|
(function(e, t) {
|
|
12575
12575
|
var r = Jt, n = r.Buffer;
|
|
@@ -12599,29 +12599,29 @@ var xa = { exports: {} }, Aa = { exports: {} };
|
|
|
12599
12599
|
throw new TypeError("Argument must be a number");
|
|
12600
12600
|
return r.SlowBuffer(o);
|
|
12601
12601
|
};
|
|
12602
|
-
})(
|
|
12603
|
-
var Qe =
|
|
12602
|
+
})(Pa, Pa.exports);
|
|
12603
|
+
var Qe = Pa.exports, Do = 65536, x1 = 4294967295;
|
|
12604
12604
|
function A1() {
|
|
12605
12605
|
throw new Error(`Secure random number generation is not supported by this browser.
|
|
12606
12606
|
Use Chrome, Firefox or Internet Explorer 11`);
|
|
12607
12607
|
}
|
|
12608
12608
|
var S1 = Qe.Buffer, xs = yr.crypto || yr.msCrypto;
|
|
12609
|
-
xs && xs.getRandomValues ?
|
|
12609
|
+
xs && xs.getRandomValues ? Sa.exports = P1 : Sa.exports = A1;
|
|
12610
12610
|
function P1(e, t) {
|
|
12611
12611
|
if (e > x1) throw new RangeError("requested too many random bytes");
|
|
12612
12612
|
var r = S1.allocUnsafe(e);
|
|
12613
12613
|
if (e > 0)
|
|
12614
|
-
if (e >
|
|
12615
|
-
for (var n = 0; n < e; n +=
|
|
12616
|
-
xs.getRandomValues(r.slice(n, n +
|
|
12614
|
+
if (e > Do)
|
|
12615
|
+
for (var n = 0; n < e; n += Do)
|
|
12616
|
+
xs.getRandomValues(r.slice(n, n + Do));
|
|
12617
12617
|
else
|
|
12618
12618
|
xs.getRandomValues(r);
|
|
12619
12619
|
return typeof t == "function" ? process.nextTick(function() {
|
|
12620
12620
|
t(null, r);
|
|
12621
12621
|
}) : r;
|
|
12622
12622
|
}
|
|
12623
|
-
var T1 =
|
|
12624
|
-
typeof Object.create == "function" ?
|
|
12623
|
+
var T1 = Sa.exports, Ta = { exports: {} };
|
|
12624
|
+
typeof Object.create == "function" ? Ta.exports = function(t, r) {
|
|
12625
12625
|
r && (t.super_ = r, t.prototype = Object.create(r.prototype, {
|
|
12626
12626
|
constructor: {
|
|
12627
12627
|
value: t,
|
|
@@ -12630,7 +12630,7 @@ typeof Object.create == "function" ? Sa.exports = function(t, r) {
|
|
|
12630
12630
|
configurable: !0
|
|
12631
12631
|
}
|
|
12632
12632
|
}));
|
|
12633
|
-
} :
|
|
12633
|
+
} : Ta.exports = function(t, r) {
|
|
12634
12634
|
if (r) {
|
|
12635
12635
|
t.super_ = r;
|
|
12636
12636
|
var n = function() {
|
|
@@ -12638,7 +12638,7 @@ typeof Object.create == "function" ? Sa.exports = function(t, r) {
|
|
|
12638
12638
|
n.prototype = r.prototype, t.prototype = new n(), t.prototype.constructor = t;
|
|
12639
12639
|
}
|
|
12640
12640
|
};
|
|
12641
|
-
var $e =
|
|
12641
|
+
var $e = Ta.exports, Ia = { exports: {} }, xc = { exports: {} }, dn = typeof Reflect == "object" ? Reflect : null, Cu = dn && typeof dn.apply == "function" ? dn.apply : function(t, r, n) {
|
|
12642
12642
|
return Function.prototype.apply.call(t, r, n);
|
|
12643
12643
|
}, ds;
|
|
12644
12644
|
dn && typeof dn.ownKeys == "function" ? ds = dn.ownKeys : Object.getOwnPropertySymbols ? ds = function(t) {
|
|
@@ -12655,8 +12655,8 @@ var pl = Number.isNaN || function(t) {
|
|
|
12655
12655
|
function ce() {
|
|
12656
12656
|
ce.init.call(this);
|
|
12657
12657
|
}
|
|
12658
|
-
|
|
12659
|
-
|
|
12658
|
+
xc.exports = ce;
|
|
12659
|
+
xc.exports.once = O1;
|
|
12660
12660
|
ce.EventEmitter = ce;
|
|
12661
12661
|
ce.prototype._events = void 0;
|
|
12662
12662
|
ce.prototype._eventsCount = 0;
|
|
@@ -12861,14 +12861,14 @@ function vl(e, t, r, n) {
|
|
|
12861
12861
|
else
|
|
12862
12862
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e);
|
|
12863
12863
|
}
|
|
12864
|
-
var El =
|
|
12864
|
+
var El = xc.exports, xl = El.EventEmitter;
|
|
12865
12865
|
const L1 = {}, U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12866
12866
|
__proto__: null,
|
|
12867
12867
|
default: L1
|
|
12868
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
12869
|
-
var
|
|
12868
|
+
}, Symbol.toStringTag, { value: "Module" })), Ac = /* @__PURE__ */ fc(U1);
|
|
12869
|
+
var jo, Ru;
|
|
12870
12870
|
function N1() {
|
|
12871
|
-
if (Ru) return
|
|
12871
|
+
if (Ru) return jo;
|
|
12872
12872
|
Ru = 1;
|
|
12873
12873
|
function e(g, v) {
|
|
12874
12874
|
var x = Object.keys(g);
|
|
@@ -12921,11 +12921,11 @@ function N1() {
|
|
|
12921
12921
|
}
|
|
12922
12922
|
return String(g);
|
|
12923
12923
|
}
|
|
12924
|
-
var c = Jt, f = c.Buffer, l =
|
|
12924
|
+
var c = Jt, f = c.Buffer, l = Ac, h = l.inspect, m = h && h.custom || "inspect";
|
|
12925
12925
|
function p(g, v, x) {
|
|
12926
12926
|
f.prototype.copy.call(g, v, x);
|
|
12927
12927
|
}
|
|
12928
|
-
return
|
|
12928
|
+
return jo = /* @__PURE__ */ function() {
|
|
12929
12929
|
function g() {
|
|
12930
12930
|
n(this, g), this.head = null, this.tail = null, this.length = 0;
|
|
12931
12931
|
}
|
|
@@ -13029,16 +13029,16 @@ function N1() {
|
|
|
13029
13029
|
}));
|
|
13030
13030
|
}
|
|
13031
13031
|
}]), g;
|
|
13032
|
-
}(),
|
|
13032
|
+
}(), jo;
|
|
13033
13033
|
}
|
|
13034
13034
|
function F1(e, t) {
|
|
13035
13035
|
var r = this, n = this._readableState && this._readableState.destroyed, i = this._writableState && this._writableState.destroyed;
|
|
13036
|
-
return n || i ? (t ? t(e) : e && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(
|
|
13036
|
+
return n || i ? (t ? t(e) : e && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(ka, this, e)) : process.nextTick(ka, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function(s) {
|
|
13037
13037
|
!t && s ? r._writableState ? r._writableState.errorEmitted ? process.nextTick(ls, r) : (r._writableState.errorEmitted = !0, process.nextTick(Lu, r, s)) : process.nextTick(Lu, r, s) : t ? (process.nextTick(ls, r), t(s)) : process.nextTick(ls, r);
|
|
13038
13038
|
}), this);
|
|
13039
13039
|
}
|
|
13040
13040
|
function Lu(e, t) {
|
|
13041
|
-
|
|
13041
|
+
ka(e, t), ls(e);
|
|
13042
13042
|
}
|
|
13043
13043
|
function ls(e) {
|
|
13044
13044
|
e._writableState && !e._writableState.emitClose || e._readableState && !e._readableState.emitClose || e.emit("close");
|
|
@@ -13046,7 +13046,7 @@ function ls(e) {
|
|
|
13046
13046
|
function $1() {
|
|
13047
13047
|
this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
|
|
13048
13048
|
}
|
|
13049
|
-
function
|
|
13049
|
+
function ka(e, t) {
|
|
13050
13050
|
e.emit("error", t);
|
|
13051
13051
|
}
|
|
13052
13052
|
function M1(e, t) {
|
|
@@ -13145,20 +13145,20 @@ var Pl = {
|
|
|
13145
13145
|
getHighWaterMark: V1
|
|
13146
13146
|
}, W1 = K1;
|
|
13147
13147
|
function K1(e, t) {
|
|
13148
|
-
if (
|
|
13148
|
+
if (Go("noDeprecation"))
|
|
13149
13149
|
return e;
|
|
13150
13150
|
var r = !1;
|
|
13151
13151
|
function n() {
|
|
13152
13152
|
if (!r) {
|
|
13153
|
-
if (
|
|
13153
|
+
if (Go("throwDeprecation"))
|
|
13154
13154
|
throw new Error(t);
|
|
13155
|
-
|
|
13155
|
+
Go("traceDeprecation") ? console.trace(t) : console.warn(t), r = !0;
|
|
13156
13156
|
}
|
|
13157
13157
|
return e.apply(this, arguments);
|
|
13158
13158
|
}
|
|
13159
13159
|
return n;
|
|
13160
13160
|
}
|
|
13161
|
-
function
|
|
13161
|
+
function Go(e) {
|
|
13162
13162
|
try {
|
|
13163
13163
|
if (!yr.localStorage) return !1;
|
|
13164
13164
|
} catch {
|
|
@@ -13167,10 +13167,10 @@ function Do(e) {
|
|
|
13167
13167
|
var t = yr.localStorage[e];
|
|
13168
13168
|
return t == null ? !1 : String(t).toLowerCase() === "true";
|
|
13169
13169
|
}
|
|
13170
|
-
var
|
|
13170
|
+
var zo, Nu;
|
|
13171
13171
|
function Tl() {
|
|
13172
|
-
if (Nu) return
|
|
13173
|
-
Nu = 1,
|
|
13172
|
+
if (Nu) return zo;
|
|
13173
|
+
Nu = 1, zo = M;
|
|
13174
13174
|
function e(O) {
|
|
13175
13175
|
var C = this;
|
|
13176
13176
|
this.next = null, this.entry = null, this.finish = function() {
|
|
@@ -13289,10 +13289,10 @@ function Tl() {
|
|
|
13289
13289
|
next: null
|
|
13290
13290
|
}, ge ? ge.next = C.lastBufferedRequest : C.bufferedRequest = C.lastBufferedRequest, C.bufferedRequestCount += 1;
|
|
13291
13291
|
} else
|
|
13292
|
-
|
|
13292
|
+
G(O, C, !1, F, W, Z, w);
|
|
13293
13293
|
return z;
|
|
13294
13294
|
}
|
|
13295
|
-
function
|
|
13295
|
+
function G(O, C, H, W, Z, w, _) {
|
|
13296
13296
|
C.writelen = W, C.writecb = _, C.writing = !0, C.sync = !0, C.destroyed ? C.onwrite(new x("write")) : H ? O._writev(Z, C.onwrite) : O._write(Z, w, C.onwrite), C.sync = !1;
|
|
13297
13297
|
}
|
|
13298
13298
|
function q(O, C, H, W, Z) {
|
|
@@ -13324,11 +13324,11 @@ function Tl() {
|
|
|
13324
13324
|
w.entry = H;
|
|
13325
13325
|
for (var _ = 0, F = !0; H; )
|
|
13326
13326
|
Z[_] = H, H.isBuf || (F = !1), H = H.next, _ += 1;
|
|
13327
|
-
Z.allBuffers = F,
|
|
13327
|
+
Z.allBuffers = F, G(O, C, !0, C.length, Z, "", w.finish), C.pendingcb++, C.lastBufferedRequest = null, w.next ? (C.corkedRequestsFree = w.next, w.next = null) : C.corkedRequestsFree = new e(C), C.bufferedRequestCount = 0;
|
|
13328
13328
|
} else {
|
|
13329
13329
|
for (; H; ) {
|
|
13330
13330
|
var z = H.chunk, ge = H.encoding, Q = H.callback, oe = C.objectMode ? 1 : z.length;
|
|
13331
|
-
if (
|
|
13331
|
+
if (G(O, C, !1, oe, z, ge, Q), H = H.next, C.bufferedRequestCount--, C.writing)
|
|
13332
13332
|
break;
|
|
13333
13333
|
}
|
|
13334
13334
|
H === null && (C.lastBufferedRequest = null);
|
|
@@ -13392,18 +13392,18 @@ function Tl() {
|
|
|
13392
13392
|
}
|
|
13393
13393
|
}), M.prototype.destroy = c.destroy, M.prototype._undestroy = c.undestroy, M.prototype._destroy = function(O, C) {
|
|
13394
13394
|
C(O);
|
|
13395
|
-
},
|
|
13395
|
+
}, zo;
|
|
13396
13396
|
}
|
|
13397
|
-
var
|
|
13397
|
+
var qo, Fu;
|
|
13398
13398
|
function wn() {
|
|
13399
|
-
if (Fu) return
|
|
13399
|
+
if (Fu) return qo;
|
|
13400
13400
|
Fu = 1;
|
|
13401
13401
|
var e = Object.keys || function(f) {
|
|
13402
13402
|
var l = [];
|
|
13403
13403
|
for (var h in f) l.push(h);
|
|
13404
13404
|
return l;
|
|
13405
13405
|
};
|
|
13406
|
-
|
|
13406
|
+
qo = o;
|
|
13407
13407
|
var t = kl(), r = Tl();
|
|
13408
13408
|
$e(o, t);
|
|
13409
13409
|
for (var n = e(r.prototype), i = 0; i < n.length; i++) {
|
|
@@ -13456,9 +13456,9 @@ function wn() {
|
|
|
13456
13456
|
set: function(l) {
|
|
13457
13457
|
this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = l, this._writableState.destroyed = l);
|
|
13458
13458
|
}
|
|
13459
|
-
}),
|
|
13459
|
+
}), qo;
|
|
13460
13460
|
}
|
|
13461
|
-
var As = {},
|
|
13461
|
+
var As = {}, Sc = Qe.Buffer, $u = Sc.isEncoding || function(e) {
|
|
13462
13462
|
switch (e = "" + e, e && e.toLowerCase()) {
|
|
13463
13463
|
case "hex":
|
|
13464
13464
|
case "utf8":
|
|
@@ -13502,7 +13502,7 @@ function Y1(e) {
|
|
|
13502
13502
|
}
|
|
13503
13503
|
function X1(e) {
|
|
13504
13504
|
var t = Y1(e);
|
|
13505
|
-
if (typeof t != "string" && (
|
|
13505
|
+
if (typeof t != "string" && (Sc.isEncoding === $u || !$u(e))) throw new Error("Unknown encoding: " + e);
|
|
13506
13506
|
return t || e;
|
|
13507
13507
|
}
|
|
13508
13508
|
As.StringDecoder = Ri;
|
|
@@ -13523,7 +13523,7 @@ function Ri(e) {
|
|
|
13523
13523
|
this.write = ow, this.end = aw;
|
|
13524
13524
|
return;
|
|
13525
13525
|
}
|
|
13526
|
-
this.lastNeed = 0, this.lastTotal = 0, this.lastChar =
|
|
13526
|
+
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = Sc.allocUnsafe(t);
|
|
13527
13527
|
}
|
|
13528
13528
|
Ri.prototype.write = function(e) {
|
|
13529
13529
|
if (e.length === 0) return "";
|
|
@@ -13542,14 +13542,14 @@ Ri.prototype.fillLast = function(e) {
|
|
|
13542
13542
|
return e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
13543
13543
|
e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e.length), this.lastNeed -= e.length;
|
|
13544
13544
|
};
|
|
13545
|
-
function
|
|
13545
|
+
function Vo(e) {
|
|
13546
13546
|
return e <= 127 ? 0 : e >> 5 === 6 ? 2 : e >> 4 === 14 ? 3 : e >> 3 === 30 ? 4 : e >> 6 === 2 ? -1 : -2;
|
|
13547
13547
|
}
|
|
13548
13548
|
function J1(e, t, r) {
|
|
13549
13549
|
var n = t.length - 1;
|
|
13550
13550
|
if (n < r) return 0;
|
|
13551
|
-
var i =
|
|
13552
|
-
return i >= 0 ? (i > 0 && (e.lastNeed = i - 1), i) : --n < r || i === -2 ? 0 : (i =
|
|
13551
|
+
var i = Vo(t[n]);
|
|
13552
|
+
return i >= 0 ? (i > 0 && (e.lastNeed = i - 1), i) : --n < r || i === -2 ? 0 : (i = Vo(t[n]), i >= 0 ? (i > 0 && (e.lastNeed = i - 2), i) : --n < r || i === -2 ? 0 : (i = Vo(t[n]), i >= 0 ? (i > 0 && (i === 2 ? i = 0 : e.lastNeed = i - 3), i) : 0));
|
|
13553
13553
|
}
|
|
13554
13554
|
function Z1(e, t, r) {
|
|
13555
13555
|
if ((t[0] & 192) !== 128)
|
|
@@ -13654,9 +13654,9 @@ function Il(e, t, r) {
|
|
|
13654
13654
|
e.removeListener("complete", a), e.removeListener("abort", h), e.removeListener("request", m), e.req && e.req.removeListener("finish", a), e.removeListener("end", s), e.removeListener("close", s), e.removeListener("finish", a), e.removeListener("end", f), e.removeListener("error", l), e.removeListener("close", h);
|
|
13655
13655
|
};
|
|
13656
13656
|
}
|
|
13657
|
-
var
|
|
13657
|
+
var Pc = Il, Wo, Hu;
|
|
13658
13658
|
function dw() {
|
|
13659
|
-
if (Hu) return
|
|
13659
|
+
if (Hu) return Wo;
|
|
13660
13660
|
Hu = 1;
|
|
13661
13661
|
var e;
|
|
13662
13662
|
function t(A, E, T) {
|
|
@@ -13676,7 +13676,7 @@ function dw() {
|
|
|
13676
13676
|
}
|
|
13677
13677
|
return (E === "string" ? String : Number)(A);
|
|
13678
13678
|
}
|
|
13679
|
-
var i =
|
|
13679
|
+
var i = Pc, s = Symbol("lastResolve"), o = Symbol("lastReject"), a = Symbol("error"), c = Symbol("ended"), f = Symbol("lastPromise"), l = Symbol("handlePromise"), h = Symbol("stream");
|
|
13680
13680
|
function m(A, E) {
|
|
13681
13681
|
return {
|
|
13682
13682
|
value: A,
|
|
@@ -13778,18 +13778,18 @@ function dw() {
|
|
|
13778
13778
|
B !== null && (S[f] = null, S[s] = null, S[o] = null, B(m(void 0, !0))), S[c] = !0;
|
|
13779
13779
|
}), E.on("readable", g.bind(null, S)), S;
|
|
13780
13780
|
};
|
|
13781
|
-
return
|
|
13781
|
+
return Wo = I, Wo;
|
|
13782
13782
|
}
|
|
13783
|
-
var
|
|
13783
|
+
var Ko, Du;
|
|
13784
13784
|
function lw() {
|
|
13785
|
-
return Du || (Du = 1,
|
|
13785
|
+
return Du || (Du = 1, Ko = function() {
|
|
13786
13786
|
throw new Error("Readable.from is not available in the browser");
|
|
13787
|
-
}),
|
|
13787
|
+
}), Ko;
|
|
13788
13788
|
}
|
|
13789
|
-
var
|
|
13789
|
+
var Yo, ju;
|
|
13790
13790
|
function kl() {
|
|
13791
|
-
if (ju) return
|
|
13792
|
-
ju = 1,
|
|
13791
|
+
if (ju) return Yo;
|
|
13792
|
+
ju = 1, Yo = B;
|
|
13793
13793
|
var e;
|
|
13794
13794
|
B.ReadableState = M, El.EventEmitter;
|
|
13795
13795
|
var t = function(_, F) {
|
|
@@ -13802,7 +13802,7 @@ function kl() {
|
|
|
13802
13802
|
function o(w) {
|
|
13803
13803
|
return n.isBuffer(w) || w instanceof i;
|
|
13804
13804
|
}
|
|
13805
|
-
var a =
|
|
13805
|
+
var a = Ac, c;
|
|
13806
13806
|
a && a.debuglog ? c = a.debuglog("stream") : c = function() {
|
|
13807
13807
|
};
|
|
13808
13808
|
var f = N1(), l = Al, h = Pl, m = h.getHighWaterMark, p = jr.codes, g = p.ERR_INVALID_ARG_TYPE, v = p.ERR_STREAM_PUSH_AFTER_EOF, x = p.ERR_METHOD_NOT_IMPLEMENTED, k = p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, I, A, E;
|
|
@@ -13879,9 +13879,9 @@ function kl() {
|
|
|
13879
13879
|
z += _.write(F.data), F = F.next;
|
|
13880
13880
|
return this._readableState.buffer.clear(), z !== "" && this._readableState.buffer.push(z), this._readableState.length = z.length, this;
|
|
13881
13881
|
};
|
|
13882
|
-
var
|
|
13882
|
+
var G = 1073741824;
|
|
13883
13883
|
function q(w) {
|
|
13884
|
-
return w >=
|
|
13884
|
+
return w >= G ? w = G : (w--, w |= w >>> 1, w |= w >>> 2, w |= w >>> 4, w |= w >>> 8, w |= w >>> 16, w++), w;
|
|
13885
13885
|
}
|
|
13886
13886
|
function Y(w, _) {
|
|
13887
13887
|
return w <= 0 || _.length === 0 && _.ended ? 0 : _.objectMode ? 1 : w !== w ? _.flowing && _.length ? _.buffer.head.data.length : _.length : (w > _.highWaterMark && (_.highWaterMark = q(w)), w <= _.length ? w : _.ended ? _.length : (_.needReadable = !0, 0));
|
|
@@ -14122,7 +14122,7 @@ function kl() {
|
|
|
14122
14122
|
if (w[F] === _) return F;
|
|
14123
14123
|
return -1;
|
|
14124
14124
|
}
|
|
14125
|
-
return
|
|
14125
|
+
return Yo;
|
|
14126
14126
|
}
|
|
14127
14127
|
var Bl = Kt, Zs = jr.codes, hw = Zs.ERR_METHOD_NOT_IMPLEMENTED, pw = Zs.ERR_MULTIPLE_CALLBACK, yw = Zs.ERR_TRANSFORM_ALREADY_TRANSFORMING, mw = Zs.ERR_TRANSFORM_WITH_LENGTH_0, Qs = wn();
|
|
14128
14128
|
$e(Kt, Qs);
|
|
@@ -14190,7 +14190,7 @@ function Ei(e) {
|
|
|
14190
14190
|
Ei.prototype._transform = function(e, t, r) {
|
|
14191
14191
|
r(null, e);
|
|
14192
14192
|
};
|
|
14193
|
-
var
|
|
14193
|
+
var Xo;
|
|
14194
14194
|
function _w(e) {
|
|
14195
14195
|
var t = !1;
|
|
14196
14196
|
return function() {
|
|
@@ -14209,7 +14209,7 @@ function Aw(e, t, r, n) {
|
|
|
14209
14209
|
var i = !1;
|
|
14210
14210
|
e.on("close", function() {
|
|
14211
14211
|
i = !0;
|
|
14212
|
-
}),
|
|
14212
|
+
}), Xo === void 0 && (Xo = Pc), Xo(e, {
|
|
14213
14213
|
readable: t,
|
|
14214
14214
|
writable: r
|
|
14215
14215
|
}, function(o) {
|
|
@@ -14250,9 +14250,9 @@ function Tw() {
|
|
|
14250
14250
|
}
|
|
14251
14251
|
var Iw = Tw;
|
|
14252
14252
|
(function(e, t) {
|
|
14253
|
-
t = e.exports = kl(), t.Stream = t, t.Readable = t, t.Writable = Tl(), t.Duplex = wn(), t.Transform = Bl, t.PassThrough = ww, t.finished =
|
|
14254
|
-
})(
|
|
14255
|
-
var Rl =
|
|
14253
|
+
t = e.exports = kl(), t.Stream = t, t.Readable = t, t.Writable = Tl(), t.Duplex = wn(), t.Transform = Bl, t.PassThrough = ww, t.finished = Pc, t.pipeline = Iw;
|
|
14254
|
+
})(Ia, Ia.exports);
|
|
14255
|
+
var Rl = Ia.exports, Ss = Qe.Buffer, Ll = Rl.Transform, kw = $e;
|
|
14256
14256
|
function Bw(e, t) {
|
|
14257
14257
|
if (!Ss.isBuffer(e) && typeof e != "string")
|
|
14258
14258
|
throw new TypeError(t + " must be a string or a buffer");
|
|
@@ -14388,7 +14388,7 @@ vr.prototype.digest = function(e) {
|
|
|
14388
14388
|
vr.prototype._digest = function() {
|
|
14389
14389
|
throw new Error("_digest is not implemented");
|
|
14390
14390
|
};
|
|
14391
|
-
var $w = vr,
|
|
14391
|
+
var $w = vr, Jo = Jt.Buffer, Mw = $e, Fl = $w, Hw = new Array(16), Un = [
|
|
14392
14392
|
0,
|
|
14393
14393
|
1,
|
|
14394
14394
|
2,
|
|
@@ -14728,7 +14728,7 @@ ro.prototype._update = function() {
|
|
|
14728
14728
|
};
|
|
14729
14729
|
ro.prototype._digest = function() {
|
|
14730
14730
|
this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
|
|
14731
|
-
var e =
|
|
14731
|
+
var e = Jo.alloc ? Jo.alloc(20) : new Jo(20);
|
|
14732
14732
|
return e.writeInt32LE(this._a, 0), e.writeInt32LE(this._b, 4), e.writeInt32LE(this._c, 8), e.writeInt32LE(this._d, 12), e.writeInt32LE(this._e, 16), e;
|
|
14733
14733
|
};
|
|
14734
14734
|
function $r(e, t) {
|
|
@@ -15170,13 +15170,13 @@ Fi.prototype._update = function(e) {
|
|
|
15170
15170
|
for (; I < 160; I += 2) {
|
|
15171
15171
|
var A = t[I - 30], E = t[I - 15 * 2 + 1], T = A2(A, E), S = S2(E, A);
|
|
15172
15172
|
A = t[I - 2 * 2], E = t[I - 2 * 2 + 1];
|
|
15173
|
-
var N = P2(A, E), M = T2(E, A), B = t[I - 7 * 2], V = t[I - 7 * 2 + 1], L = t[I - 16 * 2], D = t[I - 16 * 2 + 1],
|
|
15174
|
-
|
|
15173
|
+
var N = P2(A, E), M = T2(E, A), B = t[I - 7 * 2], V = t[I - 7 * 2 + 1], L = t[I - 16 * 2], D = t[I - 16 * 2 + 1], G = S + V | 0, q = T + B + Oe(G, S) | 0;
|
|
15174
|
+
G = G + M | 0, q = q + N + Oe(G, M) | 0, G = G + D | 0, q = q + L + Oe(G, D) | 0, t[I] = q, t[I + 1] = G;
|
|
15175
15175
|
}
|
|
15176
15176
|
for (var Y = 0; Y < 160; Y += 2) {
|
|
15177
|
-
q = t[Y],
|
|
15177
|
+
q = t[Y], G = t[Y + 1];
|
|
15178
15178
|
var re = Qu(r, n, i), le = Qu(l, h, m), be = ef(r, l), Pe = ef(l, r), qe = tf(o, g), ue = tf(g, o), pe = Ju[Y], rt = Ju[Y + 1], Zt = Zu(o, a, c), Bt = Zu(g, v, x), O = k + ue | 0, C = f + qe + Oe(O, k) | 0;
|
|
15179
|
-
O = O + Bt | 0, C = C + Zt + Oe(O, Bt) | 0, O = O + rt | 0, C = C + pe + Oe(O, rt) | 0, O = O +
|
|
15179
|
+
O = O + Bt | 0, C = C + Zt + Oe(O, Bt) | 0, O = O + rt | 0, C = C + pe + Oe(O, rt) | 0, O = O + G | 0, C = C + q + Oe(O, G) | 0;
|
|
15180
15180
|
var H = Pe + le | 0, W = be + re + Oe(H, Pe) | 0;
|
|
15181
15181
|
f = c, k = x, c = a, x = v, a = o, v = g, g = p + O | 0, o = s + C + Oe(g, p) | 0, s = i, p = m, i = n, m = h, n = r, h = l, l = O + H | 0, r = C + W + Oe(l, O) | 0;
|
|
15182
15182
|
}
|
|
@@ -15216,7 +15216,7 @@ Gr.sha224 = _2;
|
|
|
15216
15216
|
Gr.sha256 = Gl;
|
|
15217
15217
|
Gr.sha384 = R2;
|
|
15218
15218
|
Gr.sha512 = ql;
|
|
15219
|
-
var L2 = $l.exports, At = Qe.Buffer, Vl =
|
|
15219
|
+
var L2 = $l.exports, At = Qe.Buffer, Vl = Ac.Transform, U2 = As.StringDecoder, N2 = $e;
|
|
15220
15220
|
function yt(e) {
|
|
15221
15221
|
Vl.call(this), this.hashMode = typeof e == "string", this.hashMode ? this[e] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
|
|
15222
15222
|
}
|
|
@@ -15368,10 +15368,10 @@ function V2(e) {
|
|
|
15368
15368
|
decode: m
|
|
15369
15369
|
};
|
|
15370
15370
|
}
|
|
15371
|
-
var W2 = V2, K2 = W2, Y2 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", X2 = K2(Y2),
|
|
15371
|
+
var W2 = V2, K2 = W2, Y2 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", X2 = K2(Y2), Zo = X2, J2 = Qe.Buffer, Z2 = function(e) {
|
|
15372
15372
|
function t(s) {
|
|
15373
15373
|
var o = e(s);
|
|
15374
|
-
return
|
|
15374
|
+
return Zo.encode(J2.concat([
|
|
15375
15375
|
s,
|
|
15376
15376
|
o
|
|
15377
15377
|
], s.length + 4));
|
|
@@ -15382,12 +15382,12 @@ var W2 = V2, K2 = W2, Y2 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrst
|
|
|
15382
15382
|
return o;
|
|
15383
15383
|
}
|
|
15384
15384
|
function n(s) {
|
|
15385
|
-
var o =
|
|
15385
|
+
var o = Zo.decodeUnsafe(s);
|
|
15386
15386
|
if (o)
|
|
15387
15387
|
return r(o);
|
|
15388
15388
|
}
|
|
15389
15389
|
function i(s) {
|
|
15390
|
-
var o =
|
|
15390
|
+
var o = Zo.decode(s), a = r(o);
|
|
15391
15391
|
if (!a) throw new Error("Invalid checksum");
|
|
15392
15392
|
return a;
|
|
15393
15393
|
}
|
|
@@ -15401,7 +15401,7 @@ function e_(e) {
|
|
|
15401
15401
|
var t = rf("sha256").update(e).digest();
|
|
15402
15402
|
return rf("sha256").update(t).digest();
|
|
15403
15403
|
}
|
|
15404
|
-
var t_ = Q2(e_),
|
|
15404
|
+
var t_ = Q2(e_), Ba = t_;
|
|
15405
15405
|
function Kl(e, t) {
|
|
15406
15406
|
if (t !== void 0 && e[0] !== t) throw new Error("Invalid network version");
|
|
15407
15407
|
if (e.length === 33)
|
|
@@ -15418,16 +15418,16 @@ function Kl(e, t) {
|
|
|
15418
15418
|
compressed: !0
|
|
15419
15419
|
};
|
|
15420
15420
|
}
|
|
15421
|
-
function
|
|
15421
|
+
function Ca(e, t, r) {
|
|
15422
15422
|
var n = new Buffer(r ? 34 : 33);
|
|
15423
15423
|
return n.writeUInt8(e, 0), t.copy(n, 1), r && (n[33] = 1), n;
|
|
15424
15424
|
}
|
|
15425
15425
|
function r_(e, t) {
|
|
15426
|
-
return Kl(
|
|
15426
|
+
return Kl(Ba.decode(e), t);
|
|
15427
15427
|
}
|
|
15428
15428
|
function n_(e, t, r) {
|
|
15429
|
-
return typeof e == "number" ?
|
|
15430
|
-
|
|
15429
|
+
return typeof e == "number" ? Ba.encode(Ca(e, t, r)) : Ba.encode(
|
|
15430
|
+
Ca(
|
|
15431
15431
|
e.version,
|
|
15432
15432
|
e.privateKey,
|
|
15433
15433
|
e.compressed
|
|
@@ -15438,7 +15438,7 @@ var i_ = {
|
|
|
15438
15438
|
decode: r_,
|
|
15439
15439
|
decodeRaw: Kl,
|
|
15440
15440
|
encode: n_,
|
|
15441
|
-
encodeRaw:
|
|
15441
|
+
encodeRaw: Ca
|
|
15442
15442
|
}, ao = {};
|
|
15443
15443
|
Object.defineProperty(ao, "__esModule", { value: !0 });
|
|
15444
15444
|
ao.testEcc = void 0;
|
|
@@ -15639,9 +15639,9 @@ function me(e) {
|
|
|
15639
15639
|
}
|
|
15640
15640
|
Object.defineProperty(bn, "__esModule", { value: !0 });
|
|
15641
15641
|
bn.ECPairFactory = bn.networks = void 0;
|
|
15642
|
-
const
|
|
15643
|
-
bn.networks =
|
|
15644
|
-
const Ye = hl, o_ = T1, nf = i_, a_ = ao,
|
|
15642
|
+
const Oa = gn;
|
|
15643
|
+
bn.networks = Oa;
|
|
15644
|
+
const Ye = hl, o_ = T1, nf = i_, a_ = ao, Qo = Ye.typeforce.maybe(
|
|
15645
15645
|
Ye.typeforce.compile({
|
|
15646
15646
|
compressed: Ye.maybe(Ye.Boolean),
|
|
15647
15647
|
network: Ye.maybe(Ye.Network)
|
|
@@ -15655,23 +15655,23 @@ function u_(e) {
|
|
|
15655
15655
|
function r(a, c) {
|
|
15656
15656
|
if (Ye.typeforce(Ye.Buffer256bit, a), !e.isPrivate(a))
|
|
15657
15657
|
throw new TypeError("Private key not in range [1, n)");
|
|
15658
|
-
return Ye.typeforce(
|
|
15658
|
+
return Ye.typeforce(Qo, c), new o(a, void 0, c);
|
|
15659
15659
|
}
|
|
15660
15660
|
function n(a, c) {
|
|
15661
|
-
return Ye.typeforce(e.isPoint, a), Ye.typeforce(
|
|
15661
|
+
return Ye.typeforce(e.isPoint, a), Ye.typeforce(Qo, c), new o(void 0, a, c);
|
|
15662
15662
|
}
|
|
15663
15663
|
function i(a, c) {
|
|
15664
15664
|
const f = nf.decode(a), l = f.version;
|
|
15665
15665
|
if (Ye.Array(c)) {
|
|
15666
15666
|
if (c = c.filter((h) => l === h.wif).pop(), !c) throw new Error("Unknown network version");
|
|
15667
|
-
} else if (c = c ||
|
|
15667
|
+
} else if (c = c || Oa.bitcoin, l !== c.wif) throw new Error("Invalid network version");
|
|
15668
15668
|
return r(f.privateKey, {
|
|
15669
15669
|
compressed: f.compressed,
|
|
15670
15670
|
network: c
|
|
15671
15671
|
});
|
|
15672
15672
|
}
|
|
15673
15673
|
function s(a) {
|
|
15674
|
-
Ye.typeforce(
|
|
15674
|
+
Ye.typeforce(Qo, a), a === void 0 && (a = {});
|
|
15675
15675
|
const c = a.rng || o_;
|
|
15676
15676
|
let f;
|
|
15677
15677
|
do
|
|
@@ -15686,7 +15686,7 @@ function u_(e) {
|
|
|
15686
15686
|
Vr(this, "compressed");
|
|
15687
15687
|
Vr(this, "network");
|
|
15688
15688
|
Vr(this, "lowR");
|
|
15689
|
-
this.__D = c, this.__Q = f, this.lowR = !1, l === void 0 && (l = {}), this.compressed = l.compressed === void 0 ? !0 : l.compressed, this.network = l.network ||
|
|
15689
|
+
this.__D = c, this.__Q = f, this.lowR = !1, l === void 0 && (l = {}), this.compressed = l.compressed === void 0 ? !0 : l.compressed, this.network = l.network || Oa.bitcoin, f !== void 0 && (this.__Q = Buffer.from(e.pointCompress(f, this.compressed)));
|
|
15690
15690
|
}
|
|
15691
15691
|
get privateKey() {
|
|
15692
15692
|
return this.__D;
|
|
@@ -15799,11 +15799,11 @@ class Ts extends of {
|
|
|
15799
15799
|
async initialize() {
|
|
15800
15800
|
if (this.digestKey) return ne("Already initialized");
|
|
15801
15801
|
const t = await this.deriveDigestKeyFromWalletClient();
|
|
15802
|
-
return t.error ?
|
|
15802
|
+
return t.error ? j(t.error) : (this.emit("initialized", !0), ne("Initialized"));
|
|
15803
15803
|
}
|
|
15804
15804
|
async deriveDigestKeyFromWalletClient() {
|
|
15805
|
-
if (!this.walletClient) return
|
|
15806
|
-
if (!this.walletClient.account) return
|
|
15805
|
+
if (!this.walletClient) return j("No walletClient found");
|
|
15806
|
+
if (!this.walletClient.account) return j("No account found");
|
|
15807
15807
|
try {
|
|
15808
15808
|
const t = await this.walletClient.signTypedData({
|
|
15809
15809
|
account: this.walletClient.account,
|
|
@@ -15831,34 +15831,34 @@ class Ts extends of {
|
|
|
15831
15831
|
});
|
|
15832
15832
|
return this.digestKey = Tr(Gn(t)), this.emit("initialized", !0), ne(this.digestKey);
|
|
15833
15833
|
} catch (t) {
|
|
15834
|
-
return
|
|
15834
|
+
return j("Failed to initialize: " + t);
|
|
15835
15835
|
}
|
|
15836
15836
|
}
|
|
15837
15837
|
async getDigestKey() {
|
|
15838
15838
|
if (!this.digestKey && !this.walletClient)
|
|
15839
|
-
return
|
|
15839
|
+
return j("No private key or wallet client found");
|
|
15840
15840
|
if (!this.digestKey && this.walletClient) {
|
|
15841
15841
|
const t = await this.deriveDigestKeyFromWalletClient();
|
|
15842
15842
|
if (t.error)
|
|
15843
|
-
return
|
|
15843
|
+
return j(t.error);
|
|
15844
15844
|
}
|
|
15845
|
-
return this.digestKey ? ne(this.digestKey) :
|
|
15845
|
+
return this.digestKey ? ne(this.digestKey) : j("No private key found");
|
|
15846
15846
|
}
|
|
15847
15847
|
async generateSecret(t) {
|
|
15848
15848
|
const r = await this.signMessage(t);
|
|
15849
|
-
if (r.error) return
|
|
15849
|
+
if (r.error) return j(r.error);
|
|
15850
15850
|
const n = Gn(Jr(r.val)), i = Gn(n);
|
|
15851
15851
|
return ne({ secret: n, secretHash: i });
|
|
15852
15852
|
}
|
|
15853
15853
|
async signMessage(t) {
|
|
15854
15854
|
if (!this.digestKey) {
|
|
15855
15855
|
const f = await this.getDigestKey();
|
|
15856
|
-
if (f.error) return
|
|
15856
|
+
if (f.error) return j(f.error);
|
|
15857
15857
|
this.digestKey = f.val;
|
|
15858
15858
|
}
|
|
15859
15859
|
const r = f_(Cr), n = "Garden.fi" + t.toString(), i = Buffer.from(n, "utf8"), s = Gn(i), o = Buffer.from(Tr(this.digestKey), "hex");
|
|
15860
15860
|
if (o.length !== 32)
|
|
15861
|
-
return
|
|
15861
|
+
return j("Invalid private key length. Expected 32 bytes.");
|
|
15862
15862
|
const c = r.fromPrivateKey(o).sign(Buffer.from(Tr(s), "hex"));
|
|
15863
15863
|
return ne(c.toString("hex"));
|
|
15864
15864
|
}
|
|
@@ -16274,7 +16274,7 @@ const sf = [
|
|
|
16274
16274
|
transactions: (r = e.transactions) == null ? void 0 : r.map((n) => {
|
|
16275
16275
|
if (typeof n == "string")
|
|
16276
16276
|
return n;
|
|
16277
|
-
const i =
|
|
16277
|
+
const i = Ja(n);
|
|
16278
16278
|
return i.typeHex === "0x7e" && (i.isSystemTx = n.isSystemTx, i.mint = n.mint ? ft(n.mint) : void 0, i.sourceHash = n.sourceHash, i.type = "deposit"), i;
|
|
16279
16279
|
}),
|
|
16280
16280
|
stateRoot: e.stateRoot
|
|
@@ -16707,44 +16707,57 @@ const Is = {
|
|
|
16707
16707
|
hyperliquid_testnet: k_,
|
|
16708
16708
|
hyperliquid: B_
|
|
16709
16709
|
}, O_ = async (e, t) => {
|
|
16710
|
-
var n;
|
|
16710
|
+
var n, i, s, o;
|
|
16711
16711
|
const r = C_[e];
|
|
16712
16712
|
if (r)
|
|
16713
16713
|
try {
|
|
16714
16714
|
if (r.id === ((n = t.chain) == null ? void 0 : n.id))
|
|
16715
16715
|
return ne({ message: "Already on the network", walletClient: t });
|
|
16716
16716
|
await t.switchChain({ id: r.id });
|
|
16717
|
-
const
|
|
16717
|
+
const a = To({
|
|
16718
16718
|
account: t.account,
|
|
16719
16719
|
chain: r,
|
|
16720
|
-
transport:
|
|
16720
|
+
transport: So(t.transport)
|
|
16721
16721
|
});
|
|
16722
16722
|
return ne({
|
|
16723
16723
|
message: "Switched chain",
|
|
16724
|
-
walletClient:
|
|
16724
|
+
walletClient: a
|
|
16725
16725
|
});
|
|
16726
|
-
} catch (
|
|
16727
|
-
if (R_(
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16726
|
+
} catch (a) {
|
|
16727
|
+
if (R_(a))
|
|
16728
|
+
if (a.code === 4902)
|
|
16729
|
+
try {
|
|
16730
|
+
await t.addChain({ chain: r });
|
|
16731
|
+
const c = To({
|
|
16732
|
+
account: t.account,
|
|
16733
|
+
chain: r,
|
|
16734
|
+
transport: So(t.transport)
|
|
16735
|
+
});
|
|
16736
|
+
return ne({
|
|
16737
|
+
message: "Added network",
|
|
16738
|
+
walletClient: c
|
|
16739
|
+
});
|
|
16740
|
+
} catch {
|
|
16741
|
+
return j("Failed to add network");
|
|
16742
|
+
}
|
|
16743
|
+
else if ((i = a.message) != null && i.includes("method is not available") && ((o = (s = a.body) == null ? void 0 : s.method) != null && o.includes("wallet_switchEthereumChain"))) {
|
|
16744
|
+
const c = To({
|
|
16731
16745
|
account: t.account,
|
|
16732
16746
|
chain: r,
|
|
16733
|
-
transport:
|
|
16747
|
+
transport: So(t.transport)
|
|
16734
16748
|
});
|
|
16735
16749
|
return ne({
|
|
16736
16750
|
message: "Added network",
|
|
16737
|
-
walletClient:
|
|
16751
|
+
walletClient: c
|
|
16738
16752
|
});
|
|
16739
|
-
}
|
|
16740
|
-
return
|
|
16741
|
-
}
|
|
16753
|
+
} else
|
|
16754
|
+
return j("Failed to switch network");
|
|
16742
16755
|
else
|
|
16743
|
-
return
|
|
16756
|
+
return j("Failed to switch network");
|
|
16744
16757
|
}
|
|
16745
16758
|
else
|
|
16746
|
-
return
|
|
16747
|
-
}, R_ = (e) => typeof e == "object" && e
|
|
16759
|
+
return j("Chain not supported");
|
|
16760
|
+
}, R_ = (e) => typeof e == "object" && e != null && ("code" in e || "message" in e || "body" in e), L_ = [
|
|
16748
16761
|
{
|
|
16749
16762
|
inputs: [
|
|
16750
16763
|
{
|
|
@@ -18421,13 +18434,13 @@ const Yl = [
|
|
|
18421
18434
|
}
|
|
18422
18435
|
], N_ = async (e, t, r, n, i) => {
|
|
18423
18436
|
try {
|
|
18424
|
-
const s = await
|
|
18437
|
+
const s = await Ra(
|
|
18425
18438
|
e.address,
|
|
18426
18439
|
t,
|
|
18427
18440
|
r,
|
|
18428
18441
|
i
|
|
18429
18442
|
);
|
|
18430
|
-
if (s.error) return
|
|
18443
|
+
if (s.error) return j(s.error);
|
|
18431
18444
|
const o = Vn.uint256(BigInt(af.UINT_256_MAX));
|
|
18432
18445
|
if (s.val < n) {
|
|
18433
18446
|
const a = await e.execute([
|
|
@@ -18443,31 +18456,31 @@ const Yl = [
|
|
|
18443
18456
|
retryInterval: 3e3,
|
|
18444
18457
|
successStates: [cf.SUCCEEDED]
|
|
18445
18458
|
}
|
|
18446
|
-
), await
|
|
18459
|
+
), await ea(2e3);
|
|
18447
18460
|
let c = 0n;
|
|
18448
18461
|
for (let f = 0; f < 20; f++) {
|
|
18449
|
-
const l = await
|
|
18462
|
+
const l = await Ra(
|
|
18450
18463
|
e.address,
|
|
18451
18464
|
t,
|
|
18452
18465
|
r,
|
|
18453
18466
|
i
|
|
18454
18467
|
);
|
|
18455
|
-
if (l.error) return
|
|
18468
|
+
if (l.error) return j(l.error);
|
|
18456
18469
|
if (c = l.val, c >= n)
|
|
18457
18470
|
break;
|
|
18458
|
-
await
|
|
18471
|
+
await ea(2e3);
|
|
18459
18472
|
}
|
|
18460
|
-
return c < n ?
|
|
18473
|
+
return c < n ? j("Allowance not approved") : ne(a.transaction_hash);
|
|
18461
18474
|
}
|
|
18462
18475
|
return ne("Allowance already approved");
|
|
18463
18476
|
} catch (s) {
|
|
18464
|
-
return
|
|
18477
|
+
return j(
|
|
18465
18478
|
`Failed to check or approve allowance: ${s instanceof Error ? s.message : String(s)}`
|
|
18466
18479
|
);
|
|
18467
18480
|
}
|
|
18468
|
-
},
|
|
18481
|
+
}, Ra = async (e, t, r, n) => {
|
|
18469
18482
|
try {
|
|
18470
|
-
const s = await new
|
|
18483
|
+
const s = await new La(
|
|
18471
18484
|
Yl,
|
|
18472
18485
|
sn(t),
|
|
18473
18486
|
n
|
|
@@ -18477,18 +18490,18 @@ const Yl = [
|
|
|
18477
18490
|
]);
|
|
18478
18491
|
return ne(BigInt((s == null ? void 0 : s.toString()) || "0"));
|
|
18479
18492
|
} catch (i) {
|
|
18480
|
-
return
|
|
18493
|
+
return j(
|
|
18481
18494
|
`Failed to check allowance: ${i instanceof Error ? i.message : String(i)}`
|
|
18482
18495
|
);
|
|
18483
18496
|
}
|
|
18484
18497
|
}, F_ = async (e, t, r, n, i) => {
|
|
18485
|
-
const s = await
|
|
18498
|
+
const s = await Ra(
|
|
18486
18499
|
e,
|
|
18487
18500
|
t,
|
|
18488
18501
|
r,
|
|
18489
18502
|
n
|
|
18490
18503
|
);
|
|
18491
|
-
return s.error ?
|
|
18504
|
+
return s.error ? j(s.error) : ne(s.val >= i);
|
|
18492
18505
|
}, Xl = [
|
|
18493
18506
|
{
|
|
18494
18507
|
name: "HTLC",
|
|
@@ -18759,7 +18772,7 @@ const Yl = [
|
|
|
18759
18772
|
class M_ {
|
|
18760
18773
|
constructor(t, r, n, i) {
|
|
18761
18774
|
this.url = t instanceof Pt ? t : new Pt(t), this.account = r, this.starknetProvider = new uf({
|
|
18762
|
-
nodeUrl: i ||
|
|
18775
|
+
nodeUrl: i || Aa[n].nodeUrl
|
|
18763
18776
|
});
|
|
18764
18777
|
}
|
|
18765
18778
|
get htlcActorAddress() {
|
|
@@ -18771,16 +18784,16 @@ class M_ {
|
|
|
18771
18784
|
const t = await this.account.getChainId();
|
|
18772
18785
|
return ne(t);
|
|
18773
18786
|
} catch (t) {
|
|
18774
|
-
return
|
|
18787
|
+
return j(String(t));
|
|
18775
18788
|
}
|
|
18776
18789
|
}
|
|
18777
18790
|
async initiate(t) {
|
|
18778
|
-
if (!this.account.address) return
|
|
18791
|
+
if (!this.account.address) return j("No account address");
|
|
18779
18792
|
const { create_order: r, source_swap: n } = t, { redeemer: i, amount: s } = n;
|
|
18780
18793
|
if (!s || !i || !r.secret_hash || !r.timelock)
|
|
18781
|
-
return
|
|
18794
|
+
return j("Invalid order");
|
|
18782
18795
|
try {
|
|
18783
|
-
const o = new
|
|
18796
|
+
const o = new La(
|
|
18784
18797
|
Xl,
|
|
18785
18798
|
t.source_swap.asset,
|
|
18786
18799
|
this.account
|
|
@@ -18791,9 +18804,9 @@ class M_ {
|
|
|
18791
18804
|
this.starknetProvider,
|
|
18792
18805
|
BigInt(s)
|
|
18793
18806
|
);
|
|
18794
|
-
return f.error ?
|
|
18807
|
+
return f.error ? j(f.error) : f.val ? this.initiateRelay(t) : this.approveAndInitiate(c, t);
|
|
18795
18808
|
} catch (o) {
|
|
18796
|
-
return
|
|
18809
|
+
return j(String(o));
|
|
18797
18810
|
}
|
|
18798
18811
|
}
|
|
18799
18812
|
async approveAndInitiate(t, r) {
|
|
@@ -18819,12 +18832,12 @@ class M_ {
|
|
|
18819
18832
|
successStates: [cf.SUCCEEDED]
|
|
18820
18833
|
}), ne(g.transaction_hash);
|
|
18821
18834
|
} catch (l) {
|
|
18822
|
-
return
|
|
18835
|
+
return j(`Failed to approve and initiate: ${String(l)}`);
|
|
18823
18836
|
}
|
|
18824
18837
|
}
|
|
18825
18838
|
async initiateRelay(t) {
|
|
18826
18839
|
const { create_order: r, source_swap: n } = t, { redeemer: i, amount: s } = n, o = await this.getChainId();
|
|
18827
|
-
if (o.error) return
|
|
18840
|
+
if (o.error) return j(o.error);
|
|
18828
18841
|
const c = {
|
|
18829
18842
|
domain: {
|
|
18830
18843
|
name: "HTLC",
|
|
@@ -18844,7 +18857,7 @@ class M_ {
|
|
|
18844
18857
|
try {
|
|
18845
18858
|
const f = await this.account.signMessage(c), l = mb(f);
|
|
18846
18859
|
if (l.error)
|
|
18847
|
-
return
|
|
18860
|
+
return j(l.error);
|
|
18848
18861
|
const h = await Mt.post(
|
|
18849
18862
|
this.url.endpoint("initiate"),
|
|
18850
18863
|
{
|
|
@@ -18860,9 +18873,9 @@ class M_ {
|
|
|
18860
18873
|
retryDelay: 2e3
|
|
18861
18874
|
}
|
|
18862
18875
|
);
|
|
18863
|
-
return h.error ?
|
|
18876
|
+
return h.error ? j(h.error) : h.result ? ne(h.result) : j("Init: No result found");
|
|
18864
18877
|
} catch (f) {
|
|
18865
|
-
return
|
|
18878
|
+
return j(`Failed to initiate relayer: ${String(f)}`);
|
|
18866
18879
|
}
|
|
18867
18880
|
}
|
|
18868
18881
|
async redeem(t, r) {
|
|
@@ -18882,19 +18895,19 @@ class M_ {
|
|
|
18882
18895
|
retryDelay: 2e3
|
|
18883
18896
|
}
|
|
18884
18897
|
);
|
|
18885
|
-
return n.error ?
|
|
18898
|
+
return n.error ? j(n.error) : n.result ? ne(n.result) : j("Redeem: No result found");
|
|
18886
18899
|
} catch (n) {
|
|
18887
|
-
return
|
|
18900
|
+
return j(String(n));
|
|
18888
18901
|
}
|
|
18889
18902
|
}
|
|
18890
18903
|
async refund() {
|
|
18891
|
-
return
|
|
18904
|
+
return j("Refund is taken care of by the relayer");
|
|
18892
18905
|
}
|
|
18893
18906
|
}
|
|
18894
18907
|
class Jl extends of {
|
|
18895
18908
|
constructor(t) {
|
|
18896
18909
|
if (super(), this.environment = St.TESTNET, this.getOrderThreshold = 20, this.refundSacpCache = /* @__PURE__ */ new Map(), this.bitcoinRedeemCache = new _1(), typeof t.digestKey == "string") {
|
|
18897
|
-
const n =
|
|
18910
|
+
const n = Tc.from(t.digestKey);
|
|
18898
18911
|
if (!n.ok) throw new Error(n.error);
|
|
18899
18912
|
this._digestKey = n.val;
|
|
18900
18913
|
} else
|
|
@@ -18906,7 +18919,7 @@ class Jl extends of {
|
|
|
18906
18919
|
);
|
|
18907
18920
|
} else
|
|
18908
18921
|
this._api = t.environment;
|
|
18909
|
-
this._quote = t.quote ?? new E1(this._api.quote), this._auth = t.auth ??
|
|
18922
|
+
this._quote = t.quote ?? new E1(this._api.quote), this._auth = t.auth ?? Ic.fromDigestKey(new Pt(this._api.auth), this._digestKey), this._orderbook = t.orderbook ?? new ih(new Pt(this._api.orderbook)), this._evmHTLC = t.htlc.evm, this._starknetHTLC = t.htlc.starknet, this._secretManager = t.secretManager ?? Ts.fromDigestKey(this._digestKey.digestKey), this.orderExecutorCache = new w1(), this._blockNumberFetcher = t.blockNumberFetcher ?? new v1(this._api.info, this.environment);
|
|
18910
18923
|
const r = new ah(pb(this.environment));
|
|
18911
18924
|
this._btcWallet = ch.fromPrivateKey(
|
|
18912
18925
|
this._digestKey.digestKey,
|
|
@@ -18916,7 +18929,7 @@ class Jl extends of {
|
|
|
18916
18929
|
static fromWallets(t) {
|
|
18917
18930
|
let r;
|
|
18918
18931
|
if (typeof t.digestKey == "string") {
|
|
18919
|
-
const s =
|
|
18932
|
+
const s = Tc.from(t.digestKey);
|
|
18920
18933
|
if (!s.ok) throw new Error(s.error);
|
|
18921
18934
|
r = s.val;
|
|
18922
18935
|
} else
|
|
@@ -18930,7 +18943,7 @@ class Jl extends of {
|
|
|
18930
18943
|
evm: t.wallets.evm ? new U_(
|
|
18931
18944
|
n.evmRelay,
|
|
18932
18945
|
t.wallets.evm,
|
|
18933
|
-
|
|
18946
|
+
Ic.fromDigestKey(new Pt(n.auth), r)
|
|
18934
18947
|
) : void 0,
|
|
18935
18948
|
starknet: t.wallets.starknet ? new M_(
|
|
18936
18949
|
n.starknetRelay,
|
|
@@ -18972,9 +18985,9 @@ class Jl extends of {
|
|
|
18972
18985
|
}
|
|
18973
18986
|
async swap(t) {
|
|
18974
18987
|
const r = await this.validateAndFillParams(t);
|
|
18975
|
-
if (r.error) return
|
|
18988
|
+
if (r.error) return j(r.error);
|
|
18976
18989
|
const { sendAddress: n, receiveAddress: i, timelock: s } = r.val, o = Date.now().toString(), a = await this._secretManager.generateSecret(o);
|
|
18977
|
-
if (a.error) return
|
|
18990
|
+
if (a.error) return j(a.error);
|
|
18978
18991
|
const { strategyId: c, btcAddress: f } = t.additionalData, l = {
|
|
18979
18992
|
strategy_id: c,
|
|
18980
18993
|
...f && {
|
|
@@ -18996,41 +19009,41 @@ class Jl extends of {
|
|
|
18996
19009
|
min_destination_confirmations: t.minDestinationConfirmations ?? 0,
|
|
18997
19010
|
additional_data: l
|
|
18998
19011
|
}, m = await this._quote.getAttestedQuote(h);
|
|
18999
|
-
if (m.error) return
|
|
19012
|
+
if (m.error) return j(m.error);
|
|
19000
19013
|
const p = await this._orderbook.createOrder(
|
|
19001
19014
|
m.val,
|
|
19002
19015
|
this.auth
|
|
19003
19016
|
);
|
|
19004
|
-
if (p.error) return
|
|
19017
|
+
if (p.error) return j(p.error);
|
|
19005
19018
|
const g = await this.pollOrder(p.val);
|
|
19006
|
-
return g.error ?
|
|
19019
|
+
return g.error ? j(g.error) : ne(g.val);
|
|
19007
19020
|
}
|
|
19008
19021
|
async validateAndFillParams(t) {
|
|
19009
|
-
if (!t.additionalData.strategyId) return
|
|
19022
|
+
if (!t.additionalData.strategyId) return j("StrategyId is required");
|
|
19010
19023
|
if (!t.fromAsset || !t.toAsset)
|
|
19011
|
-
return
|
|
19024
|
+
return j("Source and destination assets are required for swap");
|
|
19012
19025
|
if (t.fromAsset.chain === t.toAsset.chain && t.fromAsset.atomicSwapAddress === t.toAsset.atomicSwapAddress)
|
|
19013
|
-
return
|
|
19026
|
+
return j("Source and destination assets cannot be the same");
|
|
19014
19027
|
if ($i(t.fromAsset.chain) && !$i(t.toAsset.chain) || !$i(t.fromAsset.chain) && $i(t.toAsset.chain))
|
|
19015
|
-
return
|
|
19028
|
+
return j(
|
|
19016
19029
|
"Both assets should be on the same network (either mainnet or testnet)"
|
|
19017
19030
|
);
|
|
19018
19031
|
const r = this.validateAmount(t.sendAmount);
|
|
19019
|
-
if (r.error) return
|
|
19032
|
+
if (r.error) return j(r.error);
|
|
19020
19033
|
const n = this.validateAmount(t.receiveAmount);
|
|
19021
|
-
if (n.error) return
|
|
19034
|
+
if (n.error) return j(n.error);
|
|
19022
19035
|
if (r < n)
|
|
19023
|
-
return
|
|
19036
|
+
return j("Send amount should be greater than receive amount");
|
|
19024
19037
|
const i = sh(t.fromAsset.chain);
|
|
19025
|
-
if (!i) return
|
|
19038
|
+
if (!i) return j("Unsupported chain for timelock");
|
|
19026
19039
|
if ((co(t.fromAsset.chain) || co(t.toAsset.chain)) && !t.additionalData.btcAddress)
|
|
19027
|
-
return
|
|
19040
|
+
return j(
|
|
19028
19041
|
"btcAddress in additionalData is required if source or destination chain is bitcoin, it is used as refund or redeem address."
|
|
19029
19042
|
);
|
|
19030
19043
|
const s = await this.getAddresses(t.fromAsset.chain);
|
|
19031
|
-
if (s.error) return
|
|
19044
|
+
if (s.error) return j(s.error);
|
|
19032
19045
|
const o = await this.getAddresses(t.toAsset.chain);
|
|
19033
|
-
return o.error ?
|
|
19046
|
+
return o.error ? j(o.error) : ne({
|
|
19034
19047
|
sendAddress: s.val,
|
|
19035
19048
|
receiveAddress: o.val,
|
|
19036
19049
|
timelock: t.timelock ?? i
|
|
@@ -19040,34 +19053,34 @@ class Jl extends of {
|
|
|
19040
19053
|
var n;
|
|
19041
19054
|
switch (uo(t)) {
|
|
19042
19055
|
case Ct.EVM:
|
|
19043
|
-
return this._evmHTLC ? ne(this._evmHTLC.htlcActorAddress) :
|
|
19056
|
+
return this._evmHTLC ? ne(this._evmHTLC.htlcActorAddress) : j("Please provide evmHTLC when initializing garden");
|
|
19044
19057
|
case Ct.Bitcoin: {
|
|
19045
19058
|
const i = await ((n = this._btcWallet) == null ? void 0 : n.getPublicKey());
|
|
19046
|
-
return !i || !lb(i) ?
|
|
19059
|
+
return !i || !lb(i) ? j("Invalid btc public key") : ne(Sr(i));
|
|
19047
19060
|
}
|
|
19048
19061
|
case Ct.Starknet:
|
|
19049
|
-
return this._starknetHTLC ? ne(this._starknetHTLC.htlcActorAddress) :
|
|
19062
|
+
return this._starknetHTLC ? ne(this._starknetHTLC.htlcActorAddress) : j("Please provide starknetHTLC when initializing garden");
|
|
19050
19063
|
default:
|
|
19051
|
-
return
|
|
19064
|
+
return j("Unsupported chain");
|
|
19052
19065
|
}
|
|
19053
19066
|
}
|
|
19054
19067
|
validateAmount(t) {
|
|
19055
19068
|
if (t == null || t.includes("."))
|
|
19056
|
-
return
|
|
19069
|
+
return j("Invalid amount ", t);
|
|
19057
19070
|
const r = new dh(t);
|
|
19058
|
-
return !r.isInteger() || r.isNaN() || r.lt(0) || r.isLessThanOrEqualTo(0) ?
|
|
19071
|
+
return !r.isInteger() || r.isNaN() || r.lt(0) || r.isLessThanOrEqualTo(0) ? j("Invalid amount ", t) : ne(r);
|
|
19059
19072
|
}
|
|
19060
19073
|
async pollOrder(t) {
|
|
19061
19074
|
let r = await this._orderbook.getOrder(t, !0), n = 0;
|
|
19062
19075
|
for (; n < this.getOrderThreshold; ) {
|
|
19063
|
-
if (await
|
|
19076
|
+
if (await ea(1e3), n++, r.error) {
|
|
19064
19077
|
if (!r.error.includes("result is undefined"))
|
|
19065
|
-
return
|
|
19078
|
+
return j(r.error);
|
|
19066
19079
|
} else if (r.val && r.val.create_order.create_id.toLowerCase() === t.toLowerCase())
|
|
19067
19080
|
return ne(r.val);
|
|
19068
19081
|
r = await this._orderbook.getOrder(t, !0);
|
|
19069
19082
|
}
|
|
19070
|
-
return
|
|
19083
|
+
return j(`Order not found, createOrder id: ${t}`);
|
|
19071
19084
|
}
|
|
19072
19085
|
async execute(t = 5e3) {
|
|
19073
19086
|
return await this._orderbook.subscribeOrders(
|
|
@@ -19370,7 +19383,7 @@ class Jl extends of {
|
|
|
19370
19383
|
var i;
|
|
19371
19384
|
if (t.length === 0) return ne([]);
|
|
19372
19385
|
const r = await ((i = this._blockNumberFetcher) == null ? void 0 : i.fetchBlockNumbers());
|
|
19373
|
-
if (r.error) return
|
|
19386
|
+
if (r.error) return j(r.error);
|
|
19374
19387
|
const n = [];
|
|
19375
19388
|
for (let s = 0; s < t.length; s++) {
|
|
19376
19389
|
const o = t[s];
|
|
@@ -19395,7 +19408,7 @@ class Jl extends of {
|
|
|
19395
19408
|
}
|
|
19396
19409
|
async broadcastRedeemTx(t, r) {
|
|
19397
19410
|
try {
|
|
19398
|
-
if (!this._api) return
|
|
19411
|
+
if (!this._api) return j("API not found");
|
|
19399
19412
|
const n = new Pt(this._api.evmRelay).endpoint("/bitcoin/redeem "), i = await this._auth.getAuthHeaders(), o = await (await fetch(n, {
|
|
19400
19413
|
method: "POST",
|
|
19401
19414
|
headers: {
|
|
@@ -19407,16 +19420,16 @@ class Jl extends of {
|
|
|
19407
19420
|
order_id: r
|
|
19408
19421
|
})
|
|
19409
19422
|
})).json();
|
|
19410
|
-
return o.status === "Ok" && o.result ? ne(o.result) :
|
|
19423
|
+
return o.status === "Ok" && o.result ? ne(o.result) : j(o.error);
|
|
19411
19424
|
} catch (n) {
|
|
19412
|
-
return
|
|
19425
|
+
return j("Failed to broadcast redeem tx: " + n);
|
|
19413
19426
|
}
|
|
19414
19427
|
}
|
|
19415
19428
|
}
|
|
19416
19429
|
class lv {
|
|
19417
19430
|
constructor(t, r, n) {
|
|
19418
|
-
this.callData = new
|
|
19419
|
-
nodeUrl: r || (n ?
|
|
19431
|
+
this.callData = new Oc(Yl), this.account = t, this.starknetProvider = new uf({
|
|
19432
|
+
nodeUrl: r || (n ? Aa[n].nodeUrl : Aa.mainnet.nodeUrl)
|
|
19420
19433
|
});
|
|
19421
19434
|
}
|
|
19422
19435
|
get htlcActorAddress() {
|
|
@@ -19424,7 +19437,7 @@ class lv {
|
|
|
19424
19437
|
}
|
|
19425
19438
|
async getHTLCContract(t, r = !1) {
|
|
19426
19439
|
const n = r ? t.destination_swap.asset : t.source_swap.asset;
|
|
19427
|
-
return new
|
|
19440
|
+
return new La(Xl, n, this.account);
|
|
19428
19441
|
}
|
|
19429
19442
|
/**
|
|
19430
19443
|
* Initiates the HTLC
|
|
@@ -19445,9 +19458,9 @@ class lv {
|
|
|
19445
19458
|
BigInt(t.source_swap.amount),
|
|
19446
19459
|
this.starknetProvider
|
|
19447
19460
|
);
|
|
19448
|
-
if (a.error) return
|
|
19461
|
+
if (a.error) return j(a.error);
|
|
19449
19462
|
} catch (a) {
|
|
19450
|
-
return
|
|
19463
|
+
return j(`Allowance check failed: ${a}`);
|
|
19451
19464
|
}
|
|
19452
19465
|
const o = await this.account.execute({
|
|
19453
19466
|
contractAddress: t.source_swap.asset,
|
|
@@ -19464,7 +19477,7 @@ class lv {
|
|
|
19464
19477
|
throw new Error("Failed to initiate HTLC transaction");
|
|
19465
19478
|
return ne(o.transaction_hash);
|
|
19466
19479
|
} catch (r) {
|
|
19467
|
-
return
|
|
19480
|
+
return j(`HTLC Initiation Error: ${r}`);
|
|
19468
19481
|
}
|
|
19469
19482
|
}
|
|
19470
19483
|
/**
|
|
@@ -19479,14 +19492,14 @@ class lv {
|
|
|
19479
19492
|
const n = await this.getHTLCContract(t, !0), i = t.create_order.source_chain.includes("starknet") ? t.source_swap.swap_id : t.destination_swap.swap_id, s = await this.account.execute({
|
|
19480
19493
|
contractAddress: n.address,
|
|
19481
19494
|
entrypoint: "redeem",
|
|
19482
|
-
calldata:
|
|
19495
|
+
calldata: Oc.compile({
|
|
19483
19496
|
swap_id: i,
|
|
19484
19497
|
secret: ps(r)
|
|
19485
19498
|
})
|
|
19486
19499
|
});
|
|
19487
|
-
return s.transaction_hash ? ne(s.transaction_hash) :
|
|
19500
|
+
return s.transaction_hash ? ne(s.transaction_hash) : j("Failed to redeem HTLC transaction");
|
|
19488
19501
|
} catch {
|
|
19489
|
-
return
|
|
19502
|
+
return j("HTLC Redeem Error");
|
|
19490
19503
|
}
|
|
19491
19504
|
}
|
|
19492
19505
|
/**
|
|
@@ -19504,9 +19517,9 @@ class lv {
|
|
|
19504
19517
|
orderId: r
|
|
19505
19518
|
}
|
|
19506
19519
|
});
|
|
19507
|
-
return i.transaction_hash ? ne(i.transaction_hash) :
|
|
19520
|
+
return i.transaction_hash ? ne(i.transaction_hash) : j("Failed to refund HTLC transaction");
|
|
19508
19521
|
} catch {
|
|
19509
|
-
return
|
|
19522
|
+
return j("HTLC Refund Error");
|
|
19510
19523
|
}
|
|
19511
19524
|
}
|
|
19512
19525
|
}
|
|
@@ -19542,11 +19555,11 @@ export {
|
|
|
19542
19555
|
X_ as a,
|
|
19543
19556
|
B_ as a0,
|
|
19544
19557
|
Qi as a1,
|
|
19545
|
-
|
|
19558
|
+
Aa as a2,
|
|
19546
19559
|
Y_ as b,
|
|
19547
19560
|
Xt as c,
|
|
19548
19561
|
Ls as d,
|
|
19549
|
-
|
|
19562
|
+
Ma as e,
|
|
19550
19563
|
jt as f,
|
|
19551
19564
|
Si as g,
|
|
19552
19565
|
ys as h,
|
|
@@ -19561,10 +19574,10 @@ export {
|
|
|
19561
19574
|
ln as q,
|
|
19562
19575
|
hr as r,
|
|
19563
19576
|
Xn as s,
|
|
19564
|
-
|
|
19577
|
+
Ga as t,
|
|
19565
19578
|
Nf as u,
|
|
19566
19579
|
Z_ as v,
|
|
19567
|
-
|
|
19580
|
+
Fa as w,
|
|
19568
19581
|
gs as x,
|
|
19569
19582
|
Cs as y,
|
|
19570
19583
|
tv as z
|