@omnity/ree-client-ts-sdk 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +15 -15
- package/dist/index.es.js +538 -512
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1158,7 +1158,7 @@ function Bw() {
|
|
|
1158
1158
|
return fh || (fh = 1, Object.defineProperty(Fs, "__esModule", { value: !0 }), Fs.crypto = void 0, Fs.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Fs;
|
|
1159
1159
|
}
|
|
1160
1160
|
var lh;
|
|
1161
|
-
function
|
|
1161
|
+
function ni() {
|
|
1162
1162
|
return lh || (lh = 1, (function(e) {
|
|
1163
1163
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1164
1164
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = n, e.anumber = r, e.abytes = i, e.ahash = s, e.aexists = o, e.aoutput = c, e.u8 = a, e.u32 = u, e.clean = f, e.createView = l, e.rotr = p, e.rotl = y, e.byteSwap = g, e.byteSwap32 = w, e.bytesToHex = S, e.hexToBytes = I, e.asyncLoop = U, e.utf8ToBytes = M, e.bytesToUtf8 = v, e.toBytes = R, e.kdfInputToBytes = V, e.concatBytes = W, e.checkOpts = H, e.createHasher = N, e.createOptHasher = $, e.createXOFer = F, e.randomBytes = x;
|
|
@@ -1332,7 +1332,7 @@ var hh;
|
|
|
1332
1332
|
function Lp() {
|
|
1333
1333
|
if (hh) return Ut;
|
|
1334
1334
|
hh = 1, Object.defineProperty(Ut, "__esModule", { value: !0 }), Ut.SHA512_IV = Ut.SHA384_IV = Ut.SHA224_IV = Ut.SHA256_IV = Ut.HashMD = void 0, Ut.setBigUint64 = t, Ut.Chi = n, Ut.Maj = r;
|
|
1335
|
-
const e = /* @__PURE__ */
|
|
1335
|
+
const e = /* @__PURE__ */ ni();
|
|
1336
1336
|
function t(s, o, c, a) {
|
|
1337
1337
|
if (typeof s.setBigUint64 == "function")
|
|
1338
1338
|
return s.setBigUint64(o, c, a);
|
|
@@ -1539,7 +1539,7 @@ var ph;
|
|
|
1539
1539
|
function Kp() {
|
|
1540
1540
|
if (ph) return $e;
|
|
1541
1541
|
ph = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.sha512_224 = $e.sha512_256 = $e.sha384 = $e.sha512 = $e.sha224 = $e.sha256 = $e.SHA512_256 = $e.SHA512_224 = $e.SHA384 = $e.SHA512 = $e.SHA224 = $e.SHA256 = void 0;
|
|
1542
|
-
const e = /* @__PURE__ */ Lp(), t = /* @__PURE__ */ Iw(), n = /* @__PURE__ */
|
|
1542
|
+
const e = /* @__PURE__ */ Lp(), t = /* @__PURE__ */ Iw(), n = /* @__PURE__ */ ni(), r = /* @__PURE__ */ Uint32Array.from([
|
|
1543
1543
|
1116352408,
|
|
1544
1544
|
1899447441,
|
|
1545
1545
|
3049323471,
|
|
@@ -1822,7 +1822,7 @@ var Ms = {}, hu = {}, du = {}, yh;
|
|
|
1822
1822
|
function Ow() {
|
|
1823
1823
|
return yh || (yh = 1, (function(e) {
|
|
1824
1824
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.hmac = e.HMAC = void 0;
|
|
1825
|
-
const t = /* @__PURE__ */
|
|
1825
|
+
const t = /* @__PURE__ */ ni();
|
|
1826
1826
|
class n extends t.Hash {
|
|
1827
1827
|
constructor(s, o) {
|
|
1828
1828
|
super(), this.finished = !1, this.destroyed = !1, (0, t.ahash)(s);
|
|
@@ -1871,8 +1871,8 @@ function vs() {
|
|
|
1871
1871
|
return gh || (gh = 1, (function(e) {
|
|
1872
1872
|
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 = p, e.numberToBytesLE = y, e.numberToVarBytesBE = g, e.ensureBytes = w, e.equalBytes = E, e.copyBytes = _, e.asciiToBytes = S, e.inRange = T, e.aInRange = I, e.bitLen = A, e.bitGet = U, e.bitSet = M, e.createHmacDrbg = R, e.validateObject = W, e.isHash = H, e._validateObject = K, e.memoized = $;
|
|
1873
1873
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1874
|
-
const t = /* @__PURE__ */
|
|
1875
|
-
var n = /* @__PURE__ */
|
|
1874
|
+
const t = /* @__PURE__ */ ni();
|
|
1875
|
+
var n = /* @__PURE__ */ ni();
|
|
1876
1876
|
Object.defineProperty(e, "abytes", { enumerable: !0, get: function() {
|
|
1877
1877
|
return n.abytes;
|
|
1878
1878
|
} }), Object.defineProperty(e, "anumber", { enumerable: !0, get: function() {
|
|
@@ -2596,7 +2596,7 @@ function $p() {
|
|
|
2596
2596
|
return bh || (bh = 1, (function(e) {
|
|
2597
2597
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.DER = e.DERErr = void 0, e._splitEndoScalar = c, e._normFnElement = E, e.weierstrassN = _, e.SWUFpSqrtRatio = m, e.mapToCurveSimpleSWU = T, e.ecdh = A, e.ecdsa = U, e.weierstrassPoints = M, e._legacyHelperEquat = V, e.weierstrass = K;
|
|
2598
2598
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2599
|
-
const t = /* @__PURE__ */ Ow(), n = /* @__PURE__ */
|
|
2599
|
+
const t = /* @__PURE__ */ Ow(), n = /* @__PURE__ */ ni(), r = /* @__PURE__ */ vs(), i = /* @__PURE__ */ Pw(), s = /* @__PURE__ */ Lo(), o = (N, $) => (N + (N >= 0 ? $ : -$) / y) / $;
|
|
2600
2600
|
function c(N, $, F) {
|
|
2601
2601
|
const [[x, O], [q, P]] = $, L = o(P * N, F), G = o(-O * N, F);
|
|
2602
2602
|
let X = N - L * x - G * q, Y = -L * O - G * P;
|
|
@@ -3607,7 +3607,7 @@ function Uw() {
|
|
|
3607
3607
|
return Sh || (Sh = 1, (function(e) {
|
|
3608
3608
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.encodeToCurve = e.hashToCurve = e.secp256k1_hasher = e.schnorr = e.secp256k1 = void 0;
|
|
3609
3609
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3610
|
-
const t = /* @__PURE__ */ Kp(), n = /* @__PURE__ */
|
|
3610
|
+
const t = /* @__PURE__ */ Kp(), n = /* @__PURE__ */ ni(), r = /* @__PURE__ */ kw(), i = /* @__PURE__ */ Nw(), s = /* @__PURE__ */ Lo(), o = /* @__PURE__ */ $p(), c = /* @__PURE__ */ vs(), a = {
|
|
3611
3611
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
3612
3612
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
3613
3613
|
h: BigInt(1),
|
|
@@ -4375,7 +4375,7 @@ function Ww(e) {
|
|
|
4375
4375
|
t[n * 2] = jc[e[n] >> 4], t[n * 2 + 1] = jc[e[n] & 15];
|
|
4376
4376
|
return Xp.decode(t);
|
|
4377
4377
|
}
|
|
4378
|
-
function
|
|
4378
|
+
function Ar(e) {
|
|
4379
4379
|
const t = Dp.encode(e || ""), n = new Uint8Array(Math.floor(t.length / 2));
|
|
4380
4380
|
let r;
|
|
4381
4381
|
for (r = 0; r < n.length; r++) {
|
|
@@ -4430,7 +4430,7 @@ function Xw(e, t, n, r) {
|
|
|
4430
4430
|
throw new Error(`The value of "value" is out of range. It must be >= 0 and <= ${0xffffffffffffffffn}. Received ${n}`);
|
|
4431
4431
|
return r === "LE" ? (e[t] = Number(n & 0xffn), e[t + 1] = Number(n >> 8n & 0xffn), e[t + 2] = Number(n >> 16n & 0xffn), e[t + 3] = Number(n >> 24n & 0xffn), e[t + 4] = Number(n >> 32n & 0xffn), e[t + 5] = Number(n >> 40n & 0xffn), e[t + 6] = Number(n >> 48n & 0xffn), e[t + 7] = Number(n >> 56n & 0xffn)) : (e[t] = Number(n >> 56n & 0xffn), e[t + 1] = Number(n >> 48n & 0xffn), e[t + 2] = Number(n >> 40n & 0xffn), e[t + 3] = Number(n >> 32n & 0xffn), e[t + 4] = Number(n >> 24n & 0xffn), e[t + 5] = Number(n >> 16n & 0xffn), e[t + 6] = Number(n >> 8n & 0xffn), e[t + 7] = Number(n & 0xffn)), t + 8;
|
|
4432
4432
|
}
|
|
4433
|
-
function
|
|
4433
|
+
function Er(e, t) {
|
|
4434
4434
|
if (t + 1 > e.length)
|
|
4435
4435
|
throw new Error("Offset is outside the bounds of Uint8Array");
|
|
4436
4436
|
return e[t];
|
|
@@ -4502,13 +4502,13 @@ function Zw(e, t, n) {
|
|
|
4502
4502
|
return r === 1 ? dn(e, n, t) : r === 2 ? (dn(e, n, Ke.OP_PUSHDATA1), dn(e, n + 1, t)) : r === 3 ? (dn(e, n, Ke.OP_PUSHDATA2), Dw(e, n + 1, t, "LE")) : (dn(e, n, Ke.OP_PUSHDATA4), Ko(e, n + 1, t, "LE")), r;
|
|
4503
4503
|
}
|
|
4504
4504
|
function Jw(e, t) {
|
|
4505
|
-
const n =
|
|
4505
|
+
const n = Er(e, t);
|
|
4506
4506
|
let r, i;
|
|
4507
4507
|
if (n < Ke.OP_PUSHDATA1)
|
|
4508
4508
|
r = n, i = 1;
|
|
4509
4509
|
else if (n === Ke.OP_PUSHDATA1) {
|
|
4510
4510
|
if (t + 2 > e.length) return null;
|
|
4511
|
-
r =
|
|
4511
|
+
r = Er(e, t + 1), i = 2;
|
|
4512
4512
|
} else if (n === Ke.OP_PUSHDATA2) {
|
|
4513
4513
|
if (t + 3 > e.length) return null;
|
|
4514
4514
|
r = zw(e, t + 1, "LE"), i = 3;
|
|
@@ -5014,7 +5014,7 @@ function rt(e, t, n) {
|
|
|
5014
5014
|
throw new um(r.issues);
|
|
5015
5015
|
return r.value;
|
|
5016
5016
|
}
|
|
5017
|
-
function
|
|
5017
|
+
function ri(e, t) {
|
|
5018
5018
|
const n = {};
|
|
5019
5019
|
for (const r in e.entries)
|
|
5020
5020
|
n[r] = Gc(e.entries[r]);
|
|
@@ -5037,7 +5037,7 @@ function Is(...e) {
|
|
|
5037
5037
|
}
|
|
5038
5038
|
};
|
|
5039
5039
|
}
|
|
5040
|
-
const vh = new Uint8Array(32), Bh =
|
|
5040
|
+
const vh = new Uint8Array(32), Bh = Ar(
|
|
5041
5041
|
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
|
|
5042
5042
|
), Et = (e) => Is(Ia(Uint8Array), ty(e));
|
|
5043
5043
|
function ho(e, t) {
|
|
@@ -5066,7 +5066,7 @@ const hm = Is(
|
|
|
5066
5066
|
Yf(),
|
|
5067
5067
|
va(0),
|
|
5068
5068
|
Aa(255)
|
|
5069
|
-
),
|
|
5069
|
+
), ur = Is(
|
|
5070
5070
|
sn(),
|
|
5071
5071
|
Yf(),
|
|
5072
5072
|
va(0),
|
|
@@ -5092,7 +5092,7 @@ function Nh(e) {
|
|
|
5092
5092
|
return t.set(e, n), t;
|
|
5093
5093
|
}
|
|
5094
5094
|
function dm(e) {
|
|
5095
|
-
const t =
|
|
5095
|
+
const t = Er(e, e.length - 1);
|
|
5096
5096
|
if (!tl(t))
|
|
5097
5097
|
throw new Error("Invalid hashType " + t);
|
|
5098
5098
|
const n = Vw(e.subarray(0, -1)), r = Nh(n.r), i = Nh(n.s);
|
|
@@ -5204,7 +5204,7 @@ function tl(e) {
|
|
|
5204
5204
|
const t = e & -129;
|
|
5205
5205
|
return t > 0 && t < 4;
|
|
5206
5206
|
}
|
|
5207
|
-
function
|
|
5207
|
+
function _r(e) {
|
|
5208
5208
|
return !(e instanceof Uint8Array) || !tl(e[e.length - 1]) ? !1 : qw(e.slice(0, -1));
|
|
5209
5209
|
}
|
|
5210
5210
|
const co = ym;
|
|
@@ -5236,10 +5236,10 @@ function Oa(e, t) {
|
|
|
5236
5236
|
throw new TypeError("Not enough data");
|
|
5237
5237
|
t = Object.assign({ validate: !0 }, t || {});
|
|
5238
5238
|
function n(a) {
|
|
5239
|
-
return
|
|
5239
|
+
return _r(a) || (t.allowIncomplete && a === rs.OP_0) !== void 0;
|
|
5240
5240
|
}
|
|
5241
5241
|
rt(
|
|
5242
|
-
|
|
5242
|
+
ri(
|
|
5243
5243
|
yt({
|
|
5244
5244
|
network: yt({}),
|
|
5245
5245
|
m: sn(),
|
|
@@ -5334,13 +5334,13 @@ function hy(e, t) {
|
|
|
5334
5334
|
if (!e.input && !e.output && !e.pubkey && !e.input && !e.signature)
|
|
5335
5335
|
throw new TypeError("Not enough data");
|
|
5336
5336
|
t = Object.assign({ validate: !0 }, t || {}), rt(
|
|
5337
|
-
|
|
5337
|
+
ri(
|
|
5338
5338
|
yt({
|
|
5339
5339
|
network: yt({}),
|
|
5340
5340
|
output: qe,
|
|
5341
5341
|
pubkey: Mn(Hn, "invalid pubkey"),
|
|
5342
5342
|
signature: Mn(
|
|
5343
|
-
|
|
5343
|
+
_r,
|
|
5344
5344
|
"Expected signature to be of type isCanonicalScriptSignature"
|
|
5345
5345
|
),
|
|
5346
5346
|
input: qe
|
|
@@ -5376,7 +5376,7 @@ function hy(e, t) {
|
|
|
5376
5376
|
throw new TypeError("Signature mismatch");
|
|
5377
5377
|
if (e.input) {
|
|
5378
5378
|
if (n().length !== 1) throw new TypeError("Input is invalid");
|
|
5379
|
-
if (!
|
|
5379
|
+
if (!_r(i.signature))
|
|
5380
5380
|
throw new TypeError("Input has invalid signature");
|
|
5381
5381
|
}
|
|
5382
5382
|
}
|
|
@@ -5556,7 +5556,7 @@ class nl extends xm {
|
|
|
5556
5556
|
return this._cloneInto();
|
|
5557
5557
|
}
|
|
5558
5558
|
}
|
|
5559
|
-
const
|
|
5559
|
+
const Br = /* @__PURE__ */ Uint32Array.from([
|
|
5560
5560
|
1779033703,
|
|
5561
5561
|
3144134277,
|
|
5562
5562
|
1013904242,
|
|
@@ -5565,7 +5565,7 @@ const Ar = /* @__PURE__ */ Uint32Array.from([
|
|
|
5565
5565
|
2600822924,
|
|
5566
5566
|
528734635,
|
|
5567
5567
|
1541459225
|
|
5568
|
-
]),
|
|
5568
|
+
]), Ir = /* @__PURE__ */ Uint32Array.from([
|
|
5569
5569
|
3238371032,
|
|
5570
5570
|
914150663,
|
|
5571
5571
|
812702999,
|
|
@@ -5755,10 +5755,10 @@ const qm = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Vm = (e, t, n, r) =>
|
|
|
5755
5755
|
2756734187,
|
|
5756
5756
|
3204031479,
|
|
5757
5757
|
3329325298
|
|
5758
|
-
]),
|
|
5758
|
+
]), Or = /* @__PURE__ */ new Uint32Array(64);
|
|
5759
5759
|
class _y extends nl {
|
|
5760
5760
|
constructor(t = 32) {
|
|
5761
|
-
super(64, t, 8, !1), this.A =
|
|
5761
|
+
super(64, t, 8, !1), this.A = Br[0] | 0, this.B = Br[1] | 0, this.C = Br[2] | 0, this.D = Br[3] | 0, this.E = Br[4] | 0, this.F = Br[5] | 0, this.G = Br[6] | 0, this.H = Br[7] | 0;
|
|
5762
5762
|
}
|
|
5763
5763
|
get() {
|
|
5764
5764
|
const { A: t, B: n, C: r, D: i, E: s, F: o, G: c, H: a } = this;
|
|
@@ -5770,20 +5770,20 @@ class _y extends nl {
|
|
|
5770
5770
|
}
|
|
5771
5771
|
process(t, n) {
|
|
5772
5772
|
for (let l = 0; l < 16; l++, n += 4)
|
|
5773
|
-
|
|
5773
|
+
Or[l] = t.getUint32(n, !1);
|
|
5774
5774
|
for (let l = 16; l < 64; l++) {
|
|
5775
|
-
const p =
|
|
5776
|
-
|
|
5775
|
+
const p = Or[l - 15], y = Or[l - 2], g = Kn(p, 7) ^ Kn(p, 18) ^ p >>> 3, w = Kn(y, 17) ^ Kn(y, 19) ^ y >>> 10;
|
|
5776
|
+
Or[l] = w + Or[l - 7] + g + Or[l - 16] | 0;
|
|
5777
5777
|
}
|
|
5778
5778
|
let { A: r, B: i, C: s, D: o, E: c, F: a, G: u, H: f } = this;
|
|
5779
5779
|
for (let l = 0; l < 64; l++) {
|
|
5780
|
-
const p = Kn(c, 6) ^ Kn(c, 11) ^ Kn(c, 25), y = f + p + vm(c, a, u) + Wm[l] +
|
|
5780
|
+
const p = Kn(c, 6) ^ Kn(c, 11) ^ Kn(c, 25), y = f + p + vm(c, a, u) + Wm[l] + Or[l] | 0, w = (Kn(r, 2) ^ Kn(r, 13) ^ Kn(r, 22)) + Bm(r, i, s) | 0;
|
|
5781
5781
|
f = u, u = a, a = c, c = o + y | 0, o = s, s = i, i = r, r = y + w | 0;
|
|
5782
5782
|
}
|
|
5783
5783
|
r = r + this.A | 0, i = i + this.B | 0, s = s + this.C | 0, o = o + this.D | 0, c = c + this.E | 0, a = a + this.F | 0, u = u + this.G | 0, f = f + this.H | 0, this.set(r, i, s, o, c, a, u, f);
|
|
5784
5784
|
}
|
|
5785
5785
|
roundClean() {
|
|
5786
|
-
Ri(
|
|
5786
|
+
Ri(Or);
|
|
5787
5787
|
}
|
|
5788
5788
|
destroy() {
|
|
5789
5789
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ri(this.buffer);
|
|
@@ -5791,7 +5791,7 @@ class _y extends nl {
|
|
|
5791
5791
|
}
|
|
5792
5792
|
class Gm extends _y {
|
|
5793
5793
|
constructor() {
|
|
5794
|
-
super(28), this.A =
|
|
5794
|
+
super(28), this.A = Ir[0] | 0, this.B = Ir[1] | 0, this.C = Ir[2] | 0, this.D = Ir[3] | 0, this.E = Ir[4] | 0, this.F = Ir[5] | 0, this.G = Ir[6] | 0, this.H = Ir[7] | 0;
|
|
5795
5795
|
}
|
|
5796
5796
|
}
|
|
5797
5797
|
const Sy = Mm([
|
|
@@ -5875,7 +5875,7 @@ const Sy = Mm([
|
|
|
5875
5875
|
"0x597f299cfc657e2a",
|
|
5876
5876
|
"0x5fcb6fab3ad6faec",
|
|
5877
5877
|
"0x6c44198c4a475817"
|
|
5878
|
-
].map((e) => BigInt(e))), Dm = Sy[0], Xm = Sy[1],
|
|
5878
|
+
].map((e) => BigInt(e))), Dm = Sy[0], Xm = Sy[1], Pr = /* @__PURE__ */ new Uint32Array(80), kr = /* @__PURE__ */ new Uint32Array(80);
|
|
5879
5879
|
class zm extends nl {
|
|
5880
5880
|
constructor(t = 64) {
|
|
5881
5881
|
super(128, t, 16, !1), this.Ah = Rt[0] | 0, this.Al = Rt[1] | 0, this.Bh = Rt[2] | 0, this.Bl = Rt[3] | 0, this.Ch = Rt[4] | 0, this.Cl = Rt[5] | 0, this.Dh = Rt[6] | 0, this.Dl = Rt[7] | 0, this.Eh = Rt[8] | 0, this.El = Rt[9] | 0, this.Fh = Rt[10] | 0, this.Fl = Rt[11] | 0, this.Gh = Rt[12] | 0, this.Gl = Rt[13] | 0, this.Hh = Rt[14] | 0, this.Hl = Rt[15] | 0;
|
|
@@ -5891,14 +5891,14 @@ class zm extends nl {
|
|
|
5891
5891
|
}
|
|
5892
5892
|
process(t, n) {
|
|
5893
5893
|
for (let m = 0; m < 16; m++, n += 4)
|
|
5894
|
-
|
|
5894
|
+
Pr[m] = t.getUint32(n), kr[m] = t.getUint32(n += 4);
|
|
5895
5895
|
for (let m = 16; m < 80; m++) {
|
|
5896
|
-
const T =
|
|
5897
|
-
|
|
5896
|
+
const T = Pr[m - 15] | 0, I = kr[m - 15] | 0, A = zi(T, I, 1) ^ zi(T, I, 8) ^ Mh(T, I, 7), U = Yi(T, I, 1) ^ Yi(T, I, 8) ^ qh(T, I, 7), M = Pr[m - 2] | 0, v = kr[m - 2] | 0, R = zi(M, v, 19) ^ hc(M, v, 61) ^ Mh(M, v, 6), V = Yi(M, v, 19) ^ dc(M, v, 61) ^ qh(M, v, 6), W = Lm(U, V, kr[m - 7], kr[m - 16]), H = Km(W, A, R, Pr[m - 7], Pr[m - 16]);
|
|
5897
|
+
Pr[m] = H | 0, kr[m] = W | 0;
|
|
5898
5898
|
}
|
|
5899
5899
|
let { Ah: r, Al: i, Bh: s, Bl: o, Ch: c, Cl: a, Dh: u, Dl: f, Eh: l, El: p, Fh: y, Fl: g, Gh: w, Gl: E, Hh: _, Hl: S } = this;
|
|
5900
5900
|
for (let m = 0; m < 80; m++) {
|
|
5901
|
-
const T = zi(l, p, 14) ^ zi(l, p, 18) ^ hc(l, p, 41), I = Yi(l, p, 14) ^ Yi(l, p, 18) ^ dc(l, p, 41), A = l & y ^ ~l & w, U = p & g ^ ~p & E, M = $m(S, I, U, Xm[m],
|
|
5901
|
+
const T = zi(l, p, 14) ^ zi(l, p, 18) ^ hc(l, p, 41), I = Yi(l, p, 14) ^ Yi(l, p, 18) ^ dc(l, p, 41), A = l & y ^ ~l & w, U = p & g ^ ~p & E, M = $m(S, I, U, Xm[m], kr[m]), v = jm(M, _, T, A, Dm[m], Pr[m]), R = M | 0, V = zi(r, i, 28) ^ hc(r, i, 34) ^ hc(r, i, 39), W = Yi(r, i, 28) ^ dc(r, i, 34) ^ dc(r, i, 39), H = r & s ^ r & c ^ s & c, K = i & o ^ i & a ^ o & a;
|
|
5902
5902
|
_ = w | 0, S = E | 0, w = y | 0, E = g | 0, y = l | 0, g = p | 0, { h: l, l: p } = Qn(u | 0, f | 0, v | 0, R | 0), u = c | 0, f = a | 0, c = s | 0, a = o | 0, s = r | 0, o = i | 0;
|
|
5903
5903
|
const N = qm(R, W, K);
|
|
5904
5904
|
r = Vm(N, v, V, H), i = N | 0;
|
|
@@ -5906,17 +5906,17 @@ class zm extends nl {
|
|
|
5906
5906
|
({ h: r, l: i } = Qn(this.Ah | 0, this.Al | 0, r | 0, i | 0)), { h: s, l: o } = Qn(this.Bh | 0, this.Bl | 0, s | 0, o | 0), { h: c, l: a } = Qn(this.Ch | 0, this.Cl | 0, c | 0, a | 0), { h: u, l: f } = Qn(this.Dh | 0, this.Dl | 0, u | 0, f | 0), { h: l, l: p } = Qn(this.Eh | 0, this.El | 0, l | 0, p | 0), { h: y, l: g } = Qn(this.Fh | 0, this.Fl | 0, y | 0, g | 0), { h: w, l: E } = Qn(this.Gh | 0, this.Gl | 0, w | 0, E | 0), { h: _, l: S } = Qn(this.Hh | 0, this.Hl | 0, _ | 0, S | 0), this.set(r, i, s, o, c, a, u, f, l, p, y, g, w, E, _, S);
|
|
5907
5907
|
}
|
|
5908
5908
|
roundClean() {
|
|
5909
|
-
Ri(
|
|
5909
|
+
Ri(Pr, kr);
|
|
5910
5910
|
}
|
|
5911
5911
|
destroy() {
|
|
5912
5912
|
Ri(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
5913
5913
|
}
|
|
5914
5914
|
}
|
|
5915
5915
|
const pn = /* @__PURE__ */ Pa(() => new _y()), Ym = /* @__PURE__ */ Pa(() => new Gm()), Zm = /* @__PURE__ */ Pa(() => new zm()), Xt = pn;
|
|
5916
|
-
function
|
|
5916
|
+
function br(e) {
|
|
5917
5917
|
return Hm(Xt(e));
|
|
5918
5918
|
}
|
|
5919
|
-
function
|
|
5919
|
+
function li(e) {
|
|
5920
5920
|
return Xt(Xt(e));
|
|
5921
5921
|
}
|
|
5922
5922
|
const Jm = {
|
|
@@ -6633,26 +6633,26 @@ function tb(e) {
|
|
|
6633
6633
|
function nb(e) {
|
|
6634
6634
|
return Xt(Xt(e));
|
|
6635
6635
|
}
|
|
6636
|
-
const po = tb(nb),
|
|
6636
|
+
const po = tb(nb), Nr = Ke;
|
|
6637
6637
|
function Wo(e, t) {
|
|
6638
6638
|
if (!e.address && !e.hash && !e.output && !e.pubkey && !e.input)
|
|
6639
6639
|
throw new TypeError("Not enough data");
|
|
6640
6640
|
t = Object.assign({ validate: !0 }, t || {}), rt(
|
|
6641
|
-
|
|
6641
|
+
ri(
|
|
6642
6642
|
yt({
|
|
6643
6643
|
network: yt({}),
|
|
6644
6644
|
address: Li(),
|
|
6645
6645
|
hash: lm,
|
|
6646
6646
|
output: Et(25),
|
|
6647
6647
|
pubkey: Mn(Hn),
|
|
6648
|
-
signature: Mn(
|
|
6648
|
+
signature: Mn(_r),
|
|
6649
6649
|
input: qe
|
|
6650
6650
|
})
|
|
6651
6651
|
),
|
|
6652
6652
|
e
|
|
6653
6653
|
);
|
|
6654
6654
|
const n = _n(() => {
|
|
6655
|
-
const o = po.decode(e.address), c =
|
|
6655
|
+
const o = po.decode(e.address), c = Er(o, 0), a = o.slice(1);
|
|
6656
6656
|
return { version: c, hash: a };
|
|
6657
6657
|
}), r = _n(() => ct(e.input)), i = e.network || vn, s = { name: "p2pkh", network: i };
|
|
6658
6658
|
if (Ee(s, "address", () => {
|
|
@@ -6662,15 +6662,15 @@ function Wo(e, t) {
|
|
|
6662
6662
|
}), Ee(s, "hash", () => {
|
|
6663
6663
|
if (e.output) return e.output.slice(3, 23);
|
|
6664
6664
|
if (e.address) return n().hash;
|
|
6665
|
-
if (e.pubkey || s.pubkey) return
|
|
6665
|
+
if (e.pubkey || s.pubkey) return br(e.pubkey || s.pubkey);
|
|
6666
6666
|
}), Ee(s, "output", () => {
|
|
6667
6667
|
if (s.hash)
|
|
6668
6668
|
return Yt([
|
|
6669
|
-
|
|
6670
|
-
|
|
6669
|
+
Nr.OP_DUP,
|
|
6670
|
+
Nr.OP_HASH160,
|
|
6671
6671
|
s.hash,
|
|
6672
|
-
|
|
6673
|
-
|
|
6672
|
+
Nr.OP_EQUALVERIFY,
|
|
6673
|
+
Nr.OP_CHECKSIG
|
|
6674
6674
|
]);
|
|
6675
6675
|
}), Ee(s, "pubkey", () => {
|
|
6676
6676
|
if (e.input)
|
|
@@ -6698,7 +6698,7 @@ function Wo(e, t) {
|
|
|
6698
6698
|
o = e.hash;
|
|
6699
6699
|
}
|
|
6700
6700
|
if (e.output) {
|
|
6701
|
-
if (e.output.length !== 25 || e.output[0] !==
|
|
6701
|
+
if (e.output.length !== 25 || e.output[0] !== Nr.OP_DUP || e.output[1] !== Nr.OP_HASH160 || e.output[2] !== 20 || e.output[23] !== Nr.OP_EQUALVERIFY || e.output[24] !== Nr.OP_CHECKSIG)
|
|
6702
6702
|
throw new TypeError("Output is invalid");
|
|
6703
6703
|
const c = e.output.slice(3, 23);
|
|
6704
6704
|
if (o.length > 0 && he(o, c) !== 0)
|
|
@@ -6706,7 +6706,7 @@ function Wo(e, t) {
|
|
|
6706
6706
|
o = c;
|
|
6707
6707
|
}
|
|
6708
6708
|
if (e.pubkey) {
|
|
6709
|
-
const c =
|
|
6709
|
+
const c = br(e.pubkey);
|
|
6710
6710
|
if (o.length > 0 && he(o, c) !== 0)
|
|
6711
6711
|
throw new TypeError("Hash mismatch");
|
|
6712
6712
|
o = c;
|
|
@@ -6714,14 +6714,14 @@ function Wo(e, t) {
|
|
|
6714
6714
|
if (e.input) {
|
|
6715
6715
|
const c = r();
|
|
6716
6716
|
if (c.length !== 2) throw new TypeError("Input is invalid");
|
|
6717
|
-
if (!
|
|
6717
|
+
if (!_r(c[0]))
|
|
6718
6718
|
throw new TypeError("Input has invalid signature");
|
|
6719
6719
|
if (!Hn(c[1])) throw new TypeError("Input has invalid pubkey");
|
|
6720
6720
|
if (e.signature && he(e.signature, c[0]) !== 0)
|
|
6721
6721
|
throw new TypeError("Signature mismatch");
|
|
6722
6722
|
if (e.pubkey && he(e.pubkey, c[1]) !== 0)
|
|
6723
6723
|
throw new TypeError("Pubkey mismatch");
|
|
6724
|
-
const a =
|
|
6724
|
+
const a = br(c[1]);
|
|
6725
6725
|
if (o.length > 0 && he(o, a) !== 0)
|
|
6726
6726
|
throw new TypeError("Hash mismatch");
|
|
6727
6727
|
}
|
|
@@ -6733,13 +6733,13 @@ function Go(e, t) {
|
|
|
6733
6733
|
if (!e.address && !e.hash && !e.output && !e.redeem && !e.input)
|
|
6734
6734
|
throw new TypeError("Not enough data");
|
|
6735
6735
|
t = Object.assign({ validate: !0 }, t || {}), rt(
|
|
6736
|
-
|
|
6736
|
+
ri(
|
|
6737
6737
|
yt({
|
|
6738
6738
|
network: yt({}),
|
|
6739
6739
|
address: Li(),
|
|
6740
6740
|
hash: Et(20),
|
|
6741
6741
|
output: Et(23),
|
|
6742
|
-
redeem:
|
|
6742
|
+
redeem: ri(
|
|
6743
6743
|
yt({
|
|
6744
6744
|
network: yt({}),
|
|
6745
6745
|
output: qe,
|
|
@@ -6756,7 +6756,7 @@ function Go(e, t) {
|
|
|
6756
6756
|
let n = e.network;
|
|
6757
6757
|
n || (n = e.redeem && e.redeem.network || vn);
|
|
6758
6758
|
const r = { network: n }, i = _n(() => {
|
|
6759
|
-
const c = po.decode(e.address), a =
|
|
6759
|
+
const c = po.decode(e.address), a = Er(c, 0), u = c.slice(1);
|
|
6760
6760
|
return { version: a, hash: u };
|
|
6761
6761
|
}), s = _n(() => ct(e.input)), o = _n(() => {
|
|
6762
6762
|
const c = s(), a = c[c.length - 1];
|
|
@@ -6774,7 +6774,7 @@ function Go(e, t) {
|
|
|
6774
6774
|
}), Ee(r, "hash", () => {
|
|
6775
6775
|
if (e.output) return e.output.slice(2, 22);
|
|
6776
6776
|
if (e.address) return i().hash;
|
|
6777
|
-
if (r.redeem && r.redeem.output) return
|
|
6777
|
+
if (r.redeem && r.redeem.output) return br(r.redeem.output);
|
|
6778
6778
|
}), Ee(r, "output", () => {
|
|
6779
6779
|
if (r.hash)
|
|
6780
6780
|
return Yt([qs.OP_HASH160, r.hash, qs.OP_EQUAL]);
|
|
@@ -6826,7 +6826,7 @@ function Go(e, t) {
|
|
|
6826
6826
|
throw new TypeError(
|
|
6827
6827
|
"Redeem.output unspendable with more than 201 non-push ops"
|
|
6828
6828
|
);
|
|
6829
|
-
const l =
|
|
6829
|
+
const l = br(u.output);
|
|
6830
6830
|
if (c.length > 0 && he(c, l) !== 0)
|
|
6831
6831
|
throw new TypeError("Hash mismatch");
|
|
6832
6832
|
c = l;
|
|
@@ -6867,10 +6867,10 @@ function Go(e, t) {
|
|
|
6867
6867
|
}
|
|
6868
6868
|
return Object.assign(r, e);
|
|
6869
6869
|
}
|
|
6870
|
-
var
|
|
6870
|
+
var hi = {}, Vh;
|
|
6871
6871
|
function Do() {
|
|
6872
|
-
if (Vh) return
|
|
6873
|
-
Vh = 1, Object.defineProperty(
|
|
6872
|
+
if (Vh) return hi;
|
|
6873
|
+
Vh = 1, Object.defineProperty(hi, "__esModule", { value: !0 }), hi.bech32m = hi.bech32 = void 0;
|
|
6874
6874
|
const e = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", t = {};
|
|
6875
6875
|
for (let u = 0; u < e.length; u++) {
|
|
6876
6876
|
const f = e.charAt(u);
|
|
@@ -7000,7 +7000,7 @@ function Do() {
|
|
|
7000
7000
|
fromWords: c
|
|
7001
7001
|
};
|
|
7002
7002
|
}
|
|
7003
|
-
return
|
|
7003
|
+
return hi.bech32 = a("bech32"), hi.bech32m = a("bech32m"), hi;
|
|
7004
7004
|
}
|
|
7005
7005
|
var qt = Do();
|
|
7006
7006
|
const Lh = Ke, rb = new Uint8Array(0);
|
|
@@ -7008,7 +7008,7 @@ function Na(e, t) {
|
|
|
7008
7008
|
if (!e.address && !e.hash && !e.output && !e.pubkey && !e.witness)
|
|
7009
7009
|
throw new TypeError("Not enough data");
|
|
7010
7010
|
t = Object.assign({ validate: !0 }, t || {}), rt(
|
|
7011
|
-
|
|
7011
|
+
ri(
|
|
7012
7012
|
yt({
|
|
7013
7013
|
address: Li(),
|
|
7014
7014
|
hash: Et(20),
|
|
@@ -7016,7 +7016,7 @@ function Na(e, t) {
|
|
|
7016
7016
|
network: yt({}),
|
|
7017
7017
|
output: Et(22),
|
|
7018
7018
|
pubkey: Mn(Hn, "Not a valid pubkey"),
|
|
7019
|
-
signature: Mn(
|
|
7019
|
+
signature: Mn(_r),
|
|
7020
7020
|
witness: cn(qe)
|
|
7021
7021
|
})
|
|
7022
7022
|
),
|
|
@@ -7037,7 +7037,7 @@ function Na(e, t) {
|
|
|
7037
7037
|
}), Ee(i, "hash", () => {
|
|
7038
7038
|
if (e.output) return e.output.slice(2, 22);
|
|
7039
7039
|
if (e.address) return n().data;
|
|
7040
|
-
if (e.pubkey || i.pubkey) return
|
|
7040
|
+
if (e.pubkey || i.pubkey) return br(e.pubkey || i.pubkey);
|
|
7041
7041
|
}), Ee(i, "output", () => {
|
|
7042
7042
|
if (i.hash)
|
|
7043
7043
|
return Yt([Lh.OP_0, i.hash]);
|
|
@@ -7078,7 +7078,7 @@ function Na(e, t) {
|
|
|
7078
7078
|
s = e.output.slice(2);
|
|
7079
7079
|
}
|
|
7080
7080
|
if (e.pubkey) {
|
|
7081
|
-
const o =
|
|
7081
|
+
const o = br(e.pubkey);
|
|
7082
7082
|
if (s.length > 0 && he(s, o) !== 0)
|
|
7083
7083
|
throw new TypeError("Hash mismatch");
|
|
7084
7084
|
if (s = o, !Hn(e.pubkey) || e.pubkey.length !== 33)
|
|
@@ -7086,7 +7086,7 @@ function Na(e, t) {
|
|
|
7086
7086
|
}
|
|
7087
7087
|
if (e.witness) {
|
|
7088
7088
|
if (e.witness.length !== 2) throw new TypeError("Witness is invalid");
|
|
7089
|
-
if (!
|
|
7089
|
+
if (!_r(e.witness[0]))
|
|
7090
7090
|
throw new TypeError("Witness has invalid signature");
|
|
7091
7091
|
if (!Hn(e.witness[1]) || e.witness[1].length !== 33)
|
|
7092
7092
|
throw new TypeError("Witness has invalid pubkey");
|
|
@@ -7094,7 +7094,7 @@ function Na(e, t) {
|
|
|
7094
7094
|
throw new TypeError("Signature mismatch");
|
|
7095
7095
|
if (e.pubkey && he(e.pubkey, e.witness[1]) !== 0)
|
|
7096
7096
|
throw new TypeError("Pubkey mismatch");
|
|
7097
|
-
const o =
|
|
7097
|
+
const o = br(e.witness[1]);
|
|
7098
7098
|
if (s.length > 0 && he(s, o) !== 0)
|
|
7099
7099
|
throw new TypeError("Hash mismatch");
|
|
7100
7100
|
}
|
|
@@ -7245,7 +7245,7 @@ function wf() {
|
|
|
7245
7245
|
);
|
|
7246
7246
|
return ao.eccLib;
|
|
7247
7247
|
}
|
|
7248
|
-
const er = (e) =>
|
|
7248
|
+
const er = (e) => Ar(e);
|
|
7249
7249
|
function sb(e) {
|
|
7250
7250
|
wn(typeof e.isXOnlyPoint == "function"), wn(
|
|
7251
7251
|
e.isXOnlyPoint(
|
|
@@ -7371,7 +7371,7 @@ function pb(e) {
|
|
|
7371
7371
|
function xy(e) {
|
|
7372
7372
|
typeof e == "number" ? pb(e) : db(e);
|
|
7373
7373
|
}
|
|
7374
|
-
function
|
|
7374
|
+
function ii(e, t, n) {
|
|
7375
7375
|
xy(e), n === void 0 && (n = 0), t === void 0 && (t = new Uint8Array(Tn(e)));
|
|
7376
7376
|
let r = 0;
|
|
7377
7377
|
return e < 253 ? (t.set([Number(e)], n), r = 1) : e <= 65535 ? (t.set([253], n), cb(t, n + 1, Number(e), "LE"), r = 3) : e <= 4294967295 ? (t.set([254], n), ab(t, n + 1, Number(e), "LE"), r = 5) : (t.set([255], n), ub(t, n + 1, BigInt(e), "LE"), r = 9), { buffer: t, bytes: r };
|
|
@@ -7434,7 +7434,7 @@ class Ht {
|
|
|
7434
7434
|
return new Ht(new Uint8Array(t));
|
|
7435
7435
|
}
|
|
7436
7436
|
constructor(t, n = 0) {
|
|
7437
|
-
this.buffer = t, this.offset = n, rt(Gn([qe,
|
|
7437
|
+
this.buffer = t, this.offset = n, rt(Gn([qe, ur]), [
|
|
7438
7438
|
t,
|
|
7439
7439
|
n
|
|
7440
7440
|
]);
|
|
@@ -7455,7 +7455,7 @@ class Ht {
|
|
|
7455
7455
|
this.offset = Xw(this.buffer, this.offset, BigInt(t), "LE");
|
|
7456
7456
|
}
|
|
7457
7457
|
writeVarInt(t) {
|
|
7458
|
-
const { bytes: n } =
|
|
7458
|
+
const { bytes: n } = ii(t, this.buffer, this.offset);
|
|
7459
7459
|
this.offset += n;
|
|
7460
7460
|
}
|
|
7461
7461
|
writeSlice(t) {
|
|
@@ -7479,13 +7479,13 @@ class wb {
|
|
|
7479
7479
|
buffer;
|
|
7480
7480
|
offset;
|
|
7481
7481
|
constructor(t, n = 0) {
|
|
7482
|
-
this.buffer = t, this.offset = n, rt(Gn([qe,
|
|
7482
|
+
this.buffer = t, this.offset = n, rt(Gn([qe, ur]), [
|
|
7483
7483
|
t,
|
|
7484
7484
|
n
|
|
7485
7485
|
]);
|
|
7486
7486
|
}
|
|
7487
7487
|
readUInt8() {
|
|
7488
|
-
const t =
|
|
7488
|
+
const t = Er(this.buffer, this.offset);
|
|
7489
7489
|
return this.offset++, t;
|
|
7490
7490
|
}
|
|
7491
7491
|
readInt32() {
|
|
@@ -7536,7 +7536,7 @@ function mf(e, t) {
|
|
|
7536
7536
|
return r;
|
|
7537
7537
|
}
|
|
7538
7538
|
function bf(e) {
|
|
7539
|
-
if (Qf(e)) return { hash:
|
|
7539
|
+
if (Qf(e)) return { hash: pr(e) };
|
|
7540
7540
|
const t = [bf(e[0]), bf(e[1])];
|
|
7541
7541
|
t.sort((i, s) => he(i.hash, s.hash));
|
|
7542
7542
|
const [n, r] = t;
|
|
@@ -7555,7 +7555,7 @@ function zc(e, t) {
|
|
|
7555
7555
|
} else if (he(e.hash, t) === 0)
|
|
7556
7556
|
return [];
|
|
7557
7557
|
}
|
|
7558
|
-
function
|
|
7558
|
+
function pr(e) {
|
|
7559
7559
|
const t = e.version || Ay;
|
|
7560
7560
|
return ka(
|
|
7561
7561
|
"TapLeaf",
|
|
@@ -7581,14 +7581,14 @@ function Ef(e, t) {
|
|
|
7581
7581
|
}
|
|
7582
7582
|
function _b(e) {
|
|
7583
7583
|
const t = Tn(e.length), n = new Uint8Array(t);
|
|
7584
|
-
return
|
|
7584
|
+
return ii(e.length, n), it([n, e]);
|
|
7585
7585
|
}
|
|
7586
7586
|
const jh = Ke, Wh = 1, Sb = 80;
|
|
7587
7587
|
function zo(e, t) {
|
|
7588
7588
|
if (!e.address && !e.output && !e.pubkey && !e.internalPubkey && !(e.witness && e.witness.length > 1))
|
|
7589
7589
|
throw new TypeError("Not enough data");
|
|
7590
7590
|
t = Object.assign({ validate: !0 }, t || {}), rt(
|
|
7591
|
-
|
|
7591
|
+
ri(
|
|
7592
7592
|
yt({
|
|
7593
7593
|
address: Li(),
|
|
7594
7594
|
input: Et(0),
|
|
@@ -7605,7 +7605,7 @@ function zo(e, t) {
|
|
|
7605
7605
|
]),
|
|
7606
7606
|
witness: cn(qe),
|
|
7607
7607
|
scriptTree: Mn(oy, "Taptree is not of type isTaptree"),
|
|
7608
|
-
redeem:
|
|
7608
|
+
redeem: ri(
|
|
7609
7609
|
yt({
|
|
7610
7610
|
output: qe,
|
|
7611
7611
|
// tapleaf script
|
|
@@ -7635,7 +7635,7 @@ function zo(e, t) {
|
|
|
7635
7635
|
if (c) return c.hash;
|
|
7636
7636
|
const a = r();
|
|
7637
7637
|
if (a && a.length > 1) {
|
|
7638
|
-
const u = a[a.length - 1], f = u[0] & Nc, l = a[a.length - 2], p =
|
|
7638
|
+
const u = a[a.length - 1], f = u[0] & Nc, l = a[a.length - 2], p = pr({ output: l, version: f });
|
|
7639
7639
|
return mf(u, p);
|
|
7640
7640
|
}
|
|
7641
7641
|
return null;
|
|
@@ -7672,7 +7672,7 @@ function zo(e, t) {
|
|
|
7672
7672
|
if (e.witness) return e.witness;
|
|
7673
7673
|
const c = i();
|
|
7674
7674
|
if (c && e.redeem && e.redeem.output && e.internalPubkey) {
|
|
7675
|
-
const a =
|
|
7675
|
+
const a = pr({
|
|
7676
7676
|
output: e.redeem.output,
|
|
7677
7677
|
version: o.redeemVersion
|
|
7678
7678
|
}), u = zc(c, a);
|
|
@@ -7723,7 +7723,7 @@ function zo(e, t) {
|
|
|
7723
7723
|
if (e.hash && a && he(e.hash, a.hash) !== 0)
|
|
7724
7724
|
throw new TypeError("Hash mismatch");
|
|
7725
7725
|
if (e.redeem && e.redeem.output && a) {
|
|
7726
|
-
const f =
|
|
7726
|
+
const f = pr({
|
|
7727
7727
|
output: e.redeem.output,
|
|
7728
7728
|
version: o.redeemVersion
|
|
7729
7729
|
});
|
|
@@ -7767,7 +7767,7 @@ function zo(e, t) {
|
|
|
7767
7767
|
throw new TypeError("Internal pubkey mismatch");
|
|
7768
7768
|
if (!wf().isXOnlyPoint(p))
|
|
7769
7769
|
throw new TypeError("Invalid internalPubkey for p2tr witness");
|
|
7770
|
-
const y = f[0] & Nc, g = u[u.length - 2], w =
|
|
7770
|
+
const y = f[0] & Nc, g = u[u.length - 2], w = pr({ output: g, version: y }), E = mf(f, w), _ = yc(p, E);
|
|
7771
7771
|
if (!_)
|
|
7772
7772
|
throw new TypeError("Invalid outputKey for p2tr witness");
|
|
7773
7773
|
if (c.length && he(c, _.x) !== 0)
|
|
@@ -7794,7 +7794,7 @@ function Ny(e) {
|
|
|
7794
7794
|
const t = po.decode(e);
|
|
7795
7795
|
if (t.length < 21) throw new TypeError(e + " is too short");
|
|
7796
7796
|
if (t.length > 21) throw new TypeError(e + " is too long");
|
|
7797
|
-
const n =
|
|
7797
|
+
const n = Er(t, 0), r = t.slice(1);
|
|
7798
7798
|
return { version: n, hash: r };
|
|
7799
7799
|
}
|
|
7800
7800
|
function il(e) {
|
|
@@ -7890,12 +7890,12 @@ function vb(e) {
|
|
|
7890
7890
|
const t = e.length;
|
|
7891
7891
|
return Tn(t) + e.reduce((n, r) => n + Wn(r), 0);
|
|
7892
7892
|
}
|
|
7893
|
-
const
|
|
7893
|
+
const Dr = new Uint8Array(0), Gh = [], _u = Ar(
|
|
7894
7894
|
"0000000000000000000000000000000000000000000000000000000000000000"
|
|
7895
|
-
), Dh =
|
|
7895
|
+
), Dh = Ar(
|
|
7896
7896
|
"0000000000000000000000000000000000000000000000000000000000000001"
|
|
7897
|
-
), Bb =
|
|
7898
|
-
script:
|
|
7897
|
+
), Bb = Ar("ffffffffffffffff"), Ib = {
|
|
7898
|
+
script: Dr,
|
|
7899
7899
|
valueBuffer: Bb
|
|
7900
7900
|
};
|
|
7901
7901
|
function Ob(e) {
|
|
@@ -7945,7 +7945,7 @@ let ht = class Ge {
|
|
|
7945
7945
|
return i;
|
|
7946
7946
|
}
|
|
7947
7947
|
static fromHex(t) {
|
|
7948
|
-
return Ge.fromBuffer(
|
|
7948
|
+
return Ge.fromBuffer(Ar(t), !1);
|
|
7949
7949
|
}
|
|
7950
7950
|
static isCoinbaseHash(t) {
|
|
7951
7951
|
rt(Ih, t);
|
|
@@ -7964,15 +7964,15 @@ let ht = class Ge {
|
|
|
7964
7964
|
return rt(
|
|
7965
7965
|
Gn([
|
|
7966
7966
|
Ih,
|
|
7967
|
-
|
|
7968
|
-
gf(Gc(
|
|
7967
|
+
ur,
|
|
7968
|
+
gf(Gc(ur)),
|
|
7969
7969
|
gf(Gc(qe))
|
|
7970
7970
|
]),
|
|
7971
7971
|
[t, n, r, i]
|
|
7972
7972
|
), r == null && (r = Ge.DEFAULT_SEQUENCE), this.ins.push({
|
|
7973
7973
|
hash: t,
|
|
7974
7974
|
index: n,
|
|
7975
|
-
script: i ||
|
|
7975
|
+
script: i || Dr,
|
|
7976
7976
|
sequence: r,
|
|
7977
7977
|
witness: Gh
|
|
7978
7978
|
}) - 1;
|
|
@@ -8022,7 +8022,7 @@ let ht = class Ge {
|
|
|
8022
8022
|
* This hash can then be used to sign the provided transaction input.
|
|
8023
8023
|
*/
|
|
8024
8024
|
hashForSignature(t, n, r) {
|
|
8025
|
-
if (rt(Gn([
|
|
8025
|
+
if (rt(Gn([ur, qe, sn()]), [
|
|
8026
8026
|
t,
|
|
8027
8027
|
n,
|
|
8028
8028
|
r
|
|
@@ -8044,24 +8044,24 @@ let ht = class Ge {
|
|
|
8044
8044
|
});
|
|
8045
8045
|
}
|
|
8046
8046
|
r & Ge.SIGHASH_ANYONECANPAY ? (s.ins = [s.ins[t]], s.ins[0].script = i) : (s.ins.forEach((c) => {
|
|
8047
|
-
c.script =
|
|
8047
|
+
c.script = Dr;
|
|
8048
8048
|
}), s.ins[t].script = i);
|
|
8049
8049
|
const o = new Uint8Array(s.byteLength(!1) + 4);
|
|
8050
|
-
return Yp(o, o.length - 4, r, "LE"), s.__toBuffer(o, 0, !1),
|
|
8050
|
+
return Yp(o, o.length - 4, r, "LE"), s.__toBuffer(o, 0, !1), li(o);
|
|
8051
8051
|
}
|
|
8052
8052
|
hashForWitnessV1(t, n, r, i, s, o) {
|
|
8053
8053
|
if (rt(
|
|
8054
8054
|
Gn([
|
|
8055
|
-
|
|
8055
|
+
ur,
|
|
8056
8056
|
cn(qe),
|
|
8057
8057
|
cn(wu),
|
|
8058
|
-
|
|
8058
|
+
ur
|
|
8059
8059
|
]),
|
|
8060
8060
|
[t, n, r, i]
|
|
8061
8061
|
), r.length !== this.ins.length || n.length !== this.ins.length)
|
|
8062
8062
|
throw new Error("Must supply prevout script and value for all inputs");
|
|
8063
8063
|
const c = i === Ge.SIGHASH_DEFAULT ? Ge.SIGHASH_ALL : i & Ge.SIGHASH_OUTPUT_MASK, u = (i & Ge.SIGHASH_INPUT_MASK) === Ge.SIGHASH_ANYONECANPAY, f = c === Ge.SIGHASH_NONE, l = c === Ge.SIGHASH_SINGLE;
|
|
8064
|
-
let p =
|
|
8064
|
+
let p = Dr, y = Dr, g = Dr, w = Dr, E = Dr;
|
|
8065
8065
|
if (!u) {
|
|
8066
8066
|
let T = Ht.withCapacity(36 * this.ins.length);
|
|
8067
8067
|
this.ins.forEach((I) => {
|
|
@@ -8105,33 +8105,33 @@ let ht = class Ge {
|
|
|
8105
8105
|
hashForWitnessV0(t, n, r, i) {
|
|
8106
8106
|
rt(
|
|
8107
8107
|
Gn([
|
|
8108
|
-
|
|
8108
|
+
ur,
|
|
8109
8109
|
qe,
|
|
8110
8110
|
wu,
|
|
8111
|
-
|
|
8111
|
+
ur
|
|
8112
8112
|
]),
|
|
8113
8113
|
[t, n, r, i]
|
|
8114
8114
|
);
|
|
8115
8115
|
let s = Uint8Array.from([]), o, c = _u, a = _u, u = _u;
|
|
8116
8116
|
if (i & Ge.SIGHASH_ANYONECANPAY || (s = new Uint8Array(36 * this.ins.length), o = new Ht(s, 0), this.ins.forEach((l) => {
|
|
8117
8117
|
o.writeSlice(l.hash), o.writeUInt32(l.index);
|
|
8118
|
-
}), a =
|
|
8118
|
+
}), a = li(s)), !(i & Ge.SIGHASH_ANYONECANPAY) && (i & 31) !== Ge.SIGHASH_SINGLE && (i & 31) !== Ge.SIGHASH_NONE && (s = new Uint8Array(4 * this.ins.length), o = new Ht(s, 0), this.ins.forEach((l) => {
|
|
8119
8119
|
o.writeUInt32(l.sequence);
|
|
8120
|
-
}), u =
|
|
8120
|
+
}), u = li(s)), (i & 31) !== Ge.SIGHASH_SINGLE && (i & 31) !== Ge.SIGHASH_NONE) {
|
|
8121
8121
|
const l = this.outs.reduce((p, y) => p + 8 + Wn(y.script), 0);
|
|
8122
8122
|
s = new Uint8Array(l), o = new Ht(s, 0), this.outs.forEach((p) => {
|
|
8123
8123
|
o.writeInt64(p.value), o.writeVarSlice(p.script);
|
|
8124
|
-
}), c =
|
|
8124
|
+
}), c = li(s);
|
|
8125
8125
|
} else if ((i & 31) === Ge.SIGHASH_SINGLE && t < this.outs.length) {
|
|
8126
8126
|
const l = this.outs[t];
|
|
8127
|
-
s = new Uint8Array(8 + Wn(l.script)), o = new Ht(s, 0), o.writeInt64(l.value), o.writeVarSlice(l.script), c =
|
|
8127
|
+
s = new Uint8Array(8 + Wn(l.script)), o = new Ht(s, 0), o.writeInt64(l.value), o.writeVarSlice(l.script), c = li(s);
|
|
8128
8128
|
}
|
|
8129
8129
|
s = new Uint8Array(156 + Wn(n)), o = new Ht(s, 0);
|
|
8130
8130
|
const f = this.ins[t];
|
|
8131
|
-
return o.writeInt32(this.version), o.writeSlice(a), o.writeSlice(u), o.writeSlice(f.hash), o.writeUInt32(f.index), o.writeVarSlice(n), o.writeInt64(r), o.writeUInt32(f.sequence), o.writeSlice(c), o.writeUInt32(this.locktime), o.writeUInt32(i),
|
|
8131
|
+
return o.writeInt32(this.version), o.writeSlice(a), o.writeSlice(u), o.writeSlice(f.hash), o.writeUInt32(f.index), o.writeVarSlice(n), o.writeInt64(r), o.writeUInt32(f.sequence), o.writeSlice(c), o.writeUInt32(this.locktime), o.writeUInt32(i), li(s);
|
|
8132
8132
|
}
|
|
8133
8133
|
getHash(t) {
|
|
8134
|
-
return t && this.isCoinbase() ? new Uint8Array(32) :
|
|
8134
|
+
return t && this.isCoinbase() ? new Uint8Array(32) : li(this.__toBuffer(void 0, void 0, t));
|
|
8135
8135
|
}
|
|
8136
8136
|
getId() {
|
|
8137
8137
|
return _e(rl(this.getHash(!1)));
|
|
@@ -8590,7 +8590,7 @@ function j2(e) {
|
|
|
8590
8590
|
}
|
|
8591
8591
|
function W2(e) {
|
|
8592
8592
|
const { script: t, value: n } = e, r = Tn(t.length), i = new Uint8Array(8 + r + t.length);
|
|
8593
|
-
return Zp(i, 0, BigInt(n), "LE"),
|
|
8593
|
+
return Zp(i, 0, BigInt(n), "LE"), ii(t.length, i, 8), i.set(t, 8 + r), {
|
|
8594
8594
|
key: Uint8Array.from([ye.WITNESS_UTXO]),
|
|
8595
8595
|
value: i
|
|
8596
8596
|
};
|
|
@@ -8634,7 +8634,7 @@ function Z2(e) {
|
|
|
8634
8634
|
const t = Uint8Array.from([ft.TAP_TREE]), n = [].concat(
|
|
8635
8635
|
...e.leaves.map((r) => [
|
|
8636
8636
|
Uint8Array.of(r.depth, r.leafVersion),
|
|
8637
|
-
|
|
8637
|
+
ii(BigInt(r.script.length)).buffer,
|
|
8638
8638
|
r.script
|
|
8639
8639
|
])
|
|
8640
8640
|
);
|
|
@@ -8771,7 +8771,7 @@ function Fy(e) {
|
|
|
8771
8771
|
}
|
|
8772
8772
|
function r(o) {
|
|
8773
8773
|
const c = t.encode(o), a = Tn(o.leafHashes.length), u = new Uint8Array(a);
|
|
8774
|
-
|
|
8774
|
+
ii(o.leafHashes.length, u);
|
|
8775
8775
|
const f = it([u, ...o.leafHashes, c.value]);
|
|
8776
8776
|
return { ...c, value: f };
|
|
8777
8777
|
}
|
|
@@ -8876,7 +8876,7 @@ const cl = {
|
|
|
8876
8876
|
),
|
|
8877
8877
|
tapInternalKey: My(ye.TAP_INTERNAL_KEY),
|
|
8878
8878
|
tapMerkleRoot: F2
|
|
8879
|
-
},
|
|
8879
|
+
}, fr = {
|
|
8880
8880
|
bip32Derivation: sl(ft.BIP32_DERIVATION),
|
|
8881
8881
|
redeemScript: Hy(ft.REDEEM_SCRIPT),
|
|
8882
8882
|
witnessScript: qy(ft.WITNESS_SCRIPT),
|
|
@@ -8890,7 +8890,7 @@ const cl = {
|
|
|
8890
8890
|
__proto__: null,
|
|
8891
8891
|
globals: cl,
|
|
8892
8892
|
inputs: gt,
|
|
8893
|
-
outputs:
|
|
8893
|
+
outputs: fr
|
|
8894
8894
|
}, Symbol.toStringTag, { value: "Module" })), Yc = (e) => [...Array(e).keys()];
|
|
8895
8895
|
function Xh(e) {
|
|
8896
8896
|
const t = e.map(oE);
|
|
@@ -8898,7 +8898,7 @@ function Xh(e) {
|
|
|
8898
8898
|
}
|
|
8899
8899
|
function oE(e) {
|
|
8900
8900
|
const t = e.key.length, n = e.value.length, r = Tn(t), i = Tn(n), s = new Uint8Array(r + t + i + n);
|
|
8901
|
-
return
|
|
8901
|
+
return ii(t, s, 0), s.set(e.key, r), ii(n, s, r + t), s.set(e.value, r + t + i), s;
|
|
8902
8902
|
}
|
|
8903
8903
|
function cE(e, t) {
|
|
8904
8904
|
let n = 0;
|
|
@@ -8913,7 +8913,7 @@ function cE(e, t) {
|
|
|
8913
8913
|
return n += 4, E;
|
|
8914
8914
|
}
|
|
8915
8915
|
function s() {
|
|
8916
|
-
const E =
|
|
8916
|
+
const E = Er(e, n);
|
|
8917
8917
|
return n += 1, E;
|
|
8918
8918
|
}
|
|
8919
8919
|
function o() {
|
|
@@ -8926,7 +8926,7 @@ function cE(e, t) {
|
|
|
8926
8926
|
function c() {
|
|
8927
8927
|
if (n >= e.length)
|
|
8928
8928
|
throw new Error("Format Error: Unexpected End of PSBT");
|
|
8929
|
-
const E =
|
|
8929
|
+
const E = Er(e, n) === 0;
|
|
8930
8930
|
return E && n++, E;
|
|
8931
8931
|
}
|
|
8932
8932
|
if (i() !== 1886610036)
|
|
@@ -9084,31 +9084,31 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9084
9084
|
for (const f of Yc(c)) {
|
|
9085
9085
|
const l = {};
|
|
9086
9086
|
for (const p of r[f])
|
|
9087
|
-
switch (
|
|
9087
|
+
switch (fr.checkPubkey(p), p.key[0]) {
|
|
9088
9088
|
case ft.REDEEM_SCRIPT:
|
|
9089
9089
|
if (Ct("output", p.key, ft.REDEEM_SCRIPT), l.redeemScript !== void 0)
|
|
9090
9090
|
throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");
|
|
9091
|
-
l.redeemScript =
|
|
9091
|
+
l.redeemScript = fr.redeemScript.decode(p);
|
|
9092
9092
|
break;
|
|
9093
9093
|
case ft.WITNESS_SCRIPT:
|
|
9094
9094
|
if (Ct("output", p.key, ft.WITNESS_SCRIPT), l.witnessScript !== void 0)
|
|
9095
9095
|
throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");
|
|
9096
|
-
l.witnessScript =
|
|
9096
|
+
l.witnessScript = fr.witnessScript.decode(p);
|
|
9097
9097
|
break;
|
|
9098
9098
|
case ft.BIP32_DERIVATION:
|
|
9099
9099
|
l.bip32Derivation === void 0 && (l.bip32Derivation = []), l.bip32Derivation.push(
|
|
9100
|
-
|
|
9100
|
+
fr.bip32Derivation.decode(p)
|
|
9101
9101
|
);
|
|
9102
9102
|
break;
|
|
9103
9103
|
case ft.TAP_INTERNAL_KEY:
|
|
9104
|
-
Ct("output", p.key, ft.TAP_INTERNAL_KEY), l.tapInternalKey =
|
|
9104
|
+
Ct("output", p.key, ft.TAP_INTERNAL_KEY), l.tapInternalKey = fr.tapInternalKey.decode(p);
|
|
9105
9105
|
break;
|
|
9106
9106
|
case ft.TAP_TREE:
|
|
9107
|
-
Ct("output", p.key, ft.TAP_TREE), l.tapTree =
|
|
9107
|
+
Ct("output", p.key, ft.TAP_TREE), l.tapTree = fr.tapTree.decode(p);
|
|
9108
9108
|
break;
|
|
9109
9109
|
case ft.TAP_BIP32_DERIVATION:
|
|
9110
9110
|
l.tapBip32Derivation === void 0 && (l.tapBip32Derivation = []), l.tapBip32Derivation.push(
|
|
9111
|
-
|
|
9111
|
+
fr.tapBip32Derivation.decode(p)
|
|
9112
9112
|
);
|
|
9113
9113
|
break;
|
|
9114
9114
|
default:
|
|
@@ -9149,7 +9149,7 @@ function _f({ globalMap: e, inputs: t, outputs: n }) {
|
|
|
9149
9149
|
return {
|
|
9150
9150
|
globalKeyVals: Su(e, cl),
|
|
9151
9151
|
inputKeyVals: t.map((r) => Su(r, gt)),
|
|
9152
|
-
outputKeyVals: n.map((r) => Su(r,
|
|
9152
|
+
outputKeyVals: n.map((r) => Su(r, fr))
|
|
9153
9153
|
};
|
|
9154
9154
|
}
|
|
9155
9155
|
function fE(e) {
|
|
@@ -9300,7 +9300,7 @@ let Zh = class {
|
|
|
9300
9300
|
return this.fromBuffer(r, n);
|
|
9301
9301
|
}
|
|
9302
9302
|
static fromHex(t, n) {
|
|
9303
|
-
const r =
|
|
9303
|
+
const r = Ar(t);
|
|
9304
9304
|
return this.fromBuffer(r, n);
|
|
9305
9305
|
}
|
|
9306
9306
|
static fromBuffer(t, n) {
|
|
@@ -9404,7 +9404,7 @@ function Zc(e) {
|
|
|
9404
9404
|
}
|
|
9405
9405
|
function r(o) {
|
|
9406
9406
|
const c = t.length, a = Tn(o);
|
|
9407
|
-
t = it([t, new Uint8Array(a)]),
|
|
9407
|
+
t = it([t, new Uint8Array(a)]), ii(o, t, c);
|
|
9408
9408
|
}
|
|
9409
9409
|
function i(o) {
|
|
9410
9410
|
r(o.length), n(o);
|
|
@@ -9415,7 +9415,7 @@ function Zc(e) {
|
|
|
9415
9415
|
return s(e), t;
|
|
9416
9416
|
}
|
|
9417
9417
|
function Wy(e, t) {
|
|
9418
|
-
const n =
|
|
9418
|
+
const n = br(e), r = e.slice(1, 33), i = ct(t);
|
|
9419
9419
|
if (i === null) throw new Error("Unknown script error");
|
|
9420
9420
|
return i.findIndex((s) => typeof s == "number" ? !1 : he(e, s) === 0 || he(n, s) === 0 || he(r, s) === 0);
|
|
9421
9421
|
}
|
|
@@ -9450,7 +9450,7 @@ function bE(e) {
|
|
|
9450
9450
|
}
|
|
9451
9451
|
function EE(e) {
|
|
9452
9452
|
const t = e.finalScriptSig ? ct(e.finalScriptSig) || [] : [], n = e.finalScriptWitness ? ct(e.finalScriptWitness) || [] : [];
|
|
9453
|
-
return t.concat(n).filter((r) => r instanceof Uint8Array &&
|
|
9453
|
+
return t.concat(n).filter((r) => r instanceof Uint8Array && _r(r)).map((r) => ({ signature: r }));
|
|
9454
9454
|
}
|
|
9455
9455
|
const Uc = (e) => e.length === 32 ? e : e.slice(1, 33);
|
|
9456
9456
|
function Qh(e, t, n) {
|
|
@@ -9581,14 +9581,14 @@ function kE(e, t, n) {
|
|
|
9581
9581
|
}
|
|
9582
9582
|
function Bu(e, t) {
|
|
9583
9583
|
if (!t) return !0;
|
|
9584
|
-
const n =
|
|
9584
|
+
const n = pr({
|
|
9585
9585
|
output: e.script,
|
|
9586
9586
|
version: e.leafVersion
|
|
9587
9587
|
}), r = mf(e.controlBlock, n);
|
|
9588
9588
|
return he(r, t) === 0;
|
|
9589
9589
|
}
|
|
9590
9590
|
function NE(e, t) {
|
|
9591
|
-
const n =
|
|
9591
|
+
const n = pr({
|
|
9592
9592
|
output: t.script,
|
|
9593
9593
|
version: t.leafVersion
|
|
9594
9594
|
});
|
|
@@ -9617,7 +9617,7 @@ function RE(e, t, n) {
|
|
|
9617
9617
|
return r;
|
|
9618
9618
|
}
|
|
9619
9619
|
function CE(e, t, n) {
|
|
9620
|
-
const r =
|
|
9620
|
+
const r = pr({
|
|
9621
9621
|
output: e.script,
|
|
9622
9622
|
version: e.leafVersion
|
|
9623
9623
|
});
|
|
@@ -9647,7 +9647,7 @@ class Jc {
|
|
|
9647
9647
|
return this.fromBuffer(r, n);
|
|
9648
9648
|
}
|
|
9649
9649
|
static fromHex(t, n = {}) {
|
|
9650
|
-
const r =
|
|
9650
|
+
const r = Ar(t);
|
|
9651
9651
|
return this.fromBuffer(r, n);
|
|
9652
9652
|
}
|
|
9653
9653
|
static fromBuffer(t, n = {}) {
|
|
@@ -10277,7 +10277,7 @@ class Dy {
|
|
|
10277
10277
|
addInput(t) {
|
|
10278
10278
|
if (t.hash === void 0 || t.index === void 0 || !(t.hash instanceof Uint8Array) && typeof t.hash != "string" || typeof t.index != "number")
|
|
10279
10279
|
throw new Error("Error adding input.");
|
|
10280
|
-
const n = typeof t.hash == "string" ? rl(
|
|
10280
|
+
const n = typeof t.hash == "string" ? rl(Ar(t.hash)) : t.hash;
|
|
10281
10281
|
this.tx.addInput(n, t.index, t.sequence);
|
|
10282
10282
|
}
|
|
10283
10283
|
addOutput(t) {
|
|
@@ -10535,7 +10535,7 @@ function Tf(e, t, n, r, i, s, o) {
|
|
|
10535
10535
|
}
|
|
10536
10536
|
}
|
|
10537
10537
|
const y = (t.tapLeafScript || []).filter((g) => Ra(r, g.script)).map((g) => {
|
|
10538
|
-
const w =
|
|
10538
|
+
const w = pr({
|
|
10539
10539
|
output: g.script,
|
|
10540
10540
|
version: g.leafVersion
|
|
10541
10541
|
});
|
|
@@ -10784,7 +10784,7 @@ function ig(e) {
|
|
|
10784
10784
|
return e.length === 33 && Em(e);
|
|
10785
10785
|
}
|
|
10786
10786
|
function t_(e) {
|
|
10787
|
-
return
|
|
10787
|
+
return _r(e);
|
|
10788
10788
|
}
|
|
10789
10789
|
function Ha(e, t, n, r, i) {
|
|
10790
10790
|
const s = $y(e), o = s && r && Jh(r), c = Jh(e);
|
|
@@ -11402,7 +11402,7 @@ function _t(e) {
|
|
|
11402
11402
|
}
|
|
11403
11403
|
return r.buffer;
|
|
11404
11404
|
}
|
|
11405
|
-
function
|
|
11405
|
+
function Xr(e) {
|
|
11406
11406
|
const t = new Uint8Array(e.buffer);
|
|
11407
11407
|
let n = 0;
|
|
11408
11408
|
for (; n < t.byteLength; n++)
|
|
@@ -11596,7 +11596,7 @@ class Bn extends Ma {
|
|
|
11596
11596
|
_buildTypeTableImpl(t) {
|
|
11597
11597
|
}
|
|
11598
11598
|
}
|
|
11599
|
-
class
|
|
11599
|
+
class ci extends Ma {
|
|
11600
11600
|
checkType(t) {
|
|
11601
11601
|
if (t instanceof xn) {
|
|
11602
11602
|
const n = t.getType();
|
|
@@ -11745,7 +11745,7 @@ class wo extends Bn {
|
|
|
11745
11745
|
return "null";
|
|
11746
11746
|
}
|
|
11747
11747
|
}
|
|
11748
|
-
class
|
|
11748
|
+
class si extends Bn {
|
|
11749
11749
|
get typeName() {
|
|
11750
11750
|
return ve.ReservedClass;
|
|
11751
11751
|
}
|
|
@@ -11827,7 +11827,7 @@ class ll extends Bn {
|
|
|
11827
11827
|
return _t(He.Int);
|
|
11828
11828
|
}
|
|
11829
11829
|
decodeValue(t, n) {
|
|
11830
|
-
return this.checkType(n),
|
|
11830
|
+
return this.checkType(n), Xr(t);
|
|
11831
11831
|
}
|
|
11832
11832
|
get name() {
|
|
11833
11833
|
return "int";
|
|
@@ -11952,7 +11952,7 @@ class Fi extends Bn {
|
|
|
11952
11952
|
return t.toString();
|
|
11953
11953
|
}
|
|
11954
11954
|
}
|
|
11955
|
-
class
|
|
11955
|
+
class ti extends Bn {
|
|
11956
11956
|
get typeName() {
|
|
11957
11957
|
return ve.FixedNatClass;
|
|
11958
11958
|
}
|
|
@@ -11991,7 +11991,7 @@ class ei extends Bn {
|
|
|
11991
11991
|
return t.toString();
|
|
11992
11992
|
}
|
|
11993
11993
|
}
|
|
11994
|
-
class Es extends
|
|
11994
|
+
class Es extends ci {
|
|
11995
11995
|
get typeName() {
|
|
11996
11996
|
return ve.VecClass;
|
|
11997
11997
|
}
|
|
@@ -11999,13 +11999,13 @@ class Es extends oi {
|
|
|
11999
11999
|
return t.typeName === ve.VecClass;
|
|
12000
12000
|
}
|
|
12001
12001
|
constructor(t) {
|
|
12002
|
-
super(), this._type = t, this._blobOptimization = !1, t instanceof
|
|
12002
|
+
super(), this._type = t, this._blobOptimization = !1, t instanceof ti && t._bits === 8 && (this._blobOptimization = !0);
|
|
12003
12003
|
}
|
|
12004
12004
|
accept(t, n) {
|
|
12005
12005
|
return t.visitVec(this, this._type, n);
|
|
12006
12006
|
}
|
|
12007
12007
|
covariant(t) {
|
|
12008
|
-
const n = this._type instanceof
|
|
12008
|
+
const n = this._type instanceof ti ? this._type._bits : this._type instanceof Fi ? this._type._bits : 0;
|
|
12009
12009
|
if (ArrayBuffer.isView(t) && n == t.BYTES_PER_ELEMENT * 8 || Array.isArray(t) && t.every((r, i) => {
|
|
12010
12010
|
try {
|
|
12011
12011
|
return this._type.covariant(r);
|
|
@@ -12058,7 +12058,7 @@ index ${i} -> ${s.message}`);
|
|
|
12058
12058
|
if (!(r instanceof Es))
|
|
12059
12059
|
throw new Error("Not a vector type");
|
|
12060
12060
|
const i = Number(xt(t));
|
|
12061
|
-
if (this._type instanceof
|
|
12061
|
+
if (this._type instanceof ti) {
|
|
12062
12062
|
if (this._type._bits == 8)
|
|
12063
12063
|
return new Uint8Array(t.read(i));
|
|
12064
12064
|
if (this._type._bits == 16) {
|
|
@@ -12109,7 +12109,7 @@ index ${i} -> ${s.message}`);
|
|
|
12109
12109
|
return "vec {" + t.map((r) => this._type.valueToString(r)).join("; ") + "}";
|
|
12110
12110
|
}
|
|
12111
12111
|
}
|
|
12112
|
-
class
|
|
12112
|
+
class Sr extends ci {
|
|
12113
12113
|
get typeName() {
|
|
12114
12114
|
return ve.OptClass;
|
|
12115
12115
|
}
|
|
@@ -12144,7 +12144,7 @@ class Er extends oi {
|
|
|
12144
12144
|
decodeValue(t, n) {
|
|
12145
12145
|
if (n instanceof wo)
|
|
12146
12146
|
return [];
|
|
12147
|
-
if (n instanceof
|
|
12147
|
+
if (n instanceof si)
|
|
12148
12148
|
return [];
|
|
12149
12149
|
let r = n;
|
|
12150
12150
|
if (n instanceof xn) {
|
|
@@ -12153,7 +12153,7 @@ class Er extends oi {
|
|
|
12153
12153
|
throw new Error("type mismatch with uninitialized type");
|
|
12154
12154
|
r = i;
|
|
12155
12155
|
}
|
|
12156
|
-
if (r instanceof
|
|
12156
|
+
if (r instanceof Sr)
|
|
12157
12157
|
switch (Hi(t)) {
|
|
12158
12158
|
case 0:
|
|
12159
12159
|
return [];
|
|
@@ -12171,7 +12171,7 @@ class Er extends oi {
|
|
|
12171
12171
|
else {
|
|
12172
12172
|
if (
|
|
12173
12173
|
// this check corresponds to `not (null <: <t>)` in the spec
|
|
12174
|
-
this._type instanceof wo || this._type instanceof
|
|
12174
|
+
this._type instanceof wo || this._type instanceof Sr || this._type instanceof si
|
|
12175
12175
|
)
|
|
12176
12176
|
return r.decodeValue(t, r), [];
|
|
12177
12177
|
{
|
|
@@ -12194,7 +12194,7 @@ class Er extends oi {
|
|
|
12194
12194
|
return t.length === 0 ? "null" : `opt ${this._type.valueToString(t[0])}`;
|
|
12195
12195
|
}
|
|
12196
12196
|
}
|
|
12197
|
-
class Mi extends
|
|
12197
|
+
class Mi extends ci {
|
|
12198
12198
|
get typeName() {
|
|
12199
12199
|
return ve.RecordClass;
|
|
12200
12200
|
}
|
|
@@ -12257,7 +12257,7 @@ field ${n} -> ${i.message}`);
|
|
|
12257
12257
|
if (l === p)
|
|
12258
12258
|
i[u] = f.decodeValue(t, a), s++, o++;
|
|
12259
12259
|
else if (p > l)
|
|
12260
|
-
if (f instanceof
|
|
12260
|
+
if (f instanceof Sr || f instanceof si)
|
|
12261
12261
|
i[u] = [], s++;
|
|
12262
12262
|
else
|
|
12263
12263
|
throw new Error("Cannot find required field " + u);
|
|
@@ -12265,7 +12265,7 @@ field ${n} -> ${i.message}`);
|
|
|
12265
12265
|
a.decodeValue(t, a), o++;
|
|
12266
12266
|
}
|
|
12267
12267
|
for (const [c, a] of this._fields.slice(s))
|
|
12268
|
-
if (a instanceof
|
|
12268
|
+
if (a instanceof Sr || a instanceof si)
|
|
12269
12269
|
i[c] = [];
|
|
12270
12270
|
else
|
|
12271
12271
|
throw new Error("Cannot find required field " + c);
|
|
@@ -12337,7 +12337,7 @@ index ${r} -> ${i.message}`);
|
|
|
12337
12337
|
return `record {${go(this._components, t, (r, i) => r.valueToString(i)).join("; ")}}`;
|
|
12338
12338
|
}
|
|
12339
12339
|
}
|
|
12340
|
-
class _s extends
|
|
12340
|
+
class _s extends ci {
|
|
12341
12341
|
get typeName() {
|
|
12342
12342
|
return ve.VariantClass;
|
|
12343
12343
|
}
|
|
@@ -12416,7 +12416,7 @@ variant ${n} -> ${i.message}`);
|
|
|
12416
12416
|
return t;
|
|
12417
12417
|
}
|
|
12418
12418
|
}
|
|
12419
|
-
const Ta = class Ta extends
|
|
12419
|
+
const Ta = class Ta extends ci {
|
|
12420
12420
|
constructor() {
|
|
12421
12421
|
super(...arguments), this._id = Ta._counter++;
|
|
12422
12422
|
}
|
|
@@ -12511,7 +12511,7 @@ class pg extends Bn {
|
|
|
12511
12511
|
return `${this.name} "${t.toText()}"`;
|
|
12512
12512
|
}
|
|
12513
12513
|
}
|
|
12514
|
-
class mo extends
|
|
12514
|
+
class mo extends ci {
|
|
12515
12515
|
get typeName() {
|
|
12516
12516
|
return ve.FuncClass;
|
|
12517
12517
|
}
|
|
@@ -12573,7 +12573,7 @@ class mo extends oi {
|
|
|
12573
12573
|
throw new Error("Illegal function annotation");
|
|
12574
12574
|
}
|
|
12575
12575
|
}
|
|
12576
|
-
class ta extends
|
|
12576
|
+
class ta extends ci {
|
|
12577
12577
|
get typeName() {
|
|
12578
12578
|
return ve.ServiceClass;
|
|
12579
12579
|
}
|
|
@@ -12653,11 +12653,11 @@ function yg(e, t) {
|
|
|
12653
12653
|
function s(p) {
|
|
12654
12654
|
const y = [], g = Number(xt(p));
|
|
12655
12655
|
for (let _ = 0; _ < g; _++) {
|
|
12656
|
-
const S = Number(
|
|
12656
|
+
const S = Number(Xr(p));
|
|
12657
12657
|
switch (S) {
|
|
12658
12658
|
case He.Opt:
|
|
12659
12659
|
case He.Vector: {
|
|
12660
|
-
const m = Number(
|
|
12660
|
+
const m = Number(Xr(p));
|
|
12661
12661
|
y.push([S, m]);
|
|
12662
12662
|
break;
|
|
12663
12663
|
}
|
|
@@ -12672,7 +12672,7 @@ function yg(e, t) {
|
|
|
12672
12672
|
if (typeof I == "number" && I >= A)
|
|
12673
12673
|
throw new Error("field id collision or not sorted");
|
|
12674
12674
|
I = A;
|
|
12675
|
-
const U = Number(
|
|
12675
|
+
const U = Number(Xr(p));
|
|
12676
12676
|
m.push([A, U]);
|
|
12677
12677
|
}
|
|
12678
12678
|
y.push([S, m]);
|
|
@@ -12682,11 +12682,11 @@ function yg(e, t) {
|
|
|
12682
12682
|
const m = [];
|
|
12683
12683
|
let T = Number(xt(p));
|
|
12684
12684
|
for (; T--; )
|
|
12685
|
-
m.push(Number(
|
|
12685
|
+
m.push(Number(Xr(p)));
|
|
12686
12686
|
const I = [];
|
|
12687
12687
|
let A = Number(xt(p));
|
|
12688
12688
|
for (; A--; )
|
|
12689
|
-
I.push(Number(
|
|
12689
|
+
I.push(Number(Xr(p)));
|
|
12690
12690
|
const U = [];
|
|
12691
12691
|
let M = Number(xt(p));
|
|
12692
12692
|
for (; M--; )
|
|
@@ -12713,7 +12713,7 @@ function yg(e, t) {
|
|
|
12713
12713
|
let m = Number(xt(p));
|
|
12714
12714
|
const T = [];
|
|
12715
12715
|
for (; m--; ) {
|
|
12716
|
-
const I = Number(xt(p)), A = new TextDecoder().decode(Ci(p, I)), U =
|
|
12716
|
+
const I = Number(xt(p)), A = new TextDecoder().decode(Ci(p, I)), U = Xr(p);
|
|
12717
12717
|
T.push([A, U]);
|
|
12718
12718
|
}
|
|
12719
12719
|
y.push([S, T]);
|
|
@@ -12725,7 +12725,7 @@ function yg(e, t) {
|
|
|
12725
12725
|
}
|
|
12726
12726
|
const w = [], E = Number(xt(p));
|
|
12727
12727
|
for (let _ = 0; _ < E; _++)
|
|
12728
|
-
w.push(Number(
|
|
12728
|
+
w.push(Number(Xr(p)));
|
|
12729
12729
|
return [y, w];
|
|
12730
12730
|
}
|
|
12731
12731
|
const [o, c] = s(n);
|
|
@@ -12848,7 +12848,7 @@ function yg(e, t) {
|
|
|
12848
12848
|
Bf();
|
|
12849
12849
|
}
|
|
12850
12850
|
}
|
|
12851
|
-
const gg = new fl(), wg = new
|
|
12851
|
+
const gg = new fl(), wg = new si(), y_ = new lg(), mg = new hg(), bg = new wo(), Eg = new dg(), _g = new ll(), Sg = new hl(), Tg = new dl(32), xg = new dl(64), Ag = new Fi(8), vg = new Fi(16), Bg = new Fi(32), Ig = new Fi(64), Og = new ti(8), Pg = new ti(16), kg = new ti(32), Ng = new ti(64), Ug = new pg();
|
|
12852
12852
|
function Rg(...e) {
|
|
12853
12853
|
return new qa(e);
|
|
12854
12854
|
}
|
|
@@ -12856,7 +12856,7 @@ function Cg(e) {
|
|
|
12856
12856
|
return new Es(e);
|
|
12857
12857
|
}
|
|
12858
12858
|
function Hg(e) {
|
|
12859
|
-
return new
|
|
12859
|
+
return new Sr(e);
|
|
12860
12860
|
}
|
|
12861
12861
|
function Fg(e) {
|
|
12862
12862
|
return new Mi(e);
|
|
@@ -12927,30 +12927,30 @@ function g_(e, t) {
|
|
|
12927
12927
|
return !0;
|
|
12928
12928
|
}
|
|
12929
12929
|
function Ou(e) {
|
|
12930
|
-
return e instanceof
|
|
12930
|
+
return e instanceof Sr || e instanceof wo || e instanceof si;
|
|
12931
12931
|
}
|
|
12932
12932
|
function yl(e, t) {
|
|
12933
|
-
const n = Cc.copy(), r =
|
|
12933
|
+
const n = Cc.copy(), r = cr(n, e, t);
|
|
12934
12934
|
return r ? Cc.add(e, t) : Cc.addNegative(e, t), r;
|
|
12935
12935
|
}
|
|
12936
|
-
function
|
|
12936
|
+
function cr(e, t, n) {
|
|
12937
12937
|
if (t.name === n.name)
|
|
12938
12938
|
return !0;
|
|
12939
12939
|
const r = e.known(t, n);
|
|
12940
12940
|
if (r !== void 0)
|
|
12941
12941
|
return r;
|
|
12942
|
-
if (e.add(t, n), n instanceof
|
|
12942
|
+
if (e.add(t, n), n instanceof si || t instanceof fl || t instanceof hl && n instanceof ll)
|
|
12943
12943
|
return !0;
|
|
12944
12944
|
if (t instanceof Es && n instanceof Es)
|
|
12945
|
-
return
|
|
12946
|
-
if (n instanceof
|
|
12945
|
+
return cr(e, t._type, n._type);
|
|
12946
|
+
if (n instanceof Sr)
|
|
12947
12947
|
return !0;
|
|
12948
12948
|
if (t instanceof Mi && n instanceof Mi) {
|
|
12949
12949
|
const i = t.fieldsAsObject;
|
|
12950
12950
|
for (const [s, o] of n._fields) {
|
|
12951
12951
|
const c = i[tn(s)];
|
|
12952
12952
|
if (c) {
|
|
12953
|
-
if (!
|
|
12953
|
+
if (!cr(e, c, o))
|
|
12954
12954
|
return !1;
|
|
12955
12955
|
} else if (!Ou(o))
|
|
12956
12956
|
return !1;
|
|
@@ -12963,7 +12963,7 @@ function or(e, t, n) {
|
|
|
12963
12963
|
for (let i = 0; i < t.argTypes.length; i++) {
|
|
12964
12964
|
const s = t.argTypes[i];
|
|
12965
12965
|
if (i < n.argTypes.length) {
|
|
12966
|
-
if (!
|
|
12966
|
+
if (!cr(e, n.argTypes[i], s))
|
|
12967
12967
|
return !1;
|
|
12968
12968
|
} else if (!Ou(s))
|
|
12969
12969
|
return !1;
|
|
@@ -12971,7 +12971,7 @@ function or(e, t, n) {
|
|
|
12971
12971
|
for (let i = 0; i < n.retTypes.length; i++) {
|
|
12972
12972
|
const s = n.retTypes[i];
|
|
12973
12973
|
if (i < t.retTypes.length) {
|
|
12974
|
-
if (!
|
|
12974
|
+
if (!cr(e, t.retTypes[i], s))
|
|
12975
12975
|
return !1;
|
|
12976
12976
|
} else if (!Ou(s))
|
|
12977
12977
|
return !1;
|
|
@@ -12982,7 +12982,7 @@ function or(e, t, n) {
|
|
|
12982
12982
|
const i = n.alternativesAsObject;
|
|
12983
12983
|
for (const [s, o] of t._fields) {
|
|
12984
12984
|
const c = i[tn(s)];
|
|
12985
|
-
if (!c || !
|
|
12985
|
+
if (!c || !cr(e, o, c))
|
|
12986
12986
|
return !1;
|
|
12987
12987
|
}
|
|
12988
12988
|
return !0;
|
|
@@ -12991,22 +12991,22 @@ function or(e, t, n) {
|
|
|
12991
12991
|
const i = t.fieldsAsObject();
|
|
12992
12992
|
for (const [s, o] of n._fields) {
|
|
12993
12993
|
const c = i[s];
|
|
12994
|
-
if (!c || !
|
|
12994
|
+
if (!c || !cr(e, c, o))
|
|
12995
12995
|
return !1;
|
|
12996
12996
|
}
|
|
12997
12997
|
return !0;
|
|
12998
12998
|
}
|
|
12999
|
-
return t instanceof xn ?
|
|
12999
|
+
return t instanceof xn ? cr(e, t.getType(), n) : n instanceof xn ? cr(e, t, n.getType()) : !1;
|
|
13000
13000
|
}
|
|
13001
13001
|
const w_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13002
13002
|
__proto__: null,
|
|
13003
13003
|
Bool: mg,
|
|
13004
13004
|
BoolClass: hg,
|
|
13005
|
-
ConstructType:
|
|
13005
|
+
ConstructType: ci,
|
|
13006
13006
|
Empty: gg,
|
|
13007
13007
|
EmptyClass: fl,
|
|
13008
13008
|
FixedIntClass: Fi,
|
|
13009
|
-
FixedNatClass:
|
|
13009
|
+
FixedNatClass: ti,
|
|
13010
13010
|
Float32: Tg,
|
|
13011
13011
|
Float64: xg,
|
|
13012
13012
|
FloatClass: dl,
|
|
@@ -13027,7 +13027,7 @@ const w_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13027
13027
|
Null: bg,
|
|
13028
13028
|
NullClass: wo,
|
|
13029
13029
|
Opt: Hg,
|
|
13030
|
-
OptClass:
|
|
13030
|
+
OptClass: Sr,
|
|
13031
13031
|
PrimitiveType: Bn,
|
|
13032
13032
|
Principal: Ug,
|
|
13033
13033
|
PrincipalClass: pg,
|
|
@@ -13036,7 +13036,7 @@ const w_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13036
13036
|
Record: Fg,
|
|
13037
13037
|
RecordClass: Mi,
|
|
13038
13038
|
Reserved: wg,
|
|
13039
|
-
ReservedClass:
|
|
13039
|
+
ReservedClass: si,
|
|
13040
13040
|
Service: Lg,
|
|
13041
13041
|
ServiceClass: ta,
|
|
13042
13042
|
Text: Eg,
|
|
@@ -14808,10 +14808,10 @@ function zS(e) {
|
|
|
14808
14808
|
function YS(e) {
|
|
14809
14809
|
return e != null && "certificate" in e;
|
|
14810
14810
|
}
|
|
14811
|
-
var
|
|
14811
|
+
var Tr;
|
|
14812
14812
|
(function(e) {
|
|
14813
14813
|
e.Trust = "Trust", e.Protocol = "Protocol", e.Reject = "Reject", e.Transport = "Transport", e.External = "External", e.Limit = "Limit", e.Input = "Input", e.Unknown = "Unknown";
|
|
14814
|
-
})(
|
|
14814
|
+
})(Tr || (Tr = {}));
|
|
14815
14815
|
class ke {
|
|
14816
14816
|
constructor(t = !1) {
|
|
14817
14817
|
this.isCertified = t;
|
|
@@ -14830,7 +14830,7 @@ Call context:
|
|
|
14830
14830
|
HTTP details: ${JSON.stringify(this.callContext.httpDetails, null, 2)}`), t;
|
|
14831
14831
|
}
|
|
14832
14832
|
}
|
|
14833
|
-
class
|
|
14833
|
+
class dr extends Error {
|
|
14834
14834
|
get code() {
|
|
14835
14835
|
return this.cause.code;
|
|
14836
14836
|
}
|
|
@@ -14851,7 +14851,7 @@ class lr extends Error {
|
|
|
14851
14851
|
return this.code.isCertified;
|
|
14852
14852
|
}
|
|
14853
14853
|
constructor(t, n) {
|
|
14854
|
-
super(t.toString()), this.name = "AgentError", this.cause = { code: t, kind: n }, Object.setPrototypeOf(this,
|
|
14854
|
+
super(t.toString()), this.name = "AgentError", this.cause = { code: t, kind: n }, Object.setPrototypeOf(this, dr.prototype);
|
|
14855
14855
|
}
|
|
14856
14856
|
hasCode(t) {
|
|
14857
14857
|
return this.code instanceof t;
|
|
@@ -14860,44 +14860,44 @@ class lr extends Error {
|
|
|
14860
14860
|
return `${this.name} (${this.kind}): ${this.message}`;
|
|
14861
14861
|
}
|
|
14862
14862
|
}
|
|
14863
|
-
class $i extends
|
|
14863
|
+
class $i extends dr {
|
|
14864
14864
|
static fromCode(t) {
|
|
14865
14865
|
return new this(t);
|
|
14866
14866
|
}
|
|
14867
14867
|
}
|
|
14868
14868
|
class bn extends $i {
|
|
14869
14869
|
constructor(t) {
|
|
14870
|
-
super(t,
|
|
14870
|
+
super(t, Tr.Trust), this.name = "TrustError", Object.setPrototypeOf(this, bn.prototype);
|
|
14871
14871
|
}
|
|
14872
14872
|
}
|
|
14873
14873
|
class lt extends $i {
|
|
14874
14874
|
constructor(t) {
|
|
14875
|
-
super(t,
|
|
14875
|
+
super(t, Tr.Protocol), this.name = "ProtocolError", Object.setPrototypeOf(this, lt.prototype);
|
|
14876
14876
|
}
|
|
14877
14877
|
}
|
|
14878
14878
|
class fs extends $i {
|
|
14879
14879
|
constructor(t) {
|
|
14880
|
-
super(t,
|
|
14880
|
+
super(t, Tr.Reject), this.name = "RejectError", Object.setPrototypeOf(this, fs.prototype);
|
|
14881
14881
|
}
|
|
14882
14882
|
}
|
|
14883
14883
|
class ia extends $i {
|
|
14884
14884
|
constructor(t) {
|
|
14885
|
-
super(t,
|
|
14885
|
+
super(t, Tr.Transport), this.name = "TransportError", Object.setPrototypeOf(this, ia.prototype);
|
|
14886
14886
|
}
|
|
14887
14887
|
}
|
|
14888
14888
|
class nn extends $i {
|
|
14889
14889
|
constructor(t) {
|
|
14890
|
-
super(t,
|
|
14890
|
+
super(t, Tr.External), this.name = "ExternalError", Object.setPrototypeOf(this, nn.prototype);
|
|
14891
14891
|
}
|
|
14892
14892
|
}
|
|
14893
14893
|
class Ye extends $i {
|
|
14894
14894
|
constructor(t) {
|
|
14895
|
-
super(t,
|
|
14895
|
+
super(t, Tr.Input), this.name = "InputError", Object.setPrototypeOf(this, Ye.prototype);
|
|
14896
14896
|
}
|
|
14897
14897
|
}
|
|
14898
14898
|
class rn extends $i {
|
|
14899
14899
|
constructor(t) {
|
|
14900
|
-
super(t,
|
|
14900
|
+
super(t, Tr.Unknown), this.name = "UnknownError", Object.setPrototypeOf(this, rn.prototype);
|
|
14901
14901
|
}
|
|
14902
14902
|
}
|
|
14903
14903
|
class ls extends ke {
|
|
@@ -14981,9 +14981,9 @@ class Sl extends ke {
|
|
|
14981
14981
|
return `DER payload mismatch: Expected length ${this.expectedLength}, actual length: ${this.actualLength}`;
|
|
14982
14982
|
}
|
|
14983
14983
|
}
|
|
14984
|
-
class
|
|
14984
|
+
class xr extends ke {
|
|
14985
14985
|
constructor(t) {
|
|
14986
|
-
super(), this.error = t, this.name = "DerDecodeErrorCode", Object.setPrototypeOf(this,
|
|
14986
|
+
super(), this.error = t, this.name = "DerDecodeErrorCode", Object.setPrototypeOf(this, xr.prototype);
|
|
14987
14987
|
}
|
|
14988
14988
|
toErrorMessage() {
|
|
14989
14989
|
return `Failed to decode DER: ${this.error}`;
|
|
@@ -15109,9 +15109,9 @@ class uo extends ke {
|
|
|
15109
15109
|
return this.error;
|
|
15110
15110
|
}
|
|
15111
15111
|
}
|
|
15112
|
-
class
|
|
15112
|
+
class xi extends ke {
|
|
15113
15113
|
constructor() {
|
|
15114
|
-
super(), this.name = "IdentityInvalidErrorCode", Object.setPrototypeOf(this,
|
|
15114
|
+
super(), this.name = "IdentityInvalidErrorCode", Object.setPrototypeOf(this, xi.prototype);
|
|
15115
15115
|
}
|
|
15116
15116
|
toErrorMessage() {
|
|
15117
15117
|
return "This identity has expired due this application's security policy. Please refresh your authentication.";
|
|
@@ -15847,7 +15847,7 @@ function U3(e, t) {
|
|
|
15847
15847
|
return Vl(e, c, t), c;
|
|
15848
15848
|
}
|
|
15849
15849
|
function R3(e) {
|
|
15850
|
-
const t =
|
|
15850
|
+
const t = ai(e), n = U1(e), r = n(t, t.neg(t.ONE)), i = n(t, r), s = n(t, t.neg(r)), o = (e + k3) / k1;
|
|
15851
15851
|
return (c, a) => {
|
|
15852
15852
|
let u = c.pow(a, o), f = c.mul(u, r);
|
|
15853
15853
|
const l = c.mul(u, i), p = c.mul(u, s), y = c.eql(c.sqr(f), a), g = c.eql(c.sqr(l), a);
|
|
@@ -15863,7 +15863,7 @@ function U1(e) {
|
|
|
15863
15863
|
for (; t % Ii === on; )
|
|
15864
15864
|
t /= Ii, n++;
|
|
15865
15865
|
let r = Ii;
|
|
15866
|
-
const i =
|
|
15866
|
+
const i = ai(e);
|
|
15867
15867
|
for (; da(i, r) === 1; )
|
|
15868
15868
|
if (r++ > 1e3)
|
|
15869
15869
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
@@ -15948,7 +15948,7 @@ function M3(e, t) {
|
|
|
15948
15948
|
const n = t !== void 0 ? t : e.toString(2).length, r = Math.ceil(n / 8);
|
|
15949
15949
|
return { nBitLength: n, nByteLength: r };
|
|
15950
15950
|
}
|
|
15951
|
-
function
|
|
15951
|
+
function ai(e, t, n = !1, r = {}) {
|
|
15952
15952
|
if (e <= on)
|
|
15953
15953
|
throw new Error("invalid field: expected ORDER > 0, got " + e);
|
|
15954
15954
|
let i, s, o = !1, c;
|
|
@@ -16043,7 +16043,7 @@ function pa(e, t) {
|
|
|
16043
16043
|
const n = t.negate();
|
|
16044
16044
|
return e ? n : t;
|
|
16045
16045
|
}
|
|
16046
|
-
function
|
|
16046
|
+
function yr(e, t) {
|
|
16047
16047
|
const n = Gi(e.Fp, t.map((r) => r.Z));
|
|
16048
16048
|
return t.map((r, i) => e.fromAffine(r.toAffine(n[i])));
|
|
16049
16049
|
}
|
|
@@ -16214,7 +16214,7 @@ function Rd(e, t, n) {
|
|
|
16214
16214
|
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
16215
16215
|
return R1(t), t;
|
|
16216
16216
|
} else
|
|
16217
|
-
return
|
|
16217
|
+
return ai(e, { isLE: n });
|
|
16218
16218
|
}
|
|
16219
16219
|
function L1(e, t, n = {}, r) {
|
|
16220
16220
|
if (r === void 0 && (r = e === "edwards"), !t || typeof t != "object")
|
|
@@ -16231,7 +16231,7 @@ function L1(e, t, n = {}, r) {
|
|
|
16231
16231
|
return t = Object.freeze(Object.assign({}, t)), { CURVE: t, Fp: i, Fn: s };
|
|
16232
16232
|
}
|
|
16233
16233
|
const $3 = Yn;
|
|
16234
|
-
function
|
|
16234
|
+
function zr(e, t) {
|
|
16235
16235
|
if (Io(e), Io(t), e < 0 || e >= 1 << 8 * t)
|
|
16236
16236
|
throw new Error("invalid I2OSP input: " + e);
|
|
16237
16237
|
const n = Array.from({ length: t }).fill(0);
|
|
@@ -16259,10 +16259,10 @@ function W3(e, t, n, r) {
|
|
|
16259
16259
|
const { outputLen: i, blockLen: s } = r, o = Math.ceil(n / i);
|
|
16260
16260
|
if (n > 65535 || o > 255)
|
|
16261
16261
|
throw new Error("expand_message_xmd: invalid lenInBytes");
|
|
16262
|
-
const c = Me(t,
|
|
16263
|
-
f[0] = r(Me(l,
|
|
16262
|
+
const c = Me(t, zr(t.length, 1)), a = zr(0, s), u = zr(n, 2), f = new Array(o), l = r(Me(a, e, u, zr(0, 1), c));
|
|
16263
|
+
f[0] = r(Me(l, zr(1, 1), c));
|
|
16264
16264
|
for (let y = 1; y <= o; y++) {
|
|
16265
|
-
const g = [j3(l, f[y - 1]),
|
|
16265
|
+
const g = [j3(l, f[y - 1]), zr(y + 1, 1), c];
|
|
16266
16266
|
f[y] = r(Me(...g));
|
|
16267
16267
|
}
|
|
16268
16268
|
return Me(...f).slice(0, n);
|
|
@@ -16274,7 +16274,7 @@ function G3(e, t, n, r, i) {
|
|
|
16274
16274
|
}
|
|
16275
16275
|
if (n > 65535 || t.length > 255)
|
|
16276
16276
|
throw new Error("expand_message_xof: invalid lenInBytes");
|
|
16277
|
-
return i.create({ dkLen: n }).update(e).update(
|
|
16277
|
+
return i.create({ dkLen: n }).update(e).update(zr(n, 2)).update(t).update(zr(t.length, 1)).digest();
|
|
16278
16278
|
}
|
|
16279
16279
|
function Lu(e, t, n) {
|
|
16280
16280
|
nc(n, {
|
|
@@ -16354,7 +16354,7 @@ function Cd(e, t, n) {
|
|
|
16354
16354
|
};
|
|
16355
16355
|
}
|
|
16356
16356
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16357
|
-
const Hd = (e, t) => (e + (e >= 0 ? t : -t) /
|
|
16357
|
+
const Hd = (e, t) => (e + (e >= 0 ? t : -t) / ar) / t;
|
|
16358
16358
|
function X3(e, t, n) {
|
|
16359
16359
|
const [[r, i], [s, o]] = t, c = Hd(o * e, n), a = Hd(-i * e, n);
|
|
16360
16360
|
let u = e - c * r - a * s, f = -c * i - a * o;
|
|
@@ -16365,7 +16365,7 @@ function X3(e, t, n) {
|
|
|
16365
16365
|
throw new Error("splitScalar (endomorphism): failed, k=" + e);
|
|
16366
16366
|
return { k1neg: l, k1: u, k2neg: p, k2: f };
|
|
16367
16367
|
}
|
|
16368
|
-
const Pi = BigInt(0), Dt = BigInt(1),
|
|
16368
|
+
const Pi = BigInt(0), Dt = BigInt(1), ar = BigInt(2), os = BigInt(3), Mf = BigInt(4);
|
|
16369
16369
|
function ya(e, t) {
|
|
16370
16370
|
const { BYTES: n } = e;
|
|
16371
16371
|
let r;
|
|
@@ -16600,7 +16600,7 @@ function z3(e, t = {}) {
|
|
|
16600
16600
|
if (!i.isValidNot0(H))
|
|
16601
16601
|
throw new Error("invalid scalar: out of range");
|
|
16602
16602
|
let N, $;
|
|
16603
|
-
const F = (x) => V.cached(this, x, (O) =>
|
|
16603
|
+
const F = (x) => V.cached(this, x, (O) => yr(v, O));
|
|
16604
16604
|
if (K) {
|
|
16605
16605
|
const { k1neg: x, k1: O, k2neg: q, k2: P } = I(H), { p: L, f: G } = F(O), { p: X, f: Y } = F(P);
|
|
16606
16606
|
$ = G.add(Y), N = M(K.beta, L, X, x, q);
|
|
@@ -16608,7 +16608,7 @@ function z3(e, t = {}) {
|
|
|
16608
16608
|
const { p: x, f: O } = F(H);
|
|
16609
16609
|
N = x, $ = O;
|
|
16610
16610
|
}
|
|
16611
|
-
return
|
|
16611
|
+
return yr(v, [N, $])[0];
|
|
16612
16612
|
}
|
|
16613
16613
|
/**
|
|
16614
16614
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -16683,7 +16683,7 @@ function z3(e, t = {}) {
|
|
|
16683
16683
|
this.precompute(H);
|
|
16684
16684
|
}
|
|
16685
16685
|
static normalizeZ(H) {
|
|
16686
|
-
return
|
|
16686
|
+
return yr(v, H);
|
|
16687
16687
|
}
|
|
16688
16688
|
static msm(H, K) {
|
|
16689
16689
|
return V1(v, i, H, K);
|
|
@@ -16702,9 +16702,9 @@ function Y3(e) {
|
|
|
16702
16702
|
function Z3(e, t) {
|
|
16703
16703
|
const n = e.ORDER;
|
|
16704
16704
|
let r = Pi;
|
|
16705
|
-
for (let g = n - Dt; g %
|
|
16705
|
+
for (let g = n - Dt; g % ar === Pi; g /= ar)
|
|
16706
16706
|
r += Dt;
|
|
16707
|
-
const i = r, s =
|
|
16707
|
+
const i = r, s = ar << i - Dt - Dt, o = s * ar, c = (n - Dt) / o, a = (c - Dt) / ar, u = o - Dt, f = s, l = e.pow(t, c), p = e.pow(t, (c + Dt) / ar);
|
|
16708
16708
|
let y = (g, w) => {
|
|
16709
16709
|
let E = l, _ = e.pow(w, u), S = e.sqr(_);
|
|
16710
16710
|
S = e.mul(S, w);
|
|
@@ -16715,8 +16715,8 @@ function Z3(e, t) {
|
|
|
16715
16715
|
let I = e.eql(m, e.ONE);
|
|
16716
16716
|
_ = e.mul(S, p), m = e.mul(T, E), S = e.cmov(_, S, I), T = e.cmov(m, T, I);
|
|
16717
16717
|
for (let A = i; A > Dt; A--) {
|
|
16718
|
-
let U = A -
|
|
16719
|
-
U =
|
|
16718
|
+
let U = A - ar;
|
|
16719
|
+
U = ar << U - Dt;
|
|
16720
16720
|
let M = e.pow(T, U);
|
|
16721
16721
|
const v = e.eql(M, e.ONE);
|
|
16722
16722
|
_ = e.mul(S, E), E = e.mul(E, E), M = e.mul(T, E), S = e.cmov(_, S, v), T = e.cmov(M, T, v);
|
|
@@ -16781,7 +16781,7 @@ function Q3(e) {
|
|
|
16781
16781
|
Gy: e.Gy
|
|
16782
16782
|
}, n = e.Fp;
|
|
16783
16783
|
let r = e.allowedPrivateKeyLengths ? Array.from(new Set(e.allowedPrivateKeyLengths.map((o) => Math.ceil(o / 2)))) : void 0;
|
|
16784
|
-
const i =
|
|
16784
|
+
const i = ai(t.n, {
|
|
16785
16785
|
BITS: e.nBitLength,
|
|
16786
16786
|
allowedLengths: r,
|
|
16787
16787
|
modFromBytes: e.wrapPrivateKey
|
|
@@ -16880,7 +16880,7 @@ function iT(e, t, n, r) {
|
|
|
16880
16880
|
}
|
|
16881
16881
|
function _(m, T = !0) {
|
|
16882
16882
|
const I = [];
|
|
16883
|
-
|
|
16883
|
+
yr(t, m.map(({ g1: A }) => A)), yr(n, m.map(({ g2: A }) => A));
|
|
16884
16884
|
for (const { g1: A, g2: U } of m) {
|
|
16885
16885
|
if (A.is0() || U.is0())
|
|
16886
16886
|
throw new Error("pairing is not available for ZERO point");
|
|
@@ -17086,12 +17086,12 @@ function sT(e) {
|
|
|
17086
17086
|
};
|
|
17087
17087
|
}
|
|
17088
17088
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
17089
|
-
const Vd = BigInt(0),
|
|
17089
|
+
const Vd = BigInt(0), gr = BigInt(1), zt = BigInt(2), Ld = BigInt(3);
|
|
17090
17090
|
function Ll(e, t, n, r, i = 1, s) {
|
|
17091
17091
|
const o = BigInt(s === void 0 ? r : s), c = n ** BigInt(r), a = [];
|
|
17092
17092
|
for (let u = 0; u < i; u++) {
|
|
17093
17093
|
const f = BigInt(u + 1), l = [];
|
|
17094
|
-
for (let p = 0, y =
|
|
17094
|
+
for (let p = 0, y = gr; p < r; p++) {
|
|
17095
17095
|
const g = (f * y - f) / o % c;
|
|
17096
17096
|
l.push(e.pow(t, g)), y *= n;
|
|
17097
17097
|
}
|
|
@@ -17100,12 +17100,12 @@ function Ll(e, t, n, r, i = 1, s) {
|
|
|
17100
17100
|
return a;
|
|
17101
17101
|
}
|
|
17102
17102
|
function oT(e, t, n) {
|
|
17103
|
-
const r = t.pow(n, (e.ORDER -
|
|
17103
|
+
const r = t.pow(n, (e.ORDER - gr) / Ld), i = t.pow(n, (e.ORDER - gr) / zt);
|
|
17104
17104
|
function s(p, y) {
|
|
17105
17105
|
const g = t.mul(t.frobeniusMap(p, 1), r), w = t.mul(t.frobeniusMap(y, 1), i);
|
|
17106
17106
|
return [g, w];
|
|
17107
17107
|
}
|
|
17108
|
-
const o = t.pow(n, (e.ORDER ** zt -
|
|
17108
|
+
const o = t.pow(n, (e.ORDER ** zt - gr) / Ld), c = t.pow(n, (e.ORDER ** zt - gr) / zt);
|
|
17109
17109
|
if (!t.eql(c, t.neg(t.ONE)))
|
|
17110
17110
|
throw new Error("psiFrobenius: PSI2_Y!==-1");
|
|
17111
17111
|
function a(p, y) {
|
|
@@ -17125,7 +17125,7 @@ const Kd = (e, t) => {
|
|
|
17125
17125
|
};
|
|
17126
17126
|
class cT {
|
|
17127
17127
|
constructor(t, n = {}) {
|
|
17128
|
-
this.MASK =
|
|
17128
|
+
this.MASK = gr;
|
|
17129
17129
|
const r = t.ORDER, i = r * r;
|
|
17130
17130
|
this.Fp = t, this.ORDER = i, this.BITS = vo(i), this.BYTES = Math.ceil(vo(i) / 8), this.isLE = t.isLE, this.ZERO = { c0: t.ZERO, c1: t.ZERO }, this.ONE = { c0: t.ONE, c1: t.ZERO }, this.Fp_NONRESIDUE = t.create(n.NONRESIDUE || BigInt(-1)), this.Fp_div2 = t.div(t.ONE, zt), this.NONRESIDUE = Kd(t, n.FP2_NONRESIDUE), this.FROBENIUS_COEFFICIENTS = Ll(t, this.Fp_NONRESIDUE, t.ORDER, 2)[0], this.mulByB = n.Fp2mulByB, Object.seal(this);
|
|
17131
17131
|
}
|
|
@@ -17224,7 +17224,7 @@ class cT {
|
|
|
17224
17224
|
// Same as sgn0_m_eq_2 in RFC 9380
|
|
17225
17225
|
isOdd(t) {
|
|
17226
17226
|
const { re: n, im: r } = this.reim(t), i = n % zt, s = n === Vd, o = r % zt;
|
|
17227
|
-
return BigInt(i || s && o) ==
|
|
17227
|
+
return BigInt(i || s && o) == gr;
|
|
17228
17228
|
}
|
|
17229
17229
|
// Bytes util
|
|
17230
17230
|
fromBytes(t) {
|
|
@@ -17267,7 +17267,7 @@ class cT {
|
|
|
17267
17267
|
}
|
|
17268
17268
|
class aT {
|
|
17269
17269
|
constructor(t) {
|
|
17270
|
-
this.MASK =
|
|
17270
|
+
this.MASK = gr, this.Fp2 = t, this.ORDER = t.ORDER, this.BITS = 3 * t.BITS, this.BYTES = 3 * t.BYTES, this.isLE = t.isLE, this.ZERO = { c0: t.ZERO, c1: t.ZERO, c2: t.ZERO }, this.ONE = { c0: t.ONE, c1: t.ZERO, c2: t.ZERO };
|
|
17271
17271
|
const { Fp: n } = t, r = Ll(t, t.NONRESIDUE, n.ORDER, 6, 2, 3);
|
|
17272
17272
|
this.FROBENIUS_COEFFICIENTS_1 = r[0], this.FROBENIUS_COEFFICIENTS_2 = r[1], Object.seal(this);
|
|
17273
17273
|
}
|
|
@@ -17449,7 +17449,7 @@ class aT {
|
|
|
17449
17449
|
}
|
|
17450
17450
|
class uT {
|
|
17451
17451
|
constructor(t, n) {
|
|
17452
|
-
this.MASK =
|
|
17452
|
+
this.MASK = gr;
|
|
17453
17453
|
const { Fp2: r } = t, { Fp: i } = r;
|
|
17454
17454
|
this.Fp6 = t, this.ORDER = r.ORDER, this.BITS = 2 * t.BITS, this.BYTES = 2 * t.BYTES, this.isLE = t.isLE, this.ZERO = { c0: t.ZERO, c1: t.ZERO }, this.ONE = { c0: t.ONE, c1: t.ZERO }, this.FROBENIUS_COEFFICIENTS = Ll(r, r.NONRESIDUE, i.ORDER, 12, 1, 6)[0], this.X_LEN = n.X_LEN, this.finalExponentiate = n.Fp12finalExponentiate;
|
|
17455
17455
|
}
|
|
@@ -17655,11 +17655,11 @@ class uT {
|
|
|
17655
17655
|
}
|
|
17656
17656
|
}
|
|
17657
17657
|
function fT(e) {
|
|
17658
|
-
const t =
|
|
17658
|
+
const t = ai(e.ORDER), n = new cT(t, e), r = new aT(n), i = new uT(r, e);
|
|
17659
17659
|
return { Fp: t, Fp2: n, Fp6: r, Fp12: i };
|
|
17660
17660
|
}
|
|
17661
17661
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
17662
|
-
const Mt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigInt(4),
|
|
17662
|
+
const Mt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigInt(4), Yr = BigInt("0xd201000000010000"), lT = vo(Yr), Vi = {
|
|
17663
17663
|
p: BigInt("0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab"),
|
|
17664
17664
|
n: BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"),
|
|
17665
17665
|
h: BigInt("0x396c8c005555e1568c00aaab0000aaab"),
|
|
@@ -17667,7 +17667,7 @@ const Mt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigIn
|
|
|
17667
17667
|
b: Oo,
|
|
17668
17668
|
Gx: BigInt("0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb"),
|
|
17669
17669
|
Gy: BigInt("0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1")
|
|
17670
|
-
}, hT =
|
|
17670
|
+
}, hT = ai(Vi.n, {
|
|
17671
17671
|
modFromBytes: !0,
|
|
17672
17672
|
isLE: !0
|
|
17673
17673
|
}), { Fp: me, Fp2: Pe, Fp6: dT, Fp12: Re } = fT({
|
|
@@ -17681,7 +17681,7 @@ const Mt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigIn
|
|
|
17681
17681
|
return { c0: me.sub(n, r), c1: me.add(n, r) };
|
|
17682
17682
|
},
|
|
17683
17683
|
Fp12finalExponentiate: (e) => {
|
|
17684
|
-
const t =
|
|
17684
|
+
const t = Yr, n = Re.div(Re.frobeniusMap(e, 6), e), r = Re.mul(Re.frobeniusMap(n, 2), n), i = Re.conjugate(Re._cyclotomicExp(r, t)), s = Re.mul(Re.conjugate(Re._cyclotomicSquare(r)), i), o = Re.conjugate(Re._cyclotomicExp(s, t)), c = Re.conjugate(Re._cyclotomicExp(o, t)), a = Re.mul(Re.conjugate(Re._cyclotomicExp(c, t)), Re._cyclotomicSquare(i)), u = Re.conjugate(Re._cyclotomicExp(a, t)), f = Re.frobeniusMap(Re.mul(i, c), 2), l = Re.frobeniusMap(Re.mul(o, r), 3), p = Re.frobeniusMap(Re.mul(a, Re.conjugate(r)), 1), y = Re.mul(Re.mul(u, Re.conjugate(s)), r);
|
|
17685
17685
|
return Re.mul(Re.mul(Re.mul(f, l), p), y);
|
|
17686
17686
|
}
|
|
17687
17687
|
}), { G2psi: $d, G2psi2: pT } = oT(me, Pe, Pe.div(Pe.ONE, Pe.NONRESIDUE)), $u = Object.freeze({
|
|
@@ -17861,11 +17861,11 @@ const ru = sT({
|
|
|
17861
17861
|
// https://eprint.iacr.org/2021/1130.pdf
|
|
17862
17862
|
isTorsionFree: (e, t) => {
|
|
17863
17863
|
const n = BigInt("0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe"), r = new e(me.mul(t.X, n), t.Y, t.Z);
|
|
17864
|
-
return t.multiplyUnsafe(
|
|
17864
|
+
return t.multiplyUnsafe(Yr).negate().multiplyUnsafe(Yr).equals(r);
|
|
17865
17865
|
},
|
|
17866
17866
|
// Clear cofactor of G1
|
|
17867
17867
|
// https://eprint.iacr.org/2019/403
|
|
17868
|
-
clearCofactor: (e, t) => t.multiplyUnsafe(
|
|
17868
|
+
clearCofactor: (e, t) => t.multiplyUnsafe(Yr).add(t),
|
|
17869
17869
|
mapToCurve: TT,
|
|
17870
17870
|
fromBytes: gT,
|
|
17871
17871
|
toBytes: yT,
|
|
@@ -17902,13 +17902,13 @@ const ru = sT({
|
|
|
17902
17902
|
// It returns false for shitty points.
|
|
17903
17903
|
// https://eprint.iacr.org/2021/1130.pdf
|
|
17904
17904
|
// Older version: https://eprint.iacr.org/2019/814.pdf
|
|
17905
|
-
isTorsionFree: (e, t) => t.multiplyUnsafe(
|
|
17905
|
+
isTorsionFree: (e, t) => t.multiplyUnsafe(Yr).negate().equals($d(e, t)),
|
|
17906
17906
|
// Maps the point into the prime-order subgroup G2.
|
|
17907
17907
|
// clear_cofactor_bls12381_g2 from RFC 9380.
|
|
17908
17908
|
// https://eprint.iacr.org/2017/419.pdf
|
|
17909
17909
|
// prettier-ignore
|
|
17910
17910
|
clearCofactor: (e, t) => {
|
|
17911
|
-
const n =
|
|
17911
|
+
const n = Yr;
|
|
17912
17912
|
let r = t.multiplyUnsafe(n).negate(), i = $d(e, t), s = t.double();
|
|
17913
17913
|
return s = pT(e, s), s = s.subtract(i), i = r.add(i), i = i.multiplyUnsafe(n).negate(), s = s.add(i), s = s.subtract(r), s.subtract(t);
|
|
17914
17914
|
},
|
|
@@ -17933,7 +17933,7 @@ const ru = sT({
|
|
|
17933
17933
|
}
|
|
17934
17934
|
},
|
|
17935
17935
|
params: {
|
|
17936
|
-
ateLoopSize:
|
|
17936
|
+
ateLoopSize: Yr,
|
|
17937
17937
|
// The BLS parameter x for BLS12-381
|
|
17938
17938
|
r: Vi.n,
|
|
17939
17939
|
// order; z⁴ − z² + 1; CURVE.n from other curves
|
|
@@ -18471,7 +18471,7 @@ const Dd = async (e) => {
|
|
|
18471
18471
|
}
|
|
18472
18472
|
}
|
|
18473
18473
|
} catch (l) {
|
|
18474
|
-
if (l instanceof
|
|
18474
|
+
if (l instanceof dr && (l.hasCode(ls) || l.hasCode(Eo)))
|
|
18475
18475
|
throw l;
|
|
18476
18476
|
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();
|
|
18477
18477
|
}
|
|
@@ -18538,7 +18538,7 @@ const Dd = async (e) => {
|
|
|
18538
18538
|
throw rn.fromCode(new Un(`Error while encoding your path for canister status. Please ensure that your path ${e} was formatted correctly.`));
|
|
18539
18539
|
}, MT = (e) => Dn(e).map((n) => Le.fromUint8Array(n));
|
|
18540
18540
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
18541
|
-
const
|
|
18541
|
+
const Ur = BigInt(0), Tt = BigInt(1), Gu = BigInt(2), qT = BigInt(8);
|
|
18542
18542
|
function VT(e, t, n, r) {
|
|
18543
18543
|
const i = e.sqr(n), s = e.sqr(r), o = e.add(e.mul(t.a, i), s), c = e.add(e.ONE, e.mul(t.d, e.mul(i, s)));
|
|
18544
18544
|
return e.eql(o, c);
|
|
@@ -18552,13 +18552,13 @@ function LT(e, t = {}) {
|
|
|
18552
18552
|
try {
|
|
18553
18553
|
return { isValid: !0, value: r.sqrt(r.div(E, _)) };
|
|
18554
18554
|
} catch {
|
|
18555
|
-
return { isValid: !1, value:
|
|
18555
|
+
return { isValid: !1, value: Ur };
|
|
18556
18556
|
}
|
|
18557
18557
|
});
|
|
18558
18558
|
if (!VT(r, s, s.Gx, s.Gy))
|
|
18559
18559
|
throw new Error("bad curve params: generator point");
|
|
18560
18560
|
function f(E, _, S = !1) {
|
|
18561
|
-
const m = S ? Tt :
|
|
18561
|
+
const m = S ? Tt : Ur;
|
|
18562
18562
|
return Pd("coordinate " + E, _, m, c), _;
|
|
18563
18563
|
}
|
|
18564
18564
|
function l(E) {
|
|
@@ -18570,7 +18570,7 @@ function LT(e, t = {}) {
|
|
|
18570
18570
|
_ == null && (_ = I ? qT : r.inv(T));
|
|
18571
18571
|
const A = a(S * _), U = a(m * _), M = r.mul(T, _);
|
|
18572
18572
|
if (I)
|
|
18573
|
-
return { x:
|
|
18573
|
+
return { x: Ur, y: Tt };
|
|
18574
18574
|
if (M !== Tt)
|
|
18575
18575
|
throw new Error("invZ was invalid");
|
|
18576
18576
|
return { x: A, y: U };
|
|
@@ -18606,13 +18606,13 @@ function LT(e, t = {}) {
|
|
|
18606
18606
|
const A = Od(_), U = _[m - 1];
|
|
18607
18607
|
A[m - 1] = U & -129;
|
|
18608
18608
|
const M = Ao(A), v = S ? c : r.ORDER;
|
|
18609
|
-
Pd("point.y", M,
|
|
18609
|
+
Pd("point.y", M, Ur, v);
|
|
18610
18610
|
const R = a(M * M), V = a(R - Tt), W = a(I * R - T);
|
|
18611
18611
|
let { isValid: H, value: K } = u(V, W);
|
|
18612
18612
|
if (!H)
|
|
18613
18613
|
throw new Error("bad point: invalid y coordinate");
|
|
18614
18614
|
const N = (K & Tt) === Tt, $ = (U & 128) !== 0;
|
|
18615
|
-
if (!S && K ===
|
|
18615
|
+
if (!S && K === Ur && $)
|
|
18616
18616
|
throw new Error("bad point: x=0 and x_0=1");
|
|
18617
18617
|
return $ !== N && (K = a(-K)), g.fromAffine({ x: K, y: M });
|
|
18618
18618
|
}
|
|
@@ -18666,8 +18666,8 @@ function LT(e, t = {}) {
|
|
|
18666
18666
|
multiply(_) {
|
|
18667
18667
|
if (!i.isValidNot0(_))
|
|
18668
18668
|
throw new Error("invalid scalar: expected 1 <= sc < curve.n");
|
|
18669
|
-
const { p: S, f: m } = w.cached(this, _, (T) =>
|
|
18670
|
-
return
|
|
18669
|
+
const { p: S, f: m } = w.cached(this, _, (T) => yr(g, T));
|
|
18670
|
+
return yr(g, [S, m])[0];
|
|
18671
18671
|
}
|
|
18672
18672
|
// Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
18673
18673
|
// It's faster, but should only be used when you don't care about
|
|
@@ -18677,7 +18677,7 @@ function LT(e, t = {}) {
|
|
|
18677
18677
|
multiplyUnsafe(_, S = g.ZERO) {
|
|
18678
18678
|
if (!i.isValid(_))
|
|
18679
18679
|
throw new Error("invalid scalar: expected 0 <= sc < curve.n");
|
|
18680
|
-
return _ ===
|
|
18680
|
+
return _ === Ur ? g.ZERO : this.is0() || _ === Tt ? this : w.unsafe(this, _, (m) => yr(g, m), S);
|
|
18681
18681
|
}
|
|
18682
18682
|
// Checks if point is of small order.
|
|
18683
18683
|
// If you add something to small order point, you will have "dirty"
|
|
@@ -18723,7 +18723,7 @@ function LT(e, t = {}) {
|
|
|
18723
18723
|
return this.T;
|
|
18724
18724
|
}
|
|
18725
18725
|
static normalizeZ(_) {
|
|
18726
|
-
return
|
|
18726
|
+
return yr(g, _);
|
|
18727
18727
|
}
|
|
18728
18728
|
static msm(_, S) {
|
|
18729
18729
|
return V1(g, i, _, S);
|
|
@@ -18735,7 +18735,7 @@ function LT(e, t = {}) {
|
|
|
18735
18735
|
return this.toBytes();
|
|
18736
18736
|
}
|
|
18737
18737
|
}
|
|
18738
|
-
g.BASE = new g(s.Gx, s.Gy, Tt, a(s.Gx * s.Gy)), g.ZERO = new g(
|
|
18738
|
+
g.BASE = new g(s.Gx, s.Gy, Tt, a(s.Gx * s.Gy)), g.ZERO = new g(Ur, Tt, Tt, Ur), g.Fp = r, g.Fn = i;
|
|
18739
18739
|
const w = new q1(g, i.BITS);
|
|
18740
18740
|
return g.BASE.precompute(8), g;
|
|
18741
18741
|
}
|
|
@@ -18874,7 +18874,7 @@ function $T(e) {
|
|
|
18874
18874
|
h: e.h,
|
|
18875
18875
|
Gx: e.Gx,
|
|
18876
18876
|
Gy: e.Gy
|
|
18877
|
-
}, n = e.Fp, r =
|
|
18877
|
+
}, n = e.Fp, r = ai(t.n, e.nBitLength, !0), i = { Fp: n, Fn: r, uvRatio: e.uvRatio }, s = {
|
|
18878
18878
|
randomBytes: e.randomBytes,
|
|
18879
18879
|
adjustScalarBytes: e.adjustScalarBytes,
|
|
18880
18880
|
domain: e.domain,
|
|
@@ -18922,7 +18922,7 @@ function ZT(e, t) {
|
|
|
18922
18922
|
const c = dt(t * o * o, n), a = o, u = dt(o * zd, n), f = c === e, l = c === dt(-e, n), p = c === dt(-e * zd, n);
|
|
18923
18923
|
return f && (o = a), (l || p) && (o = u), H3(o, n) && (o = dt(-o, n)), { isValid: f || l, value: o };
|
|
18924
18924
|
}
|
|
18925
|
-
const JT =
|
|
18925
|
+
const JT = ai(X1.p, { isLE: !0 }), QT = {
|
|
18926
18926
|
...X1,
|
|
18927
18927
|
Fp: JT,
|
|
18928
18928
|
hash: Zm,
|
|
@@ -19080,14 +19080,14 @@ const Jd = (e) => {
|
|
|
19080
19080
|
if (e[t] < 128)
|
|
19081
19081
|
return 1;
|
|
19082
19082
|
if (e[t] === 128)
|
|
19083
|
-
throw Ye.fromCode(new
|
|
19083
|
+
throw Ye.fromCode(new xr("Invalid length 0"));
|
|
19084
19084
|
if (e[t] === 129)
|
|
19085
19085
|
return 2;
|
|
19086
19086
|
if (e[t] === 130)
|
|
19087
19087
|
return 3;
|
|
19088
19088
|
if (e[t] === 131)
|
|
19089
19089
|
return 4;
|
|
19090
|
-
throw Ye.fromCode(new
|
|
19090
|
+
throw Ye.fromCode(new xr("Length too long (> 4 bytes)"));
|
|
19091
19091
|
}, n8 = (e, t) => {
|
|
19092
19092
|
const n = Vf(e, t);
|
|
19093
19093
|
if (n === 1)
|
|
@@ -19098,7 +19098,7 @@ const Jd = (e) => {
|
|
|
19098
19098
|
return (e[t + 1] << 8) + e[t + 2];
|
|
19099
19099
|
if (n === 4)
|
|
19100
19100
|
return (e[t + 1] << 16) + (e[t + 2] << 8) + e[t + 3];
|
|
19101
|
-
throw Ye.fromCode(new
|
|
19101
|
+
throw Ye.fromCode(new xr("Length too long (> 4 bytes)"));
|
|
19102
19102
|
};
|
|
19103
19103
|
Uint8Array.from([
|
|
19104
19104
|
48,
|
|
@@ -19191,10 +19191,10 @@ const i8 = (e, t) => {
|
|
|
19191
19191
|
let n = 0;
|
|
19192
19192
|
const r = (c, a) => {
|
|
19193
19193
|
if (i[n++] !== c)
|
|
19194
|
-
throw Ye.fromCode(new
|
|
19194
|
+
throw Ye.fromCode(new xr(`Expected ${a} at offset ${n}`));
|
|
19195
19195
|
}, i = new Uint8Array(e);
|
|
19196
19196
|
if (r(48, "sequence"), n += Vf(i, n), !Ja(i.slice(n, n + t.byteLength), t))
|
|
19197
|
-
throw Ye.fromCode(new
|
|
19197
|
+
throw Ye.fromCode(new xr("Not the expected OID."));
|
|
19198
19198
|
n += t.byteLength, r(3, "bit string");
|
|
19199
19199
|
const s = n8(i, n) - 1;
|
|
19200
19200
|
n += Vf(i, n), r(0, "0 padding");
|
|
@@ -19210,7 +19210,7 @@ const Ai = class Ai {
|
|
|
19210
19210
|
Jt(this, ko);
|
|
19211
19211
|
Jt(this, No);
|
|
19212
19212
|
if (t.byteLength !== Ai.RAW_KEY_LENGTH)
|
|
19213
|
-
throw Ye.fromCode(new
|
|
19213
|
+
throw Ye.fromCode(new xr("An Ed25519 public key must be exactly 32 bytes long"));
|
|
19214
19214
|
$t(this, ko, t), $t(this, No, Ai.derEncode(t));
|
|
19215
19215
|
}
|
|
19216
19216
|
static from(t) {
|
|
@@ -19228,7 +19228,7 @@ const Ai = class Ai {
|
|
|
19228
19228
|
static derDecode(t) {
|
|
19229
19229
|
const n = i8(t, e0);
|
|
19230
19230
|
if (n.length !== this.RAW_KEY_LENGTH)
|
|
19231
|
-
throw Ye.fromCode(new
|
|
19231
|
+
throw Ye.fromCode(new xr("An Ed25519 public key must be exactly 32 bytes long"));
|
|
19232
19232
|
return n;
|
|
19233
19233
|
}
|
|
19234
19234
|
get rawKey() {
|
|
@@ -19321,10 +19321,10 @@ Pn = new WeakMap(), Uo = new WeakMap(), Ro = new WeakMap(), Co = new WeakMap(),
|
|
|
19321
19321
|
date: Date
|
|
19322
19322
|
};
|
|
19323
19323
|
let Kf = xa;
|
|
19324
|
-
var
|
|
19324
|
+
var lr;
|
|
19325
19325
|
(function(e) {
|
|
19326
19326
|
e.Received = "received", e.Processing = "processing", e.Replied = "replied", e.Rejected = "rejected", e.Unknown = "unknown", e.Done = "done";
|
|
19327
|
-
})(
|
|
19327
|
+
})(lr || (lr = {}));
|
|
19328
19328
|
const $f = 60 * 1e3, c8 = 1e6, a8 = 0, u8 = "308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814c0e6ec71fab583b08bd81373c255c3c371b2e84863c98a4f1e08b74235d14fb5d9c0cd546d9685f913a0c0b2cc5341583bf4b4392e467db96d65b9bb4cb717112f8472e0d5a4d14505ffd7484b01291091c5f87b98883463f98091a0baaae", f8 = "ic0.app", l8 = ".ic0.app", h8 = "icp0.io", d8 = ".icp0.io", p8 = "icp-api.io", y8 = ".icp-api.io", Du = 200, g8 = 202, w8 = 404;
|
|
19329
19329
|
function m8() {
|
|
19330
19330
|
let e;
|
|
@@ -19354,7 +19354,7 @@ function b8(e) {
|
|
|
19354
19354
|
}
|
|
19355
19355
|
return t.toString();
|
|
19356
19356
|
}
|
|
19357
|
-
class
|
|
19357
|
+
class wr {
|
|
19358
19358
|
#t;
|
|
19359
19359
|
#e;
|
|
19360
19360
|
#i;
|
|
@@ -19442,12 +19442,12 @@ class yr {
|
|
|
19442
19442
|
return new this({ ...t });
|
|
19443
19443
|
}
|
|
19444
19444
|
static async create(t = {}) {
|
|
19445
|
-
const n =
|
|
19445
|
+
const n = wr.createSync(t);
|
|
19446
19446
|
return await n.#y(), n;
|
|
19447
19447
|
}
|
|
19448
19448
|
static async from(t) {
|
|
19449
19449
|
try {
|
|
19450
|
-
return "config" in t ? await
|
|
19450
|
+
return "config" in t ? await wr.create(t.config) : await wr.create({
|
|
19451
19451
|
fetch: t._fetch,
|
|
19452
19452
|
fetchOptions: t._fetchOptions,
|
|
19453
19453
|
callOptions: t._callOptions,
|
|
@@ -19473,7 +19473,7 @@ class yr {
|
|
|
19473
19473
|
}
|
|
19474
19474
|
async getPrincipal() {
|
|
19475
19475
|
if (!this.#n)
|
|
19476
|
-
throw nn.fromCode(new
|
|
19476
|
+
throw nn.fromCode(new xi());
|
|
19477
19477
|
return (await this.#n).getPrincipal();
|
|
19478
19478
|
}
|
|
19479
19479
|
/**
|
|
@@ -19491,7 +19491,7 @@ class yr {
|
|
|
19491
19491
|
async call(t, n, r) {
|
|
19492
19492
|
const i = n.callSync ?? !0, s = await (r ?? this.#n);
|
|
19493
19493
|
if (!s)
|
|
19494
|
-
throw nn.fromCode(new
|
|
19494
|
+
throw nn.fromCode(new xi());
|
|
19495
19495
|
const o = Le.from(t), c = n.effectiveCanisterId ? Le.from(n.effectiveCanisterId) : o;
|
|
19496
19496
|
await this.#y(c);
|
|
19497
19497
|
const a = s.getPrincipal(), u = Xu(this.#o, this.#i), f = {
|
|
@@ -19544,7 +19544,7 @@ class yr {
|
|
|
19544
19544
|
};
|
|
19545
19545
|
} catch (_) {
|
|
19546
19546
|
let S;
|
|
19547
|
-
if (_ instanceof
|
|
19547
|
+
if (_ instanceof dr) {
|
|
19548
19548
|
if (_.hasCode(oa))
|
|
19549
19549
|
return this.log.warn("v3 api not supported. Fall back to v2"), this.call(t, {
|
|
19550
19550
|
...n,
|
|
@@ -19599,7 +19599,7 @@ class yr {
|
|
|
19599
19599
|
return this.log.warn(`Caught exception while attempting to make query:
|
|
19600
19600
|
${y}
|
|
19601
19601
|
Retrying query.`), await this.#E({ ...t, tries: c + 1 });
|
|
19602
|
-
throw y instanceof
|
|
19602
|
+
throw y instanceof dr ? y : ia.fromCode(new ca(y));
|
|
19603
19603
|
}
|
|
19604
19604
|
if (!this.#d)
|
|
19605
19605
|
return u;
|
|
@@ -19668,7 +19668,7 @@ class yr {
|
|
|
19668
19668
|
let o;
|
|
19669
19669
|
const c = await (r ?? this.#n);
|
|
19670
19670
|
if (!c)
|
|
19671
|
-
throw nn.fromCode(new
|
|
19671
|
+
throw nn.fromCode(new xi());
|
|
19672
19672
|
const a = Le.from(t), u = c.getPrincipal(), f = Xu(this.#o, this.#i), l = {
|
|
19673
19673
|
request_type: To.Query,
|
|
19674
19674
|
canister_id: a,
|
|
@@ -19725,7 +19725,7 @@ class yr {
|
|
|
19725
19725
|
}
|
|
19726
19726
|
} catch (_) {
|
|
19727
19727
|
let S;
|
|
19728
|
-
throw _ instanceof
|
|
19728
|
+
throw _ instanceof dr ? (_.code.requestContext = {
|
|
19729
19729
|
requestId: p,
|
|
19730
19730
|
senderPubKey: o.body.sender_pubkey,
|
|
19731
19731
|
senderSignature: o.body.sender_sig,
|
|
@@ -19744,7 +19744,7 @@ class yr {
|
|
|
19744
19744
|
await this.#y();
|
|
19745
19745
|
const r = await (n ?? this.#n);
|
|
19746
19746
|
if (!r)
|
|
19747
|
-
throw nn.fromCode(new
|
|
19747
|
+
throw nn.fromCode(new xi());
|
|
19748
19748
|
const i = r.getPrincipal(), s = await this._transform({
|
|
19749
19749
|
request: {
|
|
19750
19750
|
method: "POST",
|
|
@@ -19780,7 +19780,7 @@ class yr {
|
|
|
19780
19780
|
a = o(n);
|
|
19781
19781
|
const f = await this.#n;
|
|
19782
19782
|
if (!f)
|
|
19783
|
-
throw nn.fromCode(new
|
|
19783
|
+
throw nn.fromCode(new xi());
|
|
19784
19784
|
c = await this.createReadStateRequest(n, f);
|
|
19785
19785
|
}
|
|
19786
19786
|
this.log.print(`fetching "/api/v2/canister/${s}/read_state" with request:`, c);
|
|
@@ -19798,7 +19798,7 @@ class yr {
|
|
|
19798
19798
|
return this.log.print("Read state response:", l), l;
|
|
19799
19799
|
} catch (f) {
|
|
19800
19800
|
let l;
|
|
19801
|
-
throw f instanceof
|
|
19801
|
+
throw f instanceof dr ? (f.code.requestContext = {
|
|
19802
19802
|
requestId: a,
|
|
19803
19803
|
senderPubKey: c.body.sender_pubkey,
|
|
19804
19804
|
senderSignature: c.body.sender_sig,
|
|
@@ -19835,7 +19835,7 @@ class yr {
|
|
|
19835
19835
|
const n = Date.now();
|
|
19836
19836
|
try {
|
|
19837
19837
|
t || this.log.print("Syncing time with the IC. No canisterId provided, so falling back to ryjl3-tyaaa-aaaaa-aaaba-cai");
|
|
19838
|
-
const r = t ?? Le.from("ryjl3-tyaaa-aaaaa-aaaba-cai"), i =
|
|
19838
|
+
const r = t ?? Le.from("ryjl3-tyaaa-aaaaa-aaaba-cai"), i = wr.createSync({
|
|
19839
19839
|
identity: new vd(),
|
|
19840
19840
|
host: this.host.toString(),
|
|
19841
19841
|
fetch: this.#s,
|
|
@@ -19858,7 +19858,7 @@ class yr {
|
|
|
19858
19858
|
level: "info"
|
|
19859
19859
|
}));
|
|
19860
19860
|
} catch (r) {
|
|
19861
|
-
const i = r instanceof
|
|
19861
|
+
const i = r instanceof dr ? r : rn.fromCode(new Un(r));
|
|
19862
19862
|
throw this.log.error("Caught exception while attempting to sync time", i), i;
|
|
19863
19863
|
}
|
|
19864
19864
|
})(), await this.#a.finally(() => {
|
|
@@ -20010,15 +20010,15 @@ async function Y1(e, t, n, r = {}) {
|
|
|
20010
20010
|
agent: e
|
|
20011
20011
|
}), u = yn(a.lookup_path([...i, ut("status")]));
|
|
20012
20012
|
let f;
|
|
20013
|
-
switch (typeof u > "u" ? f =
|
|
20014
|
-
case
|
|
20013
|
+
switch (typeof u > "u" ? f = lr.Unknown : f = new TextDecoder().decode(u), f) {
|
|
20014
|
+
case lr.Replied:
|
|
20015
20015
|
return {
|
|
20016
20016
|
reply: yn(a.lookup_path([...i, "reply"])),
|
|
20017
20017
|
certificate: a
|
|
20018
20018
|
};
|
|
20019
|
-
case
|
|
20020
|
-
case
|
|
20021
|
-
case
|
|
20019
|
+
case lr.Received:
|
|
20020
|
+
case lr.Unknown:
|
|
20021
|
+
case lr.Processing: {
|
|
20022
20022
|
const l = r.strategy ?? _8();
|
|
20023
20023
|
return await l(t, n, f), Y1(e, t, n, {
|
|
20024
20024
|
...r,
|
|
@@ -20027,11 +20027,11 @@ async function Y1(e, t, n, r = {}) {
|
|
|
20027
20027
|
request: o
|
|
20028
20028
|
});
|
|
20029
20029
|
}
|
|
20030
|
-
case
|
|
20030
|
+
case lr.Rejected: {
|
|
20031
20031
|
const l = new Uint8Array(yn(a.lookup_path([...i, "reject_code"])))[0], p = new TextDecoder().decode(yn(a.lookup_path([...i, "reject_message"]))), y = yn(a.lookup_path([...i, "error_code"])), g = y ? new TextDecoder().decode(y) : void 0;
|
|
20032
20032
|
throw fs.fromCode(new Za(n, l, p, g));
|
|
20033
20033
|
}
|
|
20034
|
-
case
|
|
20034
|
+
case lr.Done:
|
|
20035
20035
|
throw rn.fromCode(new Il(n));
|
|
20036
20036
|
}
|
|
20037
20037
|
throw hs;
|
|
@@ -20142,7 +20142,7 @@ function P8(e, t, n, r) {
|
|
|
20142
20142
|
...o
|
|
20143
20143
|
})
|
|
20144
20144
|
};
|
|
20145
|
-
const a = o.agent || e[mn].config.agent || new
|
|
20145
|
+
const a = o.agent || e[mn].config.agent || new wr(), u = Le.from(o.canisterId || e[mn].config.canisterId), f = vf(n.argTypes, c), l = await a.query(u, {
|
|
20146
20146
|
methodName: t,
|
|
20147
20147
|
arg: f,
|
|
20148
20148
|
effectiveCanisterId: o.effectiveCanisterId
|
|
@@ -20173,7 +20173,7 @@ function P8(e, t, n, r) {
|
|
|
20173
20173
|
...o
|
|
20174
20174
|
})
|
|
20175
20175
|
};
|
|
20176
|
-
const a = o.agent || e[mn].config.agent ||
|
|
20176
|
+
const a = o.agent || e[mn].config.agent || wr.createSync(), { canisterId: u, effectiveCanisterId: f, pollingOptions: l } = {
|
|
20177
20177
|
...Z1,
|
|
20178
20178
|
...e[mn].config,
|
|
20179
20179
|
...o
|
|
@@ -20258,7 +20258,7 @@ const Gt = {
|
|
|
20258
20258
|
P2TR: { P2TR: null },
|
|
20259
20259
|
UNKNOWN: { UNKNOWN: null }
|
|
20260
20260
|
};
|
|
20261
|
-
var
|
|
20261
|
+
var di = {}, je = {}, Yu = {}, jt = {}, tr = {}, a0;
|
|
20262
20262
|
function Vn() {
|
|
20263
20263
|
return a0 || (a0 = 1, Object.defineProperty(tr, "__esModule", { value: !0 }), tr.testnet = tr.regtest = tr.bitcoin = void 0, tr.bitcoin = {
|
|
20264
20264
|
/**
|
|
@@ -20374,10 +20374,10 @@ function Q1() {
|
|
|
20374
20374
|
}
|
|
20375
20375
|
return nr.encode = n, nr;
|
|
20376
20376
|
}
|
|
20377
|
-
var
|
|
20377
|
+
var pi = {}, f0;
|
|
20378
20378
|
function Gl() {
|
|
20379
|
-
if (f0) return
|
|
20380
|
-
f0 = 1, Object.defineProperty(
|
|
20379
|
+
if (f0) return pi;
|
|
20380
|
+
f0 = 1, Object.defineProperty(pi, "__esModule", { value: !0 }), pi.REVERSE_OPS = pi.OPS = void 0;
|
|
20381
20381
|
const e = {
|
|
20382
20382
|
OP_FALSE: 0,
|
|
20383
20383
|
OP_0: 0,
|
|
@@ -20499,14 +20499,14 @@ function Gl() {
|
|
|
20499
20499
|
OP_PUBKEY: 254,
|
|
20500
20500
|
OP_INVALIDOPCODE: 255
|
|
20501
20501
|
};
|
|
20502
|
-
|
|
20502
|
+
pi.OPS = e;
|
|
20503
20503
|
const t = {};
|
|
20504
|
-
|
|
20504
|
+
pi.REVERSE_OPS = t;
|
|
20505
20505
|
for (const n of Object.keys(e)) {
|
|
20506
20506
|
const r = e[n];
|
|
20507
20507
|
t[r] = n;
|
|
20508
20508
|
}
|
|
20509
|
-
return
|
|
20509
|
+
return pi;
|
|
20510
20510
|
}
|
|
20511
20511
|
var rr = {}, l0;
|
|
20512
20512
|
function k8() {
|
|
@@ -20546,10 +20546,10 @@ function k8() {
|
|
|
20546
20546
|
}
|
|
20547
20547
|
return rr.decode = r, rr;
|
|
20548
20548
|
}
|
|
20549
|
-
var
|
|
20549
|
+
var yi = {}, h0;
|
|
20550
20550
|
function N8() {
|
|
20551
|
-
if (h0) return
|
|
20552
|
-
h0 = 1, Object.defineProperty(
|
|
20551
|
+
if (h0) return yi;
|
|
20552
|
+
h0 = 1, Object.defineProperty(yi, "__esModule", { value: !0 }), yi.encode = yi.decode = void 0;
|
|
20553
20553
|
function e(r, i, s) {
|
|
20554
20554
|
i = i || 4, s = s === void 0 ? !0 : s;
|
|
20555
20555
|
const o = r.length;
|
|
@@ -20566,7 +20566,7 @@ function N8() {
|
|
|
20566
20566
|
c |= r[a] << 8 * a;
|
|
20567
20567
|
return r[o - 1] & 128 ? -(c & ~(128 << 8 * (o - 1))) : c;
|
|
20568
20568
|
}
|
|
20569
|
-
|
|
20569
|
+
yi.decode = e;
|
|
20570
20570
|
function t(r) {
|
|
20571
20571
|
return r > 2147483647 ? 5 : r > 8388607 ? 4 : r > 32767 ? 3 : r > 127 ? 2 : r > 0 ? 1 : 0;
|
|
20572
20572
|
}
|
|
@@ -20577,9 +20577,9 @@ function N8() {
|
|
|
20577
20577
|
o.writeUInt8(i & 255, a), i >>= 8;
|
|
20578
20578
|
return o[s - 1] & 128 ? o.writeUInt8(c ? 128 : 0, s - 1) : c && (o[s - 1] |= 128), o;
|
|
20579
20579
|
}
|
|
20580
|
-
return
|
|
20580
|
+
return yi.encode = n, yi;
|
|
20581
20581
|
}
|
|
20582
|
-
var
|
|
20582
|
+
var gi = {}, Qu = {}, ef, d0;
|
|
20583
20583
|
function Dl() {
|
|
20584
20584
|
if (d0) return ef;
|
|
20585
20585
|
d0 = 1;
|
|
@@ -20977,8 +20977,8 @@ function Kt() {
|
|
|
20977
20977
|
}
|
|
20978
20978
|
var m0;
|
|
20979
20979
|
function C8() {
|
|
20980
|
-
if (m0) return
|
|
20981
|
-
m0 = 1, Object.defineProperty(
|
|
20980
|
+
if (m0) return gi;
|
|
20981
|
+
m0 = 1, Object.defineProperty(gi, "__esModule", { value: !0 }), gi.encode = gi.decode = void 0;
|
|
20982
20982
|
const e = Q1(), t = Zt(), n = Kt(), { typeforce: r } = n, i = Buffer.alloc(1, 0);
|
|
20983
20983
|
function s(u) {
|
|
20984
20984
|
let f = 0;
|
|
@@ -20997,7 +20997,7 @@ function C8() {
|
|
|
20997
20997
|
const l = e.decode(u.slice(0, -1)), p = o(l.r), y = o(l.s);
|
|
20998
20998
|
return { signature: Buffer.concat([p, y], 64), hashType: f };
|
|
20999
20999
|
}
|
|
21000
|
-
|
|
21000
|
+
gi.decode = c;
|
|
21001
21001
|
function a(u, f) {
|
|
21002
21002
|
if (r(
|
|
21003
21003
|
{
|
|
@@ -21012,7 +21012,7 @@ function C8() {
|
|
|
21012
21012
|
const p = s(u.slice(0, 32)), y = s(u.slice(32, 64));
|
|
21013
21013
|
return Buffer.concat([e.encode(p, y), l]);
|
|
21014
21014
|
}
|
|
21015
|
-
return
|
|
21015
|
+
return gi.encode = a, gi;
|
|
21016
21016
|
}
|
|
21017
21017
|
var b0;
|
|
21018
21018
|
function Zt() {
|
|
@@ -21133,10 +21133,10 @@ function Zt() {
|
|
|
21133
21133
|
e.isCanonicalScriptSignature = M, e.number = i, e.signature = s;
|
|
21134
21134
|
})(Ju)), Ju;
|
|
21135
21135
|
}
|
|
21136
|
-
var
|
|
21137
|
-
function
|
|
21138
|
-
if (E0) return
|
|
21139
|
-
E0 = 1, Object.defineProperty(
|
|
21136
|
+
var wi = {}, E0;
|
|
21137
|
+
function ui() {
|
|
21138
|
+
if (E0) return wi;
|
|
21139
|
+
E0 = 1, Object.defineProperty(wi, "__esModule", { value: !0 }), wi.value = wi.prop = void 0;
|
|
21140
21140
|
function e(n, r, i) {
|
|
21141
21141
|
Object.defineProperty(n, r, {
|
|
21142
21142
|
configurable: !0,
|
|
@@ -21155,18 +21155,18 @@ function ai() {
|
|
|
21155
21155
|
}
|
|
21156
21156
|
});
|
|
21157
21157
|
}
|
|
21158
|
-
|
|
21158
|
+
wi.prop = e;
|
|
21159
21159
|
function t(n) {
|
|
21160
21160
|
let r;
|
|
21161
21161
|
return () => (r !== void 0 || (r = n()), r);
|
|
21162
21162
|
}
|
|
21163
|
-
return
|
|
21163
|
+
return wi.value = t, wi;
|
|
21164
21164
|
}
|
|
21165
21165
|
var _0;
|
|
21166
21166
|
function H8() {
|
|
21167
21167
|
if (_0) return Gs;
|
|
21168
21168
|
_0 = 1, Object.defineProperty(Gs, "__esModule", { value: !0 }), Gs.p2data = void 0;
|
|
21169
|
-
const e = Vn(), t = Zt(), n = Kt(), r =
|
|
21169
|
+
const e = Vn(), t = Zt(), n = Kt(), r = ui(), i = t.OPS;
|
|
21170
21170
|
function s(o, c) {
|
|
21171
21171
|
if (!o.data && !o.output) throw new TypeError("Not enough data");
|
|
21172
21172
|
c = Object.assign({ validate: !0 }, c || {}), (0, n.typeforce)(
|
|
@@ -21202,7 +21202,7 @@ var Ds = {}, S0;
|
|
|
21202
21202
|
function F8() {
|
|
21203
21203
|
if (S0) return Ds;
|
|
21204
21204
|
S0 = 1, Object.defineProperty(Ds, "__esModule", { value: !0 }), Ds.p2ms = void 0;
|
|
21205
|
-
const e = Vn(), t = Zt(), n = Kt(), r =
|
|
21205
|
+
const e = Vn(), t = Zt(), n = Kt(), r = ui(), i = t.OPS, s = i.OP_RESERVED;
|
|
21206
21206
|
function o(c, a) {
|
|
21207
21207
|
if (!c.input && !c.output && !(c.pubkeys && c.m !== void 0) && !c.signatures)
|
|
21208
21208
|
throw new TypeError("Not enough data");
|
|
@@ -21308,7 +21308,7 @@ var Xs = {}, T0;
|
|
|
21308
21308
|
function M8() {
|
|
21309
21309
|
if (T0) return Xs;
|
|
21310
21310
|
T0 = 1, Object.defineProperty(Xs, "__esModule", { value: !0 }), Xs.p2pk = void 0;
|
|
21311
|
-
const e = Vn(), t = Zt(), n = Kt(), r =
|
|
21311
|
+
const e = Vn(), t = Zt(), n = Kt(), r = ui(), i = t.OPS;
|
|
21312
21312
|
function s(o, c) {
|
|
21313
21313
|
if (!o.input && !o.output && !o.pubkey && !o.input && !o.signature)
|
|
21314
21314
|
throw new TypeError("Not enough data");
|
|
@@ -21359,11 +21359,11 @@ function M8() {
|
|
|
21359
21359
|
}
|
|
21360
21360
|
return Xs.p2pk = s, Xs;
|
|
21361
21361
|
}
|
|
21362
|
-
var zs = {}, sf = {},
|
|
21362
|
+
var zs = {}, sf = {}, mi = {}, Wt = {}, x0;
|
|
21363
21363
|
function tw() {
|
|
21364
21364
|
if (x0) return Wt;
|
|
21365
21365
|
x0 = 1, Object.defineProperty(Wt, "__esModule", { value: !0 }), Wt.ripemd160 = Wt.RIPEMD160 = Wt.md5 = Wt.MD5 = Wt.sha1 = Wt.SHA1 = void 0;
|
|
21366
|
-
const e = /* @__PURE__ */ Lp(), t = /* @__PURE__ */
|
|
21366
|
+
const e = /* @__PURE__ */ Lp(), t = /* @__PURE__ */ ni(), n = /* @__PURE__ */ Uint32Array.from([
|
|
21367
21367
|
1732584193,
|
|
21368
21368
|
4023233417,
|
|
21369
21369
|
2562383102,
|
|
@@ -21518,17 +21518,17 @@ function tw() {
|
|
|
21518
21518
|
}
|
|
21519
21519
|
var A0;
|
|
21520
21520
|
function q8() {
|
|
21521
|
-
if (A0) return
|
|
21522
|
-
A0 = 1, Object.defineProperty(
|
|
21521
|
+
if (A0) return mi;
|
|
21522
|
+
A0 = 1, Object.defineProperty(mi, "__esModule", { value: !0 }), mi.ripemd160 = mi.RIPEMD160 = void 0;
|
|
21523
21523
|
const e = /* @__PURE__ */ tw();
|
|
21524
|
-
return
|
|
21524
|
+
return mi.RIPEMD160 = e.RIPEMD160, mi.ripemd160 = e.ripemd160, mi;
|
|
21525
21525
|
}
|
|
21526
|
-
var
|
|
21526
|
+
var bi = {}, v0;
|
|
21527
21527
|
function V8() {
|
|
21528
|
-
if (v0) return
|
|
21529
|
-
v0 = 1, Object.defineProperty(
|
|
21528
|
+
if (v0) return bi;
|
|
21529
|
+
v0 = 1, Object.defineProperty(bi, "__esModule", { value: !0 }), bi.sha1 = bi.SHA1 = void 0;
|
|
21530
21530
|
const e = /* @__PURE__ */ tw();
|
|
21531
|
-
return
|
|
21531
|
+
return bi.SHA1 = e.SHA1, bi.sha1 = e.sha1, bi;
|
|
21532
21532
|
}
|
|
21533
21533
|
var In = {}, B0;
|
|
21534
21534
|
function nw() {
|
|
@@ -21538,7 +21538,7 @@ function nw() {
|
|
|
21538
21538
|
return In.SHA256 = e.SHA256, In.sha256 = e.sha256, In.SHA224 = e.SHA224, In.sha224 = e.sha224, In;
|
|
21539
21539
|
}
|
|
21540
21540
|
var I0;
|
|
21541
|
-
function
|
|
21541
|
+
function vr() {
|
|
21542
21542
|
return I0 || (I0 = 1, (function(e) {
|
|
21543
21543
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.taggedHash = e.TAGGED_HASH_PREFIXES = e.TAGS = e.hash256 = e.hash160 = e.sha256 = e.sha1 = e.ripemd160 = void 0;
|
|
21544
21544
|
const t = /* @__PURE__ */ q8(), n = /* @__PURE__ */ V8(), r = /* @__PURE__ */ nw();
|
|
@@ -22303,7 +22303,7 @@ var U0;
|
|
|
22303
22303
|
function j8() {
|
|
22304
22304
|
if (U0) return zs;
|
|
22305
22305
|
U0 = 1, Object.defineProperty(zs, "__esModule", { value: !0 }), zs.p2pkh = void 0;
|
|
22306
|
-
const e =
|
|
22306
|
+
const e = vr(), t = Vn(), n = Zt(), r = Kt(), i = ui(), s = Xl(), o = n.OPS;
|
|
22307
22307
|
function c(a, u) {
|
|
22308
22308
|
if (!a.address && !a.hash && !a.output && !a.pubkey && !a.input)
|
|
22309
22309
|
throw new TypeError("Not enough data");
|
|
@@ -22403,7 +22403,7 @@ var Ys = {}, R0;
|
|
|
22403
22403
|
function W8() {
|
|
22404
22404
|
if (R0) return Ys;
|
|
22405
22405
|
R0 = 1, Object.defineProperty(Ys, "__esModule", { value: !0 }), Ys.p2sh = void 0;
|
|
22406
|
-
const e =
|
|
22406
|
+
const e = vr(), t = Vn(), n = Zt(), r = Kt(), i = ui(), s = Xl(), o = n.OPS;
|
|
22407
22407
|
function c(a, u) {
|
|
22408
22408
|
if (!a.address && !a.hash && !a.output && !a.redeem && !a.input)
|
|
22409
22409
|
throw new TypeError("Not enough data");
|
|
@@ -22548,7 +22548,7 @@ var Zs = {}, C0;
|
|
|
22548
22548
|
function G8() {
|
|
22549
22549
|
if (C0) return Zs;
|
|
22550
22550
|
C0 = 1, Object.defineProperty(Zs, "__esModule", { value: !0 }), Zs.p2wpkh = void 0;
|
|
22551
|
-
const e =
|
|
22551
|
+
const e = vr(), t = Vn(), n = Zt(), r = Kt(), i = ui(), s = Do(), o = n.OPS, c = Buffer.alloc(0);
|
|
22552
22552
|
function a(u, f) {
|
|
22553
22553
|
if (!u.address && !u.hash && !u.output && !u.pubkey && !u.witness)
|
|
22554
22554
|
throw new TypeError("Not enough data");
|
|
@@ -22652,7 +22652,7 @@ var Js = {}, H0;
|
|
|
22652
22652
|
function D8() {
|
|
22653
22653
|
if (H0) return Js;
|
|
22654
22654
|
H0 = 1, Object.defineProperty(Js, "__esModule", { value: !0 }), Js.p2wsh = void 0;
|
|
22655
|
-
const e =
|
|
22655
|
+
const e = vr(), t = Vn(), n = Zt(), r = Kt(), i = ui(), s = Do(), o = n.OPS, c = Buffer.alloc(0);
|
|
22656
22656
|
function a(f) {
|
|
22657
22657
|
return !!(Buffer.isBuffer(f) && f.length === 65 && f[0] === 4 && (0, r.isPoint)(f));
|
|
22658
22658
|
}
|
|
@@ -22791,15 +22791,15 @@ function D8() {
|
|
|
22791
22791
|
}
|
|
22792
22792
|
return Js.p2wsh = u, Js;
|
|
22793
22793
|
}
|
|
22794
|
-
var Qs = {},
|
|
22794
|
+
var Qs = {}, Ei = {}, F0;
|
|
22795
22795
|
function zl() {
|
|
22796
|
-
if (F0) return
|
|
22797
|
-
F0 = 1, Object.defineProperty(
|
|
22796
|
+
if (F0) return Ei;
|
|
22797
|
+
F0 = 1, Object.defineProperty(Ei, "__esModule", { value: !0 }), Ei.getEccLib = Ei.initEccLib = void 0;
|
|
22798
22798
|
const e = {};
|
|
22799
22799
|
function t(c, a) {
|
|
22800
22800
|
c ? c !== e.eccLib && (a?.DANGER_DO_NOT_VERIFY_ECCLIB || i(c), e.eccLib = c) : e.eccLib = c;
|
|
22801
22801
|
}
|
|
22802
|
-
|
|
22802
|
+
Ei.initEccLib = t;
|
|
22803
22803
|
function n() {
|
|
22804
22804
|
if (!e.eccLib)
|
|
22805
22805
|
throw new Error(
|
|
@@ -22807,7 +22807,7 @@ function zl() {
|
|
|
22807
22807
|
);
|
|
22808
22808
|
return e.eccLib;
|
|
22809
22809
|
}
|
|
22810
|
-
|
|
22810
|
+
Ei.getEccLib = n;
|
|
22811
22811
|
const r = (c) => Buffer.from(c, "hex");
|
|
22812
22812
|
function i(c) {
|
|
22813
22813
|
s(typeof c.isXOnlyPoint == "function"), s(
|
|
@@ -22862,7 +22862,7 @@ function zl() {
|
|
|
22862
22862
|
result: "9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"
|
|
22863
22863
|
}
|
|
22864
22864
|
];
|
|
22865
|
-
return
|
|
22865
|
+
return Ei;
|
|
22866
22866
|
}
|
|
22867
22867
|
var ff = {}, At = {}, Sc = { exports: {} };
|
|
22868
22868
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -23052,7 +23052,7 @@ var L0;
|
|
|
23052
23052
|
function Yl() {
|
|
23053
23053
|
return L0 || (L0 = 1, (function(e) {
|
|
23054
23054
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tweakKey = e.tapTweakHash = e.tapleafHash = e.findScriptPath = e.toHashTree = e.rootHashFromPath = e.MAX_TAPTREE_DEPTH = e.LEAF_VERSION_TAPSCRIPT = void 0;
|
|
23055
|
-
const t = Vo(), n = zl(), r =
|
|
23055
|
+
const t = Vo(), n = zl(), r = vr(), i = iu(), s = Kt();
|
|
23056
23056
|
e.LEAF_VERSION_TAPSCRIPT = 192, e.MAX_TAPTREE_DEPTH = 128;
|
|
23057
23057
|
const o = (w) => "left" in w && "right" in w;
|
|
23058
23058
|
function c(w, E) {
|
|
@@ -23132,7 +23132,7 @@ var K0;
|
|
|
23132
23132
|
function Y8() {
|
|
23133
23133
|
if (K0) return Qs;
|
|
23134
23134
|
K0 = 1, Object.defineProperty(Qs, "__esModule", { value: !0 }), Qs.p2tr = void 0;
|
|
23135
|
-
const e = Vo(), t = Vn(), n = Zt(), r = Kt(), i = zl(), s = Yl(), o =
|
|
23135
|
+
const e = Vo(), t = Vn(), n = Zt(), r = Kt(), i = zl(), s = Yl(), o = ui(), c = Do(), a = Zl(), u = n.OPS, f = 1, l = 80;
|
|
23136
23136
|
function p(y, g) {
|
|
23137
23137
|
if (!y.address && !y.output && !y.pubkey && !y.internalPubkey && !(y.witness && y.witness.length > 1))
|
|
23138
23138
|
throw new TypeError("Not enough data");
|
|
@@ -23544,7 +23544,7 @@ var no = {}, G0;
|
|
|
23544
23544
|
function oc() {
|
|
23545
23545
|
if (G0) return no;
|
|
23546
23546
|
G0 = 1, Object.defineProperty(no, "__esModule", { value: !0 }), no.Transaction = void 0;
|
|
23547
|
-
const e = iu(), t =
|
|
23547
|
+
const e = iu(), t = vr(), n = Zt(), r = Zt(), i = Kt(), { typeforce: s } = i;
|
|
23548
23548
|
function o(E) {
|
|
23549
23549
|
const _ = E.length;
|
|
23550
23550
|
return e.varuint.encodingLength(_) + _;
|
|
@@ -23834,7 +23834,7 @@ var D0;
|
|
|
23834
23834
|
function J8() {
|
|
23835
23835
|
if (D0) return eo;
|
|
23836
23836
|
D0 = 1, Object.defineProperty(eo, "__esModule", { value: !0 }), eo.Block = void 0;
|
|
23837
|
-
const e = iu(), t =
|
|
23837
|
+
const e = iu(), t = vr(), n = Z8(), r = oc(), i = Kt(), { typeforce: s } = i, o = new TypeError(
|
|
23838
23838
|
"Cannot compute merkle root for zero transactions"
|
|
23839
23839
|
), c = new TypeError(
|
|
23840
23840
|
"Cannot compute witness commit for non-segwit block"
|
|
@@ -23999,10 +23999,10 @@ function Nt() {
|
|
|
23999
23999
|
];
|
|
24000
24000
|
})(df)), df;
|
|
24001
24001
|
}
|
|
24002
|
-
var
|
|
24002
|
+
var Rr = {}, z0;
|
|
24003
24003
|
function Q8() {
|
|
24004
|
-
if (z0) return
|
|
24005
|
-
z0 = 1, Object.defineProperty(
|
|
24004
|
+
if (z0) return Rr;
|
|
24005
|
+
z0 = 1, Object.defineProperty(Rr, "__esModule", { value: !0 });
|
|
24006
24006
|
const e = Nt(), t = (o) => [...Array(o).keys()];
|
|
24007
24007
|
function n(o) {
|
|
24008
24008
|
if (o.key[0] !== e.GlobalTypes.GLOBAL_XPUB)
|
|
@@ -24028,7 +24028,7 @@ function Q8() {
|
|
|
24028
24028
|
}
|
|
24029
24029
|
return a;
|
|
24030
24030
|
}
|
|
24031
|
-
|
|
24031
|
+
Rr.decode = n;
|
|
24032
24032
|
function r(o) {
|
|
24033
24033
|
const c = Buffer.from([e.GlobalTypes.GLOBAL_XPUB]), a = Buffer.concat([c, o.extendedPubkey]), u = o.path.split("/"), f = Buffer.allocUnsafe(u.length * 4);
|
|
24034
24034
|
o.masterFingerprint.copy(f, 0);
|
|
@@ -24042,17 +24042,17 @@ function Q8() {
|
|
|
24042
24042
|
value: f
|
|
24043
24043
|
};
|
|
24044
24044
|
}
|
|
24045
|
-
|
|
24045
|
+
Rr.encode = r, Rr.expected = "{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }";
|
|
24046
24046
|
function i(o) {
|
|
24047
24047
|
const c = o.extendedPubkey, a = o.masterFingerprint, u = o.path;
|
|
24048
24048
|
return Buffer.isBuffer(c) && c.length === 78 && [2, 3].indexOf(c[45]) > -1 && Buffer.isBuffer(a) && a.length === 4 && typeof u == "string" && !!u.match(/^m(\/\d+'?)*$/);
|
|
24049
24049
|
}
|
|
24050
|
-
|
|
24050
|
+
Rr.check = i;
|
|
24051
24051
|
function s(o, c, a) {
|
|
24052
24052
|
const u = c.extendedPubkey.toString("hex");
|
|
24053
24053
|
return a.has(u) ? !1 : (a.add(u), o.filter((f) => f.extendedPubkey.equals(c.extendedPubkey)).length === 0);
|
|
24054
24054
|
}
|
|
24055
|
-
return
|
|
24055
|
+
return Rr.canAddToArray = s, Rr;
|
|
24056
24056
|
}
|
|
24057
24057
|
var Ac = {}, Y0;
|
|
24058
24058
|
function ex() {
|
|
@@ -24067,10 +24067,10 @@ function ex() {
|
|
|
24067
24067
|
}
|
|
24068
24068
|
return Ac.encode = t, Ac;
|
|
24069
24069
|
}
|
|
24070
|
-
var
|
|
24070
|
+
var Cr = {}, Z0;
|
|
24071
24071
|
function tx() {
|
|
24072
|
-
if (Z0) return
|
|
24073
|
-
Z0 = 1, Object.defineProperty(
|
|
24072
|
+
if (Z0) return Cr;
|
|
24073
|
+
Z0 = 1, Object.defineProperty(Cr, "__esModule", { value: !0 });
|
|
24074
24074
|
const e = Nt();
|
|
24075
24075
|
function t(s) {
|
|
24076
24076
|
if (s.key[0] !== e.InputTypes.FINAL_SCRIPTSIG)
|
|
@@ -24079,27 +24079,27 @@ function tx() {
|
|
|
24079
24079
|
);
|
|
24080
24080
|
return s.value;
|
|
24081
24081
|
}
|
|
24082
|
-
|
|
24082
|
+
Cr.decode = t;
|
|
24083
24083
|
function n(s) {
|
|
24084
24084
|
return {
|
|
24085
24085
|
key: Buffer.from([e.InputTypes.FINAL_SCRIPTSIG]),
|
|
24086
24086
|
value: s
|
|
24087
24087
|
};
|
|
24088
24088
|
}
|
|
24089
|
-
|
|
24089
|
+
Cr.encode = n, Cr.expected = "Buffer";
|
|
24090
24090
|
function r(s) {
|
|
24091
24091
|
return Buffer.isBuffer(s);
|
|
24092
24092
|
}
|
|
24093
|
-
|
|
24093
|
+
Cr.check = r;
|
|
24094
24094
|
function i(s, o) {
|
|
24095
24095
|
return !!s && !!o && s.finalScriptSig === void 0;
|
|
24096
24096
|
}
|
|
24097
|
-
return
|
|
24097
|
+
return Cr.canAdd = i, Cr;
|
|
24098
24098
|
}
|
|
24099
|
-
var
|
|
24099
|
+
var Hr = {}, J0;
|
|
24100
24100
|
function nx() {
|
|
24101
|
-
if (J0) return
|
|
24102
|
-
J0 = 1, Object.defineProperty(
|
|
24101
|
+
if (J0) return Hr;
|
|
24102
|
+
J0 = 1, Object.defineProperty(Hr, "__esModule", { value: !0 });
|
|
24103
24103
|
const e = Nt();
|
|
24104
24104
|
function t(s) {
|
|
24105
24105
|
if (s.key[0] !== e.InputTypes.FINAL_SCRIPTWITNESS)
|
|
@@ -24108,27 +24108,27 @@ function nx() {
|
|
|
24108
24108
|
);
|
|
24109
24109
|
return s.value;
|
|
24110
24110
|
}
|
|
24111
|
-
|
|
24111
|
+
Hr.decode = t;
|
|
24112
24112
|
function n(s) {
|
|
24113
24113
|
return {
|
|
24114
24114
|
key: Buffer.from([e.InputTypes.FINAL_SCRIPTWITNESS]),
|
|
24115
24115
|
value: s
|
|
24116
24116
|
};
|
|
24117
24117
|
}
|
|
24118
|
-
|
|
24118
|
+
Hr.encode = n, Hr.expected = "Buffer";
|
|
24119
24119
|
function r(s) {
|
|
24120
24120
|
return Buffer.isBuffer(s);
|
|
24121
24121
|
}
|
|
24122
|
-
|
|
24122
|
+
Hr.check = r;
|
|
24123
24123
|
function i(s, o) {
|
|
24124
24124
|
return !!s && !!o && s.finalScriptWitness === void 0;
|
|
24125
24125
|
}
|
|
24126
|
-
return
|
|
24126
|
+
return Hr.canAdd = i, Hr;
|
|
24127
24127
|
}
|
|
24128
|
-
var
|
|
24128
|
+
var Fr = {}, Q0;
|
|
24129
24129
|
function rx() {
|
|
24130
|
-
if (Q0) return
|
|
24131
|
-
Q0 = 1, Object.defineProperty(
|
|
24130
|
+
if (Q0) return Fr;
|
|
24131
|
+
Q0 = 1, Object.defineProperty(Fr, "__esModule", { value: !0 });
|
|
24132
24132
|
const e = Nt();
|
|
24133
24133
|
function t(s) {
|
|
24134
24134
|
if (s.key[0] !== e.InputTypes.NON_WITNESS_UTXO)
|
|
@@ -24137,27 +24137,27 @@ function rx() {
|
|
|
24137
24137
|
);
|
|
24138
24138
|
return s.value;
|
|
24139
24139
|
}
|
|
24140
|
-
|
|
24140
|
+
Fr.decode = t;
|
|
24141
24141
|
function n(s) {
|
|
24142
24142
|
return {
|
|
24143
24143
|
key: Buffer.from([e.InputTypes.NON_WITNESS_UTXO]),
|
|
24144
24144
|
value: s
|
|
24145
24145
|
};
|
|
24146
24146
|
}
|
|
24147
|
-
|
|
24147
|
+
Fr.encode = n, Fr.expected = "Buffer";
|
|
24148
24148
|
function r(s) {
|
|
24149
24149
|
return Buffer.isBuffer(s);
|
|
24150
24150
|
}
|
|
24151
|
-
|
|
24151
|
+
Fr.check = r;
|
|
24152
24152
|
function i(s, o) {
|
|
24153
24153
|
return !!s && !!o && s.nonWitnessUtxo === void 0;
|
|
24154
24154
|
}
|
|
24155
|
-
return
|
|
24155
|
+
return Fr.canAdd = i, Fr;
|
|
24156
24156
|
}
|
|
24157
|
-
var
|
|
24157
|
+
var Mr = {}, ep;
|
|
24158
24158
|
function ix() {
|
|
24159
|
-
if (ep) return
|
|
24160
|
-
ep = 1, Object.defineProperty(
|
|
24159
|
+
if (ep) return Mr;
|
|
24160
|
+
ep = 1, Object.defineProperty(Mr, "__esModule", { value: !0 });
|
|
24161
24161
|
const e = Nt();
|
|
24162
24162
|
function t(o) {
|
|
24163
24163
|
if (o.key[0] !== e.InputTypes.PARTIAL_SIG)
|
|
@@ -24173,7 +24173,7 @@ function ix() {
|
|
|
24173
24173
|
signature: o.value
|
|
24174
24174
|
};
|
|
24175
24175
|
}
|
|
24176
|
-
|
|
24176
|
+
Mr.decode = t;
|
|
24177
24177
|
function n(o) {
|
|
24178
24178
|
const c = Buffer.from([e.InputTypes.PARTIAL_SIG]);
|
|
24179
24179
|
return {
|
|
@@ -24181,11 +24181,11 @@ function ix() {
|
|
|
24181
24181
|
value: o.signature
|
|
24182
24182
|
};
|
|
24183
24183
|
}
|
|
24184
|
-
|
|
24184
|
+
Mr.encode = n, Mr.expected = "{ pubkey: Buffer; signature: Buffer; }";
|
|
24185
24185
|
function r(o) {
|
|
24186
24186
|
return Buffer.isBuffer(o.pubkey) && Buffer.isBuffer(o.signature) && [33, 65].includes(o.pubkey.length) && [2, 3, 4].includes(o.pubkey[0]) && i(o.signature);
|
|
24187
24187
|
}
|
|
24188
|
-
|
|
24188
|
+
Mr.check = r;
|
|
24189
24189
|
function i(o) {
|
|
24190
24190
|
if (!Buffer.isBuffer(o) || o.length < 9 || o[0] !== 48 || o.length !== o[1] + 3 || o[2] !== 2) return !1;
|
|
24191
24191
|
const c = o[3];
|
|
@@ -24197,12 +24197,12 @@ function ix() {
|
|
|
24197
24197
|
const u = c.pubkey.toString("hex");
|
|
24198
24198
|
return a.has(u) ? !1 : (a.add(u), o.filter((f) => f.pubkey.equals(c.pubkey)).length === 0);
|
|
24199
24199
|
}
|
|
24200
|
-
return
|
|
24200
|
+
return Mr.canAddToArray = s, Mr;
|
|
24201
24201
|
}
|
|
24202
|
-
var
|
|
24202
|
+
var qr = {}, tp;
|
|
24203
24203
|
function sx() {
|
|
24204
|
-
if (tp) return
|
|
24205
|
-
tp = 1, Object.defineProperty(
|
|
24204
|
+
if (tp) return qr;
|
|
24205
|
+
tp = 1, Object.defineProperty(qr, "__esModule", { value: !0 });
|
|
24206
24206
|
const e = Nt();
|
|
24207
24207
|
function t(s) {
|
|
24208
24208
|
if (s.key[0] !== e.InputTypes.POR_COMMITMENT)
|
|
@@ -24211,27 +24211,27 @@ function sx() {
|
|
|
24211
24211
|
);
|
|
24212
24212
|
return s.value.toString("utf8");
|
|
24213
24213
|
}
|
|
24214
|
-
|
|
24214
|
+
qr.decode = t;
|
|
24215
24215
|
function n(s) {
|
|
24216
24216
|
return {
|
|
24217
24217
|
key: Buffer.from([e.InputTypes.POR_COMMITMENT]),
|
|
24218
24218
|
value: Buffer.from(s, "utf8")
|
|
24219
24219
|
};
|
|
24220
24220
|
}
|
|
24221
|
-
|
|
24221
|
+
qr.encode = n, qr.expected = "string";
|
|
24222
24222
|
function r(s) {
|
|
24223
24223
|
return typeof s == "string";
|
|
24224
24224
|
}
|
|
24225
|
-
|
|
24225
|
+
qr.check = r;
|
|
24226
24226
|
function i(s, o) {
|
|
24227
24227
|
return !!s && !!o && s.porCommitment === void 0;
|
|
24228
24228
|
}
|
|
24229
|
-
return
|
|
24229
|
+
return qr.canAdd = i, qr;
|
|
24230
24230
|
}
|
|
24231
|
-
var
|
|
24231
|
+
var Vr = {}, np;
|
|
24232
24232
|
function ox() {
|
|
24233
|
-
if (np) return
|
|
24234
|
-
np = 1, Object.defineProperty(
|
|
24233
|
+
if (np) return Vr;
|
|
24234
|
+
np = 1, Object.defineProperty(Vr, "__esModule", { value: !0 });
|
|
24235
24235
|
const e = Nt();
|
|
24236
24236
|
function t(s) {
|
|
24237
24237
|
if (s.key[0] !== e.InputTypes.SIGHASH_TYPE)
|
|
@@ -24240,7 +24240,7 @@ function ox() {
|
|
|
24240
24240
|
);
|
|
24241
24241
|
return s.value.readUInt32LE(0);
|
|
24242
24242
|
}
|
|
24243
|
-
|
|
24243
|
+
Vr.decode = t;
|
|
24244
24244
|
function n(s) {
|
|
24245
24245
|
const o = Buffer.from([e.InputTypes.SIGHASH_TYPE]), c = Buffer.allocUnsafe(4);
|
|
24246
24246
|
return c.writeUInt32LE(s, 0), {
|
|
@@ -24248,20 +24248,20 @@ function ox() {
|
|
|
24248
24248
|
value: c
|
|
24249
24249
|
};
|
|
24250
24250
|
}
|
|
24251
|
-
|
|
24251
|
+
Vr.encode = n, Vr.expected = "number";
|
|
24252
24252
|
function r(s) {
|
|
24253
24253
|
return typeof s == "number";
|
|
24254
24254
|
}
|
|
24255
|
-
|
|
24255
|
+
Vr.check = r;
|
|
24256
24256
|
function i(s, o) {
|
|
24257
24257
|
return !!s && !!o && s.sighashType === void 0;
|
|
24258
24258
|
}
|
|
24259
|
-
return
|
|
24259
|
+
return Vr.canAdd = i, Vr;
|
|
24260
24260
|
}
|
|
24261
|
-
var
|
|
24261
|
+
var Lr = {}, rp;
|
|
24262
24262
|
function cx() {
|
|
24263
|
-
if (rp) return
|
|
24264
|
-
rp = 1, Object.defineProperty(
|
|
24263
|
+
if (rp) return Lr;
|
|
24264
|
+
rp = 1, Object.defineProperty(Lr, "__esModule", { value: !0 });
|
|
24265
24265
|
const e = Nt();
|
|
24266
24266
|
function t(s) {
|
|
24267
24267
|
if (s.key[0] !== e.InputTypes.TAP_KEY_SIG || s.key.length !== 1)
|
|
@@ -24274,24 +24274,24 @@ function cx() {
|
|
|
24274
24274
|
);
|
|
24275
24275
|
return s.value;
|
|
24276
24276
|
}
|
|
24277
|
-
|
|
24277
|
+
Lr.decode = t;
|
|
24278
24278
|
function n(s) {
|
|
24279
24279
|
return { key: Buffer.from([e.InputTypes.TAP_KEY_SIG]), value: s };
|
|
24280
24280
|
}
|
|
24281
|
-
|
|
24281
|
+
Lr.encode = n, Lr.expected = "Buffer";
|
|
24282
24282
|
function r(s) {
|
|
24283
24283
|
return Buffer.isBuffer(s) && (s.length === 64 || s.length === 65);
|
|
24284
24284
|
}
|
|
24285
|
-
|
|
24285
|
+
Lr.check = r;
|
|
24286
24286
|
function i(s, o) {
|
|
24287
24287
|
return !!s && !!o && s.tapKeySig === void 0;
|
|
24288
24288
|
}
|
|
24289
|
-
return
|
|
24289
|
+
return Lr.canAdd = i, Lr;
|
|
24290
24290
|
}
|
|
24291
|
-
var
|
|
24291
|
+
var Kr = {}, ip;
|
|
24292
24292
|
function ax() {
|
|
24293
|
-
if (ip) return
|
|
24294
|
-
ip = 1, Object.defineProperty(
|
|
24293
|
+
if (ip) return Kr;
|
|
24294
|
+
ip = 1, Object.defineProperty(Kr, "__esModule", { value: !0 });
|
|
24295
24295
|
const e = Nt();
|
|
24296
24296
|
function t(s) {
|
|
24297
24297
|
if (s.key[0] !== e.InputTypes.TAP_LEAF_SCRIPT)
|
|
@@ -24310,7 +24310,7 @@ function ax() {
|
|
|
24310
24310
|
const c = s.value.slice(0, -1);
|
|
24311
24311
|
return { controlBlock: s.key.slice(1), script: c, leafVersion: o };
|
|
24312
24312
|
}
|
|
24313
|
-
|
|
24313
|
+
Kr.decode = t;
|
|
24314
24314
|
function n(s) {
|
|
24315
24315
|
const o = Buffer.from([e.InputTypes.TAP_LEAF_SCRIPT]), c = Buffer.from([s.leafVersion]);
|
|
24316
24316
|
return {
|
|
@@ -24318,21 +24318,21 @@ function ax() {
|
|
|
24318
24318
|
value: Buffer.concat([s.script, c])
|
|
24319
24319
|
};
|
|
24320
24320
|
}
|
|
24321
|
-
|
|
24321
|
+
Kr.encode = n, Kr.expected = "{ controlBlock: Buffer; leafVersion: number, script: Buffer; }";
|
|
24322
24322
|
function r(s) {
|
|
24323
24323
|
return Buffer.isBuffer(s.controlBlock) && (s.controlBlock.length - 1) % 32 === 0 && (s.controlBlock[0] & 254) === s.leafVersion && Buffer.isBuffer(s.script);
|
|
24324
24324
|
}
|
|
24325
|
-
|
|
24325
|
+
Kr.check = r;
|
|
24326
24326
|
function i(s, o, c) {
|
|
24327
24327
|
const a = o.controlBlock.toString("hex");
|
|
24328
24328
|
return c.has(a) ? !1 : (c.add(a), s.filter((u) => u.controlBlock.equals(o.controlBlock)).length === 0);
|
|
24329
24329
|
}
|
|
24330
|
-
return
|
|
24330
|
+
return Kr.canAddToArray = i, Kr;
|
|
24331
24331
|
}
|
|
24332
|
-
var
|
|
24332
|
+
var $r = {}, sp;
|
|
24333
24333
|
function ux() {
|
|
24334
|
-
if (sp) return
|
|
24335
|
-
sp = 1, Object.defineProperty(
|
|
24334
|
+
if (sp) return $r;
|
|
24335
|
+
sp = 1, Object.defineProperty($r, "__esModule", { value: !0 });
|
|
24336
24336
|
const e = Nt();
|
|
24337
24337
|
function t(s) {
|
|
24338
24338
|
if (s.key[0] !== e.InputTypes.TAP_MERKLE_ROOT || s.key.length !== 1)
|
|
@@ -24343,24 +24343,24 @@ function ux() {
|
|
|
24343
24343
|
throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");
|
|
24344
24344
|
return s.value;
|
|
24345
24345
|
}
|
|
24346
|
-
|
|
24346
|
+
$r.decode = t;
|
|
24347
24347
|
function n(s) {
|
|
24348
24348
|
return { key: Buffer.from([e.InputTypes.TAP_MERKLE_ROOT]), value: s };
|
|
24349
24349
|
}
|
|
24350
|
-
|
|
24350
|
+
$r.encode = n, $r.expected = "Buffer";
|
|
24351
24351
|
function r(s) {
|
|
24352
24352
|
return Buffer.isBuffer(s) && s.length === 32;
|
|
24353
24353
|
}
|
|
24354
|
-
|
|
24354
|
+
$r.check = r;
|
|
24355
24355
|
function i(s, o) {
|
|
24356
24356
|
return !!s && !!o && s.tapMerkleRoot === void 0;
|
|
24357
24357
|
}
|
|
24358
|
-
return
|
|
24358
|
+
return $r.canAdd = i, $r;
|
|
24359
24359
|
}
|
|
24360
|
-
var
|
|
24360
|
+
var jr = {}, op;
|
|
24361
24361
|
function fx() {
|
|
24362
|
-
if (op) return
|
|
24363
|
-
op = 1, Object.defineProperty(
|
|
24362
|
+
if (op) return jr;
|
|
24363
|
+
op = 1, Object.defineProperty(jr, "__esModule", { value: !0 });
|
|
24364
24364
|
const e = Nt();
|
|
24365
24365
|
function t(s) {
|
|
24366
24366
|
if (s.key[0] !== e.InputTypes.TAP_SCRIPT_SIG)
|
|
@@ -24382,7 +24382,7 @@ function fx() {
|
|
|
24382
24382
|
signature: s.value
|
|
24383
24383
|
};
|
|
24384
24384
|
}
|
|
24385
|
-
|
|
24385
|
+
jr.decode = t;
|
|
24386
24386
|
function n(s) {
|
|
24387
24387
|
const o = Buffer.from([e.InputTypes.TAP_SCRIPT_SIG]);
|
|
24388
24388
|
return {
|
|
@@ -24390,20 +24390,20 @@ function fx() {
|
|
|
24390
24390
|
value: s.signature
|
|
24391
24391
|
};
|
|
24392
24392
|
}
|
|
24393
|
-
|
|
24393
|
+
jr.encode = n, jr.expected = "{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }";
|
|
24394
24394
|
function r(s) {
|
|
24395
24395
|
return Buffer.isBuffer(s.pubkey) && Buffer.isBuffer(s.leafHash) && Buffer.isBuffer(s.signature) && s.pubkey.length === 32 && s.leafHash.length === 32 && (s.signature.length === 64 || s.signature.length === 65);
|
|
24396
24396
|
}
|
|
24397
|
-
|
|
24397
|
+
jr.check = r;
|
|
24398
24398
|
function i(s, o, c) {
|
|
24399
24399
|
const a = o.pubkey.toString("hex") + o.leafHash.toString("hex");
|
|
24400
24400
|
return c.has(a) ? !1 : (c.add(a), s.filter(
|
|
24401
24401
|
(u) => u.pubkey.equals(o.pubkey) && u.leafHash.equals(o.leafHash)
|
|
24402
24402
|
).length === 0);
|
|
24403
24403
|
}
|
|
24404
|
-
return
|
|
24404
|
+
return jr.canAddToArray = i, jr;
|
|
24405
24405
|
}
|
|
24406
|
-
var
|
|
24406
|
+
var Wr = {}, ir = {}, ts = {}, cp;
|
|
24407
24407
|
function Di() {
|
|
24408
24408
|
if (cp) return ts;
|
|
24409
24409
|
cp = 1, Object.defineProperty(ts, "__esModule", { value: !0 });
|
|
@@ -24489,8 +24489,8 @@ function Jl() {
|
|
|
24489
24489
|
}
|
|
24490
24490
|
var up;
|
|
24491
24491
|
function lx() {
|
|
24492
|
-
if (up) return
|
|
24493
|
-
up = 1, Object.defineProperty(
|
|
24492
|
+
if (up) return Wr;
|
|
24493
|
+
up = 1, Object.defineProperty(Wr, "__esModule", { value: !0 });
|
|
24494
24494
|
const e = Nt(), t = Jl(), n = Di();
|
|
24495
24495
|
function r(c) {
|
|
24496
24496
|
if (c.key[0] !== e.InputTypes.WITNESS_UTXO)
|
|
@@ -24509,7 +24509,7 @@ function lx() {
|
|
|
24509
24509
|
value: a
|
|
24510
24510
|
};
|
|
24511
24511
|
}
|
|
24512
|
-
|
|
24512
|
+
Wr.decode = r;
|
|
24513
24513
|
function i(c) {
|
|
24514
24514
|
const { script: a, value: u } = c, f = n.encodingLength(a.length), l = Buffer.allocUnsafe(8 + f + a.length);
|
|
24515
24515
|
return t.writeUInt64LE(l, u, 0), n.encode(a.length, l, 8), a.copy(l, 8 + f), {
|
|
@@ -24517,20 +24517,20 @@ function lx() {
|
|
|
24517
24517
|
value: l
|
|
24518
24518
|
};
|
|
24519
24519
|
}
|
|
24520
|
-
|
|
24520
|
+
Wr.encode = i, Wr.expected = "{ script: Buffer; value: number; }";
|
|
24521
24521
|
function s(c) {
|
|
24522
24522
|
return Buffer.isBuffer(c.script) && typeof c.value == "number";
|
|
24523
24523
|
}
|
|
24524
|
-
|
|
24524
|
+
Wr.check = s;
|
|
24525
24525
|
function o(c, a) {
|
|
24526
24526
|
return !!c && !!a && c.witnessUtxo === void 0;
|
|
24527
24527
|
}
|
|
24528
|
-
return
|
|
24528
|
+
return Wr.canAdd = o, Wr;
|
|
24529
24529
|
}
|
|
24530
|
-
var
|
|
24530
|
+
var Gr = {}, fp;
|
|
24531
24531
|
function hx() {
|
|
24532
|
-
if (fp) return
|
|
24533
|
-
fp = 1, Object.defineProperty(
|
|
24532
|
+
if (fp) return Gr;
|
|
24533
|
+
fp = 1, Object.defineProperty(Gr, "__esModule", { value: !0 });
|
|
24534
24534
|
const e = Nt(), t = Di();
|
|
24535
24535
|
function n(o) {
|
|
24536
24536
|
if (o.key[0] !== e.OutputTypes.TAP_TREE || o.key.length !== 1)
|
|
@@ -24549,7 +24549,7 @@ function hx() {
|
|
|
24549
24549
|
}
|
|
24550
24550
|
return { leaves: a };
|
|
24551
24551
|
}
|
|
24552
|
-
|
|
24552
|
+
Gr.decode = n;
|
|
24553
24553
|
function r(o) {
|
|
24554
24554
|
const c = Buffer.from([e.OutputTypes.TAP_TREE]), a = [].concat(
|
|
24555
24555
|
...o.leaves.map((u) => [
|
|
@@ -24563,17 +24563,17 @@ function hx() {
|
|
|
24563
24563
|
value: Buffer.concat(a)
|
|
24564
24564
|
};
|
|
24565
24565
|
}
|
|
24566
|
-
|
|
24566
|
+
Gr.encode = r, Gr.expected = "{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }";
|
|
24567
24567
|
function i(o) {
|
|
24568
24568
|
return Array.isArray(o.leaves) && o.leaves.every(
|
|
24569
24569
|
(c) => c.depth >= 0 && c.depth <= 128 && (c.leafVersion & 254) === c.leafVersion && Buffer.isBuffer(c.script)
|
|
24570
24570
|
);
|
|
24571
24571
|
}
|
|
24572
|
-
|
|
24572
|
+
Gr.check = i;
|
|
24573
24573
|
function s(o, c) {
|
|
24574
24574
|
return !!o && !!c && o.tapTree === void 0;
|
|
24575
24575
|
}
|
|
24576
|
-
return
|
|
24576
|
+
return Gr.canAdd = s, Gr;
|
|
24577
24577
|
}
|
|
24578
24578
|
var vc = {}, lp;
|
|
24579
24579
|
function rw() {
|
|
@@ -25492,7 +25492,7 @@ var ze = {}, We = {}, xp;
|
|
|
25492
25492
|
function Wf() {
|
|
25493
25493
|
if (xp) return We;
|
|
25494
25494
|
xp = 1, Object.defineProperty(We, "__esModule", { value: !0 }), We.signatureBlocksAction = We.checkInputForSig = We.pubkeyInScript = We.pubkeyPositionInScript = We.witnessStackToScriptWitness = We.isP2TR = We.isP2SHScript = We.isP2WSHScript = We.isP2WPKH = We.isP2PKH = We.isP2PK = We.isP2MS = void 0;
|
|
25495
|
-
const e = Di(), t = Zt(), n = oc(), r =
|
|
25495
|
+
const e = Di(), t = Zt(), n = oc(), r = vr(), i = sc();
|
|
25496
25496
|
function s(y) {
|
|
25497
25497
|
return (g) => {
|
|
25498
25498
|
try {
|
|
@@ -26998,7 +26998,7 @@ function xx() {
|
|
|
26998
26998
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.initEccLib = e.Transaction = e.opcodes = e.Psbt = e.Block = e.script = e.payments = e.networks = e.crypto = e.address = void 0;
|
|
26999
26999
|
const t = Zl();
|
|
27000
27000
|
e.address = t;
|
|
27001
|
-
const n =
|
|
27001
|
+
const n = vr();
|
|
27002
27002
|
e.crypto = n;
|
|
27003
27003
|
const r = Vn();
|
|
27004
27004
|
e.networks = r;
|
|
@@ -27043,10 +27043,10 @@ function xx() {
|
|
|
27043
27043
|
});
|
|
27044
27044
|
})(Yu)), Yu;
|
|
27045
27045
|
}
|
|
27046
|
-
var
|
|
27046
|
+
var _i = {}, Ip;
|
|
27047
27047
|
function Ax() {
|
|
27048
|
-
if (Ip) return
|
|
27049
|
-
Ip = 1, Object.defineProperty(
|
|
27048
|
+
if (Ip) return _i;
|
|
27049
|
+
Ip = 1, Object.defineProperty(_i, "__esModule", { value: !0 }), _i.base26Decode = _i.base26Encode = void 0;
|
|
27050
27050
|
function e(n) {
|
|
27051
27051
|
let r = 0n;
|
|
27052
27052
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -27060,7 +27060,7 @@ function Ax() {
|
|
|
27060
27060
|
}
|
|
27061
27061
|
return r;
|
|
27062
27062
|
}
|
|
27063
|
-
|
|
27063
|
+
_i.base26Encode = e;
|
|
27064
27064
|
function t(n) {
|
|
27065
27065
|
if (n === 340282366920938463463374607431768211455n)
|
|
27066
27066
|
return "BCGDENLQRQWDSLRUGSNLBTMFIJAV";
|
|
@@ -27072,12 +27072,12 @@ function Ax() {
|
|
|
27072
27072
|
}
|
|
27073
27073
|
return r.reverse().join("");
|
|
27074
27074
|
}
|
|
27075
|
-
return
|
|
27075
|
+
return _i.base26Decode = t, _i;
|
|
27076
27076
|
}
|
|
27077
|
-
var
|
|
27077
|
+
var Si = {}, Op;
|
|
27078
27078
|
function ow() {
|
|
27079
|
-
if (Op) return
|
|
27080
|
-
Op = 1, Object.defineProperty(
|
|
27079
|
+
if (Op) return Si;
|
|
27080
|
+
Op = 1, Object.defineProperty(Si, "__esModule", { value: !0 }), Si.none = Si.some = void 0;
|
|
27081
27081
|
class e {
|
|
27082
27082
|
constructor() {
|
|
27083
27083
|
}
|
|
@@ -27108,16 +27108,16 @@ function ow() {
|
|
|
27108
27108
|
function n(i) {
|
|
27109
27109
|
return new t(i);
|
|
27110
27110
|
}
|
|
27111
|
-
|
|
27111
|
+
Si.some = n;
|
|
27112
27112
|
function r() {
|
|
27113
27113
|
return new e();
|
|
27114
27114
|
}
|
|
27115
|
-
return
|
|
27115
|
+
return Si.none = r, Si;
|
|
27116
27116
|
}
|
|
27117
|
-
var
|
|
27117
|
+
var Ti = {}, Pp;
|
|
27118
27118
|
function vx() {
|
|
27119
|
-
if (Pp) return
|
|
27120
|
-
Pp = 1, Object.defineProperty(
|
|
27119
|
+
if (Pp) return Ti;
|
|
27120
|
+
Pp = 1, Object.defineProperty(Ti, "__esModule", { value: !0 }), Ti.decodeLEB128 = Ti.encodeLEB128 = void 0;
|
|
27121
27121
|
function e(n) {
|
|
27122
27122
|
const r = [];
|
|
27123
27123
|
let i = !0;
|
|
@@ -27127,7 +27127,7 @@ function vx() {
|
|
|
27127
27127
|
}
|
|
27128
27128
|
return r;
|
|
27129
27129
|
}
|
|
27130
|
-
|
|
27130
|
+
Ti.encodeLEB128 = e;
|
|
27131
27131
|
function t(n) {
|
|
27132
27132
|
let r = BigInt(0);
|
|
27133
27133
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -27145,7 +27145,7 @@ function vx() {
|
|
|
27145
27145
|
}
|
|
27146
27146
|
throw new Error("Unterminated");
|
|
27147
27147
|
}
|
|
27148
|
-
return
|
|
27148
|
+
return Ti.decodeLEB128 = t, Ti;
|
|
27149
27149
|
}
|
|
27150
27150
|
var yf = {}, kp;
|
|
27151
27151
|
function Bx() {
|
|
@@ -27658,7 +27658,7 @@ function Ix() {
|
|
|
27658
27658
|
var Rp;
|
|
27659
27659
|
function Ox() {
|
|
27660
27660
|
return Rp || (Rp = 1, (function(e) {
|
|
27661
|
-
var t =
|
|
27661
|
+
var t = di && di.__createBinding || (Object.create ? (function(s, o, c, a) {
|
|
27662
27662
|
a === void 0 && (a = c);
|
|
27663
27663
|
var u = Object.getOwnPropertyDescriptor(o, c);
|
|
27664
27664
|
(!u || ("get" in u ? !o.__esModule : u.writable || u.configurable)) && (u = { enumerable: !0, get: function() {
|
|
@@ -27666,7 +27666,7 @@ function Ox() {
|
|
|
27666
27666
|
} }), Object.defineProperty(s, a, u);
|
|
27667
27667
|
}) : (function(s, o, c, a) {
|
|
27668
27668
|
a === void 0 && (a = c), s[a] = o[c];
|
|
27669
|
-
})), n =
|
|
27669
|
+
})), n = di && di.__exportStar || function(s, o) {
|
|
27670
27670
|
for (var c in s) c !== "default" && !Object.prototype.hasOwnProperty.call(o, c) && t(o, s, c);
|
|
27671
27671
|
};
|
|
27672
27672
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.removeSpacers = e.getSpacersVal = e.applySpacers = e.some = e.none = void 0, n(Ix(), e);
|
|
@@ -27684,7 +27684,7 @@ function Ox() {
|
|
|
27684
27684
|
} }), Object.defineProperty(e, "removeSpacers", { enumerable: !0, get: function() {
|
|
27685
27685
|
return i.removeSpacers;
|
|
27686
27686
|
} });
|
|
27687
|
-
})(
|
|
27687
|
+
})(di)), di;
|
|
27688
27688
|
}
|
|
27689
27689
|
var ns = Ox();
|
|
27690
27690
|
function oo(e) {
|
|
@@ -27705,7 +27705,7 @@ function ba(e, t = Fa.Testnet) {
|
|
|
27705
27705
|
const n = eh(t);
|
|
27706
27706
|
return Uy(e, n);
|
|
27707
27707
|
}
|
|
27708
|
-
function
|
|
27708
|
+
function hr(e) {
|
|
27709
27709
|
const t = vn, n = Wp, r = Mw;
|
|
27710
27710
|
let i, s, o = Gt.UNKNOWN;
|
|
27711
27711
|
if (e.startsWith("bc1") || e.startsWith("tb1") || e.startsWith("bcrt1"))
|
|
@@ -27753,12 +27753,12 @@ const Y6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27753
27753
|
__proto__: null,
|
|
27754
27754
|
bytesToHex: ma,
|
|
27755
27755
|
formatPoolUtxo: Px,
|
|
27756
|
-
getAddressType:
|
|
27756
|
+
getAddressType: hr,
|
|
27757
27757
|
getScriptByAddress: ba,
|
|
27758
27758
|
getUtxoProof: aw,
|
|
27759
27759
|
hexToBytes: oo,
|
|
27760
27760
|
toBitcoinNetwork: eh
|
|
27761
|
-
}, Symbol.toStringTag, { value: "Module" })), kx = "kqs64-paaaa-aaaar-qamza-cai", Nx = "hvyp5-5yaaa-aaaao-qjxha-cai",
|
|
27761
|
+
}, Symbol.toStringTag, { value: "Module" })), kx = "kqs64-paaaa-aaaar-qamza-cai", Nx = "hvyp5-5yaaa-aaaao-qjxha-cai", or = BigInt(546), Qt = "0:0", Cp = {
|
|
27762
27762
|
P2PKH: 148,
|
|
27763
27763
|
P2SH_P2WPKH: 91,
|
|
27764
27764
|
P2WPKH: 68,
|
|
@@ -27780,7 +27780,7 @@ const Y6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27780
27780
|
"P2SH_P2WPKH",
|
|
27781
27781
|
"P2TR"
|
|
27782
27782
|
]), Rx = 2;
|
|
27783
|
-
class
|
|
27783
|
+
class Zr {
|
|
27784
27784
|
psbt;
|
|
27785
27785
|
client;
|
|
27786
27786
|
inputAddressTypes = [];
|
|
@@ -27807,7 +27807,7 @@ class xi {
|
|
|
27807
27807
|
) >= 0)
|
|
27808
27808
|
return;
|
|
27809
27809
|
const { address: n } = t;
|
|
27810
|
-
if (
|
|
27810
|
+
if (hr(n) === Gt.P2TR) {
|
|
27811
27811
|
let i = t.pubkey;
|
|
27812
27812
|
i || t.address === this.config.address && this.config.publicKey && (i = this.config.publicKey);
|
|
27813
27813
|
const s = i ? i.length === 66 ? i.slice(2) : i : void 0;
|
|
@@ -27836,7 +27836,7 @@ class xi {
|
|
|
27836
27836
|
script: oo(t.scriptPk)
|
|
27837
27837
|
}
|
|
27838
27838
|
});
|
|
27839
|
-
this.inputAddressTypes.push(
|
|
27839
|
+
this.inputAddressTypes.push(hr(n)), this.inputUtxos.push(t), (n === this.config.address || n === this.config.paymentAddress) && t.runes.length !== 0 && (this.userInputUtxoDusts += BigInt(t.satoshis));
|
|
27840
27840
|
}
|
|
27841
27841
|
/**
|
|
27842
27842
|
* Add a standard output to the transaction
|
|
@@ -27847,7 +27847,7 @@ class xi {
|
|
|
27847
27847
|
this.psbt.addOutput({
|
|
27848
27848
|
address: t,
|
|
27849
27849
|
value: n
|
|
27850
|
-
}), this.outputAddressTypes.push(
|
|
27850
|
+
}), this.outputAddressTypes.push(hr(t));
|
|
27851
27851
|
}
|
|
27852
27852
|
/**
|
|
27853
27853
|
* Add an OP_RETURN script output (for Runestone)
|
|
@@ -27919,13 +27919,13 @@ class xi {
|
|
|
27919
27919
|
* @returns Fee calculation result
|
|
27920
27920
|
*/
|
|
27921
27921
|
async addBtcAndFees(t, n) {
|
|
27922
|
-
const r = this.config.paymentAddress, i = this.additionalDustNeeded, s =
|
|
27922
|
+
const r = this.config.paymentAddress, i = this.additionalDustNeeded, s = hr(r), o = this.userInputUtxoDusts, c = this.config.feeRate;
|
|
27923
27923
|
this.outputAddressTypes.push(s);
|
|
27924
27924
|
let a = !0, u = BigInt(0), f = BigInt(0), l = [], p = BigInt(0), y = BigInt(0);
|
|
27925
27925
|
const g = [...this.inputAddressTypes];
|
|
27926
27926
|
do {
|
|
27927
27927
|
if (u = f, c !== void 0) {
|
|
27928
|
-
const _ =
|
|
27928
|
+
const _ = Zr.estimateTxVirtualSize(
|
|
27929
27929
|
this.inputAddressTypes,
|
|
27930
27930
|
this.outputAddressTypes
|
|
27931
27931
|
);
|
|
@@ -27949,7 +27949,7 @@ class xi {
|
|
|
27949
27949
|
(m, T) => m + BigInt(T.satoshis),
|
|
27950
27950
|
BigInt(0)
|
|
27951
27951
|
);
|
|
27952
|
-
S - p > 0 && S - p >
|
|
27952
|
+
S - p > 0 && S - p > or || (this.outputAddressTypes.pop(), a = !1), l = _;
|
|
27953
27953
|
}
|
|
27954
27954
|
} while (f > u && p > 0);
|
|
27955
27955
|
this.inputAddressTypes = [...g], a && this.outputAddressTypes.pop();
|
|
@@ -27960,7 +27960,7 @@ class xi {
|
|
|
27960
27960
|
const E = w - p;
|
|
27961
27961
|
if (E < 0)
|
|
27962
27962
|
throw new Error("Insufficient UTXO(s)");
|
|
27963
|
-
E >
|
|
27963
|
+
E > or ? this.addOutput(r, E) : E > BigInt(0) && (y = E), this.txFee = y + f;
|
|
27964
27964
|
}
|
|
27965
27965
|
/**
|
|
27966
27966
|
* Resolve and fetch all UTXOs required by the current intention set, grouped by address.
|
|
@@ -28208,8 +28208,8 @@ class xi {
|
|
|
28208
28208
|
});
|
|
28209
28209
|
const a = new ns.Runestone(s, ns.none(), ns.none(), ns.none());
|
|
28210
28210
|
this.addScriptOutput(new Uint8Array(a.encipher())), o.forEach((u) => {
|
|
28211
|
-
const f = t[u]?.[Qt] ?? BigInt(0), l = u === this.config.address, p = f > BigInt(0) && (!l || n), y = p && f >
|
|
28212
|
-
this.addOutput(u, y), p ? (f <
|
|
28211
|
+
const f = t[u]?.[Qt] ?? BigInt(0), l = u === this.config.address, p = f > BigInt(0) && (!l || n), y = p && f > or ? f : or;
|
|
28212
|
+
this.addOutput(u, y), p ? (f < or && (this.additionalDustNeeded += or - f), delete t[u][Qt]) : this.additionalDustNeeded += or;
|
|
28213
28213
|
});
|
|
28214
28214
|
}
|
|
28215
28215
|
for (const [s, o] of Object.entries(
|
|
@@ -28264,10 +28264,36 @@ class xi {
|
|
|
28264
28264
|
* ```
|
|
28265
28265
|
*/
|
|
28266
28266
|
async build() {
|
|
28267
|
-
const t = await this.getInvolvedAddressUtxos(), n = this.config.paymentAddress
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28267
|
+
const t = await this.getInvolvedAddressUtxos(), n = this.config.paymentAddress;
|
|
28268
|
+
let r = t.btc[n] ?? [];
|
|
28269
|
+
if (this.config.manualBuild) {
|
|
28270
|
+
const a = this.inputUtxos.filter((y) => y.address === n).reduce((y, g) => y + BigInt(g.satoshis), BigInt(0));
|
|
28271
|
+
let u = BigInt(0);
|
|
28272
|
+
for (const y of this.psbt.txOutputs)
|
|
28273
|
+
y.address && y.address !== n && (u += BigInt(y.value));
|
|
28274
|
+
const f = hr(n);
|
|
28275
|
+
this.outputAddressTypes.push(f);
|
|
28276
|
+
let l;
|
|
28277
|
+
if (this.config.feeRate !== void 0) {
|
|
28278
|
+
const y = Zr.estimateTxVirtualSize(
|
|
28279
|
+
this.inputAddressTypes,
|
|
28280
|
+
this.outputAddressTypes
|
|
28281
|
+
);
|
|
28282
|
+
l = BigInt(Math.round(this.config.feeRate * y));
|
|
28283
|
+
} else
|
|
28284
|
+
l = (await this.client.orchestrator.estimate_min_tx_fee({
|
|
28285
|
+
input_types: this.inputAddressTypes,
|
|
28286
|
+
pool_address: this.intentions.map((g) => g.poolAddress),
|
|
28287
|
+
output_types: this.outputAddressTypes
|
|
28288
|
+
})).Ok;
|
|
28289
|
+
this.outputAddressTypes.pop();
|
|
28290
|
+
const p = a - u - l - this.additionalDustNeeded;
|
|
28291
|
+
if (p < 0)
|
|
28292
|
+
throw new Error(
|
|
28293
|
+
`Insufficient funds: inputs=${a}, outputs=${u}, fee=${l}, needed=${this.additionalDustNeeded}, shortage=${-p}`
|
|
28294
|
+
);
|
|
28295
|
+
p > or ? (this.addOutput(n, p), this.txFee = l) : p > BigInt(0) ? this.txFee = l + p : this.txFee = l;
|
|
28296
|
+
} else {
|
|
28271
28297
|
for (const f of this.intentions) {
|
|
28272
28298
|
const l = f.poolUtxos;
|
|
28273
28299
|
if (!l) continue;
|
|
@@ -28284,7 +28310,7 @@ class xi {
|
|
|
28284
28310
|
const u = this.inputUtxos[a], f = u.address;
|
|
28285
28311
|
if (f !== this.config.paymentAddress || f !== this.config.address)
|
|
28286
28312
|
continue;
|
|
28287
|
-
const l = this.psbt.data.inputs[a].redeemScript, p =
|
|
28313
|
+
const l = this.psbt.data.inputs[a].redeemScript, p = hr(f);
|
|
28288
28314
|
if (o.push({
|
|
28289
28315
|
index: a,
|
|
28290
28316
|
...p === Gt.P2TR ? { address: f, disableTweakSigner: !1 } : { publicKey: u.pubkey, disableTweakSigner: !0 }
|
|
@@ -28304,16 +28330,16 @@ class xi {
|
|
|
28304
28330
|
static estimateTxVirtualSize(t, n) {
|
|
28305
28331
|
const r = t.length, i = n.length;
|
|
28306
28332
|
let s = 8 + // locktime
|
|
28307
|
-
|
|
28333
|
+
Zr.varIntSize(r) + Zr.varIntSize(i), o = !1;
|
|
28308
28334
|
for (const c of t) {
|
|
28309
|
-
const a =
|
|
28335
|
+
const a = Zr.parseAddressType(c);
|
|
28310
28336
|
if (a.key === "OpReturn")
|
|
28311
28337
|
continue;
|
|
28312
28338
|
const u = Cp[a.key] ?? Cp.UNKNOWN;
|
|
28313
28339
|
s += u, Ux.has(a.key) && (o = !0);
|
|
28314
28340
|
}
|
|
28315
28341
|
for (const c of n) {
|
|
28316
|
-
const a =
|
|
28342
|
+
const a = Zr.parseAddressType(c);
|
|
28317
28343
|
if (a.key === "OpReturn") {
|
|
28318
28344
|
const f = Math.max(0, a.opReturnLength ?? 0);
|
|
28319
28345
|
s += 11 + f;
|
|
@@ -28430,7 +28456,7 @@ class xi {
|
|
|
28430
28456
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
28431
28457
|
* MIT Licence
|
|
28432
28458
|
*/
|
|
28433
|
-
var as = 9e15,
|
|
28459
|
+
var as = 9e15, fi = 1e9, Gf = "0123456789abcdef", Ea = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", _a = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Df = {
|
|
28434
28460
|
// These values must be integers within the stated ranges (inclusive).
|
|
28435
28461
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
28436
28462
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -28488,7 +28514,7 @@ var as = 9e15, ui = 1e9, Gf = "0123456789abcdef", Ea = "2.3025850929940456840179
|
|
|
28488
28514
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
28489
28515
|
crypto: !1
|
|
28490
28516
|
// true/false
|
|
28491
|
-
}, uw,
|
|
28517
|
+
}, uw, mr, Te = !0, su = "[DecimalError] ", oi = su + "Invalid argument: ", fw = su + "Precision limit exceeded", lw = su + "crypto unavailable", hw = "[object Decimal]", Lt = Math.floor, bt = Math.pow, Cx = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Hx = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Fx = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, dw = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Fn = 1e7, be = 7, Mx = 9007199254740991, qx = Ea.length - 1, Xf = _a.length - 1, ie = { toStringTag: hw };
|
|
28492
28518
|
ie.absoluteValue = ie.abs = function() {
|
|
28493
28519
|
var e = new this.constructor(this);
|
|
28494
28520
|
return e.s < 0 && (e.s = 1), we(e);
|
|
@@ -28499,7 +28525,7 @@ ie.ceil = function() {
|
|
|
28499
28525
|
ie.clampedTo = ie.clamp = function(e, t) {
|
|
28500
28526
|
var n, r = this, i = r.constructor;
|
|
28501
28527
|
if (e = new i(e), t = new i(t), !e.s || !t.s) return new i(NaN);
|
|
28502
|
-
if (e.gt(t)) throw Error(
|
|
28528
|
+
if (e.gt(t)) throw Error(oi + t);
|
|
28503
28529
|
return n = r.cmp(e), n < 0 ? e : r.cmp(t) > 0 ? t : new i(r);
|
|
28504
28530
|
};
|
|
28505
28531
|
ie.comparedTo = ie.cmp = function(e) {
|
|
@@ -28515,7 +28541,7 @@ ie.comparedTo = ie.cmp = function(e) {
|
|
|
28515
28541
|
};
|
|
28516
28542
|
ie.cosine = ie.cos = function() {
|
|
28517
28543
|
var e, t, n = this, r = n.constructor;
|
|
28518
|
-
return n.d ? n.d[0] ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + be, r.rounding = 1, n = Vx(r, mw(r, n)), r.precision = e, r.rounding = t, we(
|
|
28544
|
+
return n.d ? n.d[0] ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + be, r.rounding = 1, n = Vx(r, mw(r, n)), r.precision = e, r.rounding = t, we(mr == 2 || mr == 3 ? n.neg() : n, e, t, !0)) : new r(1) : new r(NaN);
|
|
28519
28545
|
};
|
|
28520
28546
|
ie.cubeRoot = ie.cbrt = function() {
|
|
28521
28547
|
var e, t, n, r, i, s, o, c, a, u, f = this, l = f.constructor;
|
|
@@ -28665,9 +28691,9 @@ ie.logarithm = ie.log = function(e) {
|
|
|
28665
28691
|
for (i = n[0]; i % 10 === 0; ) i /= 10;
|
|
28666
28692
|
s = i !== 1;
|
|
28667
28693
|
}
|
|
28668
|
-
if (Te = !1, c = l + y, o =
|
|
28694
|
+
if (Te = !1, c = l + y, o = Qr(u, c), r = t ? Sa(f, c + 10) : Qr(e, c), a = De(o, r, c, 1), Po(a.d, i = l, p))
|
|
28669
28695
|
do
|
|
28670
|
-
if (c += 10, o =
|
|
28696
|
+
if (c += 10, o = Qr(u, c), r = t ? Sa(f, c + 10) : Qr(e, c), a = De(o, r, c, 1), !s) {
|
|
28671
28697
|
+Pt(a.d).slice(i + 1, i + 15) + 1 == 1e14 && (a = we(a, l + 1, 0));
|
|
28672
28698
|
break;
|
|
28673
28699
|
}
|
|
@@ -28717,7 +28743,7 @@ ie.naturalExponential = ie.exp = function() {
|
|
|
28717
28743
|
return zf(this);
|
|
28718
28744
|
};
|
|
28719
28745
|
ie.naturalLogarithm = ie.ln = function() {
|
|
28720
|
-
return
|
|
28746
|
+
return Qr(this);
|
|
28721
28747
|
};
|
|
28722
28748
|
ie.negated = ie.neg = function() {
|
|
28723
28749
|
var e = new this.constructor(this);
|
|
@@ -28742,7 +28768,7 @@ ie.plus = ie.add = function(e) {
|
|
|
28742
28768
|
};
|
|
28743
28769
|
ie.precision = ie.sd = function(e) {
|
|
28744
28770
|
var t, n = this;
|
|
28745
|
-
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(
|
|
28771
|
+
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(oi + e);
|
|
28746
28772
|
return n.d ? (t = pw(n.d), e && n.e + 1 > t && (t = n.e + 1)) : t = NaN, t;
|
|
28747
28773
|
};
|
|
28748
28774
|
ie.round = function() {
|
|
@@ -28751,7 +28777,7 @@ ie.round = function() {
|
|
|
28751
28777
|
};
|
|
28752
28778
|
ie.sine = ie.sin = function() {
|
|
28753
28779
|
var e, t, n = this, r = n.constructor;
|
|
28754
|
-
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + be, r.rounding = 1, n = Kx(r, mw(r, n)), r.precision = e, r.rounding = t, we(
|
|
28780
|
+
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + be, r.rounding = 1, n = Kx(r, mw(r, n)), r.precision = e, r.rounding = t, we(mr > 2 ? n.neg() : n, e, t, !0)) : new r(NaN);
|
|
28755
28781
|
};
|
|
28756
28782
|
ie.squareRoot = ie.sqrt = function() {
|
|
28757
28783
|
var e, t, n, r, i, s, o = this, c = o.d, a = o.e, u = o.s, f = o.constructor;
|
|
@@ -28773,7 +28799,7 @@ ie.squareRoot = ie.sqrt = function() {
|
|
|
28773
28799
|
};
|
|
28774
28800
|
ie.tangent = ie.tan = function() {
|
|
28775
28801
|
var e, t, n = this, r = n.constructor;
|
|
28776
|
-
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 10, r.rounding = 1, n = n.sin(), n.s = 1, n = De(n, new r(1).minus(n.times(n)).sqrt(), e + 10, 0), r.precision = e, r.rounding = t, we(
|
|
28802
|
+
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 10, r.rounding = 1, n = n.sin(), n.s = 1, n = De(n, new r(1).minus(n.times(n)).sqrt(), e + 10, 0), r.precision = e, r.rounding = t, we(mr == 2 || mr == 4 ? n.neg() : n, e, t, !0)) : new r(NaN);
|
|
28777
28803
|
};
|
|
28778
28804
|
ie.times = ie.mul = function(e) {
|
|
28779
28805
|
var t, n, r, i, s, o, c, a, u, f = this, l = f.constructor, p = f.d, y = (e = new l(e)).d;
|
|
@@ -28793,15 +28819,15 @@ ie.toBinary = function(e, t) {
|
|
|
28793
28819
|
};
|
|
28794
28820
|
ie.toDecimalPlaces = ie.toDP = function(e, t) {
|
|
28795
28821
|
var n = this, r = n.constructor;
|
|
28796
|
-
return n = new r(n), e === void 0 ? n : (fn(e, 0,
|
|
28822
|
+
return n = new r(n), e === void 0 ? n : (fn(e, 0, fi), t === void 0 ? t = r.rounding : fn(t, 0, 8), we(n, e + n.e + 1, t));
|
|
28797
28823
|
};
|
|
28798
28824
|
ie.toExponential = function(e, t) {
|
|
28799
28825
|
var n, r = this, i = r.constructor;
|
|
28800
|
-
return e === void 0 ? n = Zn(r, !0) : (fn(e, 0,
|
|
28826
|
+
return e === void 0 ? n = Zn(r, !0) : (fn(e, 0, fi), t === void 0 ? t = i.rounding : fn(t, 0, 8), r = we(new i(r), e + 1, t), n = Zn(r, !0, e + 1)), r.isNeg() && !r.isZero() ? "-" + n : n;
|
|
28801
28827
|
};
|
|
28802
28828
|
ie.toFixed = function(e, t) {
|
|
28803
28829
|
var n, r, i = this, s = i.constructor;
|
|
28804
|
-
return e === void 0 ? n = Zn(i) : (fn(e, 0,
|
|
28830
|
+
return e === void 0 ? n = Zn(i) : (fn(e, 0, fi), t === void 0 ? t = s.rounding : fn(t, 0, 8), r = we(new s(i), e + i.e + 1, t), n = Zn(r, !1, e + r.e + 1)), i.isNeg() && !i.isZero() ? "-" + n : n;
|
|
28805
28831
|
};
|
|
28806
28832
|
ie.toFraction = function(e) {
|
|
28807
28833
|
var t, n, r, i, s, o, c, a, u, f, l, p, y = this, g = y.d, w = y.constructor;
|
|
@@ -28809,7 +28835,7 @@ ie.toFraction = function(e) {
|
|
|
28809
28835
|
if (u = n = new w(1), r = a = new w(0), t = new w(r), s = t.e = pw(g) - y.e - 1, o = s % be, t.d[0] = bt(10, o < 0 ? be + o : o), e == null)
|
|
28810
28836
|
e = s > 0 ? t : u;
|
|
28811
28837
|
else {
|
|
28812
|
-
if (c = new w(e), !c.isInt() || c.lt(u)) throw Error(
|
|
28838
|
+
if (c = new w(e), !c.isInt() || c.lt(u)) throw Error(oi + c);
|
|
28813
28839
|
e = c.gt(t) ? s > 0 ? t : u : c;
|
|
28814
28840
|
}
|
|
28815
28841
|
for (Te = !1, c = new w(Pt(g)), f = w.precision, w.precision = s = g.length * be * 2; l = De(c, t, 0, 1, 1), i = n.plus(l.times(r)), i.cmp(e) != 1; )
|
|
@@ -28849,15 +28875,15 @@ ie.toPower = ie.pow = function(e) {
|
|
|
28849
28875
|
if ((e.d[t] & 1) == 0 && (o = 1), c.e == 0 && c.d[0] == 1 && c.d.length == 1)
|
|
28850
28876
|
return c.s = o, c;
|
|
28851
28877
|
}
|
|
28852
|
-
return n = bt(+c, u), t = n == 0 || !isFinite(n) ? Lt(u * (Math.log("0." + Pt(c.d)) / Math.LN10 + c.e + 1)) : new a(n + "").e, t > a.maxE + 1 || t < a.minE - 1 ? new a(t > 0 ? o / 0 : 0) : (Te = !1, a.rounding = c.s = 1, n = Math.min(12, (t + "").length), i = zf(e.times(
|
|
28878
|
+
return n = bt(+c, u), t = n == 0 || !isFinite(n) ? Lt(u * (Math.log("0." + Pt(c.d)) / Math.LN10 + c.e + 1)) : new a(n + "").e, t > a.maxE + 1 || t < a.minE - 1 ? new a(t > 0 ? o / 0 : 0) : (Te = !1, a.rounding = c.s = 1, n = Math.min(12, (t + "").length), i = zf(e.times(Qr(c, r + n)), r), i.d && (i = we(i, r + 5, 1), Po(i.d, r, s) && (t = r + 10, i = we(zf(e.times(Qr(c, t + n)), t), t + 5, 1), +Pt(i.d).slice(r + 1, r + 15) + 1 == 1e14 && (i = we(i, r + 1, 0)))), i.s = o, Te = !0, a.rounding = s, we(i, r, s));
|
|
28853
28879
|
};
|
|
28854
28880
|
ie.toPrecision = function(e, t) {
|
|
28855
28881
|
var n, r = this, i = r.constructor;
|
|
28856
|
-
return e === void 0 ? n = Zn(r, r.e <= i.toExpNeg || r.e >= i.toExpPos) : (fn(e, 1,
|
|
28882
|
+
return e === void 0 ? n = Zn(r, r.e <= i.toExpNeg || r.e >= i.toExpPos) : (fn(e, 1, fi), t === void 0 ? t = i.rounding : fn(t, 0, 8), r = we(new i(r), e, t), n = Zn(r, e <= r.e || r.e <= i.toExpNeg, e)), r.isNeg() && !r.isZero() ? "-" + n : n;
|
|
28857
28883
|
};
|
|
28858
28884
|
ie.toSignificantDigits = ie.toSD = function(e, t) {
|
|
28859
28885
|
var n = this, r = n.constructor;
|
|
28860
|
-
return e === void 0 ? (e = r.precision, t = r.rounding) : (fn(e, 1,
|
|
28886
|
+
return e === void 0 ? (e = r.precision, t = r.rounding) : (fn(e, 1, fi), t === void 0 ? t = r.rounding : fn(t, 0, 8)), we(new r(n), e, t);
|
|
28861
28887
|
};
|
|
28862
28888
|
ie.toString = function() {
|
|
28863
28889
|
var e = this, t = e.constructor, n = Zn(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
@@ -28874,8 +28900,8 @@ function Pt(e) {
|
|
|
28874
28900
|
var t, n, r, i = e.length - 1, s = "", o = e[0];
|
|
28875
28901
|
if (i > 0) {
|
|
28876
28902
|
for (s += o, t = 1; t < i; t++)
|
|
28877
|
-
r = e[t] + "", n = be - r.length, n && (s +=
|
|
28878
|
-
o = e[t], r = o + "", n = be - r.length, n && (s +=
|
|
28903
|
+
r = e[t] + "", n = be - r.length, n && (s += Jr(n)), s += r;
|
|
28904
|
+
o = e[t], r = o + "", n = be - r.length, n && (s += Jr(n));
|
|
28879
28905
|
} else if (o === 0)
|
|
28880
28906
|
return "0";
|
|
28881
28907
|
for (; o % 10 === 0; ) o /= 10;
|
|
@@ -28883,7 +28909,7 @@ function Pt(e) {
|
|
|
28883
28909
|
}
|
|
28884
28910
|
function fn(e, t, n) {
|
|
28885
28911
|
if (e !== ~~e || e < t || e > n)
|
|
28886
|
-
throw Error(
|
|
28912
|
+
throw Error(oi + e);
|
|
28887
28913
|
}
|
|
28888
28914
|
function Po(e, t, n, r) {
|
|
28889
28915
|
var i, s, o, c;
|
|
@@ -29007,7 +29033,7 @@ function we(e, t, n, r) {
|
|
|
29007
29033
|
function Zn(e, t, n) {
|
|
29008
29034
|
if (!e.isFinite()) return ww(e);
|
|
29009
29035
|
var r, i = e.e, s = Pt(e.d), o = s.length;
|
|
29010
|
-
return t ? (n && (r = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) +
|
|
29036
|
+
return t ? (n && (r = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) + Jr(r) : o > 1 && (s = s.charAt(0) + "." + s.slice(1)), s = s + (e.e < 0 ? "e" : "e+") + e.e) : i < 0 ? (s = "0." + Jr(-i - 1) + s, n && (r = n - o) > 0 && (s += Jr(r))) : i >= o ? (s += Jr(i + 1 - o), n && (r = n - i - 1) > 0 && (s = s + "." + Jr(r))) : ((r = i + 1) < o && (s = s.slice(0, r) + "." + s.slice(r)), n && (r = n - o) > 0 && (i + 1 === o && (s += "."), s += Jr(r))), s;
|
|
29011
29037
|
}
|
|
29012
29038
|
function ou(e, t) {
|
|
29013
29039
|
var n = e[0];
|
|
@@ -29031,7 +29057,7 @@ function pw(e) {
|
|
|
29031
29057
|
}
|
|
29032
29058
|
return n;
|
|
29033
29059
|
}
|
|
29034
|
-
function
|
|
29060
|
+
function Jr(e) {
|
|
29035
29061
|
for (var t = ""; e--; ) t += "0";
|
|
29036
29062
|
return t;
|
|
29037
29063
|
}
|
|
@@ -29079,7 +29105,7 @@ function zf(e, t) {
|
|
|
29079
29105
|
o = c;
|
|
29080
29106
|
}
|
|
29081
29107
|
}
|
|
29082
|
-
function
|
|
29108
|
+
function Qr(e, t) {
|
|
29083
29109
|
var n, r, i, s, o, c, a, u, f, l, p, y = 1, g = 10, w = e, E = w.d, _ = w.constructor, S = _.rounding, m = _.precision;
|
|
29084
29110
|
if (w.s < 0 || !E || !E[0] || !w.e && E[0] == 1 && E.length == 1)
|
|
29085
29111
|
return new _(E && !E[0] ? -1 / 0 : w.s != 1 ? NaN : E ? 0 : w);
|
|
@@ -29088,7 +29114,7 @@ function Jr(e, t) {
|
|
|
29088
29114
|
w = w.times(e), n = Pt(w.d), r = n.charAt(0), y++;
|
|
29089
29115
|
s = w.e, r > 1 ? (w = new _("0." + n), s++) : w = new _(r + "." + n.slice(1));
|
|
29090
29116
|
} else
|
|
29091
|
-
return u = Sa(_, f + 2, m).times(s + ""), w =
|
|
29117
|
+
return u = Sa(_, f + 2, m).times(s + ""), w = Qr(new _(r + "." + n.slice(1)), f - g).plus(u), _.precision = m, t == null ? we(w, m, S, Te = !0) : w;
|
|
29092
29118
|
for (l = w, a = o = w = De(w.minus(1), w.plus(1), f, 1), p = we(w.times(w), f, 1), i = 3; ; ) {
|
|
29093
29119
|
if (o = we(o.times(p), f, 1), u = a.plus(De(o, new _(i), f, 1)), Pt(u.d).slice(0, f) === Pt(a.d).slice(0, f))
|
|
29094
29120
|
if (a = a.times(2), s !== 0 && (a = a.plus(Sa(_, f + 2, m).times(s + ""))), a = De(a, new _(y), f, 1), t == null)
|
|
@@ -29133,9 +29159,9 @@ function Lx(e, t) {
|
|
|
29133
29159
|
else if (Fx.test(t))
|
|
29134
29160
|
n = 8;
|
|
29135
29161
|
else
|
|
29136
|
-
throw Error(
|
|
29162
|
+
throw Error(oi + t);
|
|
29137
29163
|
for (s = t.search(/p/i), s > 0 ? (a = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), o = s >= 0, r = e.constructor, o && (t = t.replace(".", ""), c = t.length, s = c - s, i = yw(r, new r(n), s, s * 2)), u = Lc(t, n, Fn), f = u.length - 1, s = f; u[s] === 0; --s) u.pop();
|
|
29138
|
-
return s < 0 ? new r(e.s * 0) : (e.e = ou(u, f), e.d = u, Te = !1, o && (e = De(e, i, c * 4)), a && (e = e.times(Math.abs(a) < 54 ? bt(2, a) :
|
|
29164
|
+
return s < 0 ? new r(e.s * 0) : (e.e = ou(u, f), e.d = u, Te = !1, o && (e = De(e, i, c * 4)), a && (e = e.times(Math.abs(a) < 54 ? bt(2, a) : ei.pow(2, a))), Te = !0, e);
|
|
29139
29165
|
}
|
|
29140
29166
|
function Kx(e, t) {
|
|
29141
29167
|
var n, r = t.d.length;
|
|
@@ -29164,19 +29190,19 @@ function cu(e, t) {
|
|
|
29164
29190
|
function mw(e, t) {
|
|
29165
29191
|
var n, r = t.s < 0, i = Xn(e, e.precision, 1), s = i.times(0.5);
|
|
29166
29192
|
if (t = t.abs(), t.lte(s))
|
|
29167
|
-
return
|
|
29193
|
+
return mr = r ? 4 : 1, t;
|
|
29168
29194
|
if (n = t.divToInt(i), n.isZero())
|
|
29169
|
-
|
|
29195
|
+
mr = r ? 3 : 2;
|
|
29170
29196
|
else {
|
|
29171
29197
|
if (t = t.minus(n.times(i)), t.lte(s))
|
|
29172
|
-
return
|
|
29173
|
-
|
|
29198
|
+
return mr = Fp(n) ? r ? 2 : 3 : r ? 4 : 1, t;
|
|
29199
|
+
mr = Fp(n) ? r ? 1 : 4 : r ? 3 : 2;
|
|
29174
29200
|
}
|
|
29175
29201
|
return t.minus(i).abs();
|
|
29176
29202
|
}
|
|
29177
29203
|
function th(e, t, n, r) {
|
|
29178
29204
|
var i, s, o, c, a, u, f, l, p, y = e.constructor, g = n !== void 0;
|
|
29179
|
-
if (g ? (fn(n, 1,
|
|
29205
|
+
if (g ? (fn(n, 1, fi), r === void 0 ? r = y.rounding : fn(r, 0, 8)) : (n = y.precision, r = y.rounding), !e.isFinite())
|
|
29180
29206
|
f = ww(e);
|
|
29181
29207
|
else {
|
|
29182
29208
|
for (f = Zn(e), o = f.indexOf("."), g ? (i = 2, t == 16 ? n = n * 4 - 3 : t == 8 && (n = n * 3 - 2)) : i = t, o >= 0 && (f = f.replace(".", ""), p = new y(1), p.e = f.length - o, p.d = Lc(Zn(p), 10, i), p.e = p.d.length), l = Lc(f, 10, i), s = a = l.length; l[--a] == 0; ) l.pop();
|
|
@@ -29254,7 +29280,7 @@ function t6(e) {
|
|
|
29254
29280
|
var t, n, r, i = e.defaults === !0, s = [
|
|
29255
29281
|
"precision",
|
|
29256
29282
|
1,
|
|
29257
|
-
|
|
29283
|
+
fi,
|
|
29258
29284
|
"rounding",
|
|
29259
29285
|
0,
|
|
29260
29286
|
8,
|
|
@@ -29277,7 +29303,7 @@ function t6(e) {
|
|
|
29277
29303
|
for (t = 0; t < s.length; t += 3)
|
|
29278
29304
|
if (n = s[t], i && (this[n] = Df[n]), (r = e[n]) !== void 0)
|
|
29279
29305
|
if (Lt(r) === r && r >= s[t + 1] && r <= s[t + 2]) this[n] = r;
|
|
29280
|
-
else throw Error(
|
|
29306
|
+
else throw Error(oi + n + ": " + r);
|
|
29281
29307
|
if (n = "crypto", i && (this[n] = Df[n]), (r = e[n]) !== void 0)
|
|
29282
29308
|
if (r === !0 || r === !1 || r === 0 || r === 1)
|
|
29283
29309
|
if (r)
|
|
@@ -29288,7 +29314,7 @@ function t6(e) {
|
|
|
29288
29314
|
else
|
|
29289
29315
|
this[n] = !1;
|
|
29290
29316
|
else
|
|
29291
|
-
throw Error(
|
|
29317
|
+
throw Error(oi + n + ": " + r);
|
|
29292
29318
|
return this;
|
|
29293
29319
|
}
|
|
29294
29320
|
function n6(e) {
|
|
@@ -29326,7 +29352,7 @@ function bw(e) {
|
|
|
29326
29352
|
return (c = s.charCodeAt(0)) === 45 ? (s = s.slice(1), u.s = -1) : (c === 43 && (s = s.slice(1)), u.s = 1), dw.test(s) ? Kc(u, s) : Lx(u, s);
|
|
29327
29353
|
if (a === "bigint")
|
|
29328
29354
|
return s < 0 ? (s = -s, u.s = -1) : u.s = 1, Kc(u, s.toString());
|
|
29329
|
-
throw Error(
|
|
29355
|
+
throw Error(oi + s);
|
|
29330
29356
|
}
|
|
29331
29357
|
if (i.prototype = ie, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = t6, i.clone = bw, i.isDecimal = qp, i.abs = $x, i.acos = jx, i.acosh = Wx, i.add = Gx, i.asin = Dx, i.asinh = Xx, i.atan = zx, i.atanh = Yx, i.atan2 = Zx, i.cbrt = Jx, i.ceil = Qx, i.clamp = e6, i.cos = n6, i.cosh = r6, i.div = i6, i.exp = s6, i.floor = o6, i.hypot = c6, i.ln = a6, i.log = u6, i.log10 = l6, i.log2 = f6, i.max = h6, i.min = d6, i.mod = p6, i.mul = y6, i.pow = g6, i.random = w6, i.round = m6, i.sign = b6, i.sin = E6, i.sinh = _6, i.sqrt = S6, i.sub = T6, i.sum = x6, i.tan = A6, i.tanh = v6, i.trunc = B6, e === void 0 && (e = {}), e && e.defaults !== !0)
|
|
29332
29358
|
for (r = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], t = 0; t < r.length; ) e.hasOwnProperty(n = r[t++]) || (e[n] = this[n]);
|
|
@@ -29354,7 +29380,7 @@ function c6() {
|
|
|
29354
29380
|
return Te = !0, n.sqrt();
|
|
29355
29381
|
}
|
|
29356
29382
|
function qp(e) {
|
|
29357
|
-
return e instanceof
|
|
29383
|
+
return e instanceof ei || e && e.toStringTag === hw || !1;
|
|
29358
29384
|
}
|
|
29359
29385
|
function a6(e) {
|
|
29360
29386
|
return new this(e).ln();
|
|
@@ -29385,7 +29411,7 @@ function g6(e, t) {
|
|
|
29385
29411
|
}
|
|
29386
29412
|
function w6(e) {
|
|
29387
29413
|
var t, n, r, i, s = 0, o = new this(1), c = [];
|
|
29388
|
-
if (e === void 0 ? e = this.precision : fn(e, 1,
|
|
29414
|
+
if (e === void 0 ? e = this.precision : fn(e, 1, fi), r = Math.ceil(e / be), this.crypto)
|
|
29389
29415
|
if (crypto.getRandomValues)
|
|
29390
29416
|
for (t = crypto.getRandomValues(new Uint32Array(r)); s < r; )
|
|
29391
29417
|
i = t[s], i >= 429e7 ? t[s] = crypto.getRandomValues(new Uint32Array(1))[0] : c[s++] = i % 1e7;
|
|
@@ -29440,9 +29466,9 @@ function B6(e) {
|
|
|
29440
29466
|
}
|
|
29441
29467
|
ie[Symbol.for("nodejs.util.inspect.custom")] = ie.toString;
|
|
29442
29468
|
ie[Symbol.toStringTag] = "Decimal";
|
|
29443
|
-
var
|
|
29444
|
-
Ea = new
|
|
29445
|
-
_a = new
|
|
29469
|
+
var ei = ie.constructor = bw(Df);
|
|
29470
|
+
Ea = new ei(Ea);
|
|
29471
|
+
_a = new ei(_a);
|
|
29446
29472
|
const I6 = ({ IDL: e }) => {
|
|
29447
29473
|
const t = e.Record({
|
|
29448
29474
|
exchange_id: e.Text,
|
|
@@ -29834,14 +29860,14 @@ class Z6 {
|
|
|
29834
29860
|
});
|
|
29835
29861
|
const i = "https://icp0.io";
|
|
29836
29862
|
this.exchange = wa.createActor(t.exchangeIdlFactory, {
|
|
29837
|
-
agent:
|
|
29863
|
+
agent: wr.createSync({
|
|
29838
29864
|
host: i,
|
|
29839
29865
|
retryTimes: 50,
|
|
29840
29866
|
verifyQuerySignatures: !1
|
|
29841
29867
|
}),
|
|
29842
29868
|
canisterId: t.exchangeCanisterId
|
|
29843
29869
|
}), this.orchestrator = wa.createActor(I6, {
|
|
29844
|
-
agent:
|
|
29870
|
+
agent: wr.createSync({
|
|
29845
29871
|
host: i,
|
|
29846
29872
|
retryTimes: 50,
|
|
29847
29873
|
verifyQuerySignatures: !1
|
|
@@ -29876,7 +29902,7 @@ class Z6 {
|
|
|
29876
29902
|
async getPendingBtcUtxos(t) {
|
|
29877
29903
|
const n = await this.orchestrator.get_zero_confirmed_utxos_of_address(
|
|
29878
29904
|
t
|
|
29879
|
-
), r =
|
|
29905
|
+
), r = hr(t);
|
|
29880
29906
|
return n.filter(({ maybe_rune: i }) => !i.length).map(({ value: i, script_pubkey_hex: s, outpoint: o }) => {
|
|
29881
29907
|
const [c, a] = o.split(":");
|
|
29882
29908
|
return {
|
|
@@ -29900,7 +29926,7 @@ class Z6 {
|
|
|
29900
29926
|
async getPendingRuneUtxos(t, n) {
|
|
29901
29927
|
const r = await this.orchestrator.get_zero_confirmed_utxos_of_address(
|
|
29902
29928
|
t
|
|
29903
|
-
), i =
|
|
29929
|
+
), i = hr(t);
|
|
29904
29930
|
return r.filter(({ maybe_rune: s }) => s.length).map(({ value: s, script_pubkey_hex: o, outpoint: c, maybe_rune: a }) => {
|
|
29905
29931
|
const [u, f] = c.split(":"), l = a[0];
|
|
29906
29932
|
return {
|
|
@@ -29971,11 +29997,11 @@ class Z6 {
|
|
|
29971
29997
|
vout: p,
|
|
29972
29998
|
address: t,
|
|
29973
29999
|
runes: y.map(
|
|
29974
|
-
({ runeId: w, amount: E
|
|
29975
|
-
const
|
|
30000
|
+
({ runeId: w, amount: E }) => {
|
|
30001
|
+
const _ = new ei(E).toFixed(0);
|
|
29976
30002
|
return {
|
|
29977
30003
|
id: w,
|
|
29978
|
-
amount:
|
|
30004
|
+
amount: _
|
|
29979
30005
|
};
|
|
29980
30006
|
}
|
|
29981
30007
|
),
|
|
@@ -29994,7 +30020,7 @@ class Z6 {
|
|
|
29994
30020
|
(i, s) => i + BigInt(s.satoshis),
|
|
29995
30021
|
BigInt(0)
|
|
29996
30022
|
);
|
|
29997
|
-
return new
|
|
30023
|
+
return new ei(r.toString()).div(1e8).toNumber();
|
|
29998
30024
|
}
|
|
29999
30025
|
/**
|
|
30000
30026
|
* Get the balance of a specific rune for the user's address
|
|
@@ -30006,10 +30032,10 @@ class Z6 {
|
|
|
30006
30032
|
const i = await this.getRuneUtxos(t, n, r);
|
|
30007
30033
|
if (!i)
|
|
30008
30034
|
return;
|
|
30009
|
-
let s = new
|
|
30035
|
+
let s = new ei(0);
|
|
30010
30036
|
for (const o of i)
|
|
30011
30037
|
s = s.add(
|
|
30012
|
-
new
|
|
30038
|
+
new ei(o.runes.find((c) => c.id === n)?.amount ?? 0)
|
|
30013
30039
|
);
|
|
30014
30040
|
return s.toNumber();
|
|
30015
30041
|
}
|
|
@@ -30059,7 +30085,7 @@ class Z6 {
|
|
|
30059
30085
|
clientInfo: o,
|
|
30060
30086
|
manualBuild: c
|
|
30061
30087
|
}) {
|
|
30062
|
-
return new
|
|
30088
|
+
return new Zr(
|
|
30063
30089
|
{
|
|
30064
30090
|
network: this.config.network,
|
|
30065
30091
|
exchangeId: this.config.exchangeId,
|
|
@@ -30085,6 +30111,6 @@ class Z6 {
|
|
|
30085
30111
|
export {
|
|
30086
30112
|
Fa as Network,
|
|
30087
30113
|
Z6 as ReeClient,
|
|
30088
|
-
|
|
30114
|
+
Zr as Transaction,
|
|
30089
30115
|
Y6 as utils
|
|
30090
30116
|
};
|