@omnity/ree-client-ts-sdk 0.3.4 → 0.3.5
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/README.md +5 -5
- package/dist/index.d.ts +5 -2
- package/dist/ree-sdk.cjs.js +29 -29
- package/dist/ree-sdk.es.js +540 -524
- package/package.json +1 -1
package/dist/ree-sdk.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var Mh = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Lh = (e, t, n) => t.has(e) || Mh("Cannot " + n);
|
|
5
|
-
var Fe = (e, t, n) => (Lh(e, t, "read from private field"), n ? n.call(e) : t.get(e)),
|
|
5
|
+
var Fe = (e, t, n) => (Lh(e, t, "read from private field"), n ? n.call(e) : t.get(e)), sn = (e, t, n) => t.has(e) ? Mh("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Yt = (e, t, n, r) => (Lh(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
6
6
|
var qh = (e, t, n, r) => ({
|
|
7
7
|
set _(i) {
|
|
8
8
|
Yt(e, t, i, n);
|
|
@@ -32,10 +32,10 @@ function P1(e, t) {
|
|
|
32
32
|
function Ry(e) {
|
|
33
33
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
34
34
|
}
|
|
35
|
-
var Ou = {},
|
|
35
|
+
var Ou = {}, Ys = {}, Dh;
|
|
36
36
|
function R1() {
|
|
37
|
-
if (Dh) return
|
|
38
|
-
Dh = 1,
|
|
37
|
+
if (Dh) return Ys;
|
|
38
|
+
Dh = 1, Ys.byteLength = c, Ys.toByteArray = u, Ys.fromByteArray = d;
|
|
39
39
|
for (var e = [], t = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, s = r.length; i < s; ++i)
|
|
40
40
|
e[i] = r[i], t[r.charCodeAt(i)] = i;
|
|
41
41
|
t[45] = 62, t[95] = 63;
|
|
@@ -78,7 +78,7 @@ function R1() {
|
|
|
78
78
|
e[g >> 10] + e[g >> 4 & 63] + e[g << 2 & 63] + "="
|
|
79
79
|
)), S.join("");
|
|
80
80
|
}
|
|
81
|
-
return
|
|
81
|
+
return Ys;
|
|
82
82
|
}
|
|
83
83
|
var Tc = {};
|
|
84
84
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -1155,9 +1155,9 @@ const M1 = /* @__PURE__ */ Ry(F1);
|
|
|
1155
1155
|
typeof globalThis > "u" && (globalThis.global = globalThis);
|
|
1156
1156
|
typeof globalThis.Buffer > "u" && (globalThis.Buffer = C1.Buffer);
|
|
1157
1157
|
typeof globalThis.process > "u" && (globalThis.process = M1);
|
|
1158
|
-
var it = {}, Nu = {}, We = {}, qt = {}, ku = {},
|
|
1158
|
+
var it = {}, Nu = {}, We = {}, qt = {}, ku = {}, Zs = {}, Gh;
|
|
1159
1159
|
function L1() {
|
|
1160
|
-
return Gh || (Gh = 1, Object.defineProperty(
|
|
1160
|
+
return Gh || (Gh = 1, Object.defineProperty(Zs, "__esModule", { value: !0 }), Zs.crypto = void 0, Zs.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Zs;
|
|
1161
1161
|
}
|
|
1162
1162
|
var Wh;
|
|
1163
1163
|
function ui() {
|
|
@@ -1820,7 +1820,7 @@ function Cy() {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
return We.SHA512_256 = S, We.sha256 = (0, n.createHasher)(() => new s()), We.sha224 = (0, n.createHasher)(() => new o()), We.sha512 = (0, n.createHasher)(() => new d()), We.sha384 = (0, n.createHasher)(() => new y()), We.sha512_256 = (0, n.createHasher)(() => new S()), We.sha512_224 = (0, n.createHasher)(() => new E()), We;
|
|
1822
1822
|
}
|
|
1823
|
-
var
|
|
1823
|
+
var Js = {}, Pu = {}, Ru = {}, Zh;
|
|
1824
1824
|
function V1() {
|
|
1825
1825
|
return Zh || (Zh = 1, (function(e) {
|
|
1826
1826
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.hmac = e.HMAC = void 0;
|
|
@@ -1869,7 +1869,7 @@ function V1() {
|
|
|
1869
1869
|
})(Ru)), Ru;
|
|
1870
1870
|
}
|
|
1871
1871
|
var Uu = {}, Jh;
|
|
1872
|
-
function
|
|
1872
|
+
function Ls() {
|
|
1873
1873
|
return Jh || (Jh = 1, (function(e) {
|
|
1874
1874
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.notImplemented = e.bitMask = e.utf8ToBytes = e.randomBytes = e.isBytes = e.hexToBytes = e.concatBytes = e.bytesToUtf8 = e.bytesToHex = e.anumber = e.abytes = void 0, e.abool = s, e._abool2 = o, e._abytes2 = c, e.numberToHexUnpadded = a, e.hexToNumber = u, e.bytesToNumberBE = f, e.bytesToNumberLE = l, e.numberToBytesBE = d, e.numberToBytesLE = y, e.numberToVarBytesBE = g, e.ensureBytes = m, e.equalBytes = E, e.copyBytes = S, e.asciiToBytes = _, e.inRange = T, e.aInRange = O, e.bitLen = A, e.bitGet = R, e.bitSet = M, e.createHmacDrbg = U, e.validateObject = K, e.isHash = H, e._validateObject = D, e.memoized = $;
|
|
1875
1875
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -2087,12 +2087,12 @@ function Ms() {
|
|
|
2087
2087
|
}
|
|
2088
2088
|
})(Uu)), Uu;
|
|
2089
2089
|
}
|
|
2090
|
-
var
|
|
2090
|
+
var Sn = {}, Je = {}, Qh;
|
|
2091
2091
|
function rc() {
|
|
2092
2092
|
if (Qh) return Je;
|
|
2093
2093
|
Qh = 1, Object.defineProperty(Je, "__esModule", { value: !0 }), Je.isNegativeLE = void 0, Je.mod = l, Je.pow = d, Je.pow2 = y, Je.invert = g, Je.tonelliShanks = w, Je.FpSqrt = T, Je.validateField = R, Je.FpPow = M, Je.FpInvertBatch = v, Je.FpDiv = U, Je.FpLegendre = q, Je.FpIsSquare = K, Je.nLength = H, Je.Field = D, Je.FpSqrtOdd = P, Je.FpSqrtEven = $, Je.hashToPrivateScalar = F, Je.getFieldBytesLength = x, Je.getMinHashLength = B, Je.mapHashToField = L;
|
|
2094
2094
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2095
|
-
const e = /* @__PURE__ */
|
|
2095
|
+
const e = /* @__PURE__ */ Ls(), t = BigInt(0), n = BigInt(1), r = /* @__PURE__ */ BigInt(2), i = /* @__PURE__ */ BigInt(3), s = /* @__PURE__ */ BigInt(4), o = /* @__PURE__ */ BigInt(5), c = /* @__PURE__ */ BigInt(7), a = /* @__PURE__ */ BigInt(8), u = /* @__PURE__ */ BigInt(9), f = /* @__PURE__ */ BigInt(16);
|
|
2096
2096
|
function l(N, V) {
|
|
2097
2097
|
const G = N % V;
|
|
2098
2098
|
return G >= t ? G : V + G;
|
|
@@ -2355,10 +2355,10 @@ function rc() {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
var ed;
|
|
2357
2357
|
function D1() {
|
|
2358
|
-
if (ed) return
|
|
2359
|
-
ed = 1, Object.defineProperty(
|
|
2358
|
+
if (ed) return Sn;
|
|
2359
|
+
ed = 1, Object.defineProperty(Sn, "__esModule", { value: !0 }), Sn.wNAF = void 0, Sn.negateCt = i, Sn.normalizeZ = s, Sn.mulEndoUnsafe = E, Sn.pippenger = S, Sn.precomputeMSMUnsafe = _, Sn.validateBasic = w, Sn._createCurveFields = O;
|
|
2360
2360
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2361
|
-
const e = /* @__PURE__ */
|
|
2361
|
+
const e = /* @__PURE__ */ Ls(), t = /* @__PURE__ */ rc(), n = BigInt(0), r = BigInt(1);
|
|
2362
2362
|
function i(A, R) {
|
|
2363
2363
|
const M = R.negate();
|
|
2364
2364
|
return A ? M : R;
|
|
@@ -2497,7 +2497,7 @@ function D1() {
|
|
|
2497
2497
|
return y(R) !== 1;
|
|
2498
2498
|
}
|
|
2499
2499
|
}
|
|
2500
|
-
|
|
2500
|
+
Sn.wNAF = m;
|
|
2501
2501
|
function E(A, R, M, v) {
|
|
2502
2502
|
let U = R, q = A.ZERO, K = A.ZERO;
|
|
2503
2503
|
for (; M > n || v > n; )
|
|
@@ -2591,14 +2591,14 @@ function D1() {
|
|
|
2591
2591
|
throw new Error(`CURVE.${D} must be valid field element of CURVE.Fp`);
|
|
2592
2592
|
return R = Object.freeze(Object.assign({}, R)), { CURVE: R, Fp: U, Fn: q };
|
|
2593
2593
|
}
|
|
2594
|
-
return
|
|
2594
|
+
return Sn;
|
|
2595
2595
|
}
|
|
2596
2596
|
var td;
|
|
2597
2597
|
function Hy() {
|
|
2598
2598
|
return td || (td = 1, (function(e) {
|
|
2599
2599
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.DER = e.DERErr = void 0, e._splitEndoScalar = c, e._normFnElement = E, e.weierstrassN = S, e.SWUFpSqrtRatio = w, e.mapToCurveSimpleSWU = T, e.ecdh = A, e.ecdsa = R, e.weierstrassPoints = M, e._legacyHelperEquat = q, e.weierstrass = D;
|
|
2600
2600
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2601
|
-
const t = /* @__PURE__ */ V1(), n = /* @__PURE__ */ ui(), r = /* @__PURE__ */
|
|
2601
|
+
const t = /* @__PURE__ */ V1(), n = /* @__PURE__ */ ui(), r = /* @__PURE__ */ Ls(), i = /* @__PURE__ */ D1(), s = /* @__PURE__ */ rc(), o = (P, $) => (P + (P >= 0 ? $ : -$) / y) / $;
|
|
2602
2602
|
function c(P, $, F) {
|
|
2603
2603
|
const [[x, B], [L, N]] = $, V = o(N * P, F), G = o(-B * P, F);
|
|
2604
2604
|
let X = P - V * x - G * L, Y = -V * B - G * N;
|
|
@@ -3462,8 +3462,8 @@ function Hy() {
|
|
|
3462
3462
|
}
|
|
3463
3463
|
var nd;
|
|
3464
3464
|
function $1() {
|
|
3465
|
-
if (nd) return
|
|
3466
|
-
nd = 1, Object.defineProperty(
|
|
3465
|
+
if (nd) return Js;
|
|
3466
|
+
nd = 1, Object.defineProperty(Js, "__esModule", { value: !0 }), Js.getHash = t, Js.createCurve = n;
|
|
3467
3467
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3468
3468
|
const e = /* @__PURE__ */ Hy();
|
|
3469
3469
|
function t(r) {
|
|
@@ -3473,13 +3473,13 @@ function $1() {
|
|
|
3473
3473
|
const s = (o) => (0, e.weierstrass)({ ...r, hash: o });
|
|
3474
3474
|
return { ...s(i), create: s };
|
|
3475
3475
|
}
|
|
3476
|
-
return
|
|
3476
|
+
return Js;
|
|
3477
3477
|
}
|
|
3478
3478
|
var Cu = {}, rd;
|
|
3479
3479
|
function j1() {
|
|
3480
3480
|
return rd || (rd = 1, (function(e) {
|
|
3481
3481
|
Object.defineProperty(e, "__esModule", { value: !0 }), e._DST_scalar = void 0, e.expand_message_xmd = a, e.expand_message_xof = u, e.hash_to_field = f, e.isogenyMap = l, e.createHasher = d;
|
|
3482
|
-
const t = /* @__PURE__ */
|
|
3482
|
+
const t = /* @__PURE__ */ Ls(), n = /* @__PURE__ */ rc(), r = t.bytesToNumberBE;
|
|
3483
3483
|
function i(y, g) {
|
|
3484
3484
|
if (o(y), o(g), y < 0 || y >= 1 << 8 * g)
|
|
3485
3485
|
throw new Error("invalid I2OSP input: " + y);
|
|
@@ -3609,7 +3609,7 @@ function K1() {
|
|
|
3609
3609
|
return id || (id = 1, (function(e) {
|
|
3610
3610
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.encodeToCurve = e.hashToCurve = e.secp256k1_hasher = e.schnorr = e.secp256k1 = void 0;
|
|
3611
3611
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3612
|
-
const t = /* @__PURE__ */ Cy(), n = /* @__PURE__ */ ui(), r = /* @__PURE__ */ $1(), i = /* @__PURE__ */ j1(), s = /* @__PURE__ */ rc(), o = /* @__PURE__ */ Hy(), c = /* @__PURE__ */
|
|
3612
|
+
const t = /* @__PURE__ */ Cy(), n = /* @__PURE__ */ ui(), r = /* @__PURE__ */ $1(), i = /* @__PURE__ */ j1(), s = /* @__PURE__ */ rc(), o = /* @__PURE__ */ Hy(), c = /* @__PURE__ */ Ls(), a = {
|
|
3613
3613
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
3614
3614
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
3615
3615
|
h: BigInt(1),
|
|
@@ -3770,7 +3770,7 @@ var pe = {}, sd;
|
|
|
3770
3770
|
function G1() {
|
|
3771
3771
|
if (sd) return pe;
|
|
3772
3772
|
sd = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.isHash = pe.validateObject = pe.memoized = pe.notImplemented = pe.createHmacDrbg = pe.bitMask = pe.bitSet = pe.bitGet = pe.bitLen = pe.aInRange = pe.inRange = pe.asciiToBytes = pe.copyBytes = pe.equalBytes = pe.ensureBytes = pe.numberToVarBytesBE = pe.numberToBytesLE = pe.numberToBytesBE = pe.bytesToNumberLE = pe.bytesToNumberBE = pe.hexToNumber = pe.numberToHexUnpadded = pe.abool = pe.utf8ToBytes = pe.randomBytes = pe.isBytes = pe.hexToBytes = pe.concatBytes = pe.bytesToUtf8 = pe.bytesToHex = pe.anumber = pe.abytes = void 0;
|
|
3773
|
-
const e = /* @__PURE__ */
|
|
3773
|
+
const e = /* @__PURE__ */ Ls();
|
|
3774
3774
|
return pe.abytes = e.abytes, pe.anumber = e.anumber, pe.bytesToHex = e.bytesToHex, pe.bytesToUtf8 = e.bytesToUtf8, pe.concatBytes = e.concatBytes, pe.hexToBytes = e.hexToBytes, pe.isBytes = e.isBytes, pe.randomBytes = e.randomBytes, pe.utf8ToBytes = e.utf8ToBytes, pe.abool = e.abool, pe.numberToHexUnpadded = e.numberToHexUnpadded, pe.hexToNumber = e.hexToNumber, pe.bytesToNumberBE = e.bytesToNumberBE, pe.bytesToNumberLE = e.bytesToNumberLE, pe.numberToBytesBE = e.numberToBytesBE, pe.numberToBytesLE = e.numberToBytesLE, pe.numberToVarBytesBE = e.numberToVarBytesBE, pe.ensureBytes = e.ensureBytes, pe.equalBytes = e.equalBytes, pe.copyBytes = e.copyBytes, pe.asciiToBytes = e.asciiToBytes, pe.inRange = e.inRange, pe.aInRange = e.aInRange, pe.bitLen = e.bitLen, pe.bitGet = e.bitGet, pe.bitSet = e.bitSet, pe.bitMask = e.bitMask, pe.createHmacDrbg = e.createHmacDrbg, pe.notImplemented = e.notImplemented, pe.memoized = e.memoized, pe.validateObject = e.validateObject, pe.isHash = e.isHash, pe;
|
|
3775
3775
|
}
|
|
3776
3776
|
var od;
|
|
@@ -4404,7 +4404,7 @@ function de(e, t) {
|
|
|
4404
4404
|
return e[r] < t[r] ? -1 : 1;
|
|
4405
4405
|
return e.length === t.length ? 0 : e.length > t.length ? 1 : -1;
|
|
4406
4406
|
}
|
|
4407
|
-
function
|
|
4407
|
+
function bn(e, t, n) {
|
|
4408
4408
|
if (t + 1 > e.length)
|
|
4409
4409
|
throw new Error("Offset is outside the bounds of Uint8Array");
|
|
4410
4410
|
if (n > 255)
|
|
@@ -4448,7 +4448,7 @@ function cb(e, t, n) {
|
|
|
4448
4448
|
return r = (r << 8) + e[t], r = (r << 8) + e[t + 1], r;
|
|
4449
4449
|
}
|
|
4450
4450
|
}
|
|
4451
|
-
function
|
|
4451
|
+
function qs(e, t, n) {
|
|
4452
4452
|
if (t + 4 > e.length)
|
|
4453
4453
|
throw new Error("Offset is outside the bounds of Uint8Array");
|
|
4454
4454
|
if (n = n.toUpperCase(), n === "LE") {
|
|
@@ -4501,7 +4501,7 @@ function Gy(e) {
|
|
|
4501
4501
|
}
|
|
4502
4502
|
function ub(e, t, n) {
|
|
4503
4503
|
const r = Gy(t);
|
|
4504
|
-
return r === 1 ?
|
|
4504
|
+
return r === 1 ? bn(e, n, t) : r === 2 ? (bn(e, n, Ge.OP_PUSHDATA1), bn(e, n + 1, t)) : r === 3 ? (bn(e, n, Ge.OP_PUSHDATA2), sb(e, n + 1, t, "LE")) : (bn(e, n, Ge.OP_PUSHDATA4), ic(e, n + 1, t, "LE")), r;
|
|
4505
4505
|
}
|
|
4506
4506
|
function fb(e, t) {
|
|
4507
4507
|
const n = Br(e, t);
|
|
@@ -4517,7 +4517,7 @@ function fb(e, t) {
|
|
|
4517
4517
|
} else {
|
|
4518
4518
|
if (t + 5 > e.length) return null;
|
|
4519
4519
|
if (n !== Ge.OP_PUSHDATA4) throw new Error("Unexpected opcode");
|
|
4520
|
-
r =
|
|
4520
|
+
r = qs(e, t + 1, "LE"), i = 5;
|
|
4521
4521
|
}
|
|
4522
4522
|
return {
|
|
4523
4523
|
opcode: n,
|
|
@@ -4532,8 +4532,8 @@ function hb(e) {
|
|
|
4532
4532
|
let t = Math.abs(e);
|
|
4533
4533
|
const n = lb(t), r = new Uint8Array(n), i = e < 0;
|
|
4534
4534
|
for (let s = 0; s < n; ++s)
|
|
4535
|
-
|
|
4536
|
-
return r[n - 1] & 128 ?
|
|
4535
|
+
bn(r, s, t & 255), t >>= 8;
|
|
4536
|
+
return r[n - 1] & 128 ? bn(r, n - 1, i ? 128 : 0) : i && (r[n - 1] |= 128), r;
|
|
4537
4537
|
}
|
|
4538
4538
|
var Hu;
|
|
4539
4539
|
function db(e) {
|
|
@@ -4711,11 +4711,11 @@ function Yy() {
|
|
|
4711
4711
|
}
|
|
4712
4712
|
};
|
|
4713
4713
|
}
|
|
4714
|
-
function
|
|
4714
|
+
function hn(e, t) {
|
|
4715
4715
|
return {
|
|
4716
4716
|
kind: "schema",
|
|
4717
4717
|
type: "array",
|
|
4718
|
-
reference:
|
|
4718
|
+
reference: hn,
|
|
4719
4719
|
expects: "Array",
|
|
4720
4720
|
async: !1,
|
|
4721
4721
|
item: e,
|
|
@@ -4826,11 +4826,11 @@ function Jy(e, ...t) {
|
|
|
4826
4826
|
};
|
|
4827
4827
|
return 0 in t && (n.default = t[0]), n;
|
|
4828
4828
|
}
|
|
4829
|
-
function
|
|
4829
|
+
function fn(e) {
|
|
4830
4830
|
return {
|
|
4831
4831
|
kind: "schema",
|
|
4832
4832
|
type: "number",
|
|
4833
|
-
reference:
|
|
4833
|
+
reference: fn,
|
|
4834
4834
|
expects: "number",
|
|
4835
4835
|
async: !1,
|
|
4836
4836
|
message: e,
|
|
@@ -5022,7 +5022,7 @@ function fi(e, t) {
|
|
|
5022
5022
|
n[r] = da(e.entries[r]);
|
|
5023
5023
|
return { ...e, entries: n };
|
|
5024
5024
|
}
|
|
5025
|
-
function
|
|
5025
|
+
function Vs(...e) {
|
|
5026
5026
|
return {
|
|
5027
5027
|
...e[0],
|
|
5028
5028
|
pipe: e,
|
|
@@ -5041,7 +5041,7 @@ function qs(...e) {
|
|
|
5041
5041
|
}
|
|
5042
5042
|
const ad = new Uint8Array(32), ud = Ur(
|
|
5043
5043
|
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
|
|
5044
|
-
), vt = (e) =>
|
|
5044
|
+
), vt = (e) => Vs(Wa(Uint8Array), Xy(e));
|
|
5045
5045
|
function Io(e, t) {
|
|
5046
5046
|
return e.length !== t.length ? !1 : e.every((n, r) => de(n, t[r]) === 0);
|
|
5047
5047
|
}
|
|
@@ -5062,18 +5062,18 @@ function Qy(e) {
|
|
|
5062
5062
|
return Array.isArray(e) ? e.length !== 2 ? !1 : e.every((t) => Qy(t)) : Ol(e);
|
|
5063
5063
|
}
|
|
5064
5064
|
const Sb = vt(32), Tb = vt(20), fd = vt(32), $e = Wa(Uint8Array);
|
|
5065
|
-
|
|
5066
|
-
const xb =
|
|
5067
|
-
|
|
5065
|
+
Vs(Yi(), zy(/^([0-9a-f]{2})+$/i));
|
|
5066
|
+
const xb = Vs(
|
|
5067
|
+
fn(),
|
|
5068
5068
|
Al(),
|
|
5069
5069
|
Ka(0),
|
|
5070
5070
|
ja(255)
|
|
5071
|
-
), wr =
|
|
5072
|
-
|
|
5071
|
+
), wr = Vs(
|
|
5072
|
+
fn(),
|
|
5073
5073
|
Al(),
|
|
5074
5074
|
Ka(0),
|
|
5075
5075
|
ja(4294967295)
|
|
5076
|
-
), Fu =
|
|
5076
|
+
), Fu = Vs(
|
|
5077
5077
|
Zy(),
|
|
5078
5078
|
Ka(0n),
|
|
5079
5079
|
ja(0x7fffffffffffffffn)
|
|
@@ -5110,7 +5110,7 @@ function vb(e, t) {
|
|
|
5110
5110
|
), !Nl(t))
|
|
5111
5111
|
throw new Error("Invalid hashType " + t);
|
|
5112
5112
|
const n = new Uint8Array(1);
|
|
5113
|
-
|
|
5113
|
+
bn(n, 0, t);
|
|
5114
5114
|
const r = dd(e.slice(0, 32)), i = dd(e.slice(32, 64));
|
|
5115
5115
|
return ct([Q1(r, i), n]);
|
|
5116
5116
|
}
|
|
@@ -5118,15 +5118,15 @@ const Ib = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5118
5118
|
__proto__: null,
|
|
5119
5119
|
decode: Ab,
|
|
5120
5120
|
encode: vb
|
|
5121
|
-
}, Symbol.toStringTag, { value: "Module" })), eg = Ge.OP_RESERVED, tg =
|
|
5121
|
+
}, Symbol.toStringTag, { value: "Module" })), eg = Ge.OP_RESERVED, tg = hn(Il([Wa(Uint8Array), fn()]));
|
|
5122
5122
|
function Ob(e) {
|
|
5123
|
-
return Ga(
|
|
5123
|
+
return Ga(fn(), e) && (e === Ge.OP_0 || e >= Ge.OP_1 && e <= Ge.OP_16 || e === Ge.OP_1NEGATE);
|
|
5124
5124
|
}
|
|
5125
5125
|
function ng(e) {
|
|
5126
5126
|
return Ga($e, e) || Ob(e);
|
|
5127
5127
|
}
|
|
5128
5128
|
function Bl(e) {
|
|
5129
|
-
return Ga(
|
|
5129
|
+
return Ga(Vs(Yy(), Wy(ng)), e);
|
|
5130
5130
|
}
|
|
5131
5131
|
function rg(e) {
|
|
5132
5132
|
return e.length - e.filter(ng).length;
|
|
@@ -5147,7 +5147,7 @@ function Bb(e) {
|
|
|
5147
5147
|
function ya(e) {
|
|
5148
5148
|
return e instanceof Uint8Array;
|
|
5149
5149
|
}
|
|
5150
|
-
function
|
|
5150
|
+
function nn(e) {
|
|
5151
5151
|
if (ig(e)) return e;
|
|
5152
5152
|
ot(tg, e);
|
|
5153
5153
|
const t = e.reduce((i, s) => ya(s) ? s.length === 1 && pa(s) !== void 0 ? i + 1 : i + Gy(s.length) + s.length : i + 1, 0), n = new Uint8Array(t);
|
|
@@ -5156,12 +5156,12 @@ function hn(e) {
|
|
|
5156
5156
|
if (ya(i)) {
|
|
5157
5157
|
const s = pa(i);
|
|
5158
5158
|
if (s !== void 0) {
|
|
5159
|
-
|
|
5159
|
+
bn(n, r, s), r += 1;
|
|
5160
5160
|
return;
|
|
5161
5161
|
}
|
|
5162
5162
|
r += ub(n, i.length, r), n.set(i, r), r += i.length;
|
|
5163
5163
|
} else
|
|
5164
|
-
|
|
5164
|
+
bn(n, r, i), r += 1;
|
|
5165
5165
|
}), r !== n.length) throw new Error("Could not decode chunks");
|
|
5166
5166
|
return n;
|
|
5167
5167
|
}
|
|
@@ -5244,11 +5244,11 @@ function Xa(e, t) {
|
|
|
5244
5244
|
fi(
|
|
5245
5245
|
_t({
|
|
5246
5246
|
network: _t({}),
|
|
5247
|
-
m:
|
|
5248
|
-
n:
|
|
5247
|
+
m: fn(),
|
|
5248
|
+
n: fn(),
|
|
5249
5249
|
output: $e,
|
|
5250
|
-
pubkeys:
|
|
5251
|
-
signatures:
|
|
5250
|
+
pubkeys: hn(Kn($n), "Received invalid pubkey"),
|
|
5251
|
+
signatures: hn(
|
|
5252
5252
|
Kn(n),
|
|
5253
5253
|
"Expected signature to be of type isAcceptableSignature"
|
|
5254
5254
|
),
|
|
@@ -5264,7 +5264,7 @@ function Xa(e, t) {
|
|
|
5264
5264
|
}
|
|
5265
5265
|
if (Te(i, "output", () => {
|
|
5266
5266
|
if (e.m && i.n && e.pubkeys)
|
|
5267
|
-
return
|
|
5267
|
+
return nn(
|
|
5268
5268
|
[].concat(
|
|
5269
5269
|
xc + e.m,
|
|
5270
5270
|
e.pubkeys,
|
|
@@ -5286,7 +5286,7 @@ function Xa(e, t) {
|
|
|
5286
5286
|
return ft(e.input).slice(1);
|
|
5287
5287
|
}), Te(i, "input", () => {
|
|
5288
5288
|
if (e.signatures)
|
|
5289
|
-
return
|
|
5289
|
+
return nn([ds.OP_0].concat(e.signatures));
|
|
5290
5290
|
}), Te(i, "witness", () => {
|
|
5291
5291
|
if (i.input)
|
|
5292
5292
|
return [];
|
|
@@ -5295,7 +5295,7 @@ function Xa(e, t) {
|
|
|
5295
5295
|
return `p2ms(${i.m} of ${i.n})`;
|
|
5296
5296
|
}), t.validate) {
|
|
5297
5297
|
if (e.output) {
|
|
5298
|
-
if (c(e.output), ot(
|
|
5298
|
+
if (c(e.output), ot(fn(), s[0], { message: "Output is invalid" }), ot(fn(), s[s.length - 2], {
|
|
5299
5299
|
message: "Output is invalid"
|
|
5300
5300
|
}), s[s.length - 1] !== ds.OP_CHECKMULTISIG)
|
|
5301
5301
|
throw new TypeError("Output is invalid");
|
|
@@ -5353,7 +5353,7 @@ function sg(e, t) {
|
|
|
5353
5353
|
const n = In(() => ft(e.input)), i = { name: "p2pk", network: e.network || Pn };
|
|
5354
5354
|
if (Te(i, "output", () => {
|
|
5355
5355
|
if (e.pubkey)
|
|
5356
|
-
return
|
|
5356
|
+
return nn([e.pubkey, yd.OP_CHECKSIG]);
|
|
5357
5357
|
}), Te(i, "pubkey", () => {
|
|
5358
5358
|
if (e.output)
|
|
5359
5359
|
return e.output.slice(1, -1);
|
|
@@ -5362,7 +5362,7 @@ function sg(e, t) {
|
|
|
5362
5362
|
return n()[0];
|
|
5363
5363
|
}), Te(i, "input", () => {
|
|
5364
5364
|
if (e.signature)
|
|
5365
|
-
return
|
|
5365
|
+
return nn([e.signature]);
|
|
5366
5366
|
}), Te(i, "witness", () => {
|
|
5367
5367
|
if (i.input)
|
|
5368
5368
|
return [];
|
|
@@ -5914,7 +5914,7 @@ class cE extends kl {
|
|
|
5914
5914
|
Di(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
5915
5915
|
}
|
|
5916
5916
|
}
|
|
5917
|
-
const
|
|
5917
|
+
const En = /* @__PURE__ */ za(() => new pg()), aE = /* @__PURE__ */ za(() => new iE()), uE = /* @__PURE__ */ za(() => new cE()), en = En;
|
|
5918
5918
|
function Or(e) {
|
|
5919
5919
|
return Xb(en(e));
|
|
5920
5920
|
}
|
|
@@ -6660,14 +6660,14 @@ function cc(e, t) {
|
|
|
6660
6660
|
if (Te(s, "address", () => {
|
|
6661
6661
|
if (!s.hash) return;
|
|
6662
6662
|
const o = new Uint8Array(21);
|
|
6663
|
-
return
|
|
6663
|
+
return bn(o, 0, i.pubKeyHash), o.set(s.hash, 1), Oo.encode(o);
|
|
6664
6664
|
}), Te(s, "hash", () => {
|
|
6665
6665
|
if (e.output) return e.output.slice(3, 23);
|
|
6666
6666
|
if (e.address) return n().hash;
|
|
6667
6667
|
if (e.pubkey || s.pubkey) return Or(e.pubkey || s.pubkey);
|
|
6668
6668
|
}), Te(s, "output", () => {
|
|
6669
6669
|
if (s.hash)
|
|
6670
|
-
return
|
|
6670
|
+
return nn([
|
|
6671
6671
|
Vr.OP_DUP,
|
|
6672
6672
|
Vr.OP_HASH160,
|
|
6673
6673
|
s.hash,
|
|
@@ -6682,7 +6682,7 @@ function cc(e, t) {
|
|
|
6682
6682
|
return r()[0];
|
|
6683
6683
|
}), Te(s, "input", () => {
|
|
6684
6684
|
if (e.pubkey && e.signature)
|
|
6685
|
-
return
|
|
6685
|
+
return nn([e.signature, e.pubkey]);
|
|
6686
6686
|
}), Te(s, "witness", () => {
|
|
6687
6687
|
if (s.input)
|
|
6688
6688
|
return [];
|
|
@@ -6730,7 +6730,7 @@ function cc(e, t) {
|
|
|
6730
6730
|
}
|
|
6731
6731
|
return Object.assign(s, e);
|
|
6732
6732
|
}
|
|
6733
|
-
const
|
|
6733
|
+
const Qs = Ge;
|
|
6734
6734
|
function ac(e, t) {
|
|
6735
6735
|
if (!e.address && !e.hash && !e.output && !e.redeem && !e.input)
|
|
6736
6736
|
throw new TypeError("Not enough data");
|
|
@@ -6746,11 +6746,11 @@ function ac(e, t) {
|
|
|
6746
6746
|
network: _t({}),
|
|
6747
6747
|
output: $e,
|
|
6748
6748
|
input: $e,
|
|
6749
|
-
witness:
|
|
6749
|
+
witness: hn($e)
|
|
6750
6750
|
})
|
|
6751
6751
|
),
|
|
6752
6752
|
input: $e,
|
|
6753
|
-
witness:
|
|
6753
|
+
witness: hn($e)
|
|
6754
6754
|
})
|
|
6755
6755
|
),
|
|
6756
6756
|
e
|
|
@@ -6764,28 +6764,28 @@ function ac(e, t) {
|
|
|
6764
6764
|
const c = s(), a = c[c.length - 1];
|
|
6765
6765
|
return {
|
|
6766
6766
|
network: n,
|
|
6767
|
-
output: a ===
|
|
6768
|
-
input:
|
|
6767
|
+
output: a === Qs.OP_FALSE ? Uint8Array.from([]) : a,
|
|
6768
|
+
input: nn(c.slice(0, -1)),
|
|
6769
6769
|
witness: e.witness || []
|
|
6770
6770
|
};
|
|
6771
6771
|
});
|
|
6772
6772
|
if (Te(r, "address", () => {
|
|
6773
6773
|
if (!r.hash) return;
|
|
6774
6774
|
const c = new Uint8Array(21);
|
|
6775
|
-
return
|
|
6775
|
+
return bn(c, 0, r.network.scriptHash), c.set(r.hash, 1), Oo.encode(c);
|
|
6776
6776
|
}), Te(r, "hash", () => {
|
|
6777
6777
|
if (e.output) return e.output.slice(2, 22);
|
|
6778
6778
|
if (e.address) return i().hash;
|
|
6779
6779
|
if (r.redeem && r.redeem.output) return Or(r.redeem.output);
|
|
6780
6780
|
}), Te(r, "output", () => {
|
|
6781
6781
|
if (r.hash)
|
|
6782
|
-
return
|
|
6782
|
+
return nn([Qs.OP_HASH160, r.hash, Qs.OP_EQUAL]);
|
|
6783
6783
|
}), Te(r, "redeem", () => {
|
|
6784
6784
|
if (e.input)
|
|
6785
6785
|
return o();
|
|
6786
6786
|
}), Te(r, "input", () => {
|
|
6787
6787
|
if (!(!e.redeem || !e.redeem.input || !e.redeem.output))
|
|
6788
|
-
return
|
|
6788
|
+
return nn(
|
|
6789
6789
|
[].concat(ft(e.redeem.input), e.redeem.output)
|
|
6790
6790
|
);
|
|
6791
6791
|
}), Te(r, "witness", () => {
|
|
@@ -6808,7 +6808,7 @@ function ac(e, t) {
|
|
|
6808
6808
|
c = e.hash;
|
|
6809
6809
|
}
|
|
6810
6810
|
if (e.output) {
|
|
6811
|
-
if (e.output.length !== 23 || e.output[0] !==
|
|
6811
|
+
if (e.output.length !== 23 || e.output[0] !== Qs.OP_HASH160 || e.output[1] !== 20 || e.output[22] !== Qs.OP_EQUAL)
|
|
6812
6812
|
throw new TypeError("Output is invalid");
|
|
6813
6813
|
const u = e.output.slice(2, 22);
|
|
6814
6814
|
if (c.length > 0 && de(c, u) !== 0)
|
|
@@ -7019,7 +7019,7 @@ function Za(e, t) {
|
|
|
7019
7019
|
output: vt(22),
|
|
7020
7020
|
pubkey: Kn($n, "Not a valid pubkey"),
|
|
7021
7021
|
signature: Kn(Nr),
|
|
7022
|
-
witness:
|
|
7022
|
+
witness: hn($e)
|
|
7023
7023
|
})
|
|
7024
7024
|
),
|
|
7025
7025
|
e
|
|
@@ -7042,7 +7042,7 @@ function Za(e, t) {
|
|
|
7042
7042
|
if (e.pubkey || i.pubkey) return Or(e.pubkey || i.pubkey);
|
|
7043
7043
|
}), Te(i, "output", () => {
|
|
7044
7044
|
if (i.hash)
|
|
7045
|
-
return
|
|
7045
|
+
return nn([Td.OP_0, i.hash]);
|
|
7046
7046
|
}), Te(i, "pubkey", () => {
|
|
7047
7047
|
if (e.pubkey) return e.pubkey;
|
|
7048
7048
|
if (e.witness)
|
|
@@ -7120,10 +7120,10 @@ function fc(e, t) {
|
|
|
7120
7120
|
input: $e,
|
|
7121
7121
|
network: _t({}),
|
|
7122
7122
|
output: $e,
|
|
7123
|
-
witness:
|
|
7123
|
+
witness: hn($e)
|
|
7124
7124
|
}),
|
|
7125
7125
|
input: vt(0),
|
|
7126
|
-
witness:
|
|
7126
|
+
witness: hn($e)
|
|
7127
7127
|
}),
|
|
7128
7128
|
e
|
|
7129
7129
|
);
|
|
@@ -7148,7 +7148,7 @@ function fc(e, t) {
|
|
|
7148
7148
|
if (s.redeem && s.redeem.output) return en(s.redeem.output);
|
|
7149
7149
|
}), Te(s, "output", () => {
|
|
7150
7150
|
if (s.hash)
|
|
7151
|
-
return
|
|
7151
|
+
return nn([xd.OP_0, s.hash]);
|
|
7152
7152
|
}), Te(s, "redeem", () => {
|
|
7153
7153
|
if (e.witness)
|
|
7154
7154
|
return {
|
|
@@ -7249,36 +7249,36 @@ function Vf() {
|
|
|
7249
7249
|
}
|
|
7250
7250
|
const fr = (e) => Ur(e);
|
|
7251
7251
|
function mE(e) {
|
|
7252
|
-
|
|
7252
|
+
Tn(typeof e.isXOnlyPoint == "function"), Tn(
|
|
7253
7253
|
e.isXOnlyPoint(
|
|
7254
7254
|
fr("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")
|
|
7255
7255
|
)
|
|
7256
|
-
),
|
|
7256
|
+
), Tn(
|
|
7257
7257
|
e.isXOnlyPoint(
|
|
7258
7258
|
fr("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e")
|
|
7259
7259
|
)
|
|
7260
|
-
),
|
|
7260
|
+
), Tn(
|
|
7261
7261
|
e.isXOnlyPoint(
|
|
7262
7262
|
fr("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9")
|
|
7263
7263
|
)
|
|
7264
|
-
),
|
|
7264
|
+
), Tn(
|
|
7265
7265
|
e.isXOnlyPoint(
|
|
7266
7266
|
fr("0000000000000000000000000000000000000000000000000000000000000001")
|
|
7267
7267
|
)
|
|
7268
|
-
),
|
|
7268
|
+
), Tn(
|
|
7269
7269
|
!e.isXOnlyPoint(
|
|
7270
7270
|
fr("0000000000000000000000000000000000000000000000000000000000000000")
|
|
7271
7271
|
)
|
|
7272
|
-
),
|
|
7272
|
+
), Tn(
|
|
7273
7273
|
!e.isXOnlyPoint(
|
|
7274
7274
|
fr("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f")
|
|
7275
7275
|
)
|
|
7276
|
-
),
|
|
7276
|
+
), Tn(typeof e.xOnlyPointAddTweak == "function"), wE.forEach((t) => {
|
|
7277
7277
|
const n = e.xOnlyPointAddTweak(fr(t.pubkey), fr(t.tweak));
|
|
7278
|
-
t.result === null ?
|
|
7278
|
+
t.result === null ? Tn(n === null) : (Tn(n !== null), Tn(n.parity === t.parity), Tn(de(n.xOnlyPubkey, fr(t.result)) === 0));
|
|
7279
7279
|
});
|
|
7280
7280
|
}
|
|
7281
|
-
function
|
|
7281
|
+
function Tn(e) {
|
|
7282
7282
|
if (!e) throw new Error("ecc library invalid");
|
|
7283
7283
|
}
|
|
7284
7284
|
const wE = [
|
|
@@ -7378,7 +7378,7 @@ function li(e, t, n) {
|
|
|
7378
7378
|
let r = 0;
|
|
7379
7379
|
return e < 253 ? (t.set([Number(e)], n), r = 1) : e <= 65535 ? (t.set([253], n), bE(t, n + 1, Number(e), "LE"), r = 3) : e <= 4294967295 ? (t.set([254], n), EE(t, n + 1, Number(e), "LE"), r = 5) : (t.set([255], n), _E(t, n + 1, BigInt(e), "LE"), r = 9), { buffer: t, bytes: r };
|
|
7380
7380
|
}
|
|
7381
|
-
function
|
|
7381
|
+
function Ds(e, t) {
|
|
7382
7382
|
t === void 0 && (t = 0);
|
|
7383
7383
|
const n = e.at(t);
|
|
7384
7384
|
if (n === void 0)
|
|
@@ -7442,7 +7442,7 @@ class $t {
|
|
|
7442
7442
|
]);
|
|
7443
7443
|
}
|
|
7444
7444
|
writeUInt8(t) {
|
|
7445
|
-
this.offset =
|
|
7445
|
+
this.offset = bn(this.buffer, this.offset, t);
|
|
7446
7446
|
}
|
|
7447
7447
|
writeInt32(t) {
|
|
7448
7448
|
this.offset = $y(this.buffer, this.offset, t, "LE");
|
|
@@ -7495,7 +7495,7 @@ class BE {
|
|
|
7495
7495
|
return this.offset += 4, t;
|
|
7496
7496
|
}
|
|
7497
7497
|
readUInt32() {
|
|
7498
|
-
const t =
|
|
7498
|
+
const t = qs(this.buffer, this.offset, "LE");
|
|
7499
7499
|
return this.offset += 4, t;
|
|
7500
7500
|
}
|
|
7501
7501
|
readInt64() {
|
|
@@ -7503,7 +7503,7 @@ class BE {
|
|
|
7503
7503
|
return this.offset += 8, t;
|
|
7504
7504
|
}
|
|
7505
7505
|
readVarInt() {
|
|
7506
|
-
const { bigintValue: t, bytes: n } =
|
|
7506
|
+
const { bigintValue: t, bytes: n } = Ds(this.buffer, this.offset);
|
|
7507
7507
|
return this.offset += n, t;
|
|
7508
7508
|
}
|
|
7509
7509
|
readSlice(t) {
|
|
@@ -7605,18 +7605,18 @@ function lc(e, t) {
|
|
|
7605
7605
|
vt(64),
|
|
7606
7606
|
vt(65)
|
|
7607
7607
|
]),
|
|
7608
|
-
witness:
|
|
7608
|
+
witness: hn($e),
|
|
7609
7609
|
scriptTree: Kn(Qy, "Taptree is not of type isTaptree"),
|
|
7610
7610
|
redeem: fi(
|
|
7611
7611
|
_t({
|
|
7612
7612
|
output: $e,
|
|
7613
7613
|
// tapleaf script
|
|
7614
|
-
redeemVersion:
|
|
7614
|
+
redeemVersion: fn(),
|
|
7615
7615
|
// tapleaf version
|
|
7616
|
-
witness:
|
|
7616
|
+
witness: hn($e)
|
|
7617
7617
|
})
|
|
7618
7618
|
),
|
|
7619
|
-
redeemVersion:
|
|
7619
|
+
redeemVersion: fn()
|
|
7620
7620
|
})
|
|
7621
7621
|
),
|
|
7622
7622
|
e
|
|
@@ -7643,7 +7643,7 @@ function lc(e, t) {
|
|
|
7643
7643
|
return null;
|
|
7644
7644
|
}), Te(o, "output", () => {
|
|
7645
7645
|
if (o.pubkey)
|
|
7646
|
-
return
|
|
7646
|
+
return nn([vd.OP_1, o.pubkey]);
|
|
7647
7647
|
}), Te(o, "redeemVersion", () => e.redeemVersion ? e.redeemVersion : e.redeem && e.redeem.redeemVersion !== void 0 && e.redeem.redeemVersion !== null ? e.redeem.redeemVersion : wg), Te(o, "redeem", () => {
|
|
7648
7648
|
const c = r();
|
|
7649
7649
|
if (!(!c || c.length < 2))
|
|
@@ -7876,7 +7876,7 @@ function vg(e, t) {
|
|
|
7876
7876
|
if (r.data.length === 32)
|
|
7877
7877
|
return lc({ pubkey: r.data }).output;
|
|
7878
7878
|
} else if (r.version >= Sg && r.version <= _g && r.data.length >= Eg && r.data.length <= bg)
|
|
7879
|
-
return console.warn(xg),
|
|
7879
|
+
return console.warn(xg), nn([
|
|
7880
7880
|
r.version + Tg,
|
|
7881
7881
|
r.data
|
|
7882
7882
|
]);
|
|
@@ -8024,12 +8024,12 @@ let gt = class Ye {
|
|
|
8024
8024
|
* This hash can then be used to sign the provided transaction input.
|
|
8025
8025
|
*/
|
|
8026
8026
|
hashForSignature(t, n, r) {
|
|
8027
|
-
if (ot(er([wr, $e,
|
|
8027
|
+
if (ot(er([wr, $e, fn()]), [
|
|
8028
8028
|
t,
|
|
8029
8029
|
n,
|
|
8030
8030
|
r
|
|
8031
8031
|
]), t >= this.ins.length) return Bd;
|
|
8032
|
-
const i =
|
|
8032
|
+
const i = nn(
|
|
8033
8033
|
ft(n).filter((c) => c !== Ge.OP_CODESEPARATOR)
|
|
8034
8034
|
), s = this.clone();
|
|
8035
8035
|
if ((r & 31) === Ye.SIGHASH_NONE)
|
|
@@ -8055,8 +8055,8 @@ let gt = class Ye {
|
|
|
8055
8055
|
if (ot(
|
|
8056
8056
|
er([
|
|
8057
8057
|
wr,
|
|
8058
|
-
|
|
8059
|
-
|
|
8058
|
+
hn($e),
|
|
8059
|
+
hn(Fu),
|
|
8060
8060
|
wr
|
|
8061
8061
|
]),
|
|
8062
8062
|
[t, n, r, i]
|
|
@@ -8145,10 +8145,10 @@ let gt = class Ye {
|
|
|
8145
8145
|
return xe(this.toBuffer(void 0, void 0));
|
|
8146
8146
|
}
|
|
8147
8147
|
setInputScript(t, n) {
|
|
8148
|
-
ot(er([
|
|
8148
|
+
ot(er([fn(), $e]), [t, n]), this.ins[t].script = n;
|
|
8149
8149
|
}
|
|
8150
8150
|
setWitness(t, n) {
|
|
8151
|
-
ot(er([
|
|
8151
|
+
ot(er([fn(), hn($e)]), [
|
|
8152
8152
|
t,
|
|
8153
8153
|
n
|
|
8154
8154
|
]), this.ins[t].witness = n;
|
|
@@ -8199,7 +8199,7 @@ function $E(e) {
|
|
|
8199
8199
|
path: "m"
|
|
8200
8200
|
};
|
|
8201
8201
|
for (const r of DE(e.value.length / 4 - 1)) {
|
|
8202
|
-
const i =
|
|
8202
|
+
const i = qs(e.value, r * 4 + 4, "LE"), s = !!(i & 2147483648), o = i & 2147483647;
|
|
8203
8203
|
n.path += "/" + o.toString(10) + (s ? "'" : "");
|
|
8204
8204
|
}
|
|
8205
8205
|
return n;
|
|
@@ -8405,7 +8405,7 @@ function O2(e) {
|
|
|
8405
8405
|
throw new Error(
|
|
8406
8406
|
"Decode Error: could not decode sighashType with key 0x" + xe(e.key)
|
|
8407
8407
|
);
|
|
8408
|
-
return Number(
|
|
8408
|
+
return Number(qs(e.value, 0, "LE"));
|
|
8409
8409
|
}
|
|
8410
8410
|
function B2(e) {
|
|
8411
8411
|
const t = Uint8Array.from([me.SIGHASH_TYPE]), n = new Uint8Array(4);
|
|
@@ -8577,7 +8577,7 @@ function n_(e) {
|
|
|
8577
8577
|
);
|
|
8578
8578
|
const t = Ky(e.value, 0, "LE");
|
|
8579
8579
|
let n = 8;
|
|
8580
|
-
const { numberValue: r, bytes: i } =
|
|
8580
|
+
const { numberValue: r, bytes: i } = Ds(
|
|
8581
8581
|
e.value,
|
|
8582
8582
|
n
|
|
8583
8583
|
);
|
|
@@ -8620,7 +8620,7 @@ function a_(e) {
|
|
|
8620
8620
|
let t = 0;
|
|
8621
8621
|
const n = [];
|
|
8622
8622
|
for (; t < e.value.length; ) {
|
|
8623
|
-
const r = e.value[t++], i = e.value[t++], { numberValue: s, bytes: o } =
|
|
8623
|
+
const r = e.value[t++], i = e.value[t++], { numberValue: s, bytes: o } = Ds(
|
|
8624
8624
|
e.value,
|
|
8625
8625
|
t
|
|
8626
8626
|
);
|
|
@@ -8683,7 +8683,7 @@ function Ul(e, t = y_) {
|
|
|
8683
8683
|
path: "m"
|
|
8684
8684
|
};
|
|
8685
8685
|
for (const f of p_(c.value.length / 4 - 1)) {
|
|
8686
|
-
const l =
|
|
8686
|
+
const l = qs(c.value, f * 4 + 4, "LE"), d = !!(l & 2147483648), y = l & 2147483647;
|
|
8687
8687
|
u.path += "/" + y.toString(10) + (d ? "'" : "");
|
|
8688
8688
|
}
|
|
8689
8689
|
return u;
|
|
@@ -8761,7 +8761,7 @@ const g_ = (e) => e.length === 32;
|
|
|
8761
8761
|
function Ng(e) {
|
|
8762
8762
|
const t = Ul(e, g_);
|
|
8763
8763
|
function n(o) {
|
|
8764
|
-
const { numberValue: c, bytes: a } =
|
|
8764
|
+
const { numberValue: c, bytes: a } = Ds(
|
|
8765
8765
|
o.value
|
|
8766
8766
|
), u = t.decode({
|
|
8767
8767
|
key: o.key,
|
|
@@ -8905,13 +8905,13 @@ function w_(e) {
|
|
|
8905
8905
|
function b_(e, t) {
|
|
8906
8906
|
let n = 0;
|
|
8907
8907
|
function r() {
|
|
8908
|
-
const { numberValue: E, bytes: S } =
|
|
8908
|
+
const { numberValue: E, bytes: S } = Ds(e, n);
|
|
8909
8909
|
n += S;
|
|
8910
8910
|
const _ = e.slice(n, n + Number(E));
|
|
8911
8911
|
return n += Number(E), _;
|
|
8912
8912
|
}
|
|
8913
8913
|
function i() {
|
|
8914
|
-
const E =
|
|
8914
|
+
const E = qs(e, n, "BE");
|
|
8915
8915
|
return n += 4, E;
|
|
8916
8916
|
}
|
|
8917
8917
|
function s() {
|
|
@@ -9550,14 +9550,14 @@ function Gf(e, t, n = 0) {
|
|
|
9550
9550
|
if (i) return [t && t[0], i];
|
|
9551
9551
|
}
|
|
9552
9552
|
function V_(e, t, n) {
|
|
9553
|
-
const r = Mn(e) &&
|
|
9553
|
+
const r = Mn(e) && _s(t), i = _s(e) && Mn(t), s = e === t && Mn(t) && _s(t);
|
|
9554
9554
|
if (r || i || s)
|
|
9555
9555
|
throw new Error(
|
|
9556
9556
|
`Invalid arguments for Psbt.${n}. Cannot use both taproot and non-taproot fields.`
|
|
9557
9557
|
);
|
|
9558
9558
|
}
|
|
9559
9559
|
function D_(e, t, n) {
|
|
9560
|
-
const r = Gu(e) &&
|
|
9560
|
+
const r = Gu(e) && _s(t), i = _s(e) && Gu(t), s = e === t && Gu(t) && _s(t);
|
|
9561
9561
|
if (r || i || s)
|
|
9562
9562
|
throw new Error(
|
|
9563
9563
|
`Invalid arguments for Psbt.${n}. Cannot use both taproot and non-taproot fields.`
|
|
@@ -9625,7 +9625,7 @@ function W_(e, t, n) {
|
|
|
9625
9625
|
});
|
|
9626
9626
|
return (!n || de(r, n) === 0) && t.find((s) => de(s.leafHash, r) === 0) !== void 0;
|
|
9627
9627
|
}
|
|
9628
|
-
function
|
|
9628
|
+
function _s(e) {
|
|
9629
9629
|
return e && !!(e.redeemScript || e.witnessScript || e.bip32Derivation && e.bip32Derivation.length);
|
|
9630
9630
|
}
|
|
9631
9631
|
const X_ = {
|
|
@@ -9727,17 +9727,17 @@ class ba {
|
|
|
9727
9727
|
Rc(t), this.opts.maximumFeeRate = t;
|
|
9728
9728
|
}
|
|
9729
9729
|
setVersion(t) {
|
|
9730
|
-
Rc(t),
|
|
9730
|
+
Rc(t), eo(this.data.inputs, "setVersion");
|
|
9731
9731
|
const n = this.__CACHE;
|
|
9732
9732
|
return n.__TX.version = t, n.__EXTRACTED_TX = void 0, this;
|
|
9733
9733
|
}
|
|
9734
9734
|
setLocktime(t) {
|
|
9735
|
-
Rc(t),
|
|
9735
|
+
Rc(t), eo(this.data.inputs, "setLocktime");
|
|
9736
9736
|
const n = this.__CACHE;
|
|
9737
9737
|
return n.__TX.locktime = t, n.__EXTRACTED_TX = void 0, this;
|
|
9738
9738
|
}
|
|
9739
9739
|
setInputSequence(t, n) {
|
|
9740
|
-
Rc(n),
|
|
9740
|
+
Rc(n), eo(this.data.inputs, "setInputSequence");
|
|
9741
9741
|
const r = this.__CACHE;
|
|
9742
9742
|
if (r.__TX.ins.length <= t)
|
|
9743
9743
|
throw new Error("Input index too high");
|
|
@@ -9751,7 +9751,7 @@ class ba {
|
|
|
9751
9751
|
throw new Error(
|
|
9752
9752
|
"Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]"
|
|
9753
9753
|
);
|
|
9754
|
-
Hd(t, t, "addInput"),
|
|
9754
|
+
Hd(t, t, "addInput"), eo(this.data.inputs, "addInput"), t.witnessScript && Ea(t.witnessScript);
|
|
9755
9755
|
const n = this.__CACHE;
|
|
9756
9756
|
this.data.addInput(t);
|
|
9757
9757
|
const r = n.__TX.ins[n.__TX.ins.length - 1];
|
|
@@ -9767,7 +9767,7 @@ class ba {
|
|
|
9767
9767
|
throw new Error(
|
|
9768
9768
|
"Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]"
|
|
9769
9769
|
);
|
|
9770
|
-
|
|
9770
|
+
eo(this.data.inputs, "addOutput");
|
|
9771
9771
|
const { address: n } = t;
|
|
9772
9772
|
if (typeof n == "string") {
|
|
9773
9773
|
const { network: i } = this.opts, s = vg(n, i);
|
|
@@ -9796,7 +9796,7 @@ class ba {
|
|
|
9796
9796
|
return Dd("__FEE", "fee", this.data.inputs, this.__CACHE);
|
|
9797
9797
|
}
|
|
9798
9798
|
finalizeAllInputs() {
|
|
9799
|
-
return Ut(this.data.inputs, 0),
|
|
9799
|
+
return Ut(this.data.inputs, 0), to(this.data.inputs.length).forEach((t) => this.finalizeInput(t)), this;
|
|
9800
9800
|
}
|
|
9801
9801
|
finalizeInput(t, n) {
|
|
9802
9802
|
const r = Ut(this.data.inputs, t);
|
|
@@ -9886,7 +9886,7 @@ class ba {
|
|
|
9886
9886
|
return !!r.bip32Derivation && r.bip32Derivation.some(i);
|
|
9887
9887
|
}
|
|
9888
9888
|
validateSignaturesOfAllInputs(t) {
|
|
9889
|
-
return Ut(this.data.inputs, 0),
|
|
9889
|
+
return Ut(this.data.inputs, 0), to(this.data.inputs.length).map(
|
|
9890
9890
|
(r) => this.validateSignaturesOfInput(r, t)
|
|
9891
9891
|
).reduce((r, i) => i === !0 && r, !0);
|
|
9892
9892
|
}
|
|
@@ -9969,7 +9969,7 @@ class ba {
|
|
|
9969
9969
|
if (!t || !t.publicKey || !t.fingerprint)
|
|
9970
9970
|
throw new Error("Need HDSigner to sign input");
|
|
9971
9971
|
const r = [];
|
|
9972
|
-
for (const i of
|
|
9972
|
+
for (const i of to(this.data.inputs.length))
|
|
9973
9973
|
try {
|
|
9974
9974
|
this.signInputHD(i, t, n), r.push(!0);
|
|
9975
9975
|
} catch {
|
|
@@ -9984,7 +9984,7 @@ class ba {
|
|
|
9984
9984
|
if (!t || !t.publicKey || !t.fingerprint)
|
|
9985
9985
|
return i(new Error("Need HDSigner to sign input"));
|
|
9986
9986
|
const s = [], o = [];
|
|
9987
|
-
for (const c of
|
|
9987
|
+
for (const c of to(this.data.inputs.length))
|
|
9988
9988
|
o.push(
|
|
9989
9989
|
this.signInputHDAsync(c, t, n).then(
|
|
9990
9990
|
() => {
|
|
@@ -10023,7 +10023,7 @@ class ba {
|
|
|
10023
10023
|
if (!t || !t.publicKey)
|
|
10024
10024
|
throw new Error("Need Signer to sign input");
|
|
10025
10025
|
const r = [];
|
|
10026
|
-
for (const i of
|
|
10026
|
+
for (const i of to(this.data.inputs.length))
|
|
10027
10027
|
try {
|
|
10028
10028
|
this.signInput(i, t, n), r.push(!0);
|
|
10029
10029
|
} catch {
|
|
@@ -10336,7 +10336,7 @@ function Z_(e, t, n) {
|
|
|
10336
10336
|
`Warning: You are paying around ${(s / 1e8).toFixed(8)} in fees, which is ${r} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`
|
|
10337
10337
|
);
|
|
10338
10338
|
}
|
|
10339
|
-
function
|
|
10339
|
+
function eo(e, t) {
|
|
10340
10340
|
e.forEach((n) => {
|
|
10341
10341
|
if (Mn(n) ? H_(n, t) : N_(n, t))
|
|
10342
10342
|
throw new Error("Can not modify transaction, signatures exist.");
|
|
@@ -10650,7 +10650,7 @@ function Xg(e) {
|
|
|
10650
10650
|
return t += o, e.slice(t - o, t);
|
|
10651
10651
|
}
|
|
10652
10652
|
function r() {
|
|
10653
|
-
const o =
|
|
10653
|
+
const o = Ds(e, t);
|
|
10654
10654
|
return t += Bn(o.bigintValue), o.numberValue;
|
|
10655
10655
|
}
|
|
10656
10656
|
function i() {
|
|
@@ -10809,18 +10809,18 @@ function Ea(e) {
|
|
|
10809
10809
|
function Jg(e) {
|
|
10810
10810
|
return Ja(e) ? "witnesspubkeyhash" : B_(e) ? "pubkeyhash" : I_(e) ? "multisig" : O_(e) ? "pubkey" : "nonstandard";
|
|
10811
10811
|
}
|
|
10812
|
-
function
|
|
10812
|
+
function to(e) {
|
|
10813
10813
|
return [...Array(e).keys()];
|
|
10814
10814
|
}
|
|
10815
10815
|
gE(z1);
|
|
10816
10816
|
const No = {
|
|
10817
10817
|
Mainnet: "mainnet",
|
|
10818
10818
|
Testnet: "testnet"
|
|
10819
|
-
}, _a = "abcdefghijklmnopqrstuvwxyz234567",
|
|
10819
|
+
}, _a = "abcdefghijklmnopqrstuvwxyz234567", Ps = /* @__PURE__ */ Object.create(null);
|
|
10820
10820
|
for (let e = 0; e < _a.length; e++)
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10821
|
+
Ps[_a[e]] = e;
|
|
10822
|
+
Ps[0] = Ps.o;
|
|
10823
|
+
Ps[1] = Ps.i;
|
|
10824
10824
|
function pS(e) {
|
|
10825
10825
|
let t = 0, n = 0, r = "";
|
|
10826
10826
|
function i(s) {
|
|
@@ -10835,7 +10835,7 @@ function yS(e) {
|
|
|
10835
10835
|
const r = new Uint8Array(e.length * 4 / 3 | 0);
|
|
10836
10836
|
let i = 0;
|
|
10837
10837
|
function s(o) {
|
|
10838
|
-
let c =
|
|
10838
|
+
let c = Ps[o.toLowerCase()];
|
|
10839
10839
|
if (c === void 0)
|
|
10840
10840
|
throw new Error(`Invalid character: ${JSON.stringify(o)}`);
|
|
10841
10841
|
c <<= 3, n |= c >>> t, t += 5, t >= 8 && (r[i++] = n, t -= 8, t > 0 ? n = c << 5 - t & 255 : n = 0);
|
|
@@ -11228,7 +11228,7 @@ function qe(...e) {
|
|
|
11228
11228
|
t.set(r, n), n += r.byteLength;
|
|
11229
11229
|
return t;
|
|
11230
11230
|
}
|
|
11231
|
-
class
|
|
11231
|
+
class $s {
|
|
11232
11232
|
/**
|
|
11233
11233
|
* Save a checkpoint of the reading view (for backtracking)
|
|
11234
11234
|
*/
|
|
@@ -11334,7 +11334,7 @@ function SS(e) {
|
|
|
11334
11334
|
r = (r * 223 + i) % 2 ** 32;
|
|
11335
11335
|
return r;
|
|
11336
11336
|
}
|
|
11337
|
-
function
|
|
11337
|
+
function cn(e) {
|
|
11338
11338
|
if (/^_\d+_$/.test(e) || /^_0x[0-9a-fA-F]+_$/.test(e)) {
|
|
11339
11339
|
const t = +e.slice(1, -1);
|
|
11340
11340
|
if (Number.isSafeInteger(t) && t >= 0 && t < 2 ** 32)
|
|
@@ -11367,7 +11367,7 @@ function ji(e) {
|
|
|
11367
11367
|
function ut(e) {
|
|
11368
11368
|
if (typeof e == "number" && (e = BigInt(e)), e < BigInt(0))
|
|
11369
11369
|
throw new Error("Cannot leb encode negative values.");
|
|
11370
|
-
const t = (e === BigInt(0) ? 0 : em(e)) + 1, n = new
|
|
11370
|
+
const t = (e === BigInt(0) ? 0 : em(e)) + 1, n = new $s(new Uint8Array(t), 0);
|
|
11371
11371
|
for (; ; ) {
|
|
11372
11372
|
const r = Number(e & BigInt(127));
|
|
11373
11373
|
if (e /= BigInt(128), e === BigInt(0)) {
|
|
@@ -11389,7 +11389,7 @@ function It(e) {
|
|
|
11389
11389
|
typeof e == "number" && (e = BigInt(e));
|
|
11390
11390
|
const t = e < BigInt(0);
|
|
11391
11391
|
t && (e = -e - BigInt(1));
|
|
11392
|
-
const n = (e === BigInt(0) ? 0 : em(e)) + 1, r = new
|
|
11392
|
+
const n = (e === BigInt(0) ? 0 : em(e)) + 1, r = new $s(new Uint8Array(n), 0);
|
|
11393
11393
|
for (; ; ) {
|
|
11394
11394
|
const s = i(e);
|
|
11395
11395
|
if (e /= BigInt(128), t && e === BigInt(0) && (s & 64) !== 0 || !t && e === BigInt(0) && (s & 64) === 0) {
|
|
@@ -11426,7 +11426,7 @@ function TS(e, t) {
|
|
|
11426
11426
|
}
|
|
11427
11427
|
function nm(e, t) {
|
|
11428
11428
|
e = BigInt(e);
|
|
11429
|
-
const n = new
|
|
11429
|
+
const n = new $s(new Uint8Array(Math.min(1, t)), 0);
|
|
11430
11430
|
let r = 0, i = BigInt(256), s = BigInt(0), o = Number(e % i);
|
|
11431
11431
|
for (n.write(new Uint8Array([o])); ++r < t; )
|
|
11432
11432
|
e < 0 && s === BigInt(0) && o !== 0 && (s = BigInt(1)), o = Number((e / i - s) % BigInt(256)), n.write(new Uint8Array([o])), i *= BigInt(256);
|
|
@@ -11993,7 +11993,7 @@ class ai extends Rn {
|
|
|
11993
11993
|
return t.toString();
|
|
11994
11994
|
}
|
|
11995
11995
|
}
|
|
11996
|
-
class
|
|
11996
|
+
class Rs extends pi {
|
|
11997
11997
|
get typeName() {
|
|
11998
11998
|
return Be.VecClass;
|
|
11999
11999
|
}
|
|
@@ -12042,7 +12042,7 @@ index ${i} -> ${s.message}`);
|
|
|
12042
12042
|
return qe(n, new Uint8Array(i.buffer));
|
|
12043
12043
|
} else
|
|
12044
12044
|
return qe(n, new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
|
|
12045
|
-
const r = new
|
|
12045
|
+
const r = new $s(new Uint8Array(n.byteLength + t.length), 0);
|
|
12046
12046
|
r.write(n);
|
|
12047
12047
|
for (const i of t) {
|
|
12048
12048
|
const s = this._type.encodeValue(i);
|
|
@@ -12057,7 +12057,7 @@ index ${i} -> ${s.message}`);
|
|
|
12057
12057
|
}
|
|
12058
12058
|
decodeValue(t, n) {
|
|
12059
12059
|
const r = this.checkType(n);
|
|
12060
|
-
if (!(r instanceof
|
|
12060
|
+
if (!(r instanceof Rs))
|
|
12061
12061
|
throw new Error("Not a vector type");
|
|
12062
12062
|
const i = Number(Nt(t));
|
|
12063
12063
|
if (this._type instanceof ai) {
|
|
@@ -12204,7 +12204,7 @@ class Gi extends pi {
|
|
|
12204
12204
|
return t.typeName === Be.RecordClass || t.typeName === Be.TupleClass;
|
|
12205
12205
|
}
|
|
12206
12206
|
constructor(t = {}) {
|
|
12207
|
-
super(), this._fields = Object.entries(t).sort((n, r) =>
|
|
12207
|
+
super(), this._fields = Object.entries(t).sort((n, r) => cn(n[0]) - cn(r[0]));
|
|
12208
12208
|
}
|
|
12209
12209
|
accept(t, n) {
|
|
12210
12210
|
return t.visitRecord(this, this._fields, n);
|
|
@@ -12240,7 +12240,7 @@ field ${n} -> ${i.message}`);
|
|
|
12240
12240
|
}
|
|
12241
12241
|
_buildTypeTableImpl(t) {
|
|
12242
12242
|
this._fields.forEach(([s, o]) => o.buildTypeTable(t));
|
|
12243
|
-
const n = It(Le.Record), r = ut(this._fields.length), i = this._fields.map(([s, o]) => qe(ut(
|
|
12243
|
+
const n = It(Le.Record), r = ut(this._fields.length), i = this._fields.map(([s, o]) => qe(ut(cn(s)), o.encodeType(t)));
|
|
12244
12244
|
t.add(this, qe(n, r, qe(...i)));
|
|
12245
12245
|
}
|
|
12246
12246
|
decodeValue(t, n) {
|
|
@@ -12255,7 +12255,7 @@ field ${n} -> ${i.message}`);
|
|
|
12255
12255
|
a.decodeValue(t, a), o++;
|
|
12256
12256
|
continue;
|
|
12257
12257
|
}
|
|
12258
|
-
const [u, f] = this._fields[s], l =
|
|
12258
|
+
const [u, f] = this._fields[s], l = cn(this._fields[s][0]), d = cn(c);
|
|
12259
12259
|
if (l === d)
|
|
12260
12260
|
i[u] = f.decodeValue(t, a), s++, o++;
|
|
12261
12261
|
else if (d > l)
|
|
@@ -12276,7 +12276,7 @@ field ${n} -> ${i.message}`);
|
|
|
12276
12276
|
get fieldsAsObject() {
|
|
12277
12277
|
const t = {};
|
|
12278
12278
|
for (const [n, r] of this._fields)
|
|
12279
|
-
t[
|
|
12279
|
+
t[cn(n)] = r;
|
|
12280
12280
|
return t;
|
|
12281
12281
|
}
|
|
12282
12282
|
get name() {
|
|
@@ -12339,7 +12339,7 @@ index ${r} -> ${i.message}`);
|
|
|
12339
12339
|
return `record {${ko(this._components, t, (r, i) => r.valueToString(i)).join("; ")}}`;
|
|
12340
12340
|
}
|
|
12341
12341
|
}
|
|
12342
|
-
class
|
|
12342
|
+
class Us extends pi {
|
|
12343
12343
|
get typeName() {
|
|
12344
12344
|
return Be.VariantClass;
|
|
12345
12345
|
}
|
|
@@ -12347,7 +12347,7 @@ class Rs extends pi {
|
|
|
12347
12347
|
return t.typeName === Be.VariantClass;
|
|
12348
12348
|
}
|
|
12349
12349
|
constructor(t = {}) {
|
|
12350
|
-
super(), this._fields = Object.entries(t).sort((n, r) =>
|
|
12350
|
+
super(), this._fields = Object.entries(t).sort((n, r) => cn(n[0]) - cn(r[0]));
|
|
12351
12351
|
}
|
|
12352
12352
|
accept(t, n) {
|
|
12353
12353
|
return t.visitVariant(this, this._fields, n);
|
|
@@ -12379,19 +12379,19 @@ variant ${n} -> ${i.message}`);
|
|
|
12379
12379
|
this._fields.forEach(([, s]) => {
|
|
12380
12380
|
s.buildTypeTable(t);
|
|
12381
12381
|
});
|
|
12382
|
-
const n = It(Le.Variant), r = ut(this._fields.length), i = this._fields.map(([s, o]) => qe(ut(
|
|
12382
|
+
const n = It(Le.Variant), r = ut(this._fields.length), i = this._fields.map(([s, o]) => qe(ut(cn(s)), o.encodeType(t)));
|
|
12383
12383
|
t.add(this, qe(n, r, ...i));
|
|
12384
12384
|
}
|
|
12385
12385
|
decodeValue(t, n) {
|
|
12386
12386
|
const r = this.checkType(n);
|
|
12387
|
-
if (!(r instanceof
|
|
12387
|
+
if (!(r instanceof Us))
|
|
12388
12388
|
throw new Error("Not a variant type");
|
|
12389
12389
|
const i = Number(Nt(t));
|
|
12390
12390
|
if (i >= r._fields.length)
|
|
12391
12391
|
throw Error("Invalid variant index: " + i);
|
|
12392
12392
|
const [s, o] = r._fields[i];
|
|
12393
12393
|
for (const [c, a] of this._fields)
|
|
12394
|
-
if (
|
|
12394
|
+
if (cn(s) === cn(c)) {
|
|
12395
12395
|
const u = a.decodeValue(t, o);
|
|
12396
12396
|
return { [c]: u };
|
|
12397
12397
|
}
|
|
@@ -12414,7 +12414,7 @@ variant ${n} -> ${i.message}`);
|
|
|
12414
12414
|
get alternativesAsObject() {
|
|
12415
12415
|
const t = {};
|
|
12416
12416
|
for (const [n, r] of this._fields)
|
|
12417
|
-
t[
|
|
12417
|
+
t[cn(n)] = r;
|
|
12418
12418
|
return t;
|
|
12419
12419
|
}
|
|
12420
12420
|
}
|
|
@@ -12646,7 +12646,7 @@ function Yf(e, t) {
|
|
|
12646
12646
|
return qe(r, i, s, o, c);
|
|
12647
12647
|
}
|
|
12648
12648
|
function am(e, t) {
|
|
12649
|
-
const n = new
|
|
12649
|
+
const n = new $s(t);
|
|
12650
12650
|
if (t.byteLength < Jc.length)
|
|
12651
12651
|
throw new Error("Message length smaller than magic number");
|
|
12652
12652
|
const r = $i(n, Jc.length), i = new TextDecoder().decode(r);
|
|
@@ -12855,7 +12855,7 @@ function Im(...e) {
|
|
|
12855
12855
|
return new ru(e);
|
|
12856
12856
|
}
|
|
12857
12857
|
function Om(e) {
|
|
12858
|
-
return new
|
|
12858
|
+
return new Rs(e);
|
|
12859
12859
|
}
|
|
12860
12860
|
function Bm(e) {
|
|
12861
12861
|
return new kr(e);
|
|
@@ -12864,7 +12864,7 @@ function Nm(e) {
|
|
|
12864
12864
|
return new Gi(e);
|
|
12865
12865
|
}
|
|
12866
12866
|
function km(e) {
|
|
12867
|
-
return new
|
|
12867
|
+
return new Us(e);
|
|
12868
12868
|
}
|
|
12869
12869
|
function Pm() {
|
|
12870
12870
|
return new Nn();
|
|
@@ -12943,14 +12943,14 @@ function gr(e, t, n) {
|
|
|
12943
12943
|
return r;
|
|
12944
12944
|
if (e.add(t, n), n instanceof hi || t instanceof Ll || t instanceof Vl && n instanceof ql)
|
|
12945
12945
|
return !0;
|
|
12946
|
-
if (t instanceof
|
|
12946
|
+
if (t instanceof Rs && n instanceof Rs)
|
|
12947
12947
|
return gr(e, t._type, n._type);
|
|
12948
12948
|
if (n instanceof kr)
|
|
12949
12949
|
return !0;
|
|
12950
12950
|
if (t instanceof Gi && n instanceof Gi) {
|
|
12951
12951
|
const i = t.fieldsAsObject;
|
|
12952
12952
|
for (const [s, o] of n._fields) {
|
|
12953
|
-
const c = i[
|
|
12953
|
+
const c = i[cn(s)];
|
|
12954
12954
|
if (c) {
|
|
12955
12955
|
if (!gr(e, c, o))
|
|
12956
12956
|
return !1;
|
|
@@ -12980,10 +12980,10 @@ function gr(e, t, n) {
|
|
|
12980
12980
|
}
|
|
12981
12981
|
return !0;
|
|
12982
12982
|
}
|
|
12983
|
-
if (t instanceof
|
|
12983
|
+
if (t instanceof Us && n instanceof Us) {
|
|
12984
12984
|
const i = n.alternativesAsObject;
|
|
12985
12985
|
for (const [s, o] of t._fields) {
|
|
12986
|
-
const c = i[
|
|
12986
|
+
const c = i[cn(s)];
|
|
12987
12987
|
if (!c || !gr(e, o, c))
|
|
12988
12988
|
return !1;
|
|
12989
12989
|
}
|
|
@@ -13049,9 +13049,9 @@ const BS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13049
13049
|
Unknown: IS,
|
|
13050
13050
|
UnknownClass: im,
|
|
13051
13051
|
Variant: km,
|
|
13052
|
-
VariantClass:
|
|
13052
|
+
VariantClass: Us,
|
|
13053
13053
|
Vec: Om,
|
|
13054
|
-
VecClass:
|
|
13054
|
+
VecClass: Rs,
|
|
13055
13055
|
Visitor: vS,
|
|
13056
13056
|
decode: am,
|
|
13057
13057
|
encode: Yf,
|
|
@@ -13066,7 +13066,7 @@ function Cm(e, t) {
|
|
|
13066
13066
|
const { toString: NS } = Object.prototype, { getPrototypeOf: Kl } = Object, { iterator: su, toStringTag: Hm } = Symbol, ou = /* @__PURE__ */ ((e) => (t) => {
|
|
13067
13067
|
const n = NS.call(t);
|
|
13068
13068
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
13069
|
-
})(/* @__PURE__ */ Object.create(null)), Gn = (e) => (e = e.toLowerCase(), (t) => ou(t) === e), cu = (e) => (t) => typeof t === e, { isArray:
|
|
13069
|
+
})(/* @__PURE__ */ Object.create(null)), Gn = (e) => (e = e.toLowerCase(), (t) => ou(t) === e), cu = (e) => (t) => typeof t === e, { isArray: js } = Array, Uo = cu("undefined");
|
|
13070
13070
|
function hc(e) {
|
|
13071
13071
|
return e !== null && !Uo(e) && e.constructor !== null && !Uo(e.constructor) && dn(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
13072
13072
|
}
|
|
@@ -13097,7 +13097,7 @@ function pc(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
13097
13097
|
if (e === null || typeof e > "u")
|
|
13098
13098
|
return;
|
|
13099
13099
|
let r, i;
|
|
13100
|
-
if (typeof e != "object" && (e = [e]),
|
|
13100
|
+
if (typeof e != "object" && (e = [e]), js(e))
|
|
13101
13101
|
for (r = 0, i = e.length; r < i; r++)
|
|
13102
13102
|
t.call(null, e[r], r, e);
|
|
13103
13103
|
else {
|
|
@@ -13124,7 +13124,7 @@ const Ui = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
|
|
|
13124
13124
|
function Jf() {
|
|
13125
13125
|
const { caseless: e } = qm(this) && this || {}, t = {}, n = (r, i) => {
|
|
13126
13126
|
const s = e && Lm(t, i) || i;
|
|
13127
|
-
ea(t[s]) && ea(r) ? t[s] = Jf(t[s], r) : ea(r) ? t[s] = Jf({}, r) :
|
|
13127
|
+
ea(t[s]) && ea(r) ? t[s] = Jf(t[s], r) : ea(r) ? t[s] = Jf({}, r) : js(r) ? t[s] = r.slice() : t[s] = r;
|
|
13128
13128
|
};
|
|
13129
13129
|
for (let r = 0, i = arguments.length; r < i; r++)
|
|
13130
13130
|
arguments[r] && pc(arguments[r], n);
|
|
@@ -13152,7 +13152,7 @@ const WS = (e, t, n, { allOwnKeys: r } = {}) => (pc(t, (i, s) => {
|
|
|
13152
13152
|
return r !== -1 && r === n;
|
|
13153
13153
|
}, JS = (e) => {
|
|
13154
13154
|
if (!e) return null;
|
|
13155
|
-
if (
|
|
13155
|
+
if (js(e)) return e;
|
|
13156
13156
|
let t = e.length;
|
|
13157
13157
|
if (!Mm(t)) return null;
|
|
13158
13158
|
const n = new Array(t);
|
|
@@ -13204,7 +13204,7 @@ const WS = (e, t, n, { allOwnKeys: r } = {}) => (pc(t, (i, s) => {
|
|
|
13204
13204
|
n[s] = !0;
|
|
13205
13205
|
});
|
|
13206
13206
|
};
|
|
13207
|
-
return
|
|
13207
|
+
return js(e) ? r(e) : r(String(e).split(t)), n;
|
|
13208
13208
|
}, cT = () => {
|
|
13209
13209
|
}, aT = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
13210
13210
|
function uT(e) {
|
|
@@ -13219,7 +13219,7 @@ const fT = (e) => {
|
|
|
13219
13219
|
return r;
|
|
13220
13220
|
if (!("toJSON" in r)) {
|
|
13221
13221
|
t[i] = r;
|
|
13222
|
-
const s =
|
|
13222
|
+
const s = js(r) ? [] : {};
|
|
13223
13223
|
return pc(r, (o, c) => {
|
|
13224
13224
|
const a = n(o, i + 1);
|
|
13225
13225
|
!Uo(a) && (s[c] = a);
|
|
@@ -13237,7 +13237,7 @@ const fT = (e) => {
|
|
|
13237
13237
|
typeof setImmediate == "function",
|
|
13238
13238
|
dn(Ui.postMessage)
|
|
13239
13239
|
), dT = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ui) : typeof process < "u" && process.nextTick || Dm, pT = (e) => e != null && dn(e[su]), z = {
|
|
13240
|
-
isArray:
|
|
13240
|
+
isArray: js,
|
|
13241
13241
|
isArrayBuffer: Fm,
|
|
13242
13242
|
isBuffer: hc,
|
|
13243
13243
|
isFormData: qS,
|
|
@@ -13692,7 +13692,7 @@ const kT = z.toObjectSet([
|
|
|
13692
13692
|
i = o.indexOf(":"), n = o.substring(0, i).trim().toLowerCase(), r = o.substring(i + 1).trim(), !(!n || t[n] && kT[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
13693
13693
|
}), t;
|
|
13694
13694
|
}, Jd = Symbol("internals");
|
|
13695
|
-
function
|
|
13695
|
+
function no(e) {
|
|
13696
13696
|
return e && String(e).trim().toLowerCase();
|
|
13697
13697
|
}
|
|
13698
13698
|
function ta(e) {
|
|
@@ -13737,7 +13737,7 @@ let pn = class {
|
|
|
13737
13737
|
set(t, n, r) {
|
|
13738
13738
|
const i = this;
|
|
13739
13739
|
function s(c, a, u) {
|
|
13740
|
-
const f =
|
|
13740
|
+
const f = no(a);
|
|
13741
13741
|
if (!f)
|
|
13742
13742
|
throw new Error("header name must be a non-empty string");
|
|
13743
13743
|
const l = z.findKey(i, f);
|
|
@@ -13761,7 +13761,7 @@ let pn = class {
|
|
|
13761
13761
|
return this;
|
|
13762
13762
|
}
|
|
13763
13763
|
get(t, n) {
|
|
13764
|
-
if (t =
|
|
13764
|
+
if (t = no(t), t) {
|
|
13765
13765
|
const r = z.findKey(this, t);
|
|
13766
13766
|
if (r) {
|
|
13767
13767
|
const i = this[r];
|
|
@@ -13778,7 +13778,7 @@ let pn = class {
|
|
|
13778
13778
|
}
|
|
13779
13779
|
}
|
|
13780
13780
|
has(t, n) {
|
|
13781
|
-
if (t =
|
|
13781
|
+
if (t = no(t), t) {
|
|
13782
13782
|
const r = z.findKey(this, t);
|
|
13783
13783
|
return !!(r && this[r] !== void 0 && (!n || Yu(this, this[r], r, n)));
|
|
13784
13784
|
}
|
|
@@ -13788,7 +13788,7 @@ let pn = class {
|
|
|
13788
13788
|
const r = this;
|
|
13789
13789
|
let i = !1;
|
|
13790
13790
|
function s(o) {
|
|
13791
|
-
if (o =
|
|
13791
|
+
if (o = no(o), o) {
|
|
13792
13792
|
const c = z.findKey(r, o);
|
|
13793
13793
|
c && (!n || Yu(r, r[c], c, n)) && (delete r[c], i = !0);
|
|
13794
13794
|
}
|
|
@@ -13850,7 +13850,7 @@ let pn = class {
|
|
|
13850
13850
|
accessors: {}
|
|
13851
13851
|
}).accessors, i = this.prototype;
|
|
13852
13852
|
function s(o) {
|
|
13853
|
-
const c =
|
|
13853
|
+
const c = no(o);
|
|
13854
13854
|
r[c] || (HT(i, o), r[c] = !0);
|
|
13855
13855
|
}
|
|
13856
13856
|
return z.isArray(t) ? t.forEach(s) : s(t), this;
|
|
@@ -13877,10 +13877,10 @@ function Zu(e, t) {
|
|
|
13877
13877
|
function Ym(e) {
|
|
13878
13878
|
return !!(e && e.__CANCEL__);
|
|
13879
13879
|
}
|
|
13880
|
-
function
|
|
13880
|
+
function Ks(e, t, n) {
|
|
13881
13881
|
ke.call(this, e ?? "canceled", ke.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
13882
13882
|
}
|
|
13883
|
-
z.inherits(
|
|
13883
|
+
z.inherits(Ks, ke, {
|
|
13884
13884
|
__CANCEL__: !0
|
|
13885
13885
|
});
|
|
13886
13886
|
function Zm(e, t, n) {
|
|
@@ -14125,7 +14125,7 @@ const Qm = (e) => {
|
|
|
14125
14125
|
}, s === void 0 && o.setContentType(null), "setRequestHeader" in E && z.forEach(o.toJSON(), function(T, O) {
|
|
14126
14126
|
E.setRequestHeader(O, T);
|
|
14127
14127
|
}), z.isUndefined(i.withCredentials) || (E.withCredentials = !!i.withCredentials), c && c !== "json" && (E.responseType = i.responseType), u && ([d, g] = Ta(u, !0), E.addEventListener("progress", d)), a && E.upload && ([l, y] = Ta(a), E.upload.addEventListener("progress", l), E.upload.addEventListener("loadend", y)), (i.cancelToken || i.signal) && (f = (w) => {
|
|
14128
|
-
E && (r(!w || w.type ? new
|
|
14128
|
+
E && (r(!w || w.type ? new Ks(null, e, E) : w), E.abort(), E = null);
|
|
14129
14129
|
}, i.cancelToken && i.cancelToken.subscribe(f), i.signal && (i.signal.aborted ? f() : i.signal.addEventListener("abort", f)));
|
|
14130
14130
|
const _ = FT(i.url);
|
|
14131
14131
|
if (_ && jt.protocols.indexOf(_) === -1) {
|
|
@@ -14142,7 +14142,7 @@ const Qm = (e) => {
|
|
|
14142
14142
|
if (!i) {
|
|
14143
14143
|
i = !0, c();
|
|
14144
14144
|
const f = u instanceof Error ? u : this.reason;
|
|
14145
|
-
r.abort(f instanceof ke ? f : new
|
|
14145
|
+
r.abort(f instanceof ke ? f : new Ks(f instanceof Error ? f.message : f));
|
|
14146
14146
|
}
|
|
14147
14147
|
};
|
|
14148
14148
|
let o = t && setTimeout(() => {
|
|
@@ -14389,7 +14389,7 @@ const i0 = (e) => `- ${e}`, tx = (e) => z.isFunction(e) || e === null || e === !
|
|
|
14389
14389
|
};
|
|
14390
14390
|
function Ju(e) {
|
|
14391
14391
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
14392
|
-
throw new
|
|
14392
|
+
throw new Ks(null, e);
|
|
14393
14393
|
}
|
|
14394
14394
|
function s0(e) {
|
|
14395
14395
|
return Ju(e), e.headers = pn.from(e.headers), e.data = Zu.call(
|
|
@@ -14606,7 +14606,7 @@ let rx = class iw {
|
|
|
14606
14606
|
r.unsubscribe(s);
|
|
14607
14607
|
}, o;
|
|
14608
14608
|
}, t(function(s, o, c) {
|
|
14609
|
-
r.reason || (r.reason = new
|
|
14609
|
+
r.reason || (r.reason = new Ks(s, o, c), n(r.reason));
|
|
14610
14610
|
});
|
|
14611
14611
|
}
|
|
14612
14612
|
/**
|
|
@@ -14739,7 +14739,7 @@ function sw(e) {
|
|
|
14739
14739
|
}
|
|
14740
14740
|
const ht = sw(yc);
|
|
14741
14741
|
ht.Axios = Li;
|
|
14742
|
-
ht.CanceledError =
|
|
14742
|
+
ht.CanceledError = Ks;
|
|
14743
14743
|
ht.CancelToken = rx;
|
|
14744
14744
|
ht.isCancel = Ym;
|
|
14745
14745
|
ht.VERSION = rw;
|
|
@@ -14810,10 +14810,10 @@ var c0;
|
|
|
14810
14810
|
(function(e) {
|
|
14811
14811
|
e[e.SysFatal = 1] = "SysFatal", e[e.SysTransient = 2] = "SysTransient", e[e.DestinationInvalid = 3] = "DestinationInvalid", e[e.CanisterReject = 4] = "CanisterReject", e[e.CanisterError = 5] = "CanisterError";
|
|
14812
14812
|
})(c0 || (c0 = {}));
|
|
14813
|
-
var
|
|
14813
|
+
var Cs;
|
|
14814
14814
|
(function(e) {
|
|
14815
14815
|
e.Replied = "replied", e.Rejected = "rejected";
|
|
14816
|
-
})(
|
|
14816
|
+
})(Cs || (Cs = {}));
|
|
14817
14817
|
function cx(e) {
|
|
14818
14818
|
return e != null && "reject_code" in e;
|
|
14819
14819
|
}
|
|
@@ -14887,9 +14887,9 @@ class yt extends Ji {
|
|
|
14887
14887
|
super(t, Pr.Protocol), this.name = "ProtocolError", Object.setPrototypeOf(this, yt.prototype);
|
|
14888
14888
|
}
|
|
14889
14889
|
}
|
|
14890
|
-
class
|
|
14890
|
+
class Ss extends Ji {
|
|
14891
14891
|
constructor(t) {
|
|
14892
|
-
super(t, Pr.Reject), this.name = "RejectError", Object.setPrototypeOf(this,
|
|
14892
|
+
super(t, Pr.Reject), this.name = "RejectError", Object.setPrototypeOf(this, Ss.prototype);
|
|
14893
14893
|
}
|
|
14894
14894
|
}
|
|
14895
14895
|
class Aa extends Ji {
|
|
@@ -14897,9 +14897,9 @@ class Aa extends Ji {
|
|
|
14897
14897
|
super(t, Pr.Transport), this.name = "TransportError", Object.setPrototypeOf(this, Aa.prototype);
|
|
14898
14898
|
}
|
|
14899
14899
|
}
|
|
14900
|
-
class
|
|
14900
|
+
class an extends Ji {
|
|
14901
14901
|
constructor(t) {
|
|
14902
|
-
super(t, Pr.External), this.name = "ExternalError", Object.setPrototypeOf(this,
|
|
14902
|
+
super(t, Pr.External), this.name = "ExternalError", Object.setPrototypeOf(this, an.prototype);
|
|
14903
14903
|
}
|
|
14904
14904
|
}
|
|
14905
14905
|
class et extends Ji {
|
|
@@ -14907,14 +14907,14 @@ class et extends Ji {
|
|
|
14907
14907
|
super(t, Pr.Input), this.name = "InputError", Object.setPrototypeOf(this, et.prototype);
|
|
14908
14908
|
}
|
|
14909
14909
|
}
|
|
14910
|
-
class
|
|
14910
|
+
class un extends Ji {
|
|
14911
14911
|
constructor(t) {
|
|
14912
|
-
super(t, Pr.Unknown), this.name = "UnknownError", Object.setPrototypeOf(this,
|
|
14912
|
+
super(t, Pr.Unknown), this.name = "UnknownError", Object.setPrototypeOf(this, un.prototype);
|
|
14913
14913
|
}
|
|
14914
14914
|
}
|
|
14915
|
-
class
|
|
14915
|
+
class Ts extends Ue {
|
|
14916
14916
|
constructor(t, n) {
|
|
14917
|
-
super(), this.reason = t, this.error = n, this.name = "CertificateVerificationErrorCode", Object.setPrototypeOf(this,
|
|
14917
|
+
super(), this.reason = t, this.error = n, this.name = "CertificateVerificationErrorCode", Object.setPrototypeOf(this, Ts.prototype);
|
|
14918
14918
|
}
|
|
14919
14919
|
toErrorMessage() {
|
|
14920
14920
|
let t = this.reason;
|
|
@@ -14945,9 +14945,9 @@ class lu extends Ue {
|
|
|
14945
14945
|
return `The certificate contains a delegation that does not include the canister ${this.canisterId.toText()} in the canister_ranges field. Subnet ID: ${this.subnetId.toText()}`;
|
|
14946
14946
|
}
|
|
14947
14947
|
}
|
|
14948
|
-
class
|
|
14948
|
+
class Hs extends Ue {
|
|
14949
14949
|
constructor(t, n) {
|
|
14950
|
-
super(), this.message = t, this.lookupStatus = n, this.name = "LookupErrorCode", Object.setPrototypeOf(this,
|
|
14950
|
+
super(), this.message = t, this.lookupStatus = n, this.name = "LookupErrorCode", Object.setPrototypeOf(this, Hs.prototype);
|
|
14951
14951
|
}
|
|
14952
14952
|
toErrorMessage() {
|
|
14953
14953
|
return `${this.message}. Lookup status: ${this.lookupStatus}`;
|
|
@@ -15097,9 +15097,9 @@ class rh extends Ue {
|
|
|
15097
15097
|
`;
|
|
15098
15098
|
}
|
|
15099
15099
|
}
|
|
15100
|
-
class
|
|
15100
|
+
class Gs extends Ue {
|
|
15101
15101
|
constructor(t) {
|
|
15102
|
-
super(), this.shouldFetchRootKey = t, this.name = "MissingRootKeyErrorCode", Object.setPrototypeOf(this,
|
|
15102
|
+
super(), this.shouldFetchRootKey = t, this.name = "MissingRootKeyErrorCode", Object.setPrototypeOf(this, Gs.prototype);
|
|
15103
15103
|
}
|
|
15104
15104
|
toErrorMessage() {
|
|
15105
15105
|
return this.shouldFetchRootKey === void 0 ? "Agent is missing root key" : `Agent is missing root key and the shouldFetchRootKey value is set to ${this.shouldFetchRootKey}. The root key should only be unknown if you are in local development. Otherwise you should avoid fetching and use the default IC Root Key or the known root key of your environment.`;
|
|
@@ -15129,9 +15129,9 @@ class Pi extends Ue {
|
|
|
15129
15129
|
return "This identity has expired due this application's security policy. Please refresh your authentication.";
|
|
15130
15130
|
}
|
|
15131
15131
|
}
|
|
15132
|
-
class
|
|
15132
|
+
class gs extends Ue {
|
|
15133
15133
|
constructor(t, n) {
|
|
15134
|
-
super(), this.message = t, this.providedIngressExpiryInMinutes = n, this.name = "IngressExpiryInvalidErrorCode", Object.setPrototypeOf(this,
|
|
15134
|
+
super(), this.message = t, this.providedIngressExpiryInMinutes = n, this.name = "IngressExpiryInvalidErrorCode", Object.setPrototypeOf(this, gs.prototype);
|
|
15135
15135
|
}
|
|
15136
15136
|
toErrorMessage() {
|
|
15137
15137
|
return `${this.message}. Provided ingress expiry time is ${this.providedIngressExpiryInMinutes} minutes.`;
|
|
@@ -15255,7 +15255,7 @@ function mc(e) {
|
|
|
15255
15255
|
return String(e);
|
|
15256
15256
|
}
|
|
15257
15257
|
}
|
|
15258
|
-
const
|
|
15258
|
+
const xs = new Error("unreachable");
|
|
15259
15259
|
function ka(e) {
|
|
15260
15260
|
if (!e)
|
|
15261
15261
|
throw new Error("Input cannot be null or undefined");
|
|
@@ -15273,27 +15273,27 @@ function il(e) {
|
|
|
15273
15273
|
if (typeof e == "string")
|
|
15274
15274
|
return ow(e);
|
|
15275
15275
|
if (typeof e == "number")
|
|
15276
|
-
return
|
|
15276
|
+
return En(ut(e));
|
|
15277
15277
|
if (e instanceof Uint8Array || ArrayBuffer.isView(e))
|
|
15278
|
-
return
|
|
15278
|
+
return En(ka(e));
|
|
15279
15279
|
if (Array.isArray(e)) {
|
|
15280
15280
|
const t = e.map(il);
|
|
15281
|
-
return
|
|
15281
|
+
return En(De(...t));
|
|
15282
15282
|
} else {
|
|
15283
15283
|
if (e && typeof e == "object" && e._isPrincipal)
|
|
15284
|
-
return
|
|
15284
|
+
return En(e.toUint8Array());
|
|
15285
15285
|
if (typeof e == "object" && e !== null && typeof e.toHash == "function")
|
|
15286
15286
|
return il(e.toHash());
|
|
15287
15287
|
if (typeof e == "object")
|
|
15288
15288
|
return Pa(e);
|
|
15289
15289
|
if (typeof e == "bigint")
|
|
15290
|
-
return
|
|
15290
|
+
return En(ut(e));
|
|
15291
15291
|
}
|
|
15292
15292
|
throw et.fromCode(new ih(e));
|
|
15293
15293
|
}
|
|
15294
15294
|
const ow = (e) => {
|
|
15295
15295
|
const t = new TextEncoder().encode(e);
|
|
15296
|
-
return
|
|
15296
|
+
return En(t);
|
|
15297
15297
|
};
|
|
15298
15298
|
function Qu(e) {
|
|
15299
15299
|
return Pa(e);
|
|
@@ -15303,7 +15303,7 @@ function Pa(e) {
|
|
|
15303
15303
|
const a = ow(o), u = il(c);
|
|
15304
15304
|
return [a, u];
|
|
15305
15305
|
}).sort(([o], [c]) => ES(o, c)), i = De(...r.map((o) => De(...o)));
|
|
15306
|
-
return
|
|
15306
|
+
return En(i);
|
|
15307
15307
|
}
|
|
15308
15308
|
new TextEncoder().encode(`
|
|
15309
15309
|
ic-request`);
|
|
@@ -15329,7 +15329,7 @@ const cw = 55799, aw = Symbol("CBOR_STOP_CODE");
|
|
|
15329
15329
|
var Vn = /* @__PURE__ */ ((e) => (e[e.False = 20] = "False", e[e.True = 21] = "True", e[e.Null = 22] = "Null", e[e.Undefined = 23] = "Undefined", e[e.Break = 31] = "Break", e))(Vn || {}), xt = /* @__PURE__ */ ((e) => (e[e.UnsignedInteger = 0] = "UnsignedInteger", e[e.NegativeInteger = 1] = "NegativeInteger", e[e.ByteString = 2] = "ByteString", e[e.TextString = 3] = "TextString", e[e.Array = 4] = "Array", e[e.Map = 5] = "Map", e[e.Tag = 6] = "Tag", e[e.Simple = 7] = "Simple", e))(xt || {});
|
|
15330
15330
|
const fx = 23, lx = 255, hx = 65535, dx = 4294967295, px = BigInt("0xffffffffffffffff");
|
|
15331
15331
|
var Ln = /* @__PURE__ */ ((e) => (e[e.Value = 23] = "Value", e[e.OneByte = 24] = "OneByte", e[e.TwoBytes = 25] = "TwoBytes", e[e.FourBytes = 26] = "FourBytes", e[e.EightBytes = 27] = "EightBytes", e[e.Indefinite = 31] = "Indefinite", e))(Ln || {});
|
|
15332
|
-
const
|
|
15332
|
+
const As = !1;
|
|
15333
15333
|
function yx(e) {
|
|
15334
15334
|
return e == null;
|
|
15335
15335
|
}
|
|
@@ -15344,7 +15344,7 @@ function mx(e) {
|
|
|
15344
15344
|
function wx(e) {
|
|
15345
15345
|
return e & 31;
|
|
15346
15346
|
}
|
|
15347
|
-
let Fo = new Uint8Array(),
|
|
15347
|
+
let Fo = new Uint8Array(), ro, Dn = 0;
|
|
15348
15348
|
function bx(e, t) {
|
|
15349
15349
|
Fo = e, Dn = 0;
|
|
15350
15350
|
const n = qi();
|
|
@@ -15354,7 +15354,7 @@ function qi(e) {
|
|
|
15354
15354
|
const [t, n] = ra();
|
|
15355
15355
|
switch (t) {
|
|
15356
15356
|
case xt.UnsignedInteger:
|
|
15357
|
-
return
|
|
15357
|
+
return Ws(n);
|
|
15358
15358
|
case xt.NegativeInteger:
|
|
15359
15359
|
return Tx(n);
|
|
15360
15360
|
case xt.ByteString:
|
|
@@ -15380,7 +15380,7 @@ function ra() {
|
|
|
15380
15380
|
return Dn++, [t, n];
|
|
15381
15381
|
}
|
|
15382
15382
|
function Ex(e, t) {
|
|
15383
|
-
const n =
|
|
15383
|
+
const n = Ws(e);
|
|
15384
15384
|
if (n === 1 / 0) {
|
|
15385
15385
|
const i = [];
|
|
15386
15386
|
let s = qi();
|
|
@@ -15411,7 +15411,7 @@ function _x(e) {
|
|
|
15411
15411
|
throw new Qi(`Unrecognized simple type: ${e.toString(2)}`);
|
|
15412
15412
|
}
|
|
15413
15413
|
function Sx(e, t) {
|
|
15414
|
-
const n =
|
|
15414
|
+
const n = Ws(e), r = {};
|
|
15415
15415
|
if (n === 1 / 0) {
|
|
15416
15416
|
let [i, s] = ra();
|
|
15417
15417
|
for (; i !== xt.Simple && s !== Vn.Break; ) {
|
|
@@ -15429,18 +15429,18 @@ function Sx(e, t) {
|
|
|
15429
15429
|
}
|
|
15430
15430
|
return r;
|
|
15431
15431
|
}
|
|
15432
|
-
function
|
|
15432
|
+
function Ws(e) {
|
|
15433
15433
|
if (e <= Ln.Value)
|
|
15434
15434
|
return e;
|
|
15435
|
-
switch (
|
|
15435
|
+
switch (ro = new DataView(Fo.buffer, Fo.byteOffset + Dn), e) {
|
|
15436
15436
|
case Ln.OneByte:
|
|
15437
|
-
return Dn++,
|
|
15437
|
+
return Dn++, ro.getUint8(0);
|
|
15438
15438
|
case Ln.TwoBytes:
|
|
15439
|
-
return Dn += 2,
|
|
15439
|
+
return Dn += 2, ro.getUint16(0, As);
|
|
15440
15440
|
case Ln.FourBytes:
|
|
15441
|
-
return Dn += 4,
|
|
15441
|
+
return Dn += 4, ro.getUint32(0, As);
|
|
15442
15442
|
case Ln.EightBytes:
|
|
15443
|
-
return Dn += 8,
|
|
15443
|
+
return Dn += 8, ro.getBigUint64(0, As);
|
|
15444
15444
|
case Ln.Indefinite:
|
|
15445
15445
|
return 1 / 0;
|
|
15446
15446
|
default:
|
|
@@ -15448,11 +15448,11 @@ function Gs(e) {
|
|
|
15448
15448
|
}
|
|
15449
15449
|
}
|
|
15450
15450
|
function Tx(e) {
|
|
15451
|
-
const t =
|
|
15451
|
+
const t = Ws(e);
|
|
15452
15452
|
return typeof t == "number" ? -1 - t : -1n - t;
|
|
15453
15453
|
}
|
|
15454
15454
|
function fw(e) {
|
|
15455
|
-
const t =
|
|
15455
|
+
const t = Ws(e);
|
|
15456
15456
|
if (t > Number.MAX_SAFE_INTEGER)
|
|
15457
15457
|
throw new Qi("Byte length is too large");
|
|
15458
15458
|
const n = Number(t);
|
|
@@ -15463,7 +15463,7 @@ function sl(e) {
|
|
|
15463
15463
|
return gx.decode(t);
|
|
15464
15464
|
}
|
|
15465
15465
|
function xx(e, t) {
|
|
15466
|
-
const n =
|
|
15466
|
+
const n = Ws(e);
|
|
15467
15467
|
if (n === cw)
|
|
15468
15468
|
return qi();
|
|
15469
15469
|
throw new Qi(`Unsupported tag: ${n}.`);
|
|
@@ -15474,17 +15474,17 @@ class lh extends Error {
|
|
|
15474
15474
|
}
|
|
15475
15475
|
}
|
|
15476
15476
|
const Ax = 2 * 1024, vx = 100, Ix = new TextEncoder();
|
|
15477
|
-
function
|
|
15477
|
+
function io(e) {
|
|
15478
15478
|
return e << 5;
|
|
15479
15479
|
}
|
|
15480
|
-
let
|
|
15480
|
+
let wn = new Uint8Array(Ax), Hn = new DataView(wn.buffer), Tt = 0, ef = [];
|
|
15481
15481
|
function Ox(e, t) {
|
|
15482
15482
|
Tt = 0;
|
|
15483
15483
|
const n = t?.(e) ?? e;
|
|
15484
|
-
return Hx(cw, n, t),
|
|
15484
|
+
return Hx(cw, n, t), wn.slice(0, Tt);
|
|
15485
15485
|
}
|
|
15486
15486
|
function hh(e, t) {
|
|
15487
|
-
if (Tt >
|
|
15487
|
+
if (Tt > wn.length - vx && (wn = uw(wn, wn.length * 2), Hn = new DataView(wn.buffer)), e === !1 || e === !0 || e === null || e === void 0) {
|
|
15488
15488
|
kx(e);
|
|
15489
15489
|
return;
|
|
15490
15490
|
}
|
|
@@ -15515,55 +15515,55 @@ function hh(e, t) {
|
|
|
15515
15515
|
throw new lh(`Unsupported type: ${typeof e}`);
|
|
15516
15516
|
}
|
|
15517
15517
|
function Bx(e, t) {
|
|
15518
|
-
|
|
15518
|
+
Xs(xt.Array, e.length), e.forEach((n, r) => {
|
|
15519
15519
|
hh(t?.(n, r.toString()) ?? n, t);
|
|
15520
15520
|
});
|
|
15521
15521
|
}
|
|
15522
15522
|
function Nx(e, t) {
|
|
15523
|
-
ef = Object.entries(e),
|
|
15523
|
+
ef = Object.entries(e), Xs(xt.Map, ef.length), ef.forEach(([n, r]) => {
|
|
15524
15524
|
dw(n), hh(t?.(r, n) ?? r, t);
|
|
15525
15525
|
});
|
|
15526
15526
|
}
|
|
15527
|
-
function
|
|
15527
|
+
function Xs(e, t) {
|
|
15528
15528
|
if (t <= fx) {
|
|
15529
15529
|
Hn.setUint8(
|
|
15530
15530
|
Tt++,
|
|
15531
|
-
|
|
15531
|
+
io(e) | Number(t)
|
|
15532
15532
|
);
|
|
15533
15533
|
return;
|
|
15534
15534
|
}
|
|
15535
15535
|
if (t <= lx) {
|
|
15536
15536
|
Hn.setUint8(
|
|
15537
15537
|
Tt++,
|
|
15538
|
-
|
|
15538
|
+
io(e) | Ln.OneByte
|
|
15539
15539
|
), Hn.setUint8(Tt, Number(t)), Tt += 1;
|
|
15540
15540
|
return;
|
|
15541
15541
|
}
|
|
15542
15542
|
if (t <= hx) {
|
|
15543
15543
|
Hn.setUint8(
|
|
15544
15544
|
Tt++,
|
|
15545
|
-
|
|
15546
|
-
), Hn.setUint16(Tt, Number(t),
|
|
15545
|
+
io(e) | Ln.TwoBytes
|
|
15546
|
+
), Hn.setUint16(Tt, Number(t), As), Tt += 2;
|
|
15547
15547
|
return;
|
|
15548
15548
|
}
|
|
15549
15549
|
if (t <= dx) {
|
|
15550
15550
|
Hn.setUint8(
|
|
15551
15551
|
Tt++,
|
|
15552
|
-
|
|
15553
|
-
), Hn.setUint32(Tt, Number(t),
|
|
15552
|
+
io(e) | Ln.FourBytes
|
|
15553
|
+
), Hn.setUint32(Tt, Number(t), As), Tt += 4;
|
|
15554
15554
|
return;
|
|
15555
15555
|
}
|
|
15556
15556
|
if (t <= px) {
|
|
15557
15557
|
Hn.setUint8(
|
|
15558
15558
|
Tt++,
|
|
15559
|
-
|
|
15560
|
-
), Hn.setBigUint64(Tt, BigInt(t),
|
|
15559
|
+
io(e) | Ln.EightBytes
|
|
15560
|
+
), Hn.setBigUint64(Tt, BigInt(t), As), Tt += 8;
|
|
15561
15561
|
return;
|
|
15562
15562
|
}
|
|
15563
15563
|
throw new lh(`Value too large to encode: ${t}`);
|
|
15564
15564
|
}
|
|
15565
15565
|
function kx(e) {
|
|
15566
|
-
|
|
15566
|
+
Xs(xt.Simple, Px(e));
|
|
15567
15567
|
}
|
|
15568
15568
|
function Px(e) {
|
|
15569
15569
|
if (e === !1)
|
|
@@ -15577,10 +15577,10 @@ function Px(e) {
|
|
|
15577
15577
|
throw new lh(`Unrecognized simple value: ${e.toString()}`);
|
|
15578
15578
|
}
|
|
15579
15579
|
function lw(e, t) {
|
|
15580
|
-
|
|
15580
|
+
Xs(e, t.length), Tt > wn.length - t.length && (wn = uw(wn, wn.length + t.length), Hn = new DataView(wn.buffer)), wn.set(t, Tt), Tt += t.length;
|
|
15581
15581
|
}
|
|
15582
15582
|
function hw(e, t) {
|
|
15583
|
-
|
|
15583
|
+
Xs(e, t);
|
|
15584
15584
|
}
|
|
15585
15585
|
function Rx(e) {
|
|
15586
15586
|
hw(xt.UnsignedInteger, e);
|
|
@@ -15601,14 +15601,14 @@ function u0(e) {
|
|
|
15601
15601
|
lw(xt.ByteString, e);
|
|
15602
15602
|
}
|
|
15603
15603
|
function Hx(e, t, n) {
|
|
15604
|
-
|
|
15604
|
+
Xs(xt.Tag, e), hh(t, n);
|
|
15605
15605
|
}
|
|
15606
15606
|
function Fx(e) {
|
|
15607
15607
|
return typeof e == "object" && e !== null && "toCborValue" in e;
|
|
15608
15608
|
}
|
|
15609
15609
|
function tf(e) {
|
|
15610
15610
|
try {
|
|
15611
|
-
return Ox(e, (t) => Ke.isPrincipal(t) ? t.toUint8Array() :
|
|
15611
|
+
return Ox(e, (t) => Ke.isPrincipal(t) ? t.toUint8Array() : vs.isExpiry(t) ? t.toBigInt() : Fx(t) ? t.toCborValue() : t);
|
|
15612
15612
|
} catch (t) {
|
|
15613
15613
|
throw et.fromCode(new Ql(t, e));
|
|
15614
15614
|
}
|
|
@@ -15654,7 +15654,7 @@ function yw(e) {
|
|
|
15654
15654
|
function qx(e) {
|
|
15655
15655
|
return yw(e) / pw;
|
|
15656
15656
|
}
|
|
15657
|
-
class
|
|
15657
|
+
class vs {
|
|
15658
15658
|
constructor(t) {
|
|
15659
15659
|
this.__expiry__ = t, this._isExpiry = !0;
|
|
15660
15660
|
}
|
|
@@ -15669,7 +15669,7 @@ class As {
|
|
|
15669
15669
|
static fromDeltaInMilliseconds(t, n = 0) {
|
|
15670
15670
|
const r = BigInt(t), i = BigInt(Date.now()) + r + BigInt(n);
|
|
15671
15671
|
let s;
|
|
15672
|
-
return r < Lx ? s = yw(i) : s = qx(i) * pw, new
|
|
15672
|
+
return r < Lx ? s = yw(i) : s = qx(i) * pw, new vs(s * dh * Mx);
|
|
15673
15673
|
}
|
|
15674
15674
|
toBigInt() {
|
|
15675
15675
|
return this.__expiry__;
|
|
@@ -15697,14 +15697,14 @@ class As {
|
|
|
15697
15697
|
if (n[Hc])
|
|
15698
15698
|
try {
|
|
15699
15699
|
const r = BigInt(n[Hc]);
|
|
15700
|
-
return new
|
|
15700
|
+
return new vs(r);
|
|
15701
15701
|
} catch (r) {
|
|
15702
15702
|
throw new et(new Na(`Not a valid BigInt: ${r}`));
|
|
15703
15703
|
}
|
|
15704
15704
|
throw new et(new Na(`The input does not contain the key ${Hc}`));
|
|
15705
15705
|
}
|
|
15706
15706
|
static isExpiry(t) {
|
|
15707
|
-
return t instanceof
|
|
15707
|
+
return t instanceof vs || typeof t == "object" && t !== null && "_isExpiry" in t && t._isExpiry === !0 && "__expiry__" in t && typeof t.__expiry__ == "bigint";
|
|
15708
15708
|
}
|
|
15709
15709
|
}
|
|
15710
15710
|
function f0(e = cl) {
|
|
@@ -15728,7 +15728,7 @@ function Lo(e, t = "") {
|
|
|
15728
15728
|
}
|
|
15729
15729
|
return e;
|
|
15730
15730
|
}
|
|
15731
|
-
function
|
|
15731
|
+
function Is(e, t, n = "") {
|
|
15732
15732
|
const r = sc(e), i = e?.length, s = t !== void 0;
|
|
15733
15733
|
if (!r || s && i !== t) {
|
|
15734
15734
|
const o = n && `"${n}" `, c = s ? ` of length ${t}` : "", a = r ? `length=${i}` : `type=${typeof e}`;
|
|
@@ -15753,7 +15753,7 @@ function Ct(e, t) {
|
|
|
15753
15753
|
function mw(e, t) {
|
|
15754
15754
|
return Ct(e, t).reverse();
|
|
15755
15755
|
}
|
|
15756
|
-
function
|
|
15756
|
+
function on(e, t, n) {
|
|
15757
15757
|
let r;
|
|
15758
15758
|
if (typeof t == "string")
|
|
15759
15759
|
try {
|
|
@@ -15821,24 +15821,24 @@ function Do(e) {
|
|
|
15821
15821
|
};
|
|
15822
15822
|
}
|
|
15823
15823
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
15824
|
-
const
|
|
15824
|
+
const ln = BigInt(0), Mt = BigInt(1), Hi = /* @__PURE__ */ BigInt(2), Ew = /* @__PURE__ */ BigInt(3), _w = /* @__PURE__ */ BigInt(4), Sw = /* @__PURE__ */ BigInt(5), $x = /* @__PURE__ */ BigInt(7), Tw = /* @__PURE__ */ BigInt(8), jx = /* @__PURE__ */ BigInt(9), xw = /* @__PURE__ */ BigInt(16);
|
|
15825
15825
|
function mt(e, t) {
|
|
15826
15826
|
const n = e % t;
|
|
15827
|
-
return n >=
|
|
15827
|
+
return n >= ln ? n : t + n;
|
|
15828
15828
|
}
|
|
15829
15829
|
function Zn(e, t, n) {
|
|
15830
15830
|
let r = e;
|
|
15831
|
-
for (; t-- >
|
|
15831
|
+
for (; t-- > ln; )
|
|
15832
15832
|
r *= r, r %= n;
|
|
15833
15833
|
return r;
|
|
15834
15834
|
}
|
|
15835
15835
|
function d0(e, t) {
|
|
15836
|
-
if (e ===
|
|
15836
|
+
if (e === ln)
|
|
15837
15837
|
throw new Error("invert: expected non-zero number");
|
|
15838
|
-
if (t <=
|
|
15838
|
+
if (t <= ln)
|
|
15839
15839
|
throw new Error("invert: expected positive modulus, got " + t);
|
|
15840
|
-
let n = mt(e, t), r = t, i =
|
|
15841
|
-
for (; n !==
|
|
15840
|
+
let n = mt(e, t), r = t, i = ln, s = Mt;
|
|
15841
|
+
for (; n !== ln; ) {
|
|
15842
15842
|
const c = r / n, a = r % n, u = i - s * c;
|
|
15843
15843
|
r = n, n = a, i = s, s = u;
|
|
15844
15844
|
}
|
|
@@ -15872,7 +15872,7 @@ function vw(e) {
|
|
|
15872
15872
|
if (e < Ew)
|
|
15873
15873
|
throw new Error("sqrt is not defined for small field");
|
|
15874
15874
|
let t = e - Mt, n = 0;
|
|
15875
|
-
for (; t % Hi ===
|
|
15875
|
+
for (; t % Hi === ln; )
|
|
15876
15876
|
t /= Hi, n++;
|
|
15877
15877
|
let r = Hi;
|
|
15878
15878
|
const i = yi(e);
|
|
@@ -15934,14 +15934,14 @@ function Iw(e) {
|
|
|
15934
15934
|
return wc(e, n), e;
|
|
15935
15935
|
}
|
|
15936
15936
|
function mu(e, t, n) {
|
|
15937
|
-
if (n <
|
|
15937
|
+
if (n < ln)
|
|
15938
15938
|
throw new Error("invalid exponent, negatives unsupported");
|
|
15939
|
-
if (n ===
|
|
15939
|
+
if (n === ln)
|
|
15940
15940
|
return e.ONE;
|
|
15941
15941
|
if (n === Mt)
|
|
15942
15942
|
return t;
|
|
15943
15943
|
let r = e.ONE, i = t;
|
|
15944
|
-
for (; n >
|
|
15944
|
+
for (; n > ln; )
|
|
15945
15945
|
n & Mt && (r = e.mul(r, i)), i = e.sqr(i), n >>= Mt;
|
|
15946
15946
|
return r;
|
|
15947
15947
|
}
|
|
@@ -15961,7 +15961,7 @@ function Yx(e, t) {
|
|
|
15961
15961
|
return { nBitLength: n, nByteLength: r };
|
|
15962
15962
|
}
|
|
15963
15963
|
function yi(e, t, n = !1, r = {}) {
|
|
15964
|
-
if (e <=
|
|
15964
|
+
if (e <= ln)
|
|
15965
15965
|
throw new Error("invalid field: expected ORDER > 0, got " + e);
|
|
15966
15966
|
let i, s, o = !1, c;
|
|
15967
15967
|
if (typeof t == "object" && t != null) {
|
|
@@ -15981,16 +15981,16 @@ function yi(e, t, n = !1, r = {}) {
|
|
|
15981
15981
|
BITS: a,
|
|
15982
15982
|
BYTES: u,
|
|
15983
15983
|
MASK: es(a),
|
|
15984
|
-
ZERO:
|
|
15984
|
+
ZERO: ln,
|
|
15985
15985
|
ONE: Mt,
|
|
15986
15986
|
allowedLengths: c,
|
|
15987
15987
|
create: (d) => mt(d, e),
|
|
15988
15988
|
isValid: (d) => {
|
|
15989
15989
|
if (typeof d != "bigint")
|
|
15990
15990
|
throw new Error("invalid field element: expected bigint, got " + typeof d);
|
|
15991
|
-
return
|
|
15991
|
+
return ln <= d && d < e;
|
|
15992
15992
|
},
|
|
15993
|
-
is0: (d) => d ===
|
|
15993
|
+
is0: (d) => d === ln,
|
|
15994
15994
|
// is valid and invertible
|
|
15995
15995
|
isValidNot0: (d) => !l.is0(d) && l.isValid(d),
|
|
15996
15996
|
isOdd: (d) => (d & Mt) === Mt,
|
|
@@ -16050,7 +16050,7 @@ function Zx(e, t, n = !1) {
|
|
|
16050
16050
|
return n ? mw(c, i) : Ct(c, i);
|
|
16051
16051
|
}
|
|
16052
16052
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16053
|
-
const
|
|
16053
|
+
const Fs = BigInt(0), Fi = BigInt(1);
|
|
16054
16054
|
function Ca(e, t) {
|
|
16055
16055
|
const n = t.negate();
|
|
16056
16056
|
return e ? n : t;
|
|
@@ -16096,7 +16096,7 @@ function cf(e) {
|
|
|
16096
16096
|
return kw.get(e) || 1;
|
|
16097
16097
|
}
|
|
16098
16098
|
function y0(e) {
|
|
16099
|
-
if (e !==
|
|
16099
|
+
if (e !== Fs)
|
|
16100
16100
|
throw new Error("invalid wNAF");
|
|
16101
16101
|
}
|
|
16102
16102
|
class Pw {
|
|
@@ -16107,7 +16107,7 @@ class Pw {
|
|
|
16107
16107
|
// non-const time multiplication ladder
|
|
16108
16108
|
_unsafeLadder(t, n, r = this.ZERO) {
|
|
16109
16109
|
let i = t;
|
|
16110
|
-
for (; n >
|
|
16110
|
+
for (; n > Fs; )
|
|
16111
16111
|
n & Fi && (r = r.add(i)), i = i.double(), n >>= Fi;
|
|
16112
16112
|
return r;
|
|
16113
16113
|
}
|
|
@@ -16158,7 +16158,7 @@ class Pw {
|
|
|
16158
16158
|
*/
|
|
16159
16159
|
wNAFUnsafe(t, n, r, i = this.ZERO) {
|
|
16160
16160
|
const s = sf(t, this.bits);
|
|
16161
|
-
for (let o = 0; o < s.windows && r !==
|
|
16161
|
+
for (let o = 0; o < s.windows && r !== Fs; o++) {
|
|
16162
16162
|
const { nextN: c, offset: a, isZero: u, isNeg: f } = p0(r, o, s);
|
|
16163
16163
|
if (r = c, !u) {
|
|
16164
16164
|
const l = n[a];
|
|
@@ -16191,7 +16191,7 @@ class Pw {
|
|
|
16191
16191
|
}
|
|
16192
16192
|
function e3(e, t, n, r) {
|
|
16193
16193
|
let i = t, s = e.ZERO, o = e.ZERO;
|
|
16194
|
-
for (; n >
|
|
16194
|
+
for (; n > Fs || r > Fs; )
|
|
16195
16195
|
n & Fi && (s = s.add(i)), r & Fi && (o = o.add(i)), i = i.double(), n >>= Fi, r >>= Fi;
|
|
16196
16196
|
return { p1: s, p2: o };
|
|
16197
16197
|
}
|
|
@@ -16233,7 +16233,7 @@ function Uw(e, t, n = {}, r) {
|
|
|
16233
16233
|
throw new Error(`expected valid ${e} CURVE object`);
|
|
16234
16234
|
for (const a of ["p", "n", "h"]) {
|
|
16235
16235
|
const u = t[a];
|
|
16236
|
-
if (!(typeof u == "bigint" && u >
|
|
16236
|
+
if (!(typeof u == "bigint" && u > Fs))
|
|
16237
16237
|
throw new Error(`CURVE.${a} must be positive bigint`);
|
|
16238
16238
|
}
|
|
16239
16239
|
const i = g0(t.p, n.Fp, r), s = g0(t.n, n.Fn, r), c = ["Gx", "Gy", "a", e === "weierstrass" ? "b" : "d"];
|
|
@@ -16377,14 +16377,14 @@ function o3(e, t, n) {
|
|
|
16377
16377
|
throw new Error("splitScalar (endomorphism): failed, k=" + e);
|
|
16378
16378
|
return { k1neg: l, k1: u, k2neg: d, k2: f };
|
|
16379
16379
|
}
|
|
16380
|
-
const Mi = BigInt(0), Qt = BigInt(1), mr = BigInt(2),
|
|
16380
|
+
const Mi = BigInt(0), Qt = BigInt(1), mr = BigInt(2), ms = BigInt(3), al = BigInt(4);
|
|
16381
16381
|
function Ha(e, t) {
|
|
16382
16382
|
const { BYTES: n } = e;
|
|
16383
16383
|
let r;
|
|
16384
16384
|
if (typeof t == "bigint")
|
|
16385
16385
|
r = t;
|
|
16386
16386
|
else {
|
|
16387
|
-
let i =
|
|
16387
|
+
let i = on("private key", t);
|
|
16388
16388
|
try {
|
|
16389
16389
|
r = e.fromBytes(i);
|
|
16390
16390
|
} catch {
|
|
@@ -16426,7 +16426,7 @@ function c3(e, t = {}) {
|
|
|
16426
16426
|
return De(Uint8Array.of(4), F, r.toBytes($));
|
|
16427
16427
|
}
|
|
16428
16428
|
function d(K) {
|
|
16429
|
-
|
|
16429
|
+
Is(K, void 0, "Point");
|
|
16430
16430
|
const { publicKey: H, publicKeyUncompressed: D } = u, P = K.length, $ = K[0], F = K.subarray(1);
|
|
16431
16431
|
if (P === H && ($ === 2 || $ === 3)) {
|
|
16432
16432
|
const x = r.fromBytes(F);
|
|
@@ -16462,7 +16462,7 @@ function c3(e, t = {}) {
|
|
|
16462
16462
|
}
|
|
16463
16463
|
if (!E(s.Gx, s.Gy))
|
|
16464
16464
|
throw new Error("bad curve params: generator point");
|
|
16465
|
-
const S = r.mul(r.pow(s.a,
|
|
16465
|
+
const S = r.mul(r.pow(s.a, ms), al), _ = r.mul(r.sqr(s.b), BigInt(27));
|
|
16466
16466
|
if (r.is0(r.add(S, _)))
|
|
16467
16467
|
throw new Error("bad curve params: a or b");
|
|
16468
16468
|
function w(K, H, D = !1) {
|
|
@@ -16527,11 +16527,11 @@ function c3(e, t = {}) {
|
|
|
16527
16527
|
return r.is0(D) && r.is0(P) ? v.ZERO : new v(D, P, r.ONE);
|
|
16528
16528
|
}
|
|
16529
16529
|
static fromBytes(H) {
|
|
16530
|
-
const D = v.fromAffine(g(
|
|
16530
|
+
const D = v.fromAffine(g(Is(H, void 0, "point")));
|
|
16531
16531
|
return D.assertValidity(), D;
|
|
16532
16532
|
}
|
|
16533
16533
|
static fromHex(H) {
|
|
16534
|
-
return v.fromBytes(
|
|
16534
|
+
return v.fromBytes(on("pointHex", H));
|
|
16535
16535
|
}
|
|
16536
16536
|
get x() {
|
|
16537
16537
|
return this.toAffine().x;
|
|
@@ -16546,7 +16546,7 @@ function c3(e, t = {}) {
|
|
|
16546
16546
|
* @returns
|
|
16547
16547
|
*/
|
|
16548
16548
|
precompute(H = 8, D = !0) {
|
|
16549
|
-
return q.createCache(this, H), D || this.multiply(
|
|
16549
|
+
return q.createCache(this, H), D || this.multiply(ms), this;
|
|
16550
16550
|
}
|
|
16551
16551
|
// TODO: return `this`
|
|
16552
16552
|
/** A point on curve is valid if it conforms to equation. */
|
|
@@ -16574,7 +16574,7 @@ function c3(e, t = {}) {
|
|
|
16574
16574
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
16575
16575
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
16576
16576
|
double() {
|
|
16577
|
-
const { a: H, b: D } = s, P = r.mul(D,
|
|
16577
|
+
const { a: H, b: D } = s, P = r.mul(D, ms), { X: $, Y: F, Z: x } = this;
|
|
16578
16578
|
let B = r.ZERO, L = r.ZERO, N = r.ZERO, V = r.mul($, $), G = r.mul(F, F), X = r.mul(x, x), Y = r.mul($, F);
|
|
16579
16579
|
return Y = r.add(Y, Y), N = r.mul($, x), N = r.add(N, N), B = r.mul(H, N), L = r.mul(P, X), L = r.add(B, L), B = r.sub(G, L), L = r.add(G, L), L = r.mul(B, L), B = r.mul(Y, B), N = r.mul(P, N), X = r.mul(H, X), Y = r.sub(V, X), Y = r.mul(H, Y), Y = r.add(Y, N), N = r.add(V, V), V = r.add(N, V), V = r.add(V, X), V = r.mul(V, Y), L = r.add(L, V), X = r.mul(F, x), X = r.add(X, X), V = r.mul(X, Y), B = r.sub(B, V), N = r.mul(X, G), N = r.add(N, N), N = r.add(N, N), new v(B, L, N);
|
|
16580
16580
|
}
|
|
@@ -16586,7 +16586,7 @@ function c3(e, t = {}) {
|
|
|
16586
16586
|
T(H);
|
|
16587
16587
|
const { X: D, Y: P, Z: $ } = this, { X: F, Y: x, Z: B } = H;
|
|
16588
16588
|
let L = r.ZERO, N = r.ZERO, V = r.ZERO;
|
|
16589
|
-
const G = s.a, X = r.mul(s.b,
|
|
16589
|
+
const G = s.a, X = r.mul(s.b, ms);
|
|
16590
16590
|
let Y = r.mul(D, F), ce = r.mul(P, x), ue = r.mul($, B), te = r.add(D, P), Z = r.add(F, x);
|
|
16591
16591
|
te = r.mul(te, Z), Z = r.add(Y, ce), te = r.sub(te, Z), Z = r.add(D, $);
|
|
16592
16592
|
let ae = r.add(F, B);
|
|
@@ -16735,8 +16735,8 @@ function u3(e, t) {
|
|
|
16735
16735
|
}
|
|
16736
16736
|
return { isValid: O, value: _ };
|
|
16737
16737
|
};
|
|
16738
|
-
if (e.ORDER % al ===
|
|
16739
|
-
const g = (e.ORDER -
|
|
16738
|
+
if (e.ORDER % al === ms) {
|
|
16739
|
+
const g = (e.ORDER - ms) / al, m = e.sqrt(e.neg(t));
|
|
16740
16740
|
y = (E, S) => {
|
|
16741
16741
|
let _ = e.sqr(S);
|
|
16742
16742
|
const w = e.mul(E, S);
|
|
@@ -16832,11 +16832,11 @@ function d3(e, t) {
|
|
|
16832
16832
|
});
|
|
16833
16833
|
}
|
|
16834
16834
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16835
|
-
const p3 = BigInt(0), Fc = BigInt(1), E0 = BigInt(2),
|
|
16835
|
+
const p3 = BigInt(0), Fc = BigInt(1), E0 = BigInt(2), ws = BigInt(3);
|
|
16836
16836
|
function y3(e) {
|
|
16837
16837
|
const t = [];
|
|
16838
16838
|
for (; e > Fc; e >>= Fc)
|
|
16839
|
-
(e & Fc) === p3 ? t.unshift(0) : (e &
|
|
16839
|
+
(e & Fc) === p3 ? t.unshift(0) : (e & ws) === ws ? (t.unshift(-1), e += Fc) : t.unshift(1);
|
|
16840
16840
|
return t;
|
|
16841
16841
|
}
|
|
16842
16842
|
function uf(e) {
|
|
@@ -16854,8 +16854,8 @@ function g3(e, t, n, r) {
|
|
|
16854
16854
|
throw new Error("bls: unknown twist type");
|
|
16855
16855
|
const l = i.div(i.ONE, i.mul(i.ONE, E0));
|
|
16856
16856
|
function d(w, T, O, A) {
|
|
16857
|
-
const R = i.sqr(O), M = i.sqr(A), v = i.mulByB(i.mul(M,
|
|
16858
|
-
return w.push([K, H, D]), T = i.mul(i.mul(i.mul(i.sub(R, U), T), O), l), O = i.sub(i.sqr(i.mul(i.add(R, U), l)), i.mul(i.sqr(v),
|
|
16857
|
+
const R = i.sqr(O), M = i.sqr(A), v = i.mulByB(i.mul(M, ws)), U = i.mul(v, ws), q = i.sub(i.sub(i.sqr(i.add(O, A)), M), R), K = i.sub(v, R), H = i.mul(i.sqr(T), ws), D = i.neg(q);
|
|
16858
|
+
return w.push([K, H, D]), T = i.mul(i.mul(i.mul(i.sub(R, U), T), O), l), O = i.sub(i.sqr(i.mul(i.add(R, U), l)), i.mul(i.sqr(v), ws)), A = i.mul(R, q), { Rx: T, Ry: O, Rz: A };
|
|
16859
16859
|
}
|
|
16860
16860
|
function y(w, T, O, A, R, M) {
|
|
16861
16861
|
const v = i.sub(O, i.mul(M, A)), U = i.sub(T, i.mul(R, A)), q = i.sub(i.mul(v, R), i.mul(U, M)), K = i.neg(v), H = U;
|
|
@@ -17015,10 +17015,10 @@ function m3(e) {
|
|
|
17015
17015
|
calcPairingPrecomputes: g
|
|
17016
17016
|
}, { ShortSignature: T } = e.G1, { Signature: O } = e.G2;
|
|
17017
17017
|
function A(x, B) {
|
|
17018
|
-
return x instanceof c.Point ? x : E.hash(
|
|
17018
|
+
return x instanceof c.Point ? x : E.hash(on("point", x), B?.DST);
|
|
17019
17019
|
}
|
|
17020
17020
|
function R(x, B) {
|
|
17021
|
-
return x instanceof u.Point ? x : m.hash(
|
|
17021
|
+
return x instanceof u.Point ? x : m.hash(on("point", x), B?.DST);
|
|
17022
17022
|
}
|
|
17023
17023
|
function M(x) {
|
|
17024
17024
|
return m.getPublicKey(x).toBytes(!0);
|
|
@@ -17703,7 +17703,7 @@ const Kt = BigInt(0), Fa = BigInt(1), kn = BigInt(2), wu = BigInt(3), jo = BigIn
|
|
|
17703
17703
|
m: 2,
|
|
17704
17704
|
k: 128,
|
|
17705
17705
|
expand: "xmd",
|
|
17706
|
-
hash:
|
|
17706
|
+
hash: En
|
|
17707
17707
|
}), mh = {
|
|
17708
17708
|
p: Re.ORDER,
|
|
17709
17709
|
n: Xi.n,
|
|
@@ -17773,7 +17773,7 @@ function O3(e) {
|
|
|
17773
17773
|
throw new Error("invalid G1 point: expected 48/96 bytes");
|
|
17774
17774
|
}
|
|
17775
17775
|
function v0(e) {
|
|
17776
|
-
const { infinity: t, sort: n, value: r } = Eu(
|
|
17776
|
+
const { infinity: t, sort: n, value: r } = Eu(on("signatureHex", e, 48)), i = Ee.ORDER, s = _u.G1.Point, o = ir(r);
|
|
17777
17777
|
if (t)
|
|
17778
17778
|
return s.ZERO;
|
|
17779
17779
|
const c = Ee.create(o & es(Ee.BITS)), a = Ee.add(Ee.pow(c, wu), Ee.create(Xi.b));
|
|
@@ -17836,7 +17836,7 @@ function N3(e) {
|
|
|
17836
17836
|
throw new Error("invalid G2 point: expected 96/192 bytes");
|
|
17837
17837
|
}
|
|
17838
17838
|
function I0(e) {
|
|
17839
|
-
const { ORDER: t } = Ee, { infinity: n, sort: r, value: i } = Eu(
|
|
17839
|
+
const { ORDER: t } = Ee, { infinity: n, sort: r, value: i } = Eu(on("signatureHex", e)), s = _u.G2.Point, o = i.length / 2;
|
|
17840
17840
|
if (o !== 48 && o !== 96)
|
|
17841
17841
|
throw new Error("invalid compressed signature length, expected 96/192 bytes");
|
|
17842
17842
|
const c = ir(i.slice(0, o)), a = ir(i.slice(o));
|
|
@@ -18116,7 +18116,7 @@ function F3(e, t, n) {
|
|
|
18116
18116
|
const r = typeof e == "string" ? e : nt(e), i = typeof t == "string" ? t : nt(t), s = typeof n == "string" ? n : nt(n);
|
|
18117
18117
|
return _u.verifyShortSignature(i, s, r);
|
|
18118
18118
|
}
|
|
18119
|
-
const M3 = BigInt(1e6), Mw = (e) => Nt(new
|
|
18119
|
+
const M3 = BigInt(1e6), Mw = (e) => Nt(new $s(e)), wh = (e) => {
|
|
18120
18120
|
const n = Mw(e) / M3;
|
|
18121
18121
|
return new Date(Number(n));
|
|
18122
18122
|
}, O0 = 60 * 1e3, L3 = 60, q3 = 24, V3 = q3 * L3, D3 = 5, $3 = 5, j3 = 30 * V3;
|
|
@@ -18165,9 +18165,9 @@ class Vi {
|
|
|
18165
18165
|
return bh(t, this.cert.tree);
|
|
18166
18166
|
}
|
|
18167
18167
|
async verify() {
|
|
18168
|
-
const t = await ia(this.cert.tree), n = await this._checkDelegationAndGetKey(this.cert.delegation), r = this.cert.signature, i = W3(n), s = De(
|
|
18168
|
+
const t = await ia(this.cert.tree), n = await this._checkDelegationAndGetKey(this.cert.delegation), r = this.cert.signature, i = W3(n), s = De(Eo("ic-state-root"), t), o = _n(this.lookup_path(["time"]));
|
|
18169
18169
|
if (!o)
|
|
18170
|
-
throw yt.fromCode(new
|
|
18170
|
+
throw yt.fromCode(new Ts("Certificate does not contain a time"));
|
|
18171
18171
|
if (!this.#t) {
|
|
18172
18172
|
const c = this.#e?.getTimeDiffMsecs() ?? 0, a = this._maxAgeInMinutes * O0, u = /* @__PURE__ */ new Date(), f = u.getTime() + c, l = f - a, d = f + $3 * O0, y = wh(o), g = y.getTime() < l, m = y.getTime() > d;
|
|
18173
18173
|
if ((g || m) && this.#e && !this.#e.hasSyncedTime())
|
|
@@ -18175,13 +18175,13 @@ class Vi {
|
|
|
18175
18175
|
if (g)
|
|
18176
18176
|
throw An.fromCode(new Co(this._maxAgeInMinutes, y, u, c, "past"));
|
|
18177
18177
|
if (m)
|
|
18178
|
-
throw this.#e?.hasSyncedTime() ?
|
|
18178
|
+
throw this.#e?.hasSyncedTime() ? un.fromCode(new qn("System time has been synced with the IC network, but certificate is still too far in the future.")) : An.fromCode(new Co(5, y, u, c, "future"));
|
|
18179
18179
|
}
|
|
18180
18180
|
try {
|
|
18181
18181
|
if (!await this._blsVerify(i, r, s))
|
|
18182
|
-
throw An.fromCode(new
|
|
18182
|
+
throw An.fromCode(new Ts("Invalid signature"));
|
|
18183
18183
|
} catch (c) {
|
|
18184
|
-
throw An.fromCode(new
|
|
18184
|
+
throw An.fromCode(new Ts("Signature verification failed", c));
|
|
18185
18185
|
}
|
|
18186
18186
|
}
|
|
18187
18187
|
async _checkDelegationAndGetKey(t) {
|
|
@@ -18206,43 +18206,43 @@ class Vi {
|
|
|
18206
18206
|
tree: n.cert.tree
|
|
18207
18207
|
}))
|
|
18208
18208
|
throw An.fromCode(new lu(this._canisterId, i));
|
|
18209
|
-
const o =
|
|
18209
|
+
const o = _n(n.lookup_path(["subnet", r, "public_key"]));
|
|
18210
18210
|
if (!o)
|
|
18211
18211
|
throw An.fromCode(new zl(`Could not find subnet key for subnet ID ${i.toText()}`));
|
|
18212
18212
|
return o;
|
|
18213
18213
|
}
|
|
18214
18214
|
}
|
|
18215
|
-
const
|
|
18215
|
+
const so = oc("308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100"), G3 = 96;
|
|
18216
18216
|
function W3(e) {
|
|
18217
|
-
const t =
|
|
18217
|
+
const t = so.byteLength + G3;
|
|
18218
18218
|
if (e.byteLength !== t)
|
|
18219
18219
|
throw yt.fromCode(new du(t, e.byteLength));
|
|
18220
|
-
const n = e.slice(0,
|
|
18221
|
-
if (!gu(n,
|
|
18222
|
-
throw yt.fromCode(new Yl(
|
|
18223
|
-
return e.slice(
|
|
18220
|
+
const n = e.slice(0, so.byteLength);
|
|
18221
|
+
if (!gu(n, so))
|
|
18222
|
+
throw yt.fromCode(new Yl(so, n));
|
|
18223
|
+
return e.slice(so.byteLength);
|
|
18224
18224
|
}
|
|
18225
|
-
function
|
|
18225
|
+
function _n(e) {
|
|
18226
18226
|
if (e.status === vn.Found && e.value instanceof Uint8Array)
|
|
18227
18227
|
return e.value;
|
|
18228
18228
|
}
|
|
18229
18229
|
async function ia(e) {
|
|
18230
18230
|
switch (e[0]) {
|
|
18231
18231
|
case Ht.Empty:
|
|
18232
|
-
return
|
|
18232
|
+
return En(Eo("ic-hashtree-empty"));
|
|
18233
18233
|
case Ht.Pruned:
|
|
18234
18234
|
return e[1];
|
|
18235
18235
|
case Ht.Leaf:
|
|
18236
|
-
return
|
|
18236
|
+
return En(De(Eo("ic-hashtree-leaf"), e[1]));
|
|
18237
18237
|
case Ht.Labeled:
|
|
18238
|
-
return
|
|
18238
|
+
return En(De(Eo("ic-hashtree-labeled"), e[1], await ia(e[2])));
|
|
18239
18239
|
case Ht.Fork:
|
|
18240
|
-
return
|
|
18240
|
+
return En(De(Eo("ic-hashtree-fork"), await ia(e[1]), await ia(e[2])));
|
|
18241
18241
|
default:
|
|
18242
|
-
throw
|
|
18242
|
+
throw xs;
|
|
18243
18243
|
}
|
|
18244
18244
|
}
|
|
18245
|
-
function
|
|
18245
|
+
function Eo(e) {
|
|
18246
18246
|
const t = new Uint8Array([e.length]), n = new TextEncoder().encode(e);
|
|
18247
18247
|
return De(t, n);
|
|
18248
18248
|
}
|
|
@@ -18253,10 +18253,10 @@ var vn;
|
|
|
18253
18253
|
(function(e) {
|
|
18254
18254
|
e.Unknown = "Unknown", e.Absent = "Absent", e.Found = "Found", e.Error = "Error";
|
|
18255
18255
|
})(vn || (vn = {}));
|
|
18256
|
-
var
|
|
18256
|
+
var Os;
|
|
18257
18257
|
(function(e) {
|
|
18258
18258
|
e.Absent = "Absent", e.Unknown = "Unknown", e.Found = "Found";
|
|
18259
|
-
})(
|
|
18259
|
+
})(Os || (Os = {}));
|
|
18260
18260
|
var st;
|
|
18261
18261
|
(function(e) {
|
|
18262
18262
|
e.Absent = "Absent", e.Unknown = "Unknown", e.Found = "Found", e.Less = "Less", e.Greater = "Greater";
|
|
@@ -18270,13 +18270,13 @@ function Ec(e, t) {
|
|
|
18270
18270
|
};
|
|
18271
18271
|
case Ht.Leaf: {
|
|
18272
18272
|
if (!t[1])
|
|
18273
|
-
throw
|
|
18273
|
+
throw un.fromCode(new gc("Invalid tree structure for leaf"));
|
|
18274
18274
|
if (t[1] instanceof Uint8Array)
|
|
18275
18275
|
return {
|
|
18276
18276
|
status: vn.Found,
|
|
18277
18277
|
value: t[1].slice(t[1].byteOffset, t[1].byteLength + t[1].byteOffset)
|
|
18278
18278
|
};
|
|
18279
|
-
throw
|
|
18279
|
+
throw xs;
|
|
18280
18280
|
}
|
|
18281
18281
|
case Ht.Pruned:
|
|
18282
18282
|
return {
|
|
@@ -18288,7 +18288,7 @@ function Ec(e, t) {
|
|
|
18288
18288
|
status: vn.Error
|
|
18289
18289
|
};
|
|
18290
18290
|
default:
|
|
18291
|
-
throw
|
|
18291
|
+
throw xs;
|
|
18292
18292
|
}
|
|
18293
18293
|
const n = Lw(e), r = Ao(n, t);
|
|
18294
18294
|
switch (r.status) {
|
|
@@ -18305,13 +18305,13 @@ function Ec(e, t) {
|
|
|
18305
18305
|
status: vn.Unknown
|
|
18306
18306
|
};
|
|
18307
18307
|
default:
|
|
18308
|
-
throw
|
|
18308
|
+
throw xs;
|
|
18309
18309
|
}
|
|
18310
18310
|
}
|
|
18311
18311
|
function bh(e, t) {
|
|
18312
18312
|
if (e.length === 0)
|
|
18313
18313
|
return {
|
|
18314
|
-
status:
|
|
18314
|
+
status: Os.Found,
|
|
18315
18315
|
value: t
|
|
18316
18316
|
};
|
|
18317
18317
|
const n = Lw(e), r = Ao(n, t);
|
|
@@ -18320,16 +18320,16 @@ function bh(e, t) {
|
|
|
18320
18320
|
return bh(e.slice(1), r.value);
|
|
18321
18321
|
case st.Unknown:
|
|
18322
18322
|
return {
|
|
18323
|
-
status:
|
|
18323
|
+
status: Os.Unknown
|
|
18324
18324
|
};
|
|
18325
18325
|
case st.Absent:
|
|
18326
18326
|
case st.Greater:
|
|
18327
18327
|
case st.Less:
|
|
18328
18328
|
return {
|
|
18329
|
-
status:
|
|
18329
|
+
status: Os.Absent
|
|
18330
18330
|
};
|
|
18331
18331
|
default:
|
|
18332
|
-
throw
|
|
18332
|
+
throw xs;
|
|
18333
18333
|
}
|
|
18334
18334
|
}
|
|
18335
18335
|
function ul(e) {
|
|
@@ -18400,7 +18400,7 @@ function Ao(e, t) {
|
|
|
18400
18400
|
function qw(e) {
|
|
18401
18401
|
const { canisterId: t, subnetId: n, tree: r } = e, i = Ec(["subnet", n.toUint8Array(), "canister_ranges"], r);
|
|
18402
18402
|
if (i.status !== vn.Found)
|
|
18403
|
-
throw yt.fromCode(new
|
|
18403
|
+
throw yt.fromCode(new Hs(`Could not find canister ranges for subnet ${n.toText()}`, i.status));
|
|
18404
18404
|
if (!(i.value instanceof Uint8Array))
|
|
18405
18405
|
throw yt.fromCode(new hu(`Could not find canister ranges for subnet ${n.toText()}`));
|
|
18406
18406
|
return tr(i.value).map((a) => [
|
|
@@ -18414,7 +18414,7 @@ const B0 = async (e) => {
|
|
|
18414
18414
|
return (async () => {
|
|
18415
18415
|
try {
|
|
18416
18416
|
if (t.rootKey === null)
|
|
18417
|
-
throw
|
|
18417
|
+
throw an.fromCode(new Gs());
|
|
18418
18418
|
const l = t.rootKey, d = await t.readState(i, {
|
|
18419
18419
|
paths: [f]
|
|
18420
18420
|
}), y = await Vi.create({
|
|
@@ -18433,7 +18433,7 @@ const B0 = async (e) => {
|
|
|
18433
18433
|
} else
|
|
18434
18434
|
return {
|
|
18435
18435
|
path: _,
|
|
18436
|
-
data:
|
|
18436
|
+
data: _n(S.lookup_path(f))
|
|
18437
18437
|
};
|
|
18438
18438
|
}, { path: m, data: E } = g(y, s[u]);
|
|
18439
18439
|
if (!E)
|
|
@@ -18483,7 +18483,7 @@ const B0 = async (e) => {
|
|
|
18483
18483
|
}
|
|
18484
18484
|
}
|
|
18485
18485
|
} catch (l) {
|
|
18486
|
-
if (l instanceof _r && (l.hasCode(
|
|
18486
|
+
if (l instanceof _r && (l.hasCode(Ts) || l.hasCode(Co)))
|
|
18487
18487
|
throw l;
|
|
18488
18488
|
typeof a != "string" && "key" in a && "path" in a ? o.set(a.key, null) : o.set(a, null), console.group(), console.warn(`Expected to find result for path ${a}, but instead found nothing.`), console.warn(l), console.groupEnd();
|
|
18489
18489
|
}
|
|
@@ -18504,15 +18504,15 @@ const B0 = async (e) => {
|
|
|
18504
18504
|
}), !qw({ canisterId: t, subnetId: o, tree: i }))
|
|
18505
18505
|
throw An.fromCode(new lu(t, o));
|
|
18506
18506
|
const a = bh(["subnet", s.subnet_id, "node"], i);
|
|
18507
|
-
if (a.status !==
|
|
18508
|
-
throw yt.fromCode(new
|
|
18507
|
+
if (a.status !== Os.Found)
|
|
18508
|
+
throw yt.fromCode(new Hs("Node not found", a.status));
|
|
18509
18509
|
if (a.value instanceof Uint8Array)
|
|
18510
|
-
throw
|
|
18510
|
+
throw un.fromCode(new gc("Invalid node tree"));
|
|
18511
18511
|
const u = ul(a.value), f = /* @__PURE__ */ new Map();
|
|
18512
18512
|
return u.forEach((l) => {
|
|
18513
18513
|
const d = Ke.from(l[1]).toText(), y = Ec(["public_key"], l[2]);
|
|
18514
18514
|
if (y.status !== vn.Found)
|
|
18515
|
-
throw yt.fromCode(new
|
|
18515
|
+
throw yt.fromCode(new Hs("Public key not found", y.status));
|
|
18516
18516
|
const g = y.value;
|
|
18517
18517
|
if (g.byteLength !== 44)
|
|
18518
18518
|
throw yt.fromCode(new du(44, g.byteLength));
|
|
@@ -18547,7 +18547,7 @@ const B0 = async (e) => {
|
|
|
18547
18547
|
} else
|
|
18548
18548
|
return e.path;
|
|
18549
18549
|
}
|
|
18550
|
-
throw
|
|
18550
|
+
throw un.fromCode(new qn(`Error while encoding your path for canister status. Please ensure that your path ${e} was formatted correctly.`));
|
|
18551
18551
|
}, Y3 = (e) => tr(e).map((n) => Ke.fromUint8Array(n));
|
|
18552
18552
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
18553
18553
|
const Dr = BigInt(0), Bt = BigInt(1), df = BigInt(2), Z3 = BigInt(8);
|
|
@@ -18614,7 +18614,7 @@ function Q3(e, t = {}) {
|
|
|
18614
18614
|
// Uses algo from RFC8032 5.1.3.
|
|
18615
18615
|
static fromBytes(S, _ = !1) {
|
|
18616
18616
|
const w = r.BYTES, { a: T, d: O } = s;
|
|
18617
|
-
S = l0(
|
|
18617
|
+
S = l0(Is(S, w, "point")), Lo(_, "zip215");
|
|
18618
18618
|
const A = l0(S), R = S[w - 1];
|
|
18619
18619
|
A[w - 1] = R & -129;
|
|
18620
18620
|
const M = qo(A), v = _ ? c : r.ORDER;
|
|
@@ -18629,7 +18629,7 @@ function Q3(e, t = {}) {
|
|
|
18629
18629
|
return $ !== P && (D = a(-D)), g.fromAffine({ x: D, y: M });
|
|
18630
18630
|
}
|
|
18631
18631
|
static fromHex(S, _ = !1) {
|
|
18632
|
-
return g.fromBytes(
|
|
18632
|
+
return g.fromBytes(on("point", S), _);
|
|
18633
18633
|
}
|
|
18634
18634
|
get x() {
|
|
18635
18635
|
return this.toAffine().x;
|
|
@@ -18771,8 +18771,8 @@ function e8(e, t, n = {}) {
|
|
|
18771
18771
|
}
|
|
18772
18772
|
function l(v) {
|
|
18773
18773
|
const U = w.secretKey;
|
|
18774
|
-
v =
|
|
18775
|
-
const q =
|
|
18774
|
+
v = on("private key", v, U);
|
|
18775
|
+
const q = on("hashed private key", t(v), 2 * U), K = a(q.slice(0, U)), H = q.slice(U, 2 * U), D = f(K);
|
|
18776
18776
|
return { head: K, prefix: H, scalar: D };
|
|
18777
18777
|
}
|
|
18778
18778
|
function d(v) {
|
|
@@ -18784,20 +18784,20 @@ function e8(e, t, n = {}) {
|
|
|
18784
18784
|
}
|
|
18785
18785
|
function g(v = Uint8Array.of(), ...U) {
|
|
18786
18786
|
const q = De(...U);
|
|
18787
|
-
return f(t(u(q,
|
|
18787
|
+
return f(t(u(q, on("context", v), !!r)));
|
|
18788
18788
|
}
|
|
18789
18789
|
function m(v, U, q = {}) {
|
|
18790
|
-
v =
|
|
18790
|
+
v = on("message", v), r && (v = r(v));
|
|
18791
18791
|
const { prefix: K, scalar: H, pointBytes: D } = d(U), P = g(q.context, K, v), $ = i.multiply(P).toBytes(), F = g(q.context, $, D, v), x = o.create(P + F * H);
|
|
18792
18792
|
if (!o.isValid(x))
|
|
18793
18793
|
throw new Error("sign failed: invalid s");
|
|
18794
18794
|
const B = De($, o.toBytes(x));
|
|
18795
|
-
return
|
|
18795
|
+
return Is(B, w.signature, "result");
|
|
18796
18796
|
}
|
|
18797
18797
|
const E = { zip215: !0 };
|
|
18798
18798
|
function S(v, U, q, K = E) {
|
|
18799
18799
|
const { context: H, zip215: D } = K, P = w.signature;
|
|
18800
|
-
v =
|
|
18800
|
+
v = on("signature", v, P), U = on("message", U), q = on("publicKey", q, w.publicKey), D !== void 0 && Lo(D, "zip215"), r && (U = r(U));
|
|
18801
18801
|
const $ = P / 2, F = v.subarray(0, $), x = qo(v.subarray($, P));
|
|
18802
18802
|
let B, L, N;
|
|
18803
18803
|
try {
|
|
@@ -18817,7 +18817,7 @@ function e8(e, t, n = {}) {
|
|
|
18817
18817
|
seed: _
|
|
18818
18818
|
};
|
|
18819
18819
|
function T(v = c(w.seed)) {
|
|
18820
|
-
return
|
|
18820
|
+
return Is(v, w.seed, "seed");
|
|
18821
18821
|
}
|
|
18822
18822
|
function O(v) {
|
|
18823
18823
|
const U = M.randomSecretKey(v);
|
|
@@ -18856,7 +18856,7 @@ function e8(e, t, n = {}) {
|
|
|
18856
18856
|
},
|
|
18857
18857
|
toMontgomerySecret(v) {
|
|
18858
18858
|
const U = w.secretKey;
|
|
18859
|
-
|
|
18859
|
+
Is(v, U);
|
|
18860
18860
|
const q = t(v.subarray(0, U));
|
|
18861
18861
|
return a(q).subarray(0, U);
|
|
18862
18862
|
},
|
|
@@ -18944,7 +18944,7 @@ const f8 = yi(Vw.p, { isLE: !0 }), l8 = {
|
|
|
18944
18944
|
// Constant-time, u/√v
|
|
18945
18945
|
uvRatio: u8
|
|
18946
18946
|
}, h8 = r8(l8);
|
|
18947
|
-
var P0, R0, Rt,
|
|
18947
|
+
var P0, R0, Rt, Ns;
|
|
18948
18948
|
class d8 {
|
|
18949
18949
|
/**
|
|
18950
18950
|
* Create a new ExpirableMap.
|
|
@@ -18954,11 +18954,11 @@ class d8 {
|
|
|
18954
18954
|
*/
|
|
18955
18955
|
constructor(t = {}) {
|
|
18956
18956
|
// Internals
|
|
18957
|
-
|
|
18958
|
-
|
|
18957
|
+
sn(this, Rt);
|
|
18958
|
+
sn(this, Ns);
|
|
18959
18959
|
this[P0] = this.entries.bind(this), this[R0] = "ExpirableMap";
|
|
18960
18960
|
const { source: n = [], expirationTime: r = 600 * 1e3 } = t, i = Date.now();
|
|
18961
|
-
Yt(this, Rt, new Map([...n].map(([s, o]) => [s, { value: o, timestamp: i }]))), Yt(this,
|
|
18961
|
+
Yt(this, Rt, new Map([...n].map(([s, o]) => [s, { value: o, timestamp: i }]))), Yt(this, Ns, r);
|
|
18962
18962
|
}
|
|
18963
18963
|
/**
|
|
18964
18964
|
* Prune removes all expired entries.
|
|
@@ -18966,7 +18966,7 @@ class d8 {
|
|
|
18966
18966
|
prune() {
|
|
18967
18967
|
const t = Date.now();
|
|
18968
18968
|
for (const [n, r] of Fe(this, Rt).entries())
|
|
18969
|
-
t - r.timestamp > Fe(this,
|
|
18969
|
+
t - r.timestamp > Fe(this, Ns) && Fe(this, Rt).delete(n);
|
|
18970
18970
|
return this;
|
|
18971
18971
|
}
|
|
18972
18972
|
// Implementing the Map interface
|
|
@@ -18992,7 +18992,7 @@ class d8 {
|
|
|
18992
18992
|
get(t) {
|
|
18993
18993
|
const n = Fe(this, Rt).get(t);
|
|
18994
18994
|
if (n !== void 0) {
|
|
18995
|
-
if (Date.now() - n.timestamp > Fe(this,
|
|
18995
|
+
if (Date.now() - n.timestamp > Fe(this, Ns)) {
|
|
18996
18996
|
Fe(this, Rt).delete(t);
|
|
18997
18997
|
return;
|
|
18998
18998
|
}
|
|
@@ -19067,7 +19067,7 @@ class d8 {
|
|
|
19067
19067
|
return Fe(this, Rt).size;
|
|
19068
19068
|
}
|
|
19069
19069
|
}
|
|
19070
|
-
Rt = new WeakMap(),
|
|
19070
|
+
Rt = new WeakMap(), Ns = new WeakMap(), P0 = Symbol.iterator, R0 = Symbol.toStringTag;
|
|
19071
19071
|
const U0 = (e) => {
|
|
19072
19072
|
if (e <= 127)
|
|
19073
19073
|
return 1;
|
|
@@ -19219,8 +19219,8 @@ var Wo, Xo;
|
|
|
19219
19219
|
const Ri = class Ri {
|
|
19220
19220
|
// `fromRaw` and `fromDer` should be used for instantiation, not this constructor.
|
|
19221
19221
|
constructor(t) {
|
|
19222
|
-
|
|
19223
|
-
|
|
19222
|
+
sn(this, Wo);
|
|
19223
|
+
sn(this, Xo);
|
|
19224
19224
|
if (t.byteLength !== Ri.RAW_KEY_LENGTH)
|
|
19225
19225
|
throw et.fromCode(new Rr("An Ed25519 public key must be exactly 32 bytes long"));
|
|
19226
19226
|
Yt(this, Wo, t), Yt(this, Xo, Ri.derEncode(t));
|
|
@@ -19287,18 +19287,18 @@ class w8 extends m8 {
|
|
|
19287
19287
|
}
|
|
19288
19288
|
}
|
|
19289
19289
|
const F0 = 0.5, M0 = 1.5, L0 = 500, q0 = 6e4, V0 = 9e5, D0 = 10;
|
|
19290
|
-
var Fn, zo, Yo, Zo, Jo, Qo, ec, tc,
|
|
19290
|
+
var Fn, zo, Yo, Zo, Jo, Qo, ec, tc, ks;
|
|
19291
19291
|
const $a = class $a {
|
|
19292
19292
|
constructor(t = $a.default) {
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19293
|
+
sn(this, Fn);
|
|
19294
|
+
sn(this, zo);
|
|
19295
|
+
sn(this, Yo);
|
|
19296
|
+
sn(this, Zo);
|
|
19297
|
+
sn(this, Jo);
|
|
19298
|
+
sn(this, Qo);
|
|
19299
|
+
sn(this, ec);
|
|
19300
|
+
sn(this, tc);
|
|
19301
|
+
sn(this, ks, 0);
|
|
19302
19302
|
const { initialInterval: n = L0, randomizationFactor: r = F0, multiplier: i = M0, maxInterval: s = q0, maxElapsedTime: o = V0, maxIterations: c = D0, date: a = Date } = t;
|
|
19303
19303
|
Yt(this, Fn, n), Yt(this, zo, r), Yt(this, Yo, i), Yt(this, Zo, s), Yt(this, tc, a), Yt(this, Jo, a.now()), Yt(this, Qo, o), Yt(this, ec, c);
|
|
19304
19304
|
}
|
|
@@ -19309,20 +19309,20 @@ const $a = class $a {
|
|
|
19309
19309
|
return Fe(this, Fn);
|
|
19310
19310
|
}
|
|
19311
19311
|
get count() {
|
|
19312
|
-
return Fe(this,
|
|
19312
|
+
return Fe(this, ks);
|
|
19313
19313
|
}
|
|
19314
19314
|
get randomValueFromInterval() {
|
|
19315
19315
|
const t = Fe(this, zo) * Fe(this, Fn), n = Fe(this, Fn) - t, r = Fe(this, Fn) + t;
|
|
19316
19316
|
return Math.random() * (r - n) + n;
|
|
19317
19317
|
}
|
|
19318
19318
|
incrementCurrentInterval() {
|
|
19319
|
-
return Yt(this, Fn, Math.min(Fe(this, Fn) * Fe(this, Yo), Fe(this, Zo))), qh(this,
|
|
19319
|
+
return Yt(this, Fn, Math.min(Fe(this, Fn) * Fe(this, Yo), Fe(this, Zo))), qh(this, ks)._++, Fe(this, Fn);
|
|
19320
19320
|
}
|
|
19321
19321
|
next() {
|
|
19322
|
-
return this.ellapsedTimeInMsec >= Fe(this, Qo) || Fe(this,
|
|
19322
|
+
return this.ellapsedTimeInMsec >= Fe(this, Qo) || Fe(this, ks) >= Fe(this, ec) ? null : (this.incrementCurrentInterval(), this.randomValueFromInterval);
|
|
19323
19323
|
}
|
|
19324
19324
|
};
|
|
19325
|
-
Fn = new WeakMap(), zo = new WeakMap(), Yo = new WeakMap(), Zo = new WeakMap(), Jo = new WeakMap(), Qo = new WeakMap(), ec = new WeakMap(), tc = new WeakMap(),
|
|
19325
|
+
Fn = new WeakMap(), zo = new WeakMap(), Yo = new WeakMap(), Zo = new WeakMap(), Jo = new WeakMap(), Qo = new WeakMap(), ec = new WeakMap(), tc = new WeakMap(), ks = new WeakMap(), $a.default = {
|
|
19326
19326
|
initialInterval: L0,
|
|
19327
19327
|
randomizationFactor: F0,
|
|
19328
19328
|
multiplier: M0,
|
|
@@ -19344,16 +19344,16 @@ function N8() {
|
|
|
19344
19344
|
if (window.fetch)
|
|
19345
19345
|
e = window.fetch.bind(window);
|
|
19346
19346
|
else
|
|
19347
|
-
throw
|
|
19347
|
+
throw an.fromCode(new xo("Fetch implementation was not available. You appear to be in a browser context, but window.fetch was not present."));
|
|
19348
19348
|
else if (typeof globalThis < "u")
|
|
19349
19349
|
if (globalThis.fetch)
|
|
19350
19350
|
e = globalThis.fetch.bind(globalThis);
|
|
19351
19351
|
else
|
|
19352
|
-
throw
|
|
19352
|
+
throw an.fromCode(new xo("Fetch implementation was not available. You appear to be in a Node.js context, but global.fetch was not available."));
|
|
19353
19353
|
else typeof self < "u" && self.fetch && (e = self.fetch.bind(self));
|
|
19354
19354
|
if (e)
|
|
19355
19355
|
return e;
|
|
19356
|
-
throw
|
|
19356
|
+
throw an.fromCode(new xo("Fetch implementation was not available. Please provide fetch to the HttpAgent constructor, or ensure it is available in the window or global context."));
|
|
19357
19357
|
}
|
|
19358
19358
|
function k8(e) {
|
|
19359
19359
|
let t;
|
|
@@ -19403,7 +19403,7 @@ class vr {
|
|
|
19403
19403
|
for (const u of c) {
|
|
19404
19404
|
const { timestamp: f, identity: l } = u, d = Ke.fromUint8Array(l).toText();
|
|
19405
19405
|
let y;
|
|
19406
|
-
if (o ===
|
|
19406
|
+
if (o === Cs.Replied) {
|
|
19407
19407
|
const { reply: _ } = i;
|
|
19408
19408
|
y = Pa({
|
|
19409
19409
|
status: o,
|
|
@@ -19411,7 +19411,7 @@ class vr {
|
|
|
19411
19411
|
timestamp: BigInt(f),
|
|
19412
19412
|
request_id: a
|
|
19413
19413
|
});
|
|
19414
|
-
} else if (o ===
|
|
19414
|
+
} else if (o === Cs.Rejected) {
|
|
19415
19415
|
const { reject_code: _, reject_message: w, error_code: T } = i;
|
|
19416
19416
|
y = Pa({
|
|
19417
19417
|
status: o,
|
|
@@ -19422,7 +19422,7 @@ class vr {
|
|
|
19422
19422
|
request_id: a
|
|
19423
19423
|
});
|
|
19424
19424
|
} else
|
|
19425
|
-
throw
|
|
19425
|
+
throw un.fromCode(new qn(`Unknown status: ${o}`));
|
|
19426
19426
|
const g = De(ux, y), m = s.nodeKeys.get(d);
|
|
19427
19427
|
if (!m)
|
|
19428
19428
|
throw yt.fromCode(new ah());
|
|
@@ -19443,9 +19443,9 @@ class vr {
|
|
|
19443
19443
|
this.#r = `${i}${s ? ":" + s : ""}`;
|
|
19444
19444
|
}
|
|
19445
19445
|
if (this.#n = Promise.resolve(t.identity || new a0()), t.ingressExpiryInMinutes && t.ingressExpiryInMinutes > 5)
|
|
19446
|
-
throw et.fromCode(new
|
|
19446
|
+
throw et.fromCode(new gs("The maximum ingress expiry time is 5 minutes.", t.ingressExpiryInMinutes));
|
|
19447
19447
|
if (t.ingressExpiryInMinutes && t.ingressExpiryInMinutes <= 0)
|
|
19448
|
-
throw et.fromCode(new
|
|
19448
|
+
throw et.fromCode(new gs("Ingress expiry time must be greater than 0.", t.ingressExpiryInMinutes));
|
|
19449
19449
|
this.#o = t.ingressExpiryInMinutes || 5, this.addTransform("update", f0(cl)), t.useQueryNonces && this.addTransform("query", f0(cl)), t.logToConsole && this.log.subscribe((i) => {
|
|
19450
19450
|
i.level === "error" ? console.error(i.message) : i.level === "warn" ? console.warn(i.message) : console.log(i.message);
|
|
19451
19451
|
});
|
|
@@ -19485,7 +19485,7 @@ class vr {
|
|
|
19485
19485
|
}
|
|
19486
19486
|
async getPrincipal() {
|
|
19487
19487
|
if (!this.#n)
|
|
19488
|
-
throw
|
|
19488
|
+
throw an.fromCode(new Pi());
|
|
19489
19489
|
return (await this.#n).getPrincipal();
|
|
19490
19490
|
}
|
|
19491
19491
|
/**
|
|
@@ -19503,7 +19503,7 @@ class vr {
|
|
|
19503
19503
|
async call(t, n, r) {
|
|
19504
19504
|
const i = n.callSync ?? !0, s = await (r ?? this.#n);
|
|
19505
19505
|
if (!s)
|
|
19506
|
-
throw
|
|
19506
|
+
throw an.fromCode(new Pi());
|
|
19507
19507
|
const o = Ke.from(t), c = n.effectiveCanisterId ? Ke.from(n.effectiveCanisterId) : o;
|
|
19508
19508
|
await this.#y(c);
|
|
19509
19509
|
const a = s.getPrincipal(), u = yf(this.#o, this.#i), f = {
|
|
@@ -19563,7 +19563,7 @@ class vr {
|
|
|
19563
19563
|
// disable v3 api
|
|
19564
19564
|
callSync: !1
|
|
19565
19565
|
}, r);
|
|
19566
|
-
if (S.hasCode(
|
|
19566
|
+
if (S.hasCode(gs) && !this.#g)
|
|
19567
19567
|
return await this.syncTime(o), this.call(o, n, r);
|
|
19568
19568
|
S.code.requestContext = {
|
|
19569
19569
|
requestId: E,
|
|
@@ -19572,7 +19572,7 @@ class vr {
|
|
|
19572
19572
|
ingressExpiry: l.body.content.ingress_expiry
|
|
19573
19573
|
}, _ = S;
|
|
19574
19574
|
} else
|
|
19575
|
-
_ =
|
|
19575
|
+
_ = un.fromCode(new qn(S));
|
|
19576
19576
|
throw this.log.error(`Error while making call: ${_.message}`, _), _;
|
|
19577
19577
|
}
|
|
19578
19578
|
}
|
|
@@ -19583,7 +19583,7 @@ class vr {
|
|
|
19583
19583
|
backoff: o,
|
|
19584
19584
|
delay: a
|
|
19585
19585
|
}), a === null)
|
|
19586
|
-
throw
|
|
19586
|
+
throw un.fromCode(new Ho(`Backoff strategy exhausted after ${c} attempts.`, s));
|
|
19587
19587
|
a > 0 && await new Promise((y) => setTimeout(y, a));
|
|
19588
19588
|
let u;
|
|
19589
19589
|
try {
|
|
@@ -19669,7 +19669,7 @@ class vr {
|
|
|
19669
19669
|
if (o.status === B8 && o.url.includes("api/v3"))
|
|
19670
19670
|
throw yt.fromCode(new Ia());
|
|
19671
19671
|
if (u.startsWith("Invalid request expiry: "))
|
|
19672
|
-
throw et.fromCode(new
|
|
19672
|
+
throw et.fromCode(new gs(u, this.#o));
|
|
19673
19673
|
if (i < this.#c)
|
|
19674
19674
|
return await this.#p({ requestFn: n, backoff: r, tries: i + 1 });
|
|
19675
19675
|
throw yt.fromCode(new va(o.status, o.statusText, a, u));
|
|
@@ -19680,7 +19680,7 @@ class vr {
|
|
|
19680
19680
|
let o;
|
|
19681
19681
|
const c = await (r ?? this.#n);
|
|
19682
19682
|
if (!c)
|
|
19683
|
-
throw
|
|
19683
|
+
throw an.fromCode(new Pi());
|
|
19684
19684
|
const a = Ke.from(t), u = c.getPrincipal(), f = yf(this.#o, this.#i), l = {
|
|
19685
19685
|
request_type: Mo.Query,
|
|
19686
19686
|
canister_id: a,
|
|
@@ -19742,7 +19742,7 @@ class vr {
|
|
|
19742
19742
|
senderPubKey: o.body.sender_pubkey,
|
|
19743
19743
|
senderSignature: o.body.sender_sig,
|
|
19744
19744
|
ingressExpiry: o.body.content.ingress_expiry
|
|
19745
|
-
}, _ = S) : _ =
|
|
19745
|
+
}, _ = S) : _ = un.fromCode(new qn(S)), this.log.error(`Error while making query: ${_.message}`, _), _;
|
|
19746
19746
|
}
|
|
19747
19747
|
}
|
|
19748
19748
|
/**
|
|
@@ -19756,7 +19756,7 @@ class vr {
|
|
|
19756
19756
|
await this.#y();
|
|
19757
19757
|
const r = await (n ?? this.#n);
|
|
19758
19758
|
if (!r)
|
|
19759
|
-
throw
|
|
19759
|
+
throw an.fromCode(new Pi());
|
|
19760
19760
|
const i = r.getPrincipal(), s = await this._transform({
|
|
19761
19761
|
request: {
|
|
19762
19762
|
method: "POST",
|
|
@@ -19792,7 +19792,7 @@ class vr {
|
|
|
19792
19792
|
a = o(n);
|
|
19793
19793
|
const f = await this.#n;
|
|
19794
19794
|
if (!f)
|
|
19795
|
-
throw
|
|
19795
|
+
throw an.fromCode(new Pi());
|
|
19796
19796
|
c = await this.createReadStateRequest(n, f);
|
|
19797
19797
|
}
|
|
19798
19798
|
this.log.print(`fetching "/api/v2/canister/${s}/read_state" with request:`, c);
|
|
@@ -19815,7 +19815,7 @@ class vr {
|
|
|
19815
19815
|
senderPubKey: c.body.sender_pubkey,
|
|
19816
19816
|
senderSignature: c.body.sender_sig,
|
|
19817
19817
|
ingressExpiry: c.body.content.ingress_expiry
|
|
19818
|
-
}, l = f) : l =
|
|
19818
|
+
}, l = f) : l = un.fromCode(new qn(f)), this.log.error(`Error while making read state: ${l.message}`, l), l;
|
|
19819
19819
|
}
|
|
19820
19820
|
}
|
|
19821
19821
|
parseTimeFromResponse(t) {
|
|
@@ -19828,7 +19828,7 @@ class vr {
|
|
|
19828
19828
|
throw yt.fromCode(new gc("Could not decode time from response"));
|
|
19829
19829
|
const i = Ec(["time"], n);
|
|
19830
19830
|
if (i.status !== vn.Found)
|
|
19831
|
-
throw yt.fromCode(new
|
|
19831
|
+
throw yt.fromCode(new Hs("Time was not found in the response or was not in its expected format.", i.status));
|
|
19832
19832
|
if (!(i.value instanceof Uint8Array) && !ArrayBuffer.isView(i))
|
|
19833
19833
|
throw yt.fromCode(new hu("Time was not in its expected format."));
|
|
19834
19834
|
const s = wh(i.value);
|
|
@@ -19870,7 +19870,7 @@ class vr {
|
|
|
19870
19870
|
level: "info"
|
|
19871
19871
|
}));
|
|
19872
19872
|
} catch (r) {
|
|
19873
|
-
const i = r instanceof _r ? r :
|
|
19873
|
+
const i = r instanceof _r ? r : un.fromCode(new qn(r));
|
|
19874
19874
|
throw this.log.error("Caught exception while attempting to sync time", i), i;
|
|
19875
19875
|
}
|
|
19876
19876
|
})(), await this.#a.finally(() => {
|
|
@@ -19905,7 +19905,7 @@ class vr {
|
|
|
19905
19905
|
if (this.rootKey === null && this.host.toString() !== "https://icp-api.io" && this.#e)
|
|
19906
19906
|
await this.fetchRootKey();
|
|
19907
19907
|
else
|
|
19908
|
-
throw
|
|
19908
|
+
throw an.fromCode(new Gs(this.#e));
|
|
19909
19909
|
}
|
|
19910
19910
|
async #x(t) {
|
|
19911
19911
|
this.#w && !this.hasSyncedTime() && await this.syncTime(t);
|
|
@@ -19955,7 +19955,7 @@ class vr {
|
|
|
19955
19955
|
}
|
|
19956
19956
|
function yf(e, t) {
|
|
19957
19957
|
const n = e * dl;
|
|
19958
|
-
return
|
|
19958
|
+
return vs.fromDeltaInMilliseconds(n, t);
|
|
19959
19959
|
}
|
|
19960
19960
|
const P8 = 300 * 1e3;
|
|
19961
19961
|
function Dw() {
|
|
@@ -20014,19 +20014,19 @@ async function jw(e, t, n, r = {}) {
|
|
|
20014
20014
|
agent: e,
|
|
20015
20015
|
pollingOptions: r
|
|
20016
20016
|
}), s = await e.readState(t, { paths: [i] }, void 0, o)) : s = await e.readState(t, { paths: [i] }), e.rootKey == null)
|
|
20017
|
-
throw
|
|
20017
|
+
throw an.fromCode(new Gs());
|
|
20018
20018
|
const a = await Vi.create({
|
|
20019
20019
|
certificate: s.certificate,
|
|
20020
20020
|
rootKey: e.rootKey,
|
|
20021
20021
|
canisterId: t,
|
|
20022
20022
|
blsVerify: r.blsVerify,
|
|
20023
20023
|
agent: e
|
|
20024
|
-
}), u =
|
|
20024
|
+
}), u = _n(a.lookup_path([...i, dt("status")]));
|
|
20025
20025
|
let f;
|
|
20026
20026
|
switch (typeof u > "u" ? f = Er.Unknown : f = new TextDecoder().decode(u), f) {
|
|
20027
20027
|
case Er.Replied:
|
|
20028
20028
|
return {
|
|
20029
|
-
reply:
|
|
20029
|
+
reply: _n(a.lookup_path([...i, "reply"])),
|
|
20030
20030
|
certificate: a
|
|
20031
20031
|
};
|
|
20032
20032
|
case Er.Received:
|
|
@@ -20037,13 +20037,13 @@ async function jw(e, t, n, r = {}) {
|
|
|
20037
20037
|
request: o
|
|
20038
20038
|
});
|
|
20039
20039
|
case Er.Rejected: {
|
|
20040
|
-
const l = new Uint8Array(
|
|
20041
|
-
throw
|
|
20040
|
+
const l = new Uint8Array(_n(a.lookup_path([...i, "reject_code"])))[0], d = new TextDecoder().decode(_n(a.lookup_path([...i, "reject_message"]))), y = _n(a.lookup_path([...i, "error_code"])), g = y ? new TextDecoder().decode(y) : void 0;
|
|
20041
|
+
throw Ss.fromCode(new yu(n, l, d, g));
|
|
20042
20042
|
}
|
|
20043
20043
|
case Er.Done:
|
|
20044
|
-
throw
|
|
20044
|
+
throw un.fromCode(new rh(n));
|
|
20045
20045
|
}
|
|
20046
|
-
throw
|
|
20046
|
+
throw xs;
|
|
20047
20047
|
}
|
|
20048
20048
|
async function q8(e) {
|
|
20049
20049
|
const { paths: t, agent: n, pollingOptions: r } = e;
|
|
@@ -20160,15 +20160,15 @@ function V8(e, t, n, r) {
|
|
|
20160
20160
|
requestDetails: l.requestDetails
|
|
20161
20161
|
};
|
|
20162
20162
|
switch (l.status) {
|
|
20163
|
-
case
|
|
20163
|
+
case Cs.Rejected: {
|
|
20164
20164
|
const y = new th(l.requestId, l.reject_code, l.reject_message, l.error_code, l.signatures);
|
|
20165
20165
|
throw y.callContext = {
|
|
20166
20166
|
canisterId: u,
|
|
20167
20167
|
methodName: t,
|
|
20168
20168
|
httpDetails: d
|
|
20169
|
-
},
|
|
20169
|
+
}, Ss.fromCode(y);
|
|
20170
20170
|
}
|
|
20171
|
-
case
|
|
20171
|
+
case Cs.Replied:
|
|
20172
20172
|
return n.annotations.includes(pl) ? {
|
|
20173
20173
|
httpDetails: d,
|
|
20174
20174
|
result: cs(n.retTypes, l.reply.arg)
|
|
@@ -20195,7 +20195,7 @@ function V8(e, t, n, r) {
|
|
|
20195
20195
|
let _, w;
|
|
20196
20196
|
if (ax(E.body)) {
|
|
20197
20197
|
if (a.rootKey == null)
|
|
20198
|
-
throw
|
|
20198
|
+
throw an.fromCode(new Gs());
|
|
20199
20199
|
const R = E.body.certificate;
|
|
20200
20200
|
w = await Vi.create({
|
|
20201
20201
|
certificate: R,
|
|
@@ -20205,17 +20205,17 @@ function V8(e, t, n, r) {
|
|
|
20205
20205
|
agent: a
|
|
20206
20206
|
});
|
|
20207
20207
|
const M = [dt("request_status"), m];
|
|
20208
|
-
switch (new TextDecoder().decode(
|
|
20208
|
+
switch (new TextDecoder().decode(_n(w.lookup_path([...M, "status"])))) {
|
|
20209
20209
|
case "replied":
|
|
20210
|
-
_ =
|
|
20210
|
+
_ = _n(w.lookup_path([...M, "reply"]));
|
|
20211
20211
|
break;
|
|
20212
20212
|
case "rejected": {
|
|
20213
|
-
const U = new Uint8Array(
|
|
20213
|
+
const U = new Uint8Array(_n(w.lookup_path([...M, "reject_code"])))[0], q = new TextDecoder().decode(_n(w.lookup_path([...M, "reject_message"]))), K = _n(w.lookup_path([...M, "error_code"])), H = K ? new TextDecoder().decode(K) : void 0, D = new yu(m, U, q, H);
|
|
20214
20214
|
throw D.callContext = {
|
|
20215
20215
|
canisterId: d,
|
|
20216
20216
|
methodName: t,
|
|
20217
20217
|
httpDetails: E
|
|
20218
|
-
},
|
|
20218
|
+
}, Ss.fromCode(D);
|
|
20219
20219
|
}
|
|
20220
20220
|
}
|
|
20221
20221
|
} else if (cx(E.body)) {
|
|
@@ -20224,7 +20224,7 @@ function V8(e, t, n, r) {
|
|
|
20224
20224
|
canisterId: d,
|
|
20225
20225
|
methodName: t,
|
|
20226
20226
|
httpDetails: E
|
|
20227
|
-
},
|
|
20227
|
+
}, Ss.fromCode(U);
|
|
20228
20228
|
}
|
|
20229
20229
|
if (E.status === 202) {
|
|
20230
20230
|
const R = {
|
|
@@ -20252,12 +20252,21 @@ function V8(e, t, n, r) {
|
|
|
20252
20252
|
canisterId: d,
|
|
20253
20253
|
methodName: t,
|
|
20254
20254
|
httpDetails: A
|
|
20255
|
-
},
|
|
20255
|
+
}, un.fromCode(R);
|
|
20256
20256
|
}
|
|
20257
20257
|
};
|
|
20258
20258
|
const s = (...o) => i({}, ...o);
|
|
20259
20259
|
return s.withOptions = (o) => (...c) => i(o, ...c), s;
|
|
20260
20260
|
}
|
|
20261
|
+
const mn = {
|
|
20262
|
+
P2PKH: { P2PKH: null },
|
|
20263
|
+
P2SH_P2WPKH: { P2SH_P2WPKH: null },
|
|
20264
|
+
P2WPKH: { P2WPKH: null },
|
|
20265
|
+
P2WSH: { P2WSH: null },
|
|
20266
|
+
P2SH: { P2SH: null },
|
|
20267
|
+
P2TR: { P2TR: null },
|
|
20268
|
+
UNKNOWN: { UNKNOWN: null }
|
|
20269
|
+
};
|
|
20261
20270
|
var _i = {}, Xe = {}, mf = {}, Zt = {}, lr = {}, j0;
|
|
20262
20271
|
function Wn() {
|
|
20263
20272
|
return j0 || (j0 = 1, Object.defineProperty(lr, "__esModule", { value: !0 }), lr.testnet = lr.regtest = lr.bitcoin = void 0, lr.bitcoin = {
|
|
@@ -20319,7 +20328,7 @@ function Wn() {
|
|
|
20319
20328
|
wif: 239
|
|
20320
20329
|
}), lr;
|
|
20321
20330
|
}
|
|
20322
|
-
var wf = {},
|
|
20331
|
+
var wf = {}, oo = {}, bf = {}, hr = {}, K0;
|
|
20323
20332
|
function Ww() {
|
|
20324
20333
|
if (K0) return hr;
|
|
20325
20334
|
K0 = 1, Object.defineProperty(hr, "__esModule", { value: !0 }), hr.encode = hr.decode = hr.check = void 0;
|
|
@@ -20979,7 +20988,7 @@ var ep;
|
|
|
20979
20988
|
function G8() {
|
|
20980
20989
|
if (ep) return xi;
|
|
20981
20990
|
ep = 1, Object.defineProperty(xi, "__esModule", { value: !0 }), xi.encode = xi.decode = void 0;
|
|
20982
|
-
const e = Ww(), t =
|
|
20991
|
+
const e = Ww(), t = rn(), n = zt(), { typeforce: r } = n, i = Buffer.alloc(1, 0);
|
|
20983
20992
|
function s(u) {
|
|
20984
20993
|
let f = 0;
|
|
20985
20994
|
for (; u[f] === 0; ) ++f;
|
|
@@ -21015,7 +21024,7 @@ function G8() {
|
|
|
21015
21024
|
return xi.encode = a, xi;
|
|
21016
21025
|
}
|
|
21017
21026
|
var tp;
|
|
21018
|
-
function
|
|
21027
|
+
function rn() {
|
|
21019
21028
|
return tp || (tp = 1, (function(e) {
|
|
21020
21029
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.signature = e.number = e.isCanonicalScriptSignature = e.isDefinedHashType = e.isCanonicalPubKey = e.toStack = e.fromASM = e.toASM = e.decompile = e.compile = e.countNonPushOnlyOPs = e.isPushOnly = e.OPS = void 0;
|
|
21021
21030
|
const t = Ww(), n = _h();
|
|
@@ -21164,9 +21173,9 @@ function gi() {
|
|
|
21164
21173
|
}
|
|
21165
21174
|
var rp;
|
|
21166
21175
|
function W8() {
|
|
21167
|
-
if (rp) return
|
|
21168
|
-
rp = 1, Object.defineProperty(
|
|
21169
|
-
const e = Wn(), t =
|
|
21176
|
+
if (rp) return oo;
|
|
21177
|
+
rp = 1, Object.defineProperty(oo, "__esModule", { value: !0 }), oo.p2data = void 0;
|
|
21178
|
+
const e = Wn(), t = rn(), n = zt(), r = gi(), i = t.OPS;
|
|
21170
21179
|
function s(o, c) {
|
|
21171
21180
|
if (!o.data && !o.output) throw new TypeError("Not enough data");
|
|
21172
21181
|
c = Object.assign({ validate: !0 }, c || {}), (0, n.typeforce)(
|
|
@@ -21196,13 +21205,13 @@ function W8() {
|
|
|
21196
21205
|
}
|
|
21197
21206
|
return Object.assign(u, o);
|
|
21198
21207
|
}
|
|
21199
|
-
return
|
|
21208
|
+
return oo.p2data = s, oo;
|
|
21200
21209
|
}
|
|
21201
|
-
var
|
|
21210
|
+
var co = {}, ip;
|
|
21202
21211
|
function X8() {
|
|
21203
|
-
if (ip) return
|
|
21204
|
-
ip = 1, Object.defineProperty(
|
|
21205
|
-
const e = Wn(), t =
|
|
21212
|
+
if (ip) return co;
|
|
21213
|
+
ip = 1, Object.defineProperty(co, "__esModule", { value: !0 }), co.p2ms = void 0;
|
|
21214
|
+
const e = Wn(), t = rn(), n = zt(), r = gi(), i = t.OPS, s = i.OP_RESERVED;
|
|
21206
21215
|
function o(c, a) {
|
|
21207
21216
|
if (!c.input && !c.output && !(c.pubkeys && c.m !== void 0) && !c.signatures)
|
|
21208
21217
|
throw new TypeError("Not enough data");
|
|
@@ -21302,13 +21311,13 @@ function X8() {
|
|
|
21302
21311
|
}
|
|
21303
21312
|
return Object.assign(l, c);
|
|
21304
21313
|
}
|
|
21305
|
-
return
|
|
21314
|
+
return co.p2ms = o, co;
|
|
21306
21315
|
}
|
|
21307
|
-
var
|
|
21316
|
+
var ao = {}, sp;
|
|
21308
21317
|
function z8() {
|
|
21309
|
-
if (sp) return
|
|
21310
|
-
sp = 1, Object.defineProperty(
|
|
21311
|
-
const e = Wn(), t =
|
|
21318
|
+
if (sp) return ao;
|
|
21319
|
+
sp = 1, Object.defineProperty(ao, "__esModule", { value: !0 }), ao.p2pk = void 0;
|
|
21320
|
+
const e = Wn(), t = rn(), n = zt(), r = gi(), i = t.OPS;
|
|
21312
21321
|
function s(o, c) {
|
|
21313
21322
|
if (!o.input && !o.output && !o.pubkey && !o.input && !o.signature)
|
|
21314
21323
|
throw new TypeError("Not enough data");
|
|
@@ -21357,9 +21366,9 @@ function z8() {
|
|
|
21357
21366
|
}
|
|
21358
21367
|
return Object.assign(f, o);
|
|
21359
21368
|
}
|
|
21360
|
-
return
|
|
21369
|
+
return ao.p2pk = s, ao;
|
|
21361
21370
|
}
|
|
21362
|
-
var
|
|
21371
|
+
var uo = {}, Af = {}, vi = {}, Jt = {}, op;
|
|
21363
21372
|
function zw() {
|
|
21364
21373
|
if (op) return Jt;
|
|
21365
21374
|
op = 1, Object.defineProperty(Jt, "__esModule", { value: !0 }), Jt.ripemd160 = Jt.RIPEMD160 = Jt.md5 = Jt.MD5 = Jt.sha1 = Jt.SHA1 = void 0;
|
|
@@ -22301,9 +22310,9 @@ function Th() {
|
|
|
22301
22310
|
}
|
|
22302
22311
|
var yp;
|
|
22303
22312
|
function tA() {
|
|
22304
|
-
if (yp) return
|
|
22305
|
-
yp = 1, Object.defineProperty(
|
|
22306
|
-
const e = Cr(), t = Wn(), n =
|
|
22313
|
+
if (yp) return uo;
|
|
22314
|
+
yp = 1, Object.defineProperty(uo, "__esModule", { value: !0 }), uo.p2pkh = void 0;
|
|
22315
|
+
const e = Cr(), t = Wn(), n = rn(), r = zt(), i = gi(), s = Th(), o = n.OPS;
|
|
22307
22316
|
function c(a, u) {
|
|
22308
22317
|
if (!a.address && !a.hash && !a.output && !a.pubkey && !a.input)
|
|
22309
22318
|
throw new TypeError("Not enough data");
|
|
@@ -22397,13 +22406,13 @@ function tA() {
|
|
|
22397
22406
|
}
|
|
22398
22407
|
return Object.assign(y, a);
|
|
22399
22408
|
}
|
|
22400
|
-
return
|
|
22409
|
+
return uo.p2pkh = c, uo;
|
|
22401
22410
|
}
|
|
22402
|
-
var
|
|
22411
|
+
var fo = {}, gp;
|
|
22403
22412
|
function nA() {
|
|
22404
|
-
if (gp) return
|
|
22405
|
-
gp = 1, Object.defineProperty(
|
|
22406
|
-
const e = Cr(), t = Wn(), n =
|
|
22413
|
+
if (gp) return fo;
|
|
22414
|
+
gp = 1, Object.defineProperty(fo, "__esModule", { value: !0 }), fo.p2sh = void 0;
|
|
22415
|
+
const e = Cr(), t = Wn(), n = rn(), r = zt(), i = gi(), s = Th(), o = n.OPS;
|
|
22407
22416
|
function c(a, u) {
|
|
22408
22417
|
if (!a.address && !a.hash && !a.output && !a.redeem && !a.input)
|
|
22409
22418
|
throw new TypeError("Not enough data");
|
|
@@ -22542,13 +22551,13 @@ function nA() {
|
|
|
22542
22551
|
}
|
|
22543
22552
|
return Object.assign(l, a);
|
|
22544
22553
|
}
|
|
22545
|
-
return
|
|
22554
|
+
return fo.p2sh = c, fo;
|
|
22546
22555
|
}
|
|
22547
|
-
var
|
|
22556
|
+
var lo = {}, mp;
|
|
22548
22557
|
function rA() {
|
|
22549
|
-
if (mp) return
|
|
22550
|
-
mp = 1, Object.defineProperty(
|
|
22551
|
-
const e = Cr(), t = Wn(), n =
|
|
22558
|
+
if (mp) return lo;
|
|
22559
|
+
mp = 1, Object.defineProperty(lo, "__esModule", { value: !0 }), lo.p2wpkh = void 0;
|
|
22560
|
+
const e = Cr(), t = Wn(), n = rn(), r = zt(), i = gi(), s = uc(), o = n.OPS, c = Buffer.alloc(0);
|
|
22552
22561
|
function a(u, f) {
|
|
22553
22562
|
if (!u.address && !u.hash && !u.output && !u.pubkey && !u.witness)
|
|
22554
22563
|
throw new TypeError("Not enough data");
|
|
@@ -22646,13 +22655,13 @@ function rA() {
|
|
|
22646
22655
|
}
|
|
22647
22656
|
return Object.assign(y, u);
|
|
22648
22657
|
}
|
|
22649
|
-
return
|
|
22658
|
+
return lo.p2wpkh = a, lo;
|
|
22650
22659
|
}
|
|
22651
|
-
var
|
|
22660
|
+
var ho = {}, wp;
|
|
22652
22661
|
function iA() {
|
|
22653
|
-
if (wp) return
|
|
22654
|
-
wp = 1, Object.defineProperty(
|
|
22655
|
-
const e = Cr(), t = Wn(), n =
|
|
22662
|
+
if (wp) return ho;
|
|
22663
|
+
wp = 1, Object.defineProperty(ho, "__esModule", { value: !0 }), ho.p2wsh = void 0;
|
|
22664
|
+
const e = Cr(), t = Wn(), n = rn(), r = zt(), i = gi(), s = uc(), o = n.OPS, c = Buffer.alloc(0);
|
|
22656
22665
|
function a(f) {
|
|
22657
22666
|
return !!(Buffer.isBuffer(f) && f.length === 65 && f[0] === 4 && (0, r.isPoint)(f));
|
|
22658
22667
|
}
|
|
@@ -22789,9 +22798,9 @@ function iA() {
|
|
|
22789
22798
|
}
|
|
22790
22799
|
return Object.assign(m, f);
|
|
22791
22800
|
}
|
|
22792
|
-
return
|
|
22801
|
+
return ho.p2wsh = u, ho;
|
|
22793
22802
|
}
|
|
22794
|
-
var
|
|
22803
|
+
var po = {}, Oi = {}, bp;
|
|
22795
22804
|
function xh() {
|
|
22796
22805
|
if (bp) return Oi;
|
|
22797
22806
|
bp = 1, Object.defineProperty(Oi, "__esModule", { value: !0 }), Oi.getEccLib = Oi.initEccLib = void 0;
|
|
@@ -23130,9 +23139,9 @@ function Ah() {
|
|
|
23130
23139
|
}
|
|
23131
23140
|
var xp;
|
|
23132
23141
|
function cA() {
|
|
23133
|
-
if (xp) return
|
|
23134
|
-
xp = 1, Object.defineProperty(
|
|
23135
|
-
const e = nc(), t = Wn(), n =
|
|
23142
|
+
if (xp) return po;
|
|
23143
|
+
xp = 1, Object.defineProperty(po, "__esModule", { value: !0 }), po.p2tr = void 0;
|
|
23144
|
+
const e = nc(), t = Wn(), n = rn(), r = zt(), i = xh(), s = Ah(), o = gi(), c = uc(), a = vh(), u = n.OPS, f = 1, l = 80;
|
|
23136
23145
|
function d(y, g) {
|
|
23137
23146
|
if (!y.address && !y.output && !y.pubkey && !y.internalPubkey && !(y.witness && y.witness.length > 1))
|
|
23138
23147
|
throw new TypeError("Not enough data");
|
|
@@ -23331,7 +23340,7 @@ function cA() {
|
|
|
23331
23340
|
}
|
|
23332
23341
|
return Object.assign(w, y);
|
|
23333
23342
|
}
|
|
23334
|
-
return
|
|
23343
|
+
return po.p2tr = d, po;
|
|
23335
23344
|
}
|
|
23336
23345
|
var Ap;
|
|
23337
23346
|
function _c() {
|
|
@@ -23399,7 +23408,7 @@ var vp;
|
|
|
23399
23408
|
function vh() {
|
|
23400
23409
|
if (vp) return Zt;
|
|
23401
23410
|
vp = 1, Object.defineProperty(Zt, "__esModule", { value: !0 }), Zt.toOutputScript = Zt.fromOutputScript = Zt.toBech32 = Zt.toBase58Check = Zt.fromBech32 = Zt.fromBase58Check = void 0;
|
|
23402
|
-
const e = Wn(), t = _c(), n =
|
|
23411
|
+
const e = Wn(), t = _c(), n = rn(), r = zt(), i = uc(), s = Th(), o = 40, c = 2, a = 16, u = 2, f = 80, l = "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.";
|
|
23403
23412
|
function d(w, T) {
|
|
23404
23413
|
const O = w.slice(2);
|
|
23405
23414
|
if (O.length < c || O.length > o)
|
|
@@ -23518,10 +23527,10 @@ function vh() {
|
|
|
23518
23527
|
}
|
|
23519
23528
|
return Zt.toOutputScript = _, Zt;
|
|
23520
23529
|
}
|
|
23521
|
-
var
|
|
23530
|
+
var yo = {}, go = {}, Ip;
|
|
23522
23531
|
function aA() {
|
|
23523
|
-
if (Ip) return
|
|
23524
|
-
Ip = 1, Object.defineProperty(
|
|
23532
|
+
if (Ip) return go;
|
|
23533
|
+
Ip = 1, Object.defineProperty(go, "__esModule", { value: !0 }), go.fastMerkleRoot = void 0;
|
|
23525
23534
|
function e(t, n) {
|
|
23526
23535
|
if (!Array.isArray(t)) throw TypeError("Expected values Array");
|
|
23527
23536
|
if (typeof n != "function")
|
|
@@ -23538,13 +23547,13 @@ function aA() {
|
|
|
23538
23547
|
}
|
|
23539
23548
|
return i[0];
|
|
23540
23549
|
}
|
|
23541
|
-
return
|
|
23550
|
+
return go.fastMerkleRoot = e, go;
|
|
23542
23551
|
}
|
|
23543
|
-
var
|
|
23552
|
+
var mo = {}, Op;
|
|
23544
23553
|
function Sc() {
|
|
23545
|
-
if (Op) return
|
|
23546
|
-
Op = 1, Object.defineProperty(
|
|
23547
|
-
const e = Su(), t = Cr(), n =
|
|
23554
|
+
if (Op) return mo;
|
|
23555
|
+
Op = 1, Object.defineProperty(mo, "__esModule", { value: !0 }), mo.Transaction = void 0;
|
|
23556
|
+
const e = Su(), t = Cr(), n = rn(), r = rn(), i = zt(), { typeforce: s } = i;
|
|
23548
23557
|
function o(E) {
|
|
23549
23558
|
const S = E.length;
|
|
23550
23559
|
return e.varuint.encodingLength(S) + S;
|
|
@@ -23828,12 +23837,12 @@ function Sc() {
|
|
|
23828
23837
|
}), T.writeUInt32(this.locktime), _ !== void 0 ? S.slice(_, T.offset) : S;
|
|
23829
23838
|
}
|
|
23830
23839
|
}
|
|
23831
|
-
return
|
|
23840
|
+
return mo.Transaction = m, m.DEFAULT_SEQUENCE = 4294967295, m.SIGHASH_DEFAULT = 0, m.SIGHASH_ALL = 1, m.SIGHASH_NONE = 2, m.SIGHASH_SINGLE = 3, m.SIGHASH_ANYONECANPAY = 128, m.SIGHASH_OUTPUT_MASK = 3, m.SIGHASH_INPUT_MASK = 128, m.ADVANCED_TRANSACTION_MARKER = 0, m.ADVANCED_TRANSACTION_FLAG = 1, mo;
|
|
23832
23841
|
}
|
|
23833
23842
|
var Bp;
|
|
23834
23843
|
function uA() {
|
|
23835
|
-
if (Bp) return
|
|
23836
|
-
Bp = 1, Object.defineProperty(
|
|
23844
|
+
if (Bp) return yo;
|
|
23845
|
+
Bp = 1, Object.defineProperty(yo, "__esModule", { value: !0 }), yo.Block = void 0;
|
|
23837
23846
|
const e = Su(), t = Cr(), n = aA(), r = Sc(), i = zt(), { typeforce: s } = i, o = new TypeError(
|
|
23838
23847
|
"Cannot compute merkle root for zero transactions"
|
|
23839
23848
|
), c = new TypeError(
|
|
@@ -23950,7 +23959,7 @@ function uA() {
|
|
|
23950
23959
|
return this.witnessCommit.compare(d) === 0;
|
|
23951
23960
|
}
|
|
23952
23961
|
}
|
|
23953
|
-
|
|
23962
|
+
yo.Block = a;
|
|
23954
23963
|
function u(l) {
|
|
23955
23964
|
return l instanceof Array && l[0] && l[0].ins && l[0].ins instanceof Array && l[0].ins[0] && l[0].ins[0].witness && l[0].ins[0].witness instanceof Array && l[0].ins[0].witness.length > 0;
|
|
23956
23965
|
}
|
|
@@ -23961,9 +23970,9 @@ function uA() {
|
|
|
23961
23970
|
)
|
|
23962
23971
|
);
|
|
23963
23972
|
}
|
|
23964
|
-
return
|
|
23973
|
+
return yo;
|
|
23965
23974
|
}
|
|
23966
|
-
var
|
|
23975
|
+
var wo = {}, Lc = {}, qc = {}, Pf = {}, as = {}, us = {}, Rf = {}, Np;
|
|
23967
23976
|
function Lt() {
|
|
23968
23977
|
return Np || (Np = 1, (function(e) {
|
|
23969
23978
|
Object.defineProperty(e, "__esModule", { value: !0 }), (function(t) {
|
|
@@ -25155,10 +25164,10 @@ function BA() {
|
|
|
25155
25164
|
}
|
|
25156
25165
|
return as.psbtFromKeyVals = o, as;
|
|
25157
25166
|
}
|
|
25158
|
-
var
|
|
25167
|
+
var bo = {}, ty;
|
|
25159
25168
|
function NA() {
|
|
25160
|
-
if (ty) return
|
|
25161
|
-
ty = 1, Object.defineProperty(
|
|
25169
|
+
if (ty) return bo;
|
|
25170
|
+
ty = 1, Object.defineProperty(bo, "__esModule", { value: !0 });
|
|
25162
25171
|
const e = Oh(), t = Ih();
|
|
25163
25172
|
function n({ globalMap: o, inputs: c, outputs: a }) {
|
|
25164
25173
|
const { globalKeyVals: u, inputKeyVals: f, outputKeyVals: l } = s({
|
|
@@ -25170,7 +25179,7 @@ function NA() {
|
|
|
25170
25179
|
[E, d].concat(g, m)
|
|
25171
25180
|
);
|
|
25172
25181
|
}
|
|
25173
|
-
|
|
25182
|
+
bo.psbtToBuffer = n;
|
|
25174
25183
|
const r = (o, c) => o.key.compare(c.key);
|
|
25175
25184
|
function i(o, c) {
|
|
25176
25185
|
const a = /* @__PURE__ */ new Set(), u = Object.entries(o).reduce((l, [d, y]) => {
|
|
@@ -25195,7 +25204,7 @@ function NA() {
|
|
|
25195
25204
|
outputKeyVals: a.map((u) => i(u, e.outputs))
|
|
25196
25205
|
};
|
|
25197
25206
|
}
|
|
25198
|
-
return
|
|
25207
|
+
return bo.psbtToKeyVals = s, bo;
|
|
25199
25208
|
}
|
|
25200
25209
|
var ny;
|
|
25201
25210
|
function Jw() {
|
|
@@ -25492,7 +25501,7 @@ var Qe = {}, ze = {}, oy;
|
|
|
25492
25501
|
function yl() {
|
|
25493
25502
|
if (oy) return ze;
|
|
25494
25503
|
oy = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.signatureBlocksAction = ze.checkInputForSig = ze.pubkeyInScript = ze.pubkeyPositionInScript = ze.witnessStackToScriptWitness = ze.isP2TR = ze.isP2SHScript = ze.isP2WSHScript = ze.isP2WPKH = ze.isP2PKH = ze.isP2PK = ze.isP2MS = void 0;
|
|
25495
|
-
const e = ns(), t =
|
|
25504
|
+
const e = ns(), t = rn(), n = Sc(), r = Cr(), i = _c();
|
|
25496
25505
|
function s(y) {
|
|
25497
25506
|
return (g) => {
|
|
25498
25507
|
try {
|
|
@@ -25791,9 +25800,9 @@ function RA() {
|
|
|
25791
25800
|
}
|
|
25792
25801
|
var ay;
|
|
25793
25802
|
function UA() {
|
|
25794
|
-
if (ay) return
|
|
25795
|
-
ay = 1, Object.defineProperty(
|
|
25796
|
-
const e = PA(), t = ns(), n = Qw(), r = vh(), i = Su(), s = Wn(), o = _c(), c = Ah(), a =
|
|
25803
|
+
if (ay) return wo;
|
|
25804
|
+
ay = 1, Object.defineProperty(wo, "__esModule", { value: !0 }), wo.Psbt = void 0;
|
|
25805
|
+
const e = PA(), t = ns(), n = Qw(), r = vh(), i = Su(), s = Wn(), o = _c(), c = Ah(), a = rn(), u = Sc(), f = RA(), l = yl(), d = {
|
|
25797
25806
|
/**
|
|
25798
25807
|
* A bitcoinjs Network object. This is only used if you pass an `address`
|
|
25799
25808
|
* parameter to addOutput. Otherwise it is not needed and can be left default.
|
|
@@ -26437,7 +26446,7 @@ function UA() {
|
|
|
26437
26446
|
return this.data.clearFinalizedInput(h), this;
|
|
26438
26447
|
}
|
|
26439
26448
|
}
|
|
26440
|
-
|
|
26449
|
+
wo.Psbt = y;
|
|
26441
26450
|
const g = (p) => new m(p);
|
|
26442
26451
|
class m {
|
|
26443
26452
|
constructor(h = Buffer.from([2, 0, 0, 0, 0, 0, 0, 0, 0, 0])) {
|
|
@@ -26990,7 +26999,7 @@ PROCEED WITH CAUTION!
|
|
|
26990
26999
|
function k(p) {
|
|
26991
27000
|
return [...Array(p).keys()];
|
|
26992
27001
|
}
|
|
26993
|
-
return
|
|
27002
|
+
return wo;
|
|
26994
27003
|
}
|
|
26995
27004
|
var uy;
|
|
26996
27005
|
function CA() {
|
|
@@ -27004,7 +27013,7 @@ function CA() {
|
|
|
27004
27013
|
e.networks = r;
|
|
27005
27014
|
const i = _c();
|
|
27006
27015
|
e.payments = i;
|
|
27007
|
-
const s =
|
|
27016
|
+
const s = rn();
|
|
27008
27017
|
e.script = s;
|
|
27009
27018
|
var o = uA();
|
|
27010
27019
|
Object.defineProperty(e, "Block", {
|
|
@@ -27701,33 +27710,24 @@ function Bh(e) {
|
|
|
27701
27710
|
function Nh(e) {
|
|
27702
27711
|
return e === No.Mainnet ? Pn : My;
|
|
27703
27712
|
}
|
|
27704
|
-
const Tn = {
|
|
27705
|
-
P2PKH: { P2PKH: null },
|
|
27706
|
-
P2SH_P2WPKH: { P2SH_P2WPKH: null },
|
|
27707
|
-
P2WPKH: { P2WPKH: null },
|
|
27708
|
-
P2WSH: { P2WSH: null },
|
|
27709
|
-
P2SH: { P2SH: null },
|
|
27710
|
-
P2TR: { P2TR: null },
|
|
27711
|
-
UNKNOWN: { UNKNOWN: null }
|
|
27712
|
-
};
|
|
27713
27713
|
function kh(e, t = No.Testnet) {
|
|
27714
27714
|
const n = Nh(t);
|
|
27715
27715
|
return vg(e, n);
|
|
27716
27716
|
}
|
|
27717
|
-
function
|
|
27717
|
+
function ys(e) {
|
|
27718
27718
|
const t = Pn, n = My, r = Y1;
|
|
27719
|
-
let i, s, o =
|
|
27719
|
+
let i, s, o = mn.UNKNOWN;
|
|
27720
27720
|
if (e.startsWith("bc1") || e.startsWith("tb1") || e.startsWith("bcrt1"))
|
|
27721
27721
|
try {
|
|
27722
|
-
return s = Rl(e), s.version === 0 ? s.data.length === 20 ? o =
|
|
27722
|
+
return s = Rl(e), s.version === 0 ? s.data.length === 20 ? o = mn.P2WPKH : o = mn.P2WSH : o = mn.P2TR, o;
|
|
27723
27723
|
} catch {
|
|
27724
|
-
return
|
|
27724
|
+
return mn.UNKNOWN;
|
|
27725
27725
|
}
|
|
27726
27726
|
else
|
|
27727
27727
|
try {
|
|
27728
|
-
return i = Ag(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o =
|
|
27728
|
+
return i = Ag(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o = mn.P2PKH : (i.version === t.scriptHash || (i.version, n.scriptHash), o = mn.P2SH_P2WPKH), o;
|
|
27729
27729
|
} catch {
|
|
27730
|
-
return
|
|
27730
|
+
return mn.UNKNOWN;
|
|
27731
27731
|
}
|
|
27732
27732
|
}
|
|
27733
27733
|
function VA(e, t, n) {
|
|
@@ -27762,7 +27762,7 @@ const g6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27762
27762
|
__proto__: null,
|
|
27763
27763
|
bytesToHex: Bh,
|
|
27764
27764
|
formatPoolUtxo: VA,
|
|
27765
|
-
getAddressType:
|
|
27765
|
+
getAddressType: ys,
|
|
27766
27766
|
getScriptByAddress: kh,
|
|
27767
27767
|
getUtxoProof: r1,
|
|
27768
27768
|
hexToBytes: n1,
|
|
@@ -27802,7 +27802,7 @@ class GA {
|
|
|
27802
27802
|
value: BigInt(t.satoshis),
|
|
27803
27803
|
script: n1(t.scriptPk)
|
|
27804
27804
|
}
|
|
27805
|
-
}), this.inputAddressTypes.push(
|
|
27805
|
+
}), this.inputAddressTypes.push(ys(n)), this.inputUtxos.push(t), (n === this.config.address || n === this.config.paymentAddress) && t.runes.length !== 0 && (this.userInputUtxoDusts += BigInt(t.satoshis));
|
|
27806
27806
|
}
|
|
27807
27807
|
/**
|
|
27808
27808
|
* Add a standard output to the transaction
|
|
@@ -27813,7 +27813,7 @@ class GA {
|
|
|
27813
27813
|
this.psbt.addOutput({
|
|
27814
27814
|
address: t,
|
|
27815
27815
|
value: n
|
|
27816
|
-
}), this.outputAddressTypes.push(
|
|
27816
|
+
}), this.outputAddressTypes.push(ys(t));
|
|
27817
27817
|
}
|
|
27818
27818
|
/**
|
|
27819
27819
|
* Add an OP_RETURN script output (for Runestone)
|
|
@@ -27886,7 +27886,7 @@ class GA {
|
|
|
27886
27886
|
*/
|
|
27887
27887
|
async addBtcAndFees(t, n) {
|
|
27888
27888
|
const r = this.config.paymentAddress, i = this.additionalDustNeeded, s = this.userInputUtxoDusts;
|
|
27889
|
-
this.outputAddressTypes.push(
|
|
27889
|
+
this.outputAddressTypes.push(ys(r));
|
|
27890
27890
|
let o = BigInt(0), c = BigInt(0), a = [], u = BigInt(0), f = BigInt(0);
|
|
27891
27891
|
const l = [...this.inputAddressTypes];
|
|
27892
27892
|
do
|
|
@@ -27899,7 +27899,7 @@ class GA {
|
|
|
27899
27899
|
if (m.length === 0)
|
|
27900
27900
|
throw new Error("INSUFFICIENT_BTC_UTXOs");
|
|
27901
27901
|
this.inputAddressTypes = l.concat([
|
|
27902
|
-
...m.map(() =>
|
|
27902
|
+
...m.map(() => ys(r))
|
|
27903
27903
|
]);
|
|
27904
27904
|
const E = m.reduce(
|
|
27905
27905
|
(S, _) => S + BigInt(_.satoshis),
|
|
@@ -28184,27 +28184,43 @@ class GA {
|
|
|
28184
28184
|
* @example
|
|
28185
28185
|
* ```typescript
|
|
28186
28186
|
* // After adding intentions
|
|
28187
|
-
* const psbt = await transaction.build();
|
|
28187
|
+
* const { psbt, txid } = await transaction.build();
|
|
28188
28188
|
* const signedPsbt = await wallet.signPsbt(psbt);
|
|
28189
28189
|
* ```
|
|
28190
28190
|
*/
|
|
28191
28191
|
async build() {
|
|
28192
28192
|
const t = await this.getInvolvedAddressUtxos();
|
|
28193
|
-
for (const
|
|
28194
|
-
const
|
|
28195
|
-
if (!
|
|
28196
|
-
t.btc[
|
|
28197
|
-
const
|
|
28198
|
-
for (const
|
|
28199
|
-
for (const
|
|
28193
|
+
for (const u of this.intentions) {
|
|
28194
|
+
const f = u.poolUtxos;
|
|
28195
|
+
if (!f?.length) continue;
|
|
28196
|
+
t.btc[u.poolAddress] = f, t.rune[u.poolAddress] = {};
|
|
28197
|
+
const l = t.rune[u.poolAddress];
|
|
28198
|
+
for (const d of f)
|
|
28199
|
+
for (const y of d.runes) (l[y.id] ??= []).push(d);
|
|
28200
28200
|
}
|
|
28201
28201
|
const n = this.addInputsAndCalculateOutputs(t);
|
|
28202
28202
|
this.addOutputs(n);
|
|
28203
28203
|
const r = this.config.paymentAddress, i = t.btc[r] ?? [], s = n[r]?.[Jn] ?? BigInt(0);
|
|
28204
|
-
|
|
28204
|
+
await this.addBtcAndFees(
|
|
28205
28205
|
i,
|
|
28206
28206
|
s < 0 ? -s : BigInt(0)
|
|
28207
|
-
)
|
|
28207
|
+
);
|
|
28208
|
+
const c = this.psbt.__CACHE.__TX.clone();
|
|
28209
|
+
for (let u = 0; u < this.inputUtxos.length; u++) {
|
|
28210
|
+
const l = this.inputUtxos[u].address;
|
|
28211
|
+
if (l !== this.config.paymentAddress || l !== this.config.address)
|
|
28212
|
+
continue;
|
|
28213
|
+
const d = this.psbt.data.inputs[u].redeemScript, y = ys(l);
|
|
28214
|
+
if (d && y === mn.P2SH_P2WPKH) {
|
|
28215
|
+
const g = nn([d]);
|
|
28216
|
+
c.setInputScript(u, g);
|
|
28217
|
+
}
|
|
28218
|
+
}
|
|
28219
|
+
const a = c.getId();
|
|
28220
|
+
return {
|
|
28221
|
+
psbt: this.psbt,
|
|
28222
|
+
txid: a
|
|
28223
|
+
};
|
|
28208
28224
|
}
|
|
28209
28225
|
/**
|
|
28210
28226
|
* Submit the signed transaction to the orchestrator for execution
|
|
@@ -28271,15 +28287,15 @@ class GA {
|
|
|
28271
28287
|
});
|
|
28272
28288
|
}
|
|
28273
28289
|
}
|
|
28274
|
-
class
|
|
28290
|
+
class Bs extends Error {
|
|
28275
28291
|
response;
|
|
28276
28292
|
request;
|
|
28277
28293
|
constructor(t, n) {
|
|
28278
|
-
const r = `${
|
|
28294
|
+
const r = `${Bs.extractMessage(t)}: ${JSON.stringify({
|
|
28279
28295
|
response: t,
|
|
28280
28296
|
request: n
|
|
28281
28297
|
})}`;
|
|
28282
|
-
super(r), Object.setPrototypeOf(this,
|
|
28298
|
+
super(r), Object.setPrototypeOf(this, Bs.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Bs);
|
|
28283
28299
|
}
|
|
28284
28300
|
static extractMessage(t) {
|
|
28285
28301
|
return t.errors?.[0]?.message ?? `GraphQL Error (Code: ${String(t.status)})`;
|
|
@@ -28649,10 +28665,10 @@ function _y(e) {
|
|
|
28649
28665
|
const t = e?.kind;
|
|
28650
28666
|
return typeof t == "string" && iv.has(t);
|
|
28651
28667
|
}
|
|
28652
|
-
var
|
|
28668
|
+
var bs;
|
|
28653
28669
|
(function(e) {
|
|
28654
28670
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
28655
|
-
})(
|
|
28671
|
+
})(bs || (bs = {}));
|
|
28656
28672
|
var ml;
|
|
28657
28673
|
(function(e) {
|
|
28658
28674
|
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
@@ -28758,7 +28774,7 @@ class uv {
|
|
|
28758
28774
|
function fv(e) {
|
|
28759
28775
|
return e === ee.BANG || e === ee.DOLLAR || e === ee.AMP || e === ee.PAREN_L || e === ee.PAREN_R || e === ee.SPREAD || e === ee.COLON || e === ee.EQUALS || e === ee.AT || e === ee.BRACKET_L || e === ee.BRACKET_R || e === ee.BRACE_L || e === ee.PIPE || e === ee.BRACE_R;
|
|
28760
28776
|
}
|
|
28761
|
-
function
|
|
28777
|
+
function zs(e) {
|
|
28762
28778
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
28763
28779
|
}
|
|
28764
28780
|
function Tu(e, t) {
|
|
@@ -28875,7 +28891,7 @@ function lv(e, t) {
|
|
|
28875
28891
|
throw kt(
|
|
28876
28892
|
e.source,
|
|
28877
28893
|
i,
|
|
28878
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` :
|
|
28894
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : zs(s) || Tu(n, i) ? `Unexpected character: ${zi(e, i)}.` : `Invalid character: ${zi(e, i)}.`
|
|
28879
28895
|
);
|
|
28880
28896
|
}
|
|
28881
28897
|
return Et(e, ee.EOF, r, r);
|
|
@@ -28887,7 +28903,7 @@ function hv(e, t) {
|
|
|
28887
28903
|
const s = n.charCodeAt(i);
|
|
28888
28904
|
if (s === 10 || s === 13)
|
|
28889
28905
|
break;
|
|
28890
|
-
if (
|
|
28906
|
+
if (zs(s))
|
|
28891
28907
|
++i;
|
|
28892
28908
|
else if (Tu(n, i))
|
|
28893
28909
|
i += 2;
|
|
@@ -28965,7 +28981,7 @@ function pv(e, t) {
|
|
|
28965
28981
|
}
|
|
28966
28982
|
if (c === 10 || c === 13)
|
|
28967
28983
|
break;
|
|
28968
|
-
if (
|
|
28984
|
+
if (zs(c))
|
|
28969
28985
|
++i;
|
|
28970
28986
|
else if (Tu(n, i))
|
|
28971
28987
|
i += 2;
|
|
@@ -28987,7 +29003,7 @@ function yv(e, t) {
|
|
|
28987
29003
|
for (; i < 12; ) {
|
|
28988
29004
|
const s = n.charCodeAt(t + i++);
|
|
28989
29005
|
if (s === 125) {
|
|
28990
|
-
if (i < 5 || !
|
|
29006
|
+
if (i < 5 || !zs(r))
|
|
28991
29007
|
break;
|
|
28992
29008
|
return {
|
|
28993
29009
|
value: String.fromCodePoint(r),
|
|
@@ -29008,7 +29024,7 @@ function yv(e, t) {
|
|
|
29008
29024
|
}
|
|
29009
29025
|
function gv(e, t) {
|
|
29010
29026
|
const n = e.source.body, r = Sy(n, t + 2);
|
|
29011
|
-
if (
|
|
29027
|
+
if (zs(r))
|
|
29012
29028
|
return {
|
|
29013
29029
|
value: String.fromCodePoint(r),
|
|
29014
29030
|
size: 6
|
|
@@ -29114,7 +29130,7 @@ function wv(e, t) {
|
|
|
29114
29130
|
c += n.slice(o, s), a.push(c), u === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
|
|
29115
29131
|
continue;
|
|
29116
29132
|
}
|
|
29117
|
-
if (
|
|
29133
|
+
if (zs(u))
|
|
29118
29134
|
++s;
|
|
29119
29135
|
else if (Tu(n, s))
|
|
29120
29136
|
s += 2;
|
|
@@ -29375,7 +29391,7 @@ class Nv {
|
|
|
29375
29391
|
if (this.peek(ee.BRACE_L))
|
|
29376
29392
|
return this.node(t, {
|
|
29377
29393
|
kind: Se.OPERATION_DEFINITION,
|
|
29378
|
-
operation:
|
|
29394
|
+
operation: bs.QUERY,
|
|
29379
29395
|
name: void 0,
|
|
29380
29396
|
variableDefinitions: [],
|
|
29381
29397
|
directives: [],
|
|
@@ -29399,11 +29415,11 @@ class Nv {
|
|
|
29399
29415
|
const t = this.expectToken(ee.NAME);
|
|
29400
29416
|
switch (t.value) {
|
|
29401
29417
|
case "query":
|
|
29402
|
-
return
|
|
29418
|
+
return bs.QUERY;
|
|
29403
29419
|
case "mutation":
|
|
29404
|
-
return
|
|
29420
|
+
return bs.MUTATION;
|
|
29405
29421
|
case "subscription":
|
|
29406
|
-
return
|
|
29422
|
+
return bs.SUBSCRIPTION;
|
|
29407
29423
|
}
|
|
29408
29424
|
throw this.unexpected(t);
|
|
29409
29425
|
}
|
|
@@ -30958,7 +30974,7 @@ ${String(e)}`);
|
|
|
30958
30974
|
}
|
|
30959
30975
|
}, r = await Gv(t.method)(t);
|
|
30960
30976
|
if (!r.ok)
|
|
30961
|
-
return new
|
|
30977
|
+
return new Bs({ status: r.status, headers: r.headers }, {
|
|
30962
30978
|
query: e.request._tag === "Single" ? e.request.document.expression : e.request.query,
|
|
30963
30979
|
variables: e.request.variables
|
|
30964
30980
|
});
|
|
@@ -30974,7 +30990,7 @@ ${String(e)}`);
|
|
|
30974
30990
|
...i.executionResult,
|
|
30975
30991
|
...s
|
|
30976
30992
|
};
|
|
30977
|
-
return new
|
|
30993
|
+
return new Bs(o, {
|
|
30978
30994
|
query: e.request._tag === "Single" ? e.request.document.expression : e.request.query,
|
|
30979
30995
|
variables: e.request.variables
|
|
30980
30996
|
});
|
|
@@ -31172,7 +31188,7 @@ const Yv = (e, t, n) => e.document ? e : {
|
|
|
31172
31188
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
31173
31189
|
* MIT Licence
|
|
31174
31190
|
*/
|
|
31175
|
-
var
|
|
31191
|
+
var Es = 9e15, mi = 1e9, _l = "0123456789abcdef", La = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", qa = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Sl = {
|
|
31176
31192
|
// These values must be integers within the stated ranges (inclusive).
|
|
31177
31193
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
31178
31194
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -31221,11 +31237,11 @@ var bs = 9e15, mi = 1e9, _l = "0123456789abcdef", La = "2.3025850929940456840179
|
|
|
31221
31237
|
// 0 to EXP_LIMIT
|
|
31222
31238
|
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
31223
31239
|
// JavaScript numbers: -324 (5e-324)
|
|
31224
|
-
minE: -
|
|
31240
|
+
minE: -Es,
|
|
31225
31241
|
// -1 to -EXP_LIMIT
|
|
31226
31242
|
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
31227
31243
|
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
31228
|
-
maxE:
|
|
31244
|
+
maxE: Es,
|
|
31229
31245
|
// 1 to EXP_LIMIT
|
|
31230
31246
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
31231
31247
|
crypto: !1
|
|
@@ -31308,7 +31324,7 @@ se.hyperbolicCosine = se.cosh = function() {
|
|
|
31308
31324
|
var e, t, n, r, i, s = this, o = s.constructor, c = new o(1);
|
|
31309
31325
|
if (!s.isFinite()) return new o(s.s ? 1 / 0 : NaN);
|
|
31310
31326
|
if (s.isZero()) return c;
|
|
31311
|
-
n = o.precision, r = o.rounding, o.precision = n + Math.max(s.e, s.sd()) + 4, o.rounding = 1, i = s.d.length, i < 32 ? (e = Math.ceil(i / 3), t = (1 / Iu(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), s =
|
|
31327
|
+
n = o.precision, r = o.rounding, o.precision = n + Math.max(s.e, s.sd()) + 4, o.rounding = 1, i = s.d.length, i < 32 ? (e = Math.ceil(i / 3), t = (1 / Iu(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), s = Ms(o, 1, s.times(t), new o(1), !0);
|
|
31312
31328
|
for (var a, u = e, f = new o(8); u--; )
|
|
31313
31329
|
a = s.times(s), s = c.minus(a.times(f.minus(a.times(f))));
|
|
31314
31330
|
return be(s, o.precision = n, o.rounding = r, !0);
|
|
@@ -31317,9 +31333,9 @@ se.hyperbolicSine = se.sinh = function() {
|
|
|
31317
31333
|
var e, t, n, r, i = this, s = i.constructor;
|
|
31318
31334
|
if (!i.isFinite() || i.isZero()) return new s(i);
|
|
31319
31335
|
if (t = s.precision, n = s.rounding, s.precision = t + Math.max(i.e, i.sd()) + 4, s.rounding = 1, r = i.d.length, r < 3)
|
|
31320
|
-
i =
|
|
31336
|
+
i = Ms(s, 2, i, i, !0);
|
|
31321
31337
|
else {
|
|
31322
|
-
e = 1.4 * Math.sqrt(r), e = e > 16 ? 16 : e | 0, i = i.times(1 / Iu(5, e)), i =
|
|
31338
|
+
e = 1.4 * Math.sqrt(r), e = e > 16 ? 16 : e | 0, i = i.times(1 / Iu(5, e)), i = Ms(s, 2, i, i, !0);
|
|
31323
31339
|
for (var o, c = new s(5), a = new s(16), u = new s(20); e--; )
|
|
31324
31340
|
o = i.times(i), i = i.times(c.plus(o.times(a.times(o).plus(u))));
|
|
31325
31341
|
}
|
|
@@ -31643,7 +31659,7 @@ function aa(e, t, n) {
|
|
|
31643
31659
|
function rI(e, t) {
|
|
31644
31660
|
var n, r, i;
|
|
31645
31661
|
if (t.isZero()) return t;
|
|
31646
|
-
r = t.d.length, r < 32 ? (n = Math.ceil(r / 3), i = (1 / Iu(4, n)).toString()) : (n = 16, i = "2.3283064365386962890625e-10"), e.precision += n, t =
|
|
31662
|
+
r = t.d.length, r < 32 ? (n = Math.ceil(r / 3), i = (1 / Iu(4, n)).toString()) : (n = 16, i = "2.3283064365386962890625e-10"), e.precision += n, t = Ms(e, 1, t.times(i), new e(1));
|
|
31647
31663
|
for (var s = n; s--; ) {
|
|
31648
31664
|
var o = t.times(t);
|
|
31649
31665
|
t = o.times(o).minus(o).times(8).plus(1);
|
|
@@ -31882,13 +31898,13 @@ function iI(e, t) {
|
|
|
31882
31898
|
function sI(e, t) {
|
|
31883
31899
|
var n, r = t.d.length;
|
|
31884
31900
|
if (r < 3)
|
|
31885
|
-
return t.isZero() ? t :
|
|
31886
|
-
n = 1.4 * Math.sqrt(r), n = n > 16 ? 16 : n | 0, t = t.times(1 / Iu(5, n)), t =
|
|
31901
|
+
return t.isZero() ? t : Ms(e, 2, t, t);
|
|
31902
|
+
n = 1.4 * Math.sqrt(r), n = n > 16 ? 16 : n | 0, t = t.times(1 / Iu(5, n)), t = Ms(e, 2, t, t);
|
|
31887
31903
|
for (var i, s = new e(5), o = new e(16), c = new e(20); n--; )
|
|
31888
31904
|
i = t.times(t), t = t.times(s.plus(i.times(o.times(i).minus(c))));
|
|
31889
31905
|
return t;
|
|
31890
31906
|
}
|
|
31891
|
-
function
|
|
31907
|
+
function Ms(e, t, n, r, i) {
|
|
31892
31908
|
var s, o, c, a, u = e.precision, f = Math.ceil(u / _e);
|
|
31893
31909
|
for (Ae = !1, a = n.times(n), c = new e(r); ; ) {
|
|
31894
31910
|
if (o = Ze(c.times(a), new e(t++ * t++), u, 1), c = i ? r.plus(o) : r.minus(o), r = Ze(o.times(a), new e(t++ * t++), u, 1), o = c.plus(r), o.d[f] !== void 0) {
|
|
@@ -32001,16 +32017,16 @@ function wI(e) {
|
|
|
32001
32017
|
0,
|
|
32002
32018
|
8,
|
|
32003
32019
|
"toExpNeg",
|
|
32004
|
-
-
|
|
32020
|
+
-Es,
|
|
32005
32021
|
0,
|
|
32006
32022
|
"toExpPos",
|
|
32007
32023
|
0,
|
|
32008
|
-
|
|
32024
|
+
Es,
|
|
32009
32025
|
"maxE",
|
|
32010
32026
|
0,
|
|
32011
|
-
|
|
32027
|
+
Es,
|
|
32012
32028
|
"minE",
|
|
32013
|
-
-
|
|
32029
|
+
-Es,
|
|
32014
32030
|
0,
|
|
32015
32031
|
"modulo",
|
|
32016
32032
|
0,
|