@omnity/ree-client-ts-sdk 0.7.7 → 0.7.9
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 +11 -11
- package/dist/index.es.js +370 -362
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,10 +2,10 @@ var rh = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var ih = (e, t, n) => t.has(e) || rh("Cannot " + n);
|
|
5
|
-
var Ue = (e, t, n) => (ih(e, t, "read from private field"), n ? n.call(e) : t.get(e)),
|
|
5
|
+
var Ue = (e, t, n) => (ih(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Qt = (e, t, n) => t.has(e) ? rh("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), jt = (e, t, n, r) => (ih(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
6
6
|
var sh = (e, t, n, r) => ({
|
|
7
7
|
set _(i) {
|
|
8
|
-
|
|
8
|
+
jt(e, t, i, n);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
11
|
return Ue(e, t, r);
|
|
@@ -1153,7 +1153,7 @@ const vw = /* @__PURE__ */ Vp(Aw);
|
|
|
1153
1153
|
typeof globalThis > "u" && (globalThis.global = globalThis);
|
|
1154
1154
|
typeof globalThis.Buffer > "u" && (globalThis.Buffer = Tw.Buffer);
|
|
1155
1155
|
typeof globalThis.process > "u" && (globalThis.process = vw);
|
|
1156
|
-
var tt = {}, fu = {}, Ke = {},
|
|
1156
|
+
var tt = {}, fu = {}, Ke = {}, Rt = {}, lu = {}, Fs = {}, fh;
|
|
1157
1157
|
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
|
}
|
|
@@ -1330,8 +1330,8 @@ function ti() {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
var hh;
|
|
1332
1332
|
function Lp() {
|
|
1333
|
-
if (hh) return
|
|
1334
|
-
hh = 1, Object.defineProperty(
|
|
1333
|
+
if (hh) return Rt;
|
|
1334
|
+
hh = 1, Object.defineProperty(Rt, "__esModule", { value: !0 }), Rt.SHA512_IV = Rt.SHA384_IV = Rt.SHA224_IV = Rt.SHA256_IV = Rt.HashMD = void 0, Rt.setBigUint64 = t, Rt.Chi = n, Rt.Maj = r;
|
|
1335
1335
|
const e = /* @__PURE__ */ ti();
|
|
1336
1336
|
function t(s, o, c, a) {
|
|
1337
1337
|
if (typeof s.setBigUint64 == "function")
|
|
@@ -1396,7 +1396,7 @@ function Lp() {
|
|
|
1396
1396
|
return this._cloneInto();
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
return
|
|
1399
|
+
return Rt.HashMD = i, Rt.SHA256_IV = Uint32Array.from([
|
|
1400
1400
|
1779033703,
|
|
1401
1401
|
3144134277,
|
|
1402
1402
|
1013904242,
|
|
@@ -1405,7 +1405,7 @@ function Lp() {
|
|
|
1405
1405
|
2600822924,
|
|
1406
1406
|
528734635,
|
|
1407
1407
|
1541459225
|
|
1408
|
-
]),
|
|
1408
|
+
]), Rt.SHA224_IV = Uint32Array.from([
|
|
1409
1409
|
3238371032,
|
|
1410
1410
|
914150663,
|
|
1411
1411
|
812702999,
|
|
@@ -1414,7 +1414,7 @@ function Lp() {
|
|
|
1414
1414
|
1750603025,
|
|
1415
1415
|
1694076839,
|
|
1416
1416
|
3204075428
|
|
1417
|
-
]),
|
|
1417
|
+
]), Rt.SHA384_IV = Uint32Array.from([
|
|
1418
1418
|
3418070365,
|
|
1419
1419
|
3238371032,
|
|
1420
1420
|
1654270250,
|
|
@@ -1431,7 +1431,7 @@ function Lp() {
|
|
|
1431
1431
|
1694076839,
|
|
1432
1432
|
1203062813,
|
|
1433
1433
|
3204075428
|
|
1434
|
-
]),
|
|
1434
|
+
]), Rt.SHA512_IV = Uint32Array.from([
|
|
1435
1435
|
1779033703,
|
|
1436
1436
|
4089235720,
|
|
1437
1437
|
3144134277,
|
|
@@ -1448,7 +1448,7 @@ function Lp() {
|
|
|
1448
1448
|
4215389547,
|
|
1449
1449
|
1541459225,
|
|
1450
1450
|
327033209
|
|
1451
|
-
]),
|
|
1451
|
+
]), Rt;
|
|
1452
1452
|
}
|
|
1453
1453
|
var xe = {}, dh;
|
|
1454
1454
|
function Iw() {
|
|
@@ -4558,7 +4558,7 @@ function lo(e) {
|
|
|
4558
4558
|
const t = typeof e;
|
|
4559
4559
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
4560
4560
|
}
|
|
4561
|
-
function
|
|
4561
|
+
function Lt(e, t, n, r, i) {
|
|
4562
4562
|
const s = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, c = i?.received ?? lo(s), a = {
|
|
4563
4563
|
kind: e.kind,
|
|
4564
4564
|
type: e.type,
|
|
@@ -4605,7 +4605,7 @@ function ey(e, t) {
|
|
|
4605
4605
|
requirement: e,
|
|
4606
4606
|
message: t,
|
|
4607
4607
|
_run(n, r) {
|
|
4608
|
-
return n.typed && !n.value.every(this.requirement) &&
|
|
4608
|
+
return n.typed && !n.value.every(this.requirement) && Lt(this, "item", n, r), n;
|
|
4609
4609
|
}
|
|
4610
4610
|
};
|
|
4611
4611
|
}
|
|
@@ -4619,7 +4619,7 @@ function Yf(e) {
|
|
|
4619
4619
|
requirement: Number.isInteger,
|
|
4620
4620
|
message: e,
|
|
4621
4621
|
_run(t, n) {
|
|
4622
|
-
return t.typed && !this.requirement(t.value) &&
|
|
4622
|
+
return t.typed && !this.requirement(t.value) && Lt(this, "integer", t, n), t;
|
|
4623
4623
|
}
|
|
4624
4624
|
};
|
|
4625
4625
|
}
|
|
@@ -4633,7 +4633,7 @@ function ty(e, t) {
|
|
|
4633
4633
|
requirement: e,
|
|
4634
4634
|
message: t,
|
|
4635
4635
|
_run(n, r) {
|
|
4636
|
-
return n.typed && n.value.length !== this.requirement &&
|
|
4636
|
+
return n.typed && n.value.length !== this.requirement && Lt(this, "length", n, r, {
|
|
4637
4637
|
received: `${n.value.length}`
|
|
4638
4638
|
}), n;
|
|
4639
4639
|
}
|
|
@@ -4649,7 +4649,7 @@ function Aa(e, t) {
|
|
|
4649
4649
|
requirement: e,
|
|
4650
4650
|
message: t,
|
|
4651
4651
|
_run(n, r) {
|
|
4652
|
-
return n.typed && n.value > this.requirement &&
|
|
4652
|
+
return n.typed && n.value > this.requirement && Lt(this, "value", n, r, {
|
|
4653
4653
|
received: n.value instanceof Date ? n.value.toJSON() : lo(n.value)
|
|
4654
4654
|
}), n;
|
|
4655
4655
|
}
|
|
@@ -4665,7 +4665,7 @@ function va(e, t) {
|
|
|
4665
4665
|
requirement: e,
|
|
4666
4666
|
message: t,
|
|
4667
4667
|
_run(n, r) {
|
|
4668
|
-
return n.typed && n.value < this.requirement &&
|
|
4668
|
+
return n.typed && n.value < this.requirement && Lt(this, "value", n, r, {
|
|
4669
4669
|
received: n.value instanceof Date ? n.value.toJSON() : lo(n.value)
|
|
4670
4670
|
}), n;
|
|
4671
4671
|
}
|
|
@@ -4681,7 +4681,7 @@ function ny(e, t) {
|
|
|
4681
4681
|
requirement: e,
|
|
4682
4682
|
message: t,
|
|
4683
4683
|
_run(n, r) {
|
|
4684
|
-
return n.typed && !this.requirement.test(n.value) &&
|
|
4684
|
+
return n.typed && !this.requirement.test(n.value) && Lt(this, "format", n, r), n;
|
|
4685
4685
|
}
|
|
4686
4686
|
};
|
|
4687
4687
|
}
|
|
@@ -4742,7 +4742,7 @@ function cn(e, t) {
|
|
|
4742
4742
|
c.typed || (n.typed = !1), n.value.push(c.value);
|
|
4743
4743
|
}
|
|
4744
4744
|
} else
|
|
4745
|
-
|
|
4745
|
+
Lt(this, "type", n, r);
|
|
4746
4746
|
return n;
|
|
4747
4747
|
}
|
|
4748
4748
|
};
|
|
@@ -4756,7 +4756,7 @@ function iy(e) {
|
|
|
4756
4756
|
async: !1,
|
|
4757
4757
|
message: e,
|
|
4758
4758
|
_run(t, n) {
|
|
4759
|
-
return typeof t.value == "bigint" ? t.typed = !0 :
|
|
4759
|
+
return typeof t.value == "bigint" ? t.typed = !0 : Lt(this, "type", t, n), t;
|
|
4760
4760
|
}
|
|
4761
4761
|
};
|
|
4762
4762
|
}
|
|
@@ -4770,7 +4770,7 @@ function Mn(e, t) {
|
|
|
4770
4770
|
check: e,
|
|
4771
4771
|
message: t,
|
|
4772
4772
|
_run(n, r) {
|
|
4773
|
-
return this.check(n.value) ? n.typed = !0 :
|
|
4773
|
+
return this.check(n.value) ? n.typed = !0 : Lt(this, "type", n, r), n;
|
|
4774
4774
|
}
|
|
4775
4775
|
};
|
|
4776
4776
|
}
|
|
@@ -4784,7 +4784,7 @@ function Ia(e, t) {
|
|
|
4784
4784
|
class: e,
|
|
4785
4785
|
message: t,
|
|
4786
4786
|
_run(n, r) {
|
|
4787
|
-
return n.value instanceof this.class ? n.typed = !0 :
|
|
4787
|
+
return n.value instanceof this.class ? n.typed = !0 : Lt(this, "type", n, r), n;
|
|
4788
4788
|
}
|
|
4789
4789
|
};
|
|
4790
4790
|
}
|
|
@@ -4833,7 +4833,7 @@ function sn(e) {
|
|
|
4833
4833
|
async: !1,
|
|
4834
4834
|
message: e,
|
|
4835
4835
|
_run(t, n) {
|
|
4836
|
-
return typeof t.value == "number" && !isNaN(t.value) ? t.typed = !0 :
|
|
4836
|
+
return typeof t.value == "number" && !isNaN(t.value) ? t.typed = !0 : Lt(this, "type", t, n), t;
|
|
4837
4837
|
}
|
|
4838
4838
|
};
|
|
4839
4839
|
}
|
|
@@ -4873,7 +4873,7 @@ function yt(e, t) {
|
|
|
4873
4873
|
c.typed || (n.typed = !1), (c.value !== void 0 || s in i) && (n.value[s] = c.value);
|
|
4874
4874
|
}
|
|
4875
4875
|
} else
|
|
4876
|
-
|
|
4876
|
+
Lt(this, "type", n, r);
|
|
4877
4877
|
return n;
|
|
4878
4878
|
}
|
|
4879
4879
|
};
|
|
@@ -4905,7 +4905,7 @@ function Li(e) {
|
|
|
4905
4905
|
async: !1,
|
|
4906
4906
|
message: e,
|
|
4907
4907
|
_run(t, n) {
|
|
4908
|
-
return typeof t.value == "string" ? t.typed = !0 :
|
|
4908
|
+
return typeof t.value == "string" ? t.typed = !0 : Lt(this, "type", t, n), t;
|
|
4909
4909
|
}
|
|
4910
4910
|
};
|
|
4911
4911
|
}
|
|
@@ -4945,7 +4945,7 @@ function Gn(e, t) {
|
|
|
4945
4945
|
c.typed || (n.typed = !1), n.value.push(c.value);
|
|
4946
4946
|
}
|
|
4947
4947
|
} else
|
|
4948
|
-
|
|
4948
|
+
Lt(this, "type", n, r);
|
|
4949
4949
|
return n;
|
|
4950
4950
|
}
|
|
4951
4951
|
};
|
|
@@ -4991,13 +4991,13 @@ function Jf(e, t) {
|
|
|
4991
4991
|
if (s) {
|
|
4992
4992
|
if (s.length === 1)
|
|
4993
4993
|
return s[0];
|
|
4994
|
-
|
|
4994
|
+
Lt(this, "type", n, r, {
|
|
4995
4995
|
issues: Ah(s)
|
|
4996
4996
|
}), n.typed = !0;
|
|
4997
4997
|
} else {
|
|
4998
4998
|
if (o?.length === 1)
|
|
4999
4999
|
return o[0];
|
|
5000
|
-
|
|
5000
|
+
Lt(this, "type", n, r, {
|
|
5001
5001
|
issues: Ah(o)
|
|
5002
5002
|
});
|
|
5003
5003
|
}
|
|
@@ -5145,7 +5145,7 @@ function wm(e) {
|
|
|
5145
5145
|
function Xc(e) {
|
|
5146
5146
|
return e instanceof Uint8Array;
|
|
5147
5147
|
}
|
|
5148
|
-
function
|
|
5148
|
+
function Zt(e) {
|
|
5149
5149
|
if (ly(e)) return e;
|
|
5150
5150
|
rt(ay, e);
|
|
5151
5151
|
const t = e.reduce((i, s) => Xc(s) ? s.length === 1 && Dc(s) !== void 0 ? i + 1 : i + Qp(s.length) + s.length : i + 1, 0), n = new Uint8Array(t);
|
|
@@ -5262,7 +5262,7 @@ function Oa(e, t) {
|
|
|
5262
5262
|
}
|
|
5263
5263
|
if (Ee(i, "output", () => {
|
|
5264
5264
|
if (e.m && i.n && e.pubkeys)
|
|
5265
|
-
return
|
|
5265
|
+
return Zt(
|
|
5266
5266
|
[].concat(
|
|
5267
5267
|
ac + e.m,
|
|
5268
5268
|
e.pubkeys,
|
|
@@ -5284,7 +5284,7 @@ function Oa(e, t) {
|
|
|
5284
5284
|
return ct(e.input).slice(1);
|
|
5285
5285
|
}), Ee(i, "input", () => {
|
|
5286
5286
|
if (e.signatures)
|
|
5287
|
-
return
|
|
5287
|
+
return Zt([rs.OP_0].concat(e.signatures));
|
|
5288
5288
|
}), Ee(i, "witness", () => {
|
|
5289
5289
|
if (i.input)
|
|
5290
5290
|
return [];
|
|
@@ -5351,7 +5351,7 @@ function hy(e, t) {
|
|
|
5351
5351
|
const n = _n(() => ct(e.input)), i = { name: "p2pk", network: e.network || vn };
|
|
5352
5352
|
if (Ee(i, "output", () => {
|
|
5353
5353
|
if (e.pubkey)
|
|
5354
|
-
return
|
|
5354
|
+
return Zt([e.pubkey, Uh.OP_CHECKSIG]);
|
|
5355
5355
|
}), Ee(i, "pubkey", () => {
|
|
5356
5356
|
if (e.output)
|
|
5357
5357
|
return e.output.slice(1, -1);
|
|
@@ -5360,7 +5360,7 @@ function hy(e, t) {
|
|
|
5360
5360
|
return n()[0];
|
|
5361
5361
|
}), Ee(i, "input", () => {
|
|
5362
5362
|
if (e.signature)
|
|
5363
|
-
return
|
|
5363
|
+
return Zt([e.signature]);
|
|
5364
5364
|
}), Ee(i, "witness", () => {
|
|
5365
5365
|
if (i.input)
|
|
5366
5366
|
return [];
|
|
@@ -5574,7 +5574,7 @@ const Ar = /* @__PURE__ */ Uint32Array.from([
|
|
|
5574
5574
|
1750603025,
|
|
5575
5575
|
1694076839,
|
|
5576
5576
|
3204075428
|
|
5577
|
-
]),
|
|
5577
|
+
]), Ct = /* @__PURE__ */ Uint32Array.from([
|
|
5578
5578
|
1779033703,
|
|
5579
5579
|
4089235720,
|
|
5580
5580
|
3144134277,
|
|
@@ -5878,7 +5878,7 @@ const Sy = Mm([
|
|
|
5878
5878
|
].map((e) => BigInt(e))), Dm = Sy[0], Xm = Sy[1], Ir = /* @__PURE__ */ new Uint32Array(80), Or = /* @__PURE__ */ new Uint32Array(80);
|
|
5879
5879
|
class zm extends nl {
|
|
5880
5880
|
constructor(t = 64) {
|
|
5881
|
-
super(128, t, 16, !1), this.Ah =
|
|
5881
|
+
super(128, t, 16, !1), this.Ah = Ct[0] | 0, this.Al = Ct[1] | 0, this.Bh = Ct[2] | 0, this.Bl = Ct[3] | 0, this.Ch = Ct[4] | 0, this.Cl = Ct[5] | 0, this.Dh = Ct[6] | 0, this.Dl = Ct[7] | 0, this.Eh = Ct[8] | 0, this.El = Ct[9] | 0, this.Fh = Ct[10] | 0, this.Fl = Ct[11] | 0, this.Gh = Ct[12] | 0, this.Gl = Ct[13] | 0, this.Hh = Ct[14] | 0, this.Hl = Ct[15] | 0;
|
|
5882
5882
|
}
|
|
5883
5883
|
// prettier-ignore
|
|
5884
5884
|
get() {
|
|
@@ -5912,12 +5912,12 @@ class zm extends nl {
|
|
|
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
|
-
const pn = /* @__PURE__ */ Pa(() => new _y()), Ym = /* @__PURE__ */ Pa(() => new Gm()), Zm = /* @__PURE__ */ Pa(() => new zm()),
|
|
5915
|
+
const pn = /* @__PURE__ */ Pa(() => new _y()), Ym = /* @__PURE__ */ Pa(() => new Gm()), Zm = /* @__PURE__ */ Pa(() => new zm()), zt = pn;
|
|
5916
5916
|
function wr(e) {
|
|
5917
|
-
return Hm(
|
|
5917
|
+
return Hm(zt(e));
|
|
5918
5918
|
}
|
|
5919
5919
|
function fi(e) {
|
|
5920
|
-
return
|
|
5920
|
+
return zt(zt(e));
|
|
5921
5921
|
}
|
|
5922
5922
|
const Jm = {
|
|
5923
5923
|
"BIP0340/challenge": Uint8Array.from([
|
|
@@ -6516,7 +6516,7 @@ const Jm = {
|
|
|
6516
6516
|
])
|
|
6517
6517
|
};
|
|
6518
6518
|
function ka(e, t) {
|
|
6519
|
-
return
|
|
6519
|
+
return zt(it([Jm[e], t]));
|
|
6520
6520
|
}
|
|
6521
6521
|
function Qm(e) {
|
|
6522
6522
|
if (e.length >= 255)
|
|
@@ -6631,7 +6631,7 @@ function tb(e) {
|
|
|
6631
6631
|
};
|
|
6632
6632
|
}
|
|
6633
6633
|
function nb(e) {
|
|
6634
|
-
return
|
|
6634
|
+
return zt(zt(e));
|
|
6635
6635
|
}
|
|
6636
6636
|
const po = tb(nb), Pr = $e;
|
|
6637
6637
|
function Wo(e, t) {
|
|
@@ -6665,7 +6665,7 @@ function Wo(e, t) {
|
|
|
6665
6665
|
if (e.pubkey || s.pubkey) return wr(e.pubkey || s.pubkey);
|
|
6666
6666
|
}), Ee(s, "output", () => {
|
|
6667
6667
|
if (s.hash)
|
|
6668
|
-
return
|
|
6668
|
+
return Zt([
|
|
6669
6669
|
Pr.OP_DUP,
|
|
6670
6670
|
Pr.OP_HASH160,
|
|
6671
6671
|
s.hash,
|
|
@@ -6680,7 +6680,7 @@ function Wo(e, t) {
|
|
|
6680
6680
|
return r()[0];
|
|
6681
6681
|
}), Ee(s, "input", () => {
|
|
6682
6682
|
if (e.pubkey && e.signature)
|
|
6683
|
-
return
|
|
6683
|
+
return Zt([e.signature, e.pubkey]);
|
|
6684
6684
|
}), Ee(s, "witness", () => {
|
|
6685
6685
|
if (s.input)
|
|
6686
6686
|
return [];
|
|
@@ -6763,7 +6763,7 @@ function Go(e, t) {
|
|
|
6763
6763
|
return {
|
|
6764
6764
|
network: n,
|
|
6765
6765
|
output: a === qs.OP_FALSE ? Uint8Array.from([]) : a,
|
|
6766
|
-
input:
|
|
6766
|
+
input: Zt(c.slice(0, -1)),
|
|
6767
6767
|
witness: e.witness || []
|
|
6768
6768
|
};
|
|
6769
6769
|
});
|
|
@@ -6777,13 +6777,13 @@ function Go(e, t) {
|
|
|
6777
6777
|
if (r.redeem && r.redeem.output) return wr(r.redeem.output);
|
|
6778
6778
|
}), Ee(r, "output", () => {
|
|
6779
6779
|
if (r.hash)
|
|
6780
|
-
return
|
|
6780
|
+
return Zt([qs.OP_HASH160, r.hash, qs.OP_EQUAL]);
|
|
6781
6781
|
}), Ee(r, "redeem", () => {
|
|
6782
6782
|
if (e.input)
|
|
6783
6783
|
return o();
|
|
6784
6784
|
}), Ee(r, "input", () => {
|
|
6785
6785
|
if (!(!e.redeem || !e.redeem.input || !e.redeem.output))
|
|
6786
|
-
return
|
|
6786
|
+
return Zt(
|
|
6787
6787
|
[].concat(ct(e.redeem.input), e.redeem.output)
|
|
6788
6788
|
);
|
|
6789
6789
|
}), Ee(r, "witness", () => {
|
|
@@ -7002,7 +7002,7 @@ function Do() {
|
|
|
7002
7002
|
}
|
|
7003
7003
|
return li.bech32 = a("bech32"), li.bech32m = a("bech32m"), li;
|
|
7004
7004
|
}
|
|
7005
|
-
var
|
|
7005
|
+
var Vt = Do();
|
|
7006
7006
|
const Lh = $e, rb = new Uint8Array(0);
|
|
7007
7007
|
function Na(e, t) {
|
|
7008
7008
|
if (!e.address && !e.hash && !e.output && !e.pubkey && !e.witness)
|
|
@@ -7023,7 +7023,7 @@ function Na(e, t) {
|
|
|
7023
7023
|
e
|
|
7024
7024
|
);
|
|
7025
7025
|
const n = _n(() => {
|
|
7026
|
-
const s =
|
|
7026
|
+
const s = Vt.bech32.decode(e.address), o = s.words.shift(), c = Vt.bech32.fromWords(s.words);
|
|
7027
7027
|
return {
|
|
7028
7028
|
version: o,
|
|
7029
7029
|
prefix: s.prefix,
|
|
@@ -7032,15 +7032,15 @@ function Na(e, t) {
|
|
|
7032
7032
|
}), r = e.network || vn, i = { name: "p2wpkh", network: r };
|
|
7033
7033
|
if (Ee(i, "address", () => {
|
|
7034
7034
|
if (!i.hash) return;
|
|
7035
|
-
const s =
|
|
7036
|
-
return s.unshift(0),
|
|
7035
|
+
const s = Vt.bech32.toWords(i.hash);
|
|
7036
|
+
return s.unshift(0), Vt.bech32.encode(r.bech32, s);
|
|
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
7040
|
if (e.pubkey || i.pubkey) return wr(e.pubkey || i.pubkey);
|
|
7041
7041
|
}), Ee(i, "output", () => {
|
|
7042
7042
|
if (i.hash)
|
|
7043
|
-
return
|
|
7043
|
+
return Zt([Lh.OP_0, i.hash]);
|
|
7044
7044
|
}), Ee(i, "pubkey", () => {
|
|
7045
7045
|
if (e.pubkey) return e.pubkey;
|
|
7046
7046
|
if (e.witness)
|
|
@@ -7126,7 +7126,7 @@ function Xo(e, t) {
|
|
|
7126
7126
|
e
|
|
7127
7127
|
);
|
|
7128
7128
|
const n = _n(() => {
|
|
7129
|
-
const o =
|
|
7129
|
+
const o = Vt.bech32.decode(e.address), c = o.words.shift(), a = Vt.bech32.fromWords(o.words);
|
|
7130
7130
|
return {
|
|
7131
7131
|
version: c,
|
|
7132
7132
|
prefix: o.prefix,
|
|
@@ -7138,15 +7138,15 @@ function Xo(e, t) {
|
|
|
7138
7138
|
const s = { network: i };
|
|
7139
7139
|
if (Ee(s, "address", () => {
|
|
7140
7140
|
if (!s.hash) return;
|
|
7141
|
-
const o =
|
|
7142
|
-
return o.unshift(0),
|
|
7141
|
+
const o = Vt.bech32.toWords(s.hash);
|
|
7142
|
+
return o.unshift(0), Vt.bech32.encode(i.bech32, o);
|
|
7143
7143
|
}), Ee(s, "hash", () => {
|
|
7144
7144
|
if (e.output) return e.output.slice(2);
|
|
7145
7145
|
if (e.address) return n().data;
|
|
7146
|
-
if (s.redeem && s.redeem.output) return
|
|
7146
|
+
if (s.redeem && s.redeem.output) return zt(s.redeem.output);
|
|
7147
7147
|
}), Ee(s, "output", () => {
|
|
7148
7148
|
if (s.hash)
|
|
7149
|
-
return
|
|
7149
|
+
return Zt([$h.OP_0, s.hash]);
|
|
7150
7150
|
}), Ee(s, "redeem", () => {
|
|
7151
7151
|
if (e.witness)
|
|
7152
7152
|
return {
|
|
@@ -7208,7 +7208,7 @@ function Xo(e, t) {
|
|
|
7208
7208
|
throw new TypeError(
|
|
7209
7209
|
"Redeem.output unspendable with more than 201 non-push ops"
|
|
7210
7210
|
);
|
|
7211
|
-
const a =
|
|
7211
|
+
const a = zt(e.redeem.output);
|
|
7212
7212
|
if (o.length > 0 && he(o, a) !== 0)
|
|
7213
7213
|
throw new TypeError("Hash mismatch");
|
|
7214
7214
|
o = a;
|
|
@@ -7427,11 +7427,11 @@ function Kh(e) {
|
|
|
7427
7427
|
const t = new Uint8Array(e.length);
|
|
7428
7428
|
return t.set(e), t;
|
|
7429
7429
|
}
|
|
7430
|
-
class
|
|
7430
|
+
class Ft {
|
|
7431
7431
|
buffer;
|
|
7432
7432
|
offset;
|
|
7433
7433
|
static withCapacity(t) {
|
|
7434
|
-
return new
|
|
7434
|
+
return new Ft(new Uint8Array(t));
|
|
7435
7435
|
}
|
|
7436
7436
|
constructor(t, n = 0) {
|
|
7437
7437
|
this.buffer = t, this.offset = n, rt(Gn([qe, ar]), [
|
|
@@ -7628,8 +7628,8 @@ function zo(e, t) {
|
|
|
7628
7628
|
}), s = e.network || vn, o = { name: "p2tr", network: s };
|
|
7629
7629
|
if (Ee(o, "address", () => {
|
|
7630
7630
|
if (!o.pubkey) return;
|
|
7631
|
-
const c =
|
|
7632
|
-
return c.unshift(Wh),
|
|
7631
|
+
const c = Vt.bech32m.toWords(o.pubkey);
|
|
7632
|
+
return c.unshift(Wh), Vt.bech32m.encode(s.bech32, c);
|
|
7633
7633
|
}), Ee(o, "hash", () => {
|
|
7634
7634
|
const c = i();
|
|
7635
7635
|
if (c) return c.hash;
|
|
@@ -7641,7 +7641,7 @@ function zo(e, t) {
|
|
|
7641
7641
|
return null;
|
|
7642
7642
|
}), Ee(o, "output", () => {
|
|
7643
7643
|
if (o.pubkey)
|
|
7644
|
-
return
|
|
7644
|
+
return Zt([jh.OP_1, o.pubkey]);
|
|
7645
7645
|
}), Ee(o, "redeemVersion", () => e.redeemVersion ? e.redeemVersion : e.redeem && e.redeem.redeemVersion !== void 0 && e.redeem.redeemVersion !== null ? e.redeem.redeemVersion : Ay), Ee(o, "redeem", () => {
|
|
7646
7646
|
const c = r();
|
|
7647
7647
|
if (!(!c || c.length < 2))
|
|
@@ -7800,13 +7800,13 @@ function Ny(e) {
|
|
|
7800
7800
|
function il(e) {
|
|
7801
7801
|
let t, n;
|
|
7802
7802
|
try {
|
|
7803
|
-
t =
|
|
7803
|
+
t = Vt.bech32.decode(e);
|
|
7804
7804
|
} catch {
|
|
7805
7805
|
}
|
|
7806
7806
|
if (t) {
|
|
7807
7807
|
if (n = t.words[0], n !== 0) throw new TypeError(e + " uses wrong encoding");
|
|
7808
|
-
} else if (t =
|
|
7809
|
-
const r =
|
|
7808
|
+
} else if (t = Vt.bech32m.decode(e), n = t.words[0], n === 0) throw new TypeError(e + " uses wrong encoding");
|
|
7809
|
+
const r = Vt.bech32.fromWords(t.words.slice(1));
|
|
7810
7810
|
return {
|
|
7811
7811
|
version: n,
|
|
7812
7812
|
prefix: t.prefix,
|
|
@@ -7814,8 +7814,8 @@ function il(e) {
|
|
|
7814
7814
|
};
|
|
7815
7815
|
}
|
|
7816
7816
|
function xb(e, t, n) {
|
|
7817
|
-
const r =
|
|
7818
|
-
return r.unshift(t), t === 0 ?
|
|
7817
|
+
const r = Vt.bech32.toWords(e);
|
|
7818
|
+
return r.unshift(t), t === 0 ? Vt.bech32.encode(n, r) : Vt.bech32m.encode(n, r);
|
|
7819
7819
|
}
|
|
7820
7820
|
function Ab(e, t) {
|
|
7821
7821
|
t = t || vn;
|
|
@@ -7874,7 +7874,7 @@ function Uy(e, t) {
|
|
|
7874
7874
|
if (r.data.length === 32)
|
|
7875
7875
|
return zo({ pubkey: r.data }).output;
|
|
7876
7876
|
} else if (r.version >= Oy && r.version <= Iy && r.data.length >= By && r.data.length <= vy)
|
|
7877
|
-
return console.warn(ky),
|
|
7877
|
+
return console.warn(ky), Zt([
|
|
7878
7878
|
r.version + Py,
|
|
7879
7879
|
r.data
|
|
7880
7880
|
]);
|
|
@@ -8027,7 +8027,7 @@ let ht = class Ge {
|
|
|
8027
8027
|
n,
|
|
8028
8028
|
r
|
|
8029
8029
|
]), t >= this.ins.length) return Dh;
|
|
8030
|
-
const i =
|
|
8030
|
+
const i = Zt(
|
|
8031
8031
|
ct(n).filter((c) => c !== $e.OP_CODESEPARATOR)
|
|
8032
8032
|
), s = this.clone();
|
|
8033
8033
|
if ((r & 31) === Ge.SIGHASH_NONE)
|
|
@@ -8063,39 +8063,39 @@ let ht = class Ge {
|
|
|
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
8064
|
let p = Gr, y = Gr, g = Gr, w = Gr, E = Gr;
|
|
8065
8065
|
if (!u) {
|
|
8066
|
-
let T =
|
|
8066
|
+
let T = Ft.withCapacity(36 * this.ins.length);
|
|
8067
8067
|
this.ins.forEach((I) => {
|
|
8068
8068
|
T.writeSlice(I.hash), T.writeUInt32(I.index);
|
|
8069
|
-
}), p =
|
|
8069
|
+
}), p = zt(T.end()), T = Ft.withCapacity(8 * this.ins.length), r.forEach((I) => T.writeInt64(I)), y = zt(T.end()), T = Ft.withCapacity(
|
|
8070
8070
|
n.map(Wn).reduce((I, A) => I + A)
|
|
8071
8071
|
), n.forEach(
|
|
8072
8072
|
(I) => T.writeVarSlice(I)
|
|
8073
|
-
), g =
|
|
8073
|
+
), g = zt(T.end()), T = Ft.withCapacity(4 * this.ins.length), this.ins.forEach((I) => T.writeUInt32(I.sequence)), w = zt(T.end());
|
|
8074
8074
|
}
|
|
8075
8075
|
if (f || l) {
|
|
8076
8076
|
if (l && t < this.outs.length) {
|
|
8077
|
-
const T = this.outs[t], I =
|
|
8077
|
+
const T = this.outs[t], I = Ft.withCapacity(
|
|
8078
8078
|
8 + Wn(T.script)
|
|
8079
8079
|
);
|
|
8080
|
-
I.writeInt64(T.value), I.writeVarSlice(T.script), E =
|
|
8080
|
+
I.writeInt64(T.value), I.writeVarSlice(T.script), E = zt(I.end());
|
|
8081
8081
|
}
|
|
8082
8082
|
} else {
|
|
8083
8083
|
if (!this.outs.length)
|
|
8084
8084
|
throw new Error("Add outputs to the transaction before signing.");
|
|
8085
|
-
const T = this.outs.map((A) => 8 + Wn(A.script)).reduce((A, U) => A + U), I =
|
|
8085
|
+
const T = this.outs.map((A) => 8 + Wn(A.script)).reduce((A, U) => A + U), I = Ft.withCapacity(T);
|
|
8086
8086
|
this.outs.forEach((A) => {
|
|
8087
8087
|
I.writeInt64(A.value), I.writeVarSlice(A.script);
|
|
8088
|
-
}), E =
|
|
8088
|
+
}), E = zt(I.end());
|
|
8089
8089
|
}
|
|
8090
|
-
const S = (s ? 2 : 0) + (o ? 1 : 0), _ = 174 - (u ? 49 : 0) - (f ? 32 : 0) + (o ? 32 : 0) + (s ? 37 : 0), m =
|
|
8090
|
+
const S = (s ? 2 : 0) + (o ? 1 : 0), _ = 174 - (u ? 49 : 0) - (f ? 32 : 0) + (o ? 32 : 0) + (s ? 37 : 0), m = Ft.withCapacity(_);
|
|
8091
8091
|
if (m.writeUInt8(i), m.writeInt32(this.version), m.writeUInt32(this.locktime), m.writeSlice(p), m.writeSlice(y), m.writeSlice(g), m.writeSlice(w), f || l || m.writeSlice(E), m.writeUInt8(S), u) {
|
|
8092
8092
|
const T = this.ins[t];
|
|
8093
8093
|
m.writeSlice(T.hash), m.writeUInt32(T.index), m.writeInt64(r[t]), m.writeVarSlice(n[t]), m.writeUInt32(T.sequence);
|
|
8094
8094
|
} else
|
|
8095
8095
|
m.writeUInt32(t);
|
|
8096
8096
|
if (o) {
|
|
8097
|
-
const T =
|
|
8098
|
-
T.writeVarSlice(o), m.writeSlice(
|
|
8097
|
+
const T = Ft.withCapacity(Wn(o));
|
|
8098
|
+
T.writeVarSlice(o), m.writeSlice(zt(T.end()));
|
|
8099
8099
|
}
|
|
8100
8100
|
return l && m.writeSlice(E), s && (m.writeSlice(s), m.writeUInt8(0), m.writeUInt32(4294967295)), ka(
|
|
8101
8101
|
"TapSighash",
|
|
@@ -8113,20 +8113,20 @@ let ht = class Ge {
|
|
|
8113
8113
|
[t, n, r, i]
|
|
8114
8114
|
);
|
|
8115
8115
|
let s = Uint8Array.from([]), o, c = _u, a = _u, u = _u;
|
|
8116
|
-
if (i & Ge.SIGHASH_ANYONECANPAY || (s = new Uint8Array(36 * this.ins.length), o = new
|
|
8116
|
+
if (i & Ge.SIGHASH_ANYONECANPAY || (s = new Uint8Array(36 * this.ins.length), o = new Ft(s, 0), this.ins.forEach((l) => {
|
|
8117
8117
|
o.writeSlice(l.hash), o.writeUInt32(l.index);
|
|
8118
|
-
}), a = fi(s)), !(i & Ge.SIGHASH_ANYONECANPAY) && (i & 31) !== Ge.SIGHASH_SINGLE && (i & 31) !== Ge.SIGHASH_NONE && (s = new Uint8Array(4 * this.ins.length), o = new
|
|
8118
|
+
}), a = fi(s)), !(i & Ge.SIGHASH_ANYONECANPAY) && (i & 31) !== Ge.SIGHASH_SINGLE && (i & 31) !== Ge.SIGHASH_NONE && (s = new Uint8Array(4 * this.ins.length), o = new Ft(s, 0), this.ins.forEach((l) => {
|
|
8119
8119
|
o.writeUInt32(l.sequence);
|
|
8120
8120
|
}), u = fi(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
|
-
s = new Uint8Array(l), o = new
|
|
8122
|
+
s = new Uint8Array(l), o = new Ft(s, 0), this.outs.forEach((p) => {
|
|
8123
8123
|
o.writeInt64(p.value), o.writeVarSlice(p.script);
|
|
8124
8124
|
}), c = fi(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
|
|
8127
|
+
s = new Uint8Array(8 + Wn(l.script)), o = new Ft(s, 0), o.writeInt64(l.value), o.writeVarSlice(l.script), c = fi(s);
|
|
8128
8128
|
}
|
|
8129
|
-
s = new Uint8Array(156 + Wn(n)), o = new
|
|
8129
|
+
s = new Uint8Array(156 + Wn(n)), o = new Ft(s, 0);
|
|
8130
8130
|
const f = this.ins[t];
|
|
8131
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), fi(s);
|
|
8132
8132
|
}
|
|
@@ -8153,7 +8153,7 @@ let ht = class Ge {
|
|
|
8153
8153
|
}
|
|
8154
8154
|
__toBuffer(t, n, r = !1) {
|
|
8155
8155
|
t || (t = new Uint8Array(this.byteLength(r)));
|
|
8156
|
-
const i = new
|
|
8156
|
+
const i = new Ft(t, n || 0);
|
|
8157
8157
|
i.writeInt32(this.version);
|
|
8158
8158
|
const s = r && this.hasWitnesses();
|
|
8159
8159
|
return s && (i.writeUInt8(Ge.ADVANCED_TRANSACTION_MARKER), i.writeUInt8(Ge.ADVANCED_TRANSACTION_FLAG)), i.writeVarInt(this.ins.length), this.ins.forEach((o) => {
|
|
@@ -8980,7 +8980,7 @@ function cE(e, t) {
|
|
|
8980
8980
|
outputKeyVals: w
|
|
8981
8981
|
});
|
|
8982
8982
|
}
|
|
8983
|
-
function
|
|
8983
|
+
function Ht(e, t, n) {
|
|
8984
8984
|
if (he(t, Uint8Array.from([n])))
|
|
8985
8985
|
throw new Error(
|
|
8986
8986
|
// `Format Error: Invalid ${type} key: ${keyBuf.toString('hex')}`,
|
|
@@ -8995,7 +8995,7 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
8995
8995
|
for (const f of t)
|
|
8996
8996
|
switch (f.key[0]) {
|
|
8997
8997
|
case zn.UNSIGNED_TX:
|
|
8998
|
-
if (
|
|
8998
|
+
if (Ht("global", f.key, zn.UNSIGNED_TX), s > 0)
|
|
8999
8999
|
throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");
|
|
9000
9000
|
s++;
|
|
9001
9001
|
break;
|
|
@@ -9011,14 +9011,14 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9011
9011
|
for (const p of n[f])
|
|
9012
9012
|
switch (gt.checkPubkey(p), p.key[0]) {
|
|
9013
9013
|
case ye.NON_WITNESS_UTXO:
|
|
9014
|
-
if (
|
|
9014
|
+
if (Ht("input", p.key, ye.NON_WITNESS_UTXO), l.nonWitnessUtxo !== void 0)
|
|
9015
9015
|
throw new Error(
|
|
9016
9016
|
"Format Error: Input has multiple NON_WITNESS_UTXO"
|
|
9017
9017
|
);
|
|
9018
9018
|
l.nonWitnessUtxo = gt.nonWitnessUtxo.decode(p);
|
|
9019
9019
|
break;
|
|
9020
9020
|
case ye.WITNESS_UTXO:
|
|
9021
|
-
if (
|
|
9021
|
+
if (Ht("input", p.key, ye.WITNESS_UTXO), l.witnessUtxo !== void 0)
|
|
9022
9022
|
throw new Error("Format Error: Input has multiple WITNESS_UTXO");
|
|
9023
9023
|
l.witnessUtxo = gt.witnessUtxo.decode(p);
|
|
9024
9024
|
break;
|
|
@@ -9026,17 +9026,17 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9026
9026
|
l.partialSig === void 0 && (l.partialSig = []), l.partialSig.push(gt.partialSig.decode(p));
|
|
9027
9027
|
break;
|
|
9028
9028
|
case ye.SIGHASH_TYPE:
|
|
9029
|
-
if (
|
|
9029
|
+
if (Ht("input", p.key, ye.SIGHASH_TYPE), l.sighashType !== void 0)
|
|
9030
9030
|
throw new Error("Format Error: Input has multiple SIGHASH_TYPE");
|
|
9031
9031
|
l.sighashType = gt.sighashType.decode(p);
|
|
9032
9032
|
break;
|
|
9033
9033
|
case ye.REDEEM_SCRIPT:
|
|
9034
|
-
if (
|
|
9034
|
+
if (Ht("input", p.key, ye.REDEEM_SCRIPT), l.redeemScript !== void 0)
|
|
9035
9035
|
throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");
|
|
9036
9036
|
l.redeemScript = gt.redeemScript.decode(p);
|
|
9037
9037
|
break;
|
|
9038
9038
|
case ye.WITNESS_SCRIPT:
|
|
9039
|
-
if (
|
|
9039
|
+
if (Ht("input", p.key, ye.WITNESS_SCRIPT), l.witnessScript !== void 0)
|
|
9040
9040
|
throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");
|
|
9041
9041
|
l.witnessScript = gt.witnessScript.decode(p);
|
|
9042
9042
|
break;
|
|
@@ -9046,18 +9046,18 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9046
9046
|
);
|
|
9047
9047
|
break;
|
|
9048
9048
|
case ye.FINAL_SCRIPTSIG:
|
|
9049
|
-
|
|
9049
|
+
Ht("input", p.key, ye.FINAL_SCRIPTSIG), l.finalScriptSig = gt.finalScriptSig.decode(p);
|
|
9050
9050
|
break;
|
|
9051
9051
|
case ye.FINAL_SCRIPTWITNESS:
|
|
9052
|
-
|
|
9052
|
+
Ht("input", p.key, ye.FINAL_SCRIPTWITNESS), l.finalScriptWitness = gt.finalScriptWitness.decode(
|
|
9053
9053
|
p
|
|
9054
9054
|
);
|
|
9055
9055
|
break;
|
|
9056
9056
|
case ye.POR_COMMITMENT:
|
|
9057
|
-
|
|
9057
|
+
Ht("input", p.key, ye.POR_COMMITMENT), l.porCommitment = gt.porCommitment.decode(p);
|
|
9058
9058
|
break;
|
|
9059
9059
|
case ye.TAP_KEY_SIG:
|
|
9060
|
-
|
|
9060
|
+
Ht("input", p.key, ye.TAP_KEY_SIG), l.tapKeySig = gt.tapKeySig.decode(p);
|
|
9061
9061
|
break;
|
|
9062
9062
|
case ye.TAP_SCRIPT_SIG:
|
|
9063
9063
|
l.tapScriptSig === void 0 && (l.tapScriptSig = []), l.tapScriptSig.push(gt.tapScriptSig.decode(p));
|
|
@@ -9071,10 +9071,10 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9071
9071
|
);
|
|
9072
9072
|
break;
|
|
9073
9073
|
case ye.TAP_INTERNAL_KEY:
|
|
9074
|
-
|
|
9074
|
+
Ht("input", p.key, ye.TAP_INTERNAL_KEY), l.tapInternalKey = gt.tapInternalKey.decode(p);
|
|
9075
9075
|
break;
|
|
9076
9076
|
case ye.TAP_MERKLE_ROOT:
|
|
9077
|
-
|
|
9077
|
+
Ht("input", p.key, ye.TAP_MERKLE_ROOT), l.tapMerkleRoot = gt.tapMerkleRoot.decode(p);
|
|
9078
9078
|
break;
|
|
9079
9079
|
default:
|
|
9080
9080
|
l.unknownKeyVals || (l.unknownKeyVals = []), l.unknownKeyVals.push(p);
|
|
@@ -9086,12 +9086,12 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9086
9086
|
for (const p of r[f])
|
|
9087
9087
|
switch (ur.checkPubkey(p), p.key[0]) {
|
|
9088
9088
|
case ft.REDEEM_SCRIPT:
|
|
9089
|
-
if (
|
|
9089
|
+
if (Ht("output", p.key, ft.REDEEM_SCRIPT), l.redeemScript !== void 0)
|
|
9090
9090
|
throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");
|
|
9091
9091
|
l.redeemScript = ur.redeemScript.decode(p);
|
|
9092
9092
|
break;
|
|
9093
9093
|
case ft.WITNESS_SCRIPT:
|
|
9094
|
-
if (
|
|
9094
|
+
if (Ht("output", p.key, ft.WITNESS_SCRIPT), l.witnessScript !== void 0)
|
|
9095
9095
|
throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");
|
|
9096
9096
|
l.witnessScript = ur.witnessScript.decode(p);
|
|
9097
9097
|
break;
|
|
@@ -9101,10 +9101,10 @@ function Vy(e, { globalMapKeyVals: t, inputKeyVals: n, outputKeyVals: r }) {
|
|
|
9101
9101
|
);
|
|
9102
9102
|
break;
|
|
9103
9103
|
case ft.TAP_INTERNAL_KEY:
|
|
9104
|
-
|
|
9104
|
+
Ht("output", p.key, ft.TAP_INTERNAL_KEY), l.tapInternalKey = ur.tapInternalKey.decode(p);
|
|
9105
9105
|
break;
|
|
9106
9106
|
case ft.TAP_TREE:
|
|
9107
|
-
|
|
9107
|
+
Ht("output", p.key, ft.TAP_TREE), l.tapTree = ur.tapTree.decode(p);
|
|
9108
9108
|
break;
|
|
9109
9109
|
case ft.TAP_BIP32_DERIVATION:
|
|
9110
9110
|
l.tapBip32Derivation === void 0 && (l.tapBip32Derivation = []), l.tapBip32Derivation.push(
|
|
@@ -9215,7 +9215,7 @@ function Zi(e) {
|
|
|
9215
9215
|
t.add(r);
|
|
9216
9216
|
}), t;
|
|
9217
9217
|
}
|
|
9218
|
-
function
|
|
9218
|
+
function It(e, t) {
|
|
9219
9219
|
const n = e[t];
|
|
9220
9220
|
if (n === void 0) throw new Error(`No input #${t}`);
|
|
9221
9221
|
return n;
|
|
@@ -9282,7 +9282,7 @@ function al(e) {
|
|
|
9282
9282
|
}
|
|
9283
9283
|
const hE = al("global"), Ly = al("input"), $y = al("output");
|
|
9284
9284
|
function dE(e, t) {
|
|
9285
|
-
const n = e.length - 1, r =
|
|
9285
|
+
const n = e.length - 1, r = It(e, n);
|
|
9286
9286
|
Ly(t, r);
|
|
9287
9287
|
}
|
|
9288
9288
|
function pE(e, t) {
|
|
@@ -9322,7 +9322,7 @@ let Zh = class {
|
|
|
9322
9322
|
return hE(t, this.globalMap), this;
|
|
9323
9323
|
}
|
|
9324
9324
|
updateInput(t, n) {
|
|
9325
|
-
const r =
|
|
9325
|
+
const r = It(this.inputs, t);
|
|
9326
9326
|
return Ly(n, r), this;
|
|
9327
9327
|
}
|
|
9328
9328
|
updateOutput(t, n) {
|
|
@@ -9337,7 +9337,7 @@ let Zh = class {
|
|
|
9337
9337
|
), this.globalMap.unknownKeyVals || (this.globalMap.unknownKeyVals = []), this.globalMap.unknownKeyVals.push(t), this;
|
|
9338
9338
|
}
|
|
9339
9339
|
addUnknownKeyValToInput(t, n) {
|
|
9340
|
-
const r =
|
|
9340
|
+
const r = It(this.inputs, t);
|
|
9341
9341
|
return xu(n, r.unknownKeyVals, Au(ye)), r.unknownKeyVals || (r.unknownKeyVals = []), r.unknownKeyVals.push(n), this;
|
|
9342
9342
|
}
|
|
9343
9343
|
addUnknownKeyValToOutput(t, n) {
|
|
@@ -9367,7 +9367,7 @@ let Zh = class {
|
|
|
9367
9367
|
), pE(this.outputs, t), this;
|
|
9368
9368
|
}
|
|
9369
9369
|
clearFinalizedInput(t) {
|
|
9370
|
-
const n =
|
|
9370
|
+
const n = It(this.inputs, t);
|
|
9371
9371
|
lE(t, n);
|
|
9372
9372
|
for (const r of Object.keys(n))
|
|
9373
9373
|
[
|
|
@@ -9794,10 +9794,10 @@ class Jc {
|
|
|
9794
9794
|
return od("__FEE", "fee", this.data.inputs, this.__CACHE);
|
|
9795
9795
|
}
|
|
9796
9796
|
finalizeAllInputs() {
|
|
9797
|
-
return
|
|
9797
|
+
return It(this.data.inputs, 0), Ls(this.data.inputs.length).forEach((t) => this.finalizeInput(t)), this;
|
|
9798
9798
|
}
|
|
9799
9799
|
finalizeInput(t, n) {
|
|
9800
|
-
const r =
|
|
9800
|
+
const r = It(this.data.inputs, t);
|
|
9801
9801
|
return kn(r) ? this._finalizeTaprootInput(
|
|
9802
9802
|
t,
|
|
9803
9803
|
r,
|
|
@@ -9806,7 +9806,7 @@ class Jc {
|
|
|
9806
9806
|
) : this._finalizeInput(t, r, n);
|
|
9807
9807
|
}
|
|
9808
9808
|
finalizeTaprootInput(t, n, r = Qh) {
|
|
9809
|
-
const i =
|
|
9809
|
+
const i = It(this.data.inputs, t);
|
|
9810
9810
|
if (kn(i))
|
|
9811
9811
|
return this._finalizeTaprootInput(
|
|
9812
9812
|
t,
|
|
@@ -9858,7 +9858,7 @@ class Jc {
|
|
|
9858
9858
|
return this.data.clearFinalizedInput(t), this;
|
|
9859
9859
|
}
|
|
9860
9860
|
getInputType(t) {
|
|
9861
|
-
const n =
|
|
9861
|
+
const n = It(this.data.inputs, t), r = rg(t, n, this.__CACHE), i = Ha(
|
|
9862
9862
|
r,
|
|
9863
9863
|
t,
|
|
9864
9864
|
"input",
|
|
@@ -9868,11 +9868,11 @@ class Jc {
|
|
|
9868
9868
|
return s + o;
|
|
9869
9869
|
}
|
|
9870
9870
|
inputHasPubkey(t, n) {
|
|
9871
|
-
const r =
|
|
9871
|
+
const r = It(this.data.inputs, t);
|
|
9872
9872
|
return YE(n, r, t, this.__CACHE);
|
|
9873
9873
|
}
|
|
9874
9874
|
inputHasHDKey(t, n) {
|
|
9875
|
-
const r =
|
|
9875
|
+
const r = It(this.data.inputs, t), i = rd(n);
|
|
9876
9876
|
return !!r.bip32Derivation && r.bip32Derivation.some(i);
|
|
9877
9877
|
}
|
|
9878
9878
|
outputHasPubkey(t, n) {
|
|
@@ -9884,7 +9884,7 @@ class Jc {
|
|
|
9884
9884
|
return !!r.bip32Derivation && r.bip32Derivation.some(i);
|
|
9885
9885
|
}
|
|
9886
9886
|
validateSignaturesOfAllInputs(t) {
|
|
9887
|
-
return
|
|
9887
|
+
return It(this.data.inputs, 0), Ls(this.data.inputs.length).map(
|
|
9888
9888
|
(r) => this.validateSignaturesOfInput(r, t)
|
|
9889
9889
|
).reduce((r, i) => i === !0 && r, !0);
|
|
9890
9890
|
}
|
|
@@ -10057,7 +10057,7 @@ class Jc {
|
|
|
10057
10057
|
signInput(t, n, r) {
|
|
10058
10058
|
if (!n || !n.publicKey)
|
|
10059
10059
|
throw new Error("Need Signer to sign input");
|
|
10060
|
-
const i =
|
|
10060
|
+
const i = It(this.data.inputs, t);
|
|
10061
10061
|
return kn(i) ? this._signTaprootInput(
|
|
10062
10062
|
t,
|
|
10063
10063
|
i,
|
|
@@ -10069,7 +10069,7 @@ class Jc {
|
|
|
10069
10069
|
signTaprootInput(t, n, r, i) {
|
|
10070
10070
|
if (!n || !n.publicKey)
|
|
10071
10071
|
throw new Error("Need Signer to sign input");
|
|
10072
|
-
const s =
|
|
10072
|
+
const s = It(this.data.inputs, t);
|
|
10073
10073
|
if (kn(s))
|
|
10074
10074
|
return this._signTaprootInput(
|
|
10075
10075
|
t,
|
|
@@ -10121,7 +10121,7 @@ class Jc {
|
|
|
10121
10121
|
return Promise.resolve().then(() => {
|
|
10122
10122
|
if (!n || !n.publicKey)
|
|
10123
10123
|
throw new Error("Need Signer to sign input");
|
|
10124
|
-
const i =
|
|
10124
|
+
const i = It(this.data.inputs, t);
|
|
10125
10125
|
return kn(i) ? this._signTaprootInputAsync(
|
|
10126
10126
|
t,
|
|
10127
10127
|
i,
|
|
@@ -10135,7 +10135,7 @@ class Jc {
|
|
|
10135
10135
|
return Promise.resolve().then(() => {
|
|
10136
10136
|
if (!n || !n.publicKey)
|
|
10137
10137
|
throw new Error("Need Signer to sign input");
|
|
10138
|
-
const s =
|
|
10138
|
+
const s = It(this.data.inputs, t);
|
|
10139
10139
|
if (kn(s))
|
|
10140
10140
|
return this._signTaprootInputAsync(
|
|
10141
10141
|
t,
|
|
@@ -10417,7 +10417,7 @@ function jE(e, t, n, r, i, s) {
|
|
|
10417
10417
|
};
|
|
10418
10418
|
}
|
|
10419
10419
|
function cd(e, t, n, r, i) {
|
|
10420
|
-
const s =
|
|
10420
|
+
const s = It(e, t), { hash: o, sighashType: c, script: a } = Jy(
|
|
10421
10421
|
t,
|
|
10422
10422
|
s,
|
|
10423
10423
|
r,
|
|
@@ -10621,7 +10621,7 @@ function DE(e, t, n) {
|
|
|
10621
10621
|
return (t.witnessScript || Ua(i.script)) && (i.isSegwit = !0), i;
|
|
10622
10622
|
}
|
|
10623
10623
|
function ud(e, t, n) {
|
|
10624
|
-
const r =
|
|
10624
|
+
const r = It(t, e);
|
|
10625
10625
|
if (!r.bip32Derivation || r.bip32Derivation.length === 0)
|
|
10626
10626
|
throw new Error("Need bip32Derivation to sign with HD");
|
|
10627
10627
|
const i = r.bip32Derivation.map((o) => {
|
|
@@ -13546,14 +13546,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", dS
|
|
|
13546
13546
|
hasStandardBrowserWebWorkerEnv: hS,
|
|
13547
13547
|
navigator: Pf,
|
|
13548
13548
|
origin: dS
|
|
13549
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
13549
|
+
}, Symbol.toStringTag, { value: "Module" })), Mt = {
|
|
13550
13550
|
...pS,
|
|
13551
13551
|
...fS
|
|
13552
13552
|
};
|
|
13553
13553
|
function yS(e, t) {
|
|
13554
|
-
return ja(e, new
|
|
13554
|
+
return ja(e, new Mt.classes.URLSearchParams(), {
|
|
13555
13555
|
visitor: function(n, r, i, s) {
|
|
13556
|
-
return
|
|
13556
|
+
return Mt.isNode && z.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
13557
13557
|
},
|
|
13558
13558
|
...t
|
|
13559
13559
|
});
|
|
@@ -13648,8 +13648,8 @@ const Qo = {
|
|
|
13648
13648
|
maxContentLength: -1,
|
|
13649
13649
|
maxBodyLength: -1,
|
|
13650
13650
|
env: {
|
|
13651
|
-
FormData:
|
|
13652
|
-
Blob:
|
|
13651
|
+
FormData: Mt.classes.FormData,
|
|
13652
|
+
Blob: Mt.classes.Blob
|
|
13653
13653
|
},
|
|
13654
13654
|
validateStatus: function(t) {
|
|
13655
13655
|
return t >= 200 && t < 300;
|
|
@@ -13949,10 +13949,10 @@ const na = (e, t, n = 3) => {
|
|
|
13949
13949
|
total: e,
|
|
13950
13950
|
loaded: r
|
|
13951
13951
|
}), t[1]];
|
|
13952
|
-
}, md = (e) => (...t) => z.asap(() => e(...t)), IS =
|
|
13953
|
-
new URL(
|
|
13954
|
-
|
|
13955
|
-
) : () => !0, OS =
|
|
13952
|
+
}, md = (e) => (...t) => z.asap(() => e(...t)), IS = Mt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Mt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
13953
|
+
new URL(Mt.origin),
|
|
13954
|
+
Mt.navigator && /(msie|trident)/i.test(Mt.navigator.userAgent)
|
|
13955
|
+
) : () => !0, OS = Mt.hasStandardBrowserEnv ? (
|
|
13956
13956
|
// Standard browser envs support document.cookie
|
|
13957
13957
|
{
|
|
13958
13958
|
write(e, t, n, r, i, s) {
|
|
@@ -14063,14 +14063,14 @@ const o1 = (e) => {
|
|
|
14063
14063
|
);
|
|
14064
14064
|
let a;
|
|
14065
14065
|
if (z.isFormData(n)) {
|
|
14066
|
-
if (
|
|
14066
|
+
if (Mt.hasStandardBrowserEnv || Mt.hasStandardBrowserWebWorkerEnv)
|
|
14067
14067
|
o.setContentType(void 0);
|
|
14068
14068
|
else if ((a = o.getContentType()) !== !1) {
|
|
14069
14069
|
const [u, ...f] = a ? a.split(";").map((l) => l.trim()).filter(Boolean) : [];
|
|
14070
14070
|
o.setContentType([u || "multipart/form-data", ...f].join("; "));
|
|
14071
14071
|
}
|
|
14072
14072
|
}
|
|
14073
|
-
if (
|
|
14073
|
+
if (Mt.hasStandardBrowserEnv && (r && z.isFunction(r) && (r = r(t)), r || r !== !1 && IS(t.url))) {
|
|
14074
14074
|
const u = i && s && OS.read(s);
|
|
14075
14075
|
u && o.set(i, u);
|
|
14076
14076
|
}
|
|
@@ -14126,7 +14126,7 @@ const o1 = (e) => {
|
|
|
14126
14126
|
E && (r(!m || m.type ? new Ns(null, e, E) : m), E.abort(), E = null);
|
|
14127
14127
|
}, i.cancelToken && i.cancelToken.subscribe(f), i.signal && (i.signal.aborted ? f() : i.signal.addEventListener("abort", f)));
|
|
14128
14128
|
const _ = AS(i.url);
|
|
14129
|
-
if (_ &&
|
|
14129
|
+
if (_ && Mt.protocols.indexOf(_) === -1) {
|
|
14130
14130
|
r(new Ie("Unsupported protocol " + _ + ":", Ie.ERR_BAD_REQUEST, e));
|
|
14131
14131
|
return;
|
|
14132
14132
|
}
|
|
@@ -14220,7 +14220,7 @@ const o1 = (e) => {
|
|
|
14220
14220
|
}
|
|
14221
14221
|
}, qS = c1 && a1(() => {
|
|
14222
14222
|
let e = !1;
|
|
14223
|
-
const t = new Request(
|
|
14223
|
+
const t = new Request(Mt.origin, {
|
|
14224
14224
|
body: new ReadableStream(),
|
|
14225
14225
|
method: "POST",
|
|
14226
14226
|
get duplex() {
|
|
@@ -14244,7 +14244,7 @@ const VS = async (e) => {
|
|
|
14244
14244
|
if (z.isBlob(e))
|
|
14245
14245
|
return e.size;
|
|
14246
14246
|
if (z.isSpecCompliantForm(e))
|
|
14247
|
-
return (await new Request(
|
|
14247
|
+
return (await new Request(Mt.origin, {
|
|
14248
14248
|
method: "POST",
|
|
14249
14249
|
body: e
|
|
14250
14250
|
}).arrayBuffer()).byteLength;
|
|
@@ -15735,11 +15735,11 @@ function Yn(e) {
|
|
|
15735
15735
|
function Ao(e) {
|
|
15736
15736
|
return Sn(e), T1(Qe(Uint8Array.from(e).reverse()));
|
|
15737
15737
|
}
|
|
15738
|
-
function
|
|
15738
|
+
function Ot(e, t) {
|
|
15739
15739
|
return jo(e.toString(16).padStart(t * 2, "0"));
|
|
15740
15740
|
}
|
|
15741
15741
|
function x1(e, t) {
|
|
15742
|
-
return
|
|
15742
|
+
return Ot(e, t).reverse();
|
|
15743
15743
|
}
|
|
15744
15744
|
function en(e, t, n) {
|
|
15745
15745
|
let r;
|
|
@@ -15809,7 +15809,7 @@ function Bo(e) {
|
|
|
15809
15809
|
};
|
|
15810
15810
|
}
|
|
15811
15811
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
15812
|
-
const on = BigInt(0),
|
|
15812
|
+
const on = BigInt(0), Nt = BigInt(1), Ii = /* @__PURE__ */ BigInt(2), B1 = /* @__PURE__ */ BigInt(3), I1 = /* @__PURE__ */ BigInt(4), O1 = /* @__PURE__ */ BigInt(5), k3 = /* @__PURE__ */ BigInt(7), P1 = /* @__PURE__ */ BigInt(8), N3 = /* @__PURE__ */ BigInt(9), k1 = /* @__PURE__ */ BigInt(16);
|
|
15813
15813
|
function dt(e, t) {
|
|
15814
15814
|
const n = e % t;
|
|
15815
15815
|
return n >= on ? n : t + n;
|
|
@@ -15825,12 +15825,12 @@ function kd(e, t) {
|
|
|
15825
15825
|
throw new Error("invert: expected non-zero number");
|
|
15826
15826
|
if (t <= on)
|
|
15827
15827
|
throw new Error("invert: expected positive modulus, got " + t);
|
|
15828
|
-
let n = dt(e, t), r = t, i = on, s =
|
|
15828
|
+
let n = dt(e, t), r = t, i = on, s = Nt;
|
|
15829
15829
|
for (; n !== on; ) {
|
|
15830
15830
|
const c = r / n, a = r % n, u = i - s * c;
|
|
15831
15831
|
r = n, n = a, i = s, s = u;
|
|
15832
15832
|
}
|
|
15833
|
-
if (r !==
|
|
15833
|
+
if (r !== Nt)
|
|
15834
15834
|
throw new Error("invert: does not exist");
|
|
15835
15835
|
return dt(i, t);
|
|
15836
15836
|
}
|
|
@@ -15839,7 +15839,7 @@ function Vl(e, t, n) {
|
|
|
15839
15839
|
throw new Error("Cannot find square root");
|
|
15840
15840
|
}
|
|
15841
15841
|
function N1(e, t) {
|
|
15842
|
-
const n = (e.ORDER +
|
|
15842
|
+
const n = (e.ORDER + Nt) / I1, r = e.pow(t, n);
|
|
15843
15843
|
return Vl(e, r, t), r;
|
|
15844
15844
|
}
|
|
15845
15845
|
function U3(e, t) {
|
|
@@ -15859,7 +15859,7 @@ function R3(e) {
|
|
|
15859
15859
|
function U1(e) {
|
|
15860
15860
|
if (e < B1)
|
|
15861
15861
|
throw new Error("sqrt is not defined for small field");
|
|
15862
|
-
let t = e -
|
|
15862
|
+
let t = e - Nt, n = 0;
|
|
15863
15863
|
for (; t % Ii === on; )
|
|
15864
15864
|
t /= Ii, n++;
|
|
15865
15865
|
let r = Ii;
|
|
@@ -15870,7 +15870,7 @@ function U1(e) {
|
|
|
15870
15870
|
if (n === 1)
|
|
15871
15871
|
return N1;
|
|
15872
15872
|
let s = i.pow(r, t);
|
|
15873
|
-
const o = (t +
|
|
15873
|
+
const o = (t + Nt) / Ii;
|
|
15874
15874
|
return function(a, u) {
|
|
15875
15875
|
if (a.is0(u))
|
|
15876
15876
|
return u;
|
|
@@ -15884,7 +15884,7 @@ function U1(e) {
|
|
|
15884
15884
|
for (; !a.eql(w, a.ONE); )
|
|
15885
15885
|
if (g++, w = a.sqr(w), g === f)
|
|
15886
15886
|
throw new Error("Cannot find square root");
|
|
15887
|
-
const E =
|
|
15887
|
+
const E = Nt << BigInt(f - g - 1), S = a.pow(l, E);
|
|
15888
15888
|
f = g, l = a.sqr(S), p = a.mul(p, l), y = a.mul(y, S);
|
|
15889
15889
|
}
|
|
15890
15890
|
return y;
|
|
@@ -15893,7 +15893,7 @@ function U1(e) {
|
|
|
15893
15893
|
function C3(e) {
|
|
15894
15894
|
return e % I1 === B1 ? N1 : e % P1 === O1 ? U3 : e % k1 === N3 ? R3(e) : U1(e);
|
|
15895
15895
|
}
|
|
15896
|
-
const H3 = (e, t) => (dt(e, t) &
|
|
15896
|
+
const H3 = (e, t) => (dt(e, t) & Nt) === Nt, F3 = [
|
|
15897
15897
|
"create",
|
|
15898
15898
|
"isValid",
|
|
15899
15899
|
"is0",
|
|
@@ -15926,11 +15926,11 @@ function Qa(e, t, n) {
|
|
|
15926
15926
|
throw new Error("invalid exponent, negatives unsupported");
|
|
15927
15927
|
if (n === on)
|
|
15928
15928
|
return e.ONE;
|
|
15929
|
-
if (n ===
|
|
15929
|
+
if (n === Nt)
|
|
15930
15930
|
return t;
|
|
15931
15931
|
let r = e.ONE, i = t;
|
|
15932
15932
|
for (; n > on; )
|
|
15933
|
-
n &
|
|
15933
|
+
n & Nt && (r = e.mul(r, i)), i = e.sqr(i), n >>= Nt;
|
|
15934
15934
|
return r;
|
|
15935
15935
|
}
|
|
15936
15936
|
function Gi(e, t, n = !1) {
|
|
@@ -15938,7 +15938,7 @@ function Gi(e, t, n = !1) {
|
|
|
15938
15938
|
return t.reduceRight((o, c, a) => e.is0(c) ? o : (r[a] = e.mul(o, r[a]), e.mul(o, c)), s), r;
|
|
15939
15939
|
}
|
|
15940
15940
|
function da(e, t) {
|
|
15941
|
-
const n = (e.ORDER -
|
|
15941
|
+
const n = (e.ORDER - Nt) / Ii, r = e.pow(t, n), i = e.eql(r, e.ONE), s = e.eql(r, e.ZERO), o = e.eql(r, e.neg(e.ONE));
|
|
15942
15942
|
if (!i && !s && !o)
|
|
15943
15943
|
throw new Error("invalid Legendre symbol result");
|
|
15944
15944
|
return i ? 1 : s ? 0 : -1;
|
|
@@ -15970,7 +15970,7 @@ function ci(e, t, n = !1, r = {}) {
|
|
|
15970
15970
|
BYTES: u,
|
|
15971
15971
|
MASK: Wi(a),
|
|
15972
15972
|
ZERO: on,
|
|
15973
|
-
ONE:
|
|
15973
|
+
ONE: Nt,
|
|
15974
15974
|
allowedLengths: c,
|
|
15975
15975
|
create: (p) => dt(p, e),
|
|
15976
15976
|
isValid: (p) => {
|
|
@@ -15981,7 +15981,7 @@ function ci(e, t, n = !1, r = {}) {
|
|
|
15981
15981
|
is0: (p) => p === on,
|
|
15982
15982
|
// is valid and invertible
|
|
15983
15983
|
isValidNot0: (p) => !l.is0(p) && l.isValid(p),
|
|
15984
|
-
isOdd: (p) => (p &
|
|
15984
|
+
isOdd: (p) => (p & Nt) === Nt,
|
|
15985
15985
|
neg: (p) => dt(-p, e),
|
|
15986
15986
|
eql: (p, y) => p === y,
|
|
15987
15987
|
sqr: (p) => dt(p * p, e),
|
|
@@ -15997,7 +15997,7 @@ function ci(e, t, n = !1, r = {}) {
|
|
|
15997
15997
|
mulN: (p, y) => p * y,
|
|
15998
15998
|
inv: (p) => kd(p, e),
|
|
15999
15999
|
sqrt: s || ((p) => (f || (f = C3(e)), f(l, p))),
|
|
16000
|
-
toBytes: (p) => n ? x1(p, u) :
|
|
16000
|
+
toBytes: (p) => n ? x1(p, u) : Ot(p, u),
|
|
16001
16001
|
fromBytes: (p, y = !0) => {
|
|
16002
16002
|
if (c) {
|
|
16003
16003
|
if (!c.includes(p.length) || p.length > u)
|
|
@@ -16034,8 +16034,8 @@ function q3(e, t, n = !1) {
|
|
|
16034
16034
|
const r = e.length, i = C1(t), s = H1(t);
|
|
16035
16035
|
if (r < 16 || r < s || r > 1024)
|
|
16036
16036
|
throw new Error("expected " + s + "-1024 bytes of input, got " + r);
|
|
16037
|
-
const o = n ? Ao(e) : Yn(e), c = dt(o, t -
|
|
16038
|
-
return n ? x1(c, i) :
|
|
16037
|
+
const o = n ? Ao(e) : Yn(e), c = dt(o, t - Nt) + Nt;
|
|
16038
|
+
return n ? x1(c, i) : Ot(c, i);
|
|
16039
16039
|
}
|
|
16040
16040
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16041
16041
|
const xs = BigInt(0), Oi = BigInt(1);
|
|
@@ -16360,12 +16360,12 @@ function X3(e, t, n) {
|
|
|
16360
16360
|
let u = e - c * r - a * s, f = -c * i - a * o;
|
|
16361
16361
|
const l = u < Pi, p = f < Pi;
|
|
16362
16362
|
l && (u = -u), p && (f = -f);
|
|
16363
|
-
const y = Wi(Math.ceil(vo(n) / 2)) +
|
|
16363
|
+
const y = Wi(Math.ceil(vo(n) / 2)) + Xt;
|
|
16364
16364
|
if (u < Pi || u >= y || f < Pi || f >= y)
|
|
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),
|
|
16368
|
+
const Pi = BigInt(0), Xt = BigInt(1), cr = BigInt(2), os = BigInt(3), Mf = BigInt(4);
|
|
16369
16369
|
function ya(e, t) {
|
|
16370
16370
|
const { BYTES: n } = e;
|
|
16371
16371
|
let r;
|
|
@@ -16621,7 +16621,7 @@ function z3(e, t = {}) {
|
|
|
16621
16621
|
throw new Error("invalid scalar: out of range");
|
|
16622
16622
|
if (H === Pi || N.is0())
|
|
16623
16623
|
return v.ZERO;
|
|
16624
|
-
if (H ===
|
|
16624
|
+
if (H === Xt)
|
|
16625
16625
|
return N;
|
|
16626
16626
|
if (V.hasCache(this))
|
|
16627
16627
|
return this.multiply(H);
|
|
@@ -16648,11 +16648,11 @@ function z3(e, t = {}) {
|
|
|
16648
16648
|
*/
|
|
16649
16649
|
isTorsionFree() {
|
|
16650
16650
|
const { isTorsionFree: H } = t;
|
|
16651
|
-
return o ===
|
|
16651
|
+
return o === Xt ? !0 : H ? H(v, this) : V.unsafe(this, c).is0();
|
|
16652
16652
|
}
|
|
16653
16653
|
clearCofactor() {
|
|
16654
16654
|
const { clearCofactor: H } = t;
|
|
16655
|
-
return o ===
|
|
16655
|
+
return o === Xt ? this : H ? H(v, this) : this.multiplyUnsafe(o);
|
|
16656
16656
|
}
|
|
16657
16657
|
isSmallOrder() {
|
|
16658
16658
|
return this.multiplyUnsafe(o).is0();
|
|
@@ -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 -
|
|
16706
|
-
r +=
|
|
16707
|
-
const i = r, s = cr << i -
|
|
16705
|
+
for (let g = n - Xt; g % cr === Pi; g /= cr)
|
|
16706
|
+
r += Xt;
|
|
16707
|
+
const i = r, s = cr << i - Xt - Xt, o = s * cr, c = (n - Xt) / o, a = (c - Xt) / cr, u = o - Xt, f = s, l = e.pow(t, c), p = e.pow(t, (c + Xt) / cr);
|
|
16708
16708
|
let y = (g, w) => {
|
|
16709
16709
|
let E = l, S = e.pow(w, u), _ = e.sqr(S);
|
|
16710
16710
|
_ = e.mul(_, w);
|
|
@@ -16714,9 +16714,9 @@ function Z3(e, t) {
|
|
|
16714
16714
|
m = e.pow(T, f);
|
|
16715
16715
|
let I = e.eql(m, e.ONE);
|
|
16716
16716
|
S = e.mul(_, p), m = e.mul(T, E), _ = e.cmov(S, _, I), T = e.cmov(m, T, I);
|
|
16717
|
-
for (let A = i; A >
|
|
16717
|
+
for (let A = i; A > Xt; A--) {
|
|
16718
16718
|
let U = A - cr;
|
|
16719
|
-
U = cr << U -
|
|
16719
|
+
U = cr << U - Xt;
|
|
16720
16720
|
let M = e.pow(T, U);
|
|
16721
16721
|
const v = e.eql(M, e.ONE);
|
|
16722
16722
|
S = e.mul(_, E), E = e.mul(E, E), M = e.mul(T, E), _ = e.cmov(S, _, v), T = e.cmov(M, T, v);
|
|
@@ -16807,7 +16807,7 @@ function eT(e, t, n) {
|
|
|
16807
16807
|
function tT(e, t) {
|
|
16808
16808
|
const { Fp: n, Fn: r } = t;
|
|
16809
16809
|
function i(o) {
|
|
16810
|
-
return A1(o,
|
|
16810
|
+
return A1(o, Xt, r.ORDER);
|
|
16811
16811
|
}
|
|
16812
16812
|
const s = eT(n, e.a, e.b);
|
|
16813
16813
|
return Object.assign({}, {
|
|
@@ -17086,7 +17086,7 @@ function sT(e) {
|
|
|
17086
17086
|
};
|
|
17087
17087
|
}
|
|
17088
17088
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
17089
|
-
const Vd = BigInt(0), pr = BigInt(1),
|
|
17089
|
+
const Vd = BigInt(0), pr = BigInt(1), Yt = 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++) {
|
|
@@ -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 - pr) / Ld), i = t.pow(n, (e.ORDER - pr) /
|
|
17103
|
+
const r = t.pow(n, (e.ORDER - pr) / Ld), i = t.pow(n, (e.ORDER - pr) / Yt);
|
|
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 **
|
|
17108
|
+
const o = t.pow(n, (e.ORDER ** Yt - pr) / Ld), c = t.pow(n, (e.ORDER ** Yt - pr) / Yt);
|
|
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) {
|
|
@@ -17127,7 +17127,7 @@ class cT {
|
|
|
17127
17127
|
constructor(t, n = {}) {
|
|
17128
17128
|
this.MASK = pr;
|
|
17129
17129
|
const r = t.ORDER, i = r * r;
|
|
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,
|
|
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, Yt), this.NONRESIDUE = $d(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
|
}
|
|
17132
17132
|
fromBigTuple(t) {
|
|
17133
17133
|
return $d(this.Fp, t);
|
|
@@ -17223,7 +17223,7 @@ class cT {
|
|
|
17223
17223
|
}
|
|
17224
17224
|
// Same as sgn0_m_eq_2 in RFC 9380
|
|
17225
17225
|
isOdd(t) {
|
|
17226
|
-
const { re: n, im: r } = this.reim(t), i = n %
|
|
17226
|
+
const { re: n, im: r } = this.reim(t), i = n % Yt, s = n === Vd, o = r % Yt;
|
|
17227
17227
|
return BigInt(i || s && o) == pr;
|
|
17228
17228
|
}
|
|
17229
17229
|
// Bytes util
|
|
@@ -17307,7 +17307,7 @@ class aT {
|
|
|
17307
17307
|
}
|
|
17308
17308
|
sqr({ c0: t, c1: n, c2: r }) {
|
|
17309
17309
|
const { Fp2: i } = this;
|
|
17310
|
-
let s = i.sqr(t), o = i.mul(i.mul(t, n),
|
|
17310
|
+
let s = i.sqr(t), o = i.mul(i.mul(t, n), Yt), c = i.mul(i.mul(n, r), Yt), a = i.sqr(r);
|
|
17311
17311
|
return {
|
|
17312
17312
|
c0: i.add(i.mulByNonresidue(c), s),
|
|
17313
17313
|
// T3 * (u + 1) + T0
|
|
@@ -17630,19 +17630,19 @@ class uT {
|
|
|
17630
17630
|
const { Fp6: r } = this, { Fp2: i } = r, { c0: s, c1: o, c2: c } = t, { c0: a, c1: u, c2: f } = n, { first: l, second: p } = i.Fp4Square(s, u), { first: y, second: g } = i.Fp4Square(a, c), { first: w, second: E } = i.Fp4Square(o, f), S = i.mulByNonresidue(E);
|
|
17631
17631
|
return {
|
|
17632
17632
|
c0: r.create({
|
|
17633
|
-
c0: i.add(i.mul(i.sub(l, s),
|
|
17633
|
+
c0: i.add(i.mul(i.sub(l, s), Yt), l),
|
|
17634
17634
|
// 2 * (T3 - c0c0) + T3
|
|
17635
|
-
c1: i.add(i.mul(i.sub(y, o),
|
|
17635
|
+
c1: i.add(i.mul(i.sub(y, o), Yt), y),
|
|
17636
17636
|
// 2 * (T5 - c0c1) + T5
|
|
17637
|
-
c2: i.add(i.mul(i.sub(w, c),
|
|
17637
|
+
c2: i.add(i.mul(i.sub(w, c), Yt), w)
|
|
17638
17638
|
}),
|
|
17639
17639
|
// 2 * (T7 - c0c2) + T7
|
|
17640
17640
|
c1: r.create({
|
|
17641
|
-
c0: i.add(i.mul(i.add(S, a),
|
|
17641
|
+
c0: i.add(i.mul(i.add(S, a), Yt), S),
|
|
17642
17642
|
// 2 * (T9 + c1c0) + T9
|
|
17643
|
-
c1: i.add(i.mul(i.add(p, u),
|
|
17643
|
+
c1: i.add(i.mul(i.add(p, u), Yt), p),
|
|
17644
17644
|
// 2 * (T4 + c1c1) + T4
|
|
17645
|
-
c2: i.add(i.mul(i.add(g, f),
|
|
17645
|
+
c2: i.add(i.mul(i.add(g, f), Yt), g)
|
|
17646
17646
|
})
|
|
17647
17647
|
};
|
|
17648
17648
|
}
|
|
@@ -17659,11 +17659,11 @@ function fT(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
|
|
17662
|
+
const qt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigInt(4), zr = BigInt("0xd201000000010000"), lT = vo(zr), Vi = {
|
|
17663
17663
|
p: BigInt("0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab"),
|
|
17664
17664
|
n: BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"),
|
|
17665
17665
|
h: BigInt("0x396c8c005555e1568c00aaab0000aaab"),
|
|
17666
|
-
a:
|
|
17666
|
+
a: qt,
|
|
17667
17667
|
b: Oo,
|
|
17668
17668
|
Gx: BigInt("0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb"),
|
|
17669
17669
|
Gy: BigInt("0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1")
|
|
@@ -17706,7 +17706,7 @@ const Mt = BigInt(0), ga = BigInt(1), An = BigInt(2), eu = BigInt(3), Oo = BigIn
|
|
|
17706
17706
|
BigInt("0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801"),
|
|
17707
17707
|
BigInt("0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be")
|
|
17708
17708
|
])
|
|
17709
|
-
}, tu = rc(me.toBytes(
|
|
17709
|
+
}, tu = rc(me.toBytes(qt), { infinity: !0, compressed: !0 });
|
|
17710
17710
|
function nu(e) {
|
|
17711
17711
|
e = e.slice();
|
|
17712
17712
|
const t = e[0] & 224, n = !!(t >> 7 & 1), r = !!(t >> 6 & 1), i = !!(t >> 5 & 1);
|
|
@@ -17723,9 +17723,9 @@ function yT(e, t, n) {
|
|
|
17723
17723
|
if (s)
|
|
17724
17724
|
return tu.slice();
|
|
17725
17725
|
const a = !!(c * An / i);
|
|
17726
|
-
return rc(
|
|
17726
|
+
return rc(Ot(o, r), { compressed: !0, sort: a });
|
|
17727
17727
|
} else
|
|
17728
|
-
return s ? Me(Uint8Array.of(64), new Uint8Array(2 * r - 1)) : Me(
|
|
17728
|
+
return s ? Me(Uint8Array.of(64), new Uint8Array(2 * r - 1)) : Me(Ot(o, r), Ot(c, r));
|
|
17729
17729
|
}
|
|
17730
17730
|
function ju(e) {
|
|
17731
17731
|
e.assertValidity();
|
|
@@ -17733,16 +17733,16 @@ function ju(e) {
|
|
|
17733
17733
|
if (e.is0())
|
|
17734
17734
|
return tu.slice();
|
|
17735
17735
|
const s = !!(i * An / n);
|
|
17736
|
-
return rc(
|
|
17736
|
+
return rc(Ot(r, t), { compressed: !0, sort: s });
|
|
17737
17737
|
}
|
|
17738
17738
|
function gT(e) {
|
|
17739
17739
|
const { compressed: t, infinity: n, sort: r, value: i } = nu(e), { BYTES: s, ORDER: o } = me;
|
|
17740
17740
|
if (i.length === 48 && t) {
|
|
17741
17741
|
const c = Yn(i), a = me.create(c & Wi(me.BITS));
|
|
17742
17742
|
if (n) {
|
|
17743
|
-
if (a !==
|
|
17743
|
+
if (a !== qt)
|
|
17744
17744
|
throw new Error("invalid G1 point: non-empty, at infinity, with compression");
|
|
17745
|
-
return { x:
|
|
17745
|
+
return { x: qt, y: qt };
|
|
17746
17746
|
}
|
|
17747
17747
|
const u = me.add(me.pow(a, eu), me.create(Vi.b));
|
|
17748
17748
|
let f = me.sqrt(u);
|
|
@@ -17752,7 +17752,7 @@ function gT(e) {
|
|
|
17752
17752
|
} else if (i.length === 96 && !t) {
|
|
17753
17753
|
const c = Yn(i.subarray(0, s)), a = Yn(i.subarray(s));
|
|
17754
17754
|
if (n) {
|
|
17755
|
-
if (c !==
|
|
17755
|
+
if (c !== qt || a !== qt)
|
|
17756
17756
|
throw new Error("G1: non-empty point at infinity");
|
|
17757
17757
|
return ru.G1.Point.ZERO.toAffine();
|
|
17758
17758
|
}
|
|
@@ -17777,23 +17777,23 @@ function wT(e, t, n) {
|
|
|
17777
17777
|
const { BYTES: r, ORDER: i } = me, s = t.is0(), { x: o, y: c } = t.toAffine();
|
|
17778
17778
|
if (n) {
|
|
17779
17779
|
if (s)
|
|
17780
|
-
return Me(tu,
|
|
17781
|
-
const a = !!(c.c1 ===
|
|
17782
|
-
return Me(rc(
|
|
17780
|
+
return Me(tu, Ot(qt, r));
|
|
17781
|
+
const a = !!(c.c1 === qt ? c.c0 * An / i : c.c1 * An / i);
|
|
17782
|
+
return Me(rc(Ot(o.c1, r), { compressed: !0, sort: a }), Ot(o.c0, r));
|
|
17783
17783
|
} else {
|
|
17784
17784
|
if (s)
|
|
17785
17785
|
return Me(Uint8Array.of(64), new Uint8Array(4 * r - 1));
|
|
17786
17786
|
const { re: a, im: u } = Pe.reim(o), { re: f, im: l } = Pe.reim(c);
|
|
17787
|
-
return Me(
|
|
17787
|
+
return Me(Ot(u, r), Ot(a, r), Ot(l, r), Ot(f, r));
|
|
17788
17788
|
}
|
|
17789
17789
|
}
|
|
17790
17790
|
function Wu(e) {
|
|
17791
17791
|
e.assertValidity();
|
|
17792
17792
|
const { BYTES: t } = me;
|
|
17793
17793
|
if (e.is0())
|
|
17794
|
-
return Me(tu,
|
|
17795
|
-
const { x: n, y: r } = e.toAffine(), { re: i, im: s } = Pe.reim(n), { re: o, im: c } = Pe.reim(r), u = !!((c >
|
|
17796
|
-
return Me(rc(
|
|
17794
|
+
return Me(tu, Ot(qt, t));
|
|
17795
|
+
const { x: n, y: r } = e.toAffine(), { re: i, im: s } = Pe.reim(n), { re: o, im: c } = Pe.reim(r), u = !!((c > qt ? c * An : o * An) / me.ORDER & ga), f = i;
|
|
17796
|
+
return Me(rc(Ot(s, t), { sort: u, compressed: !0 }), Ot(f, t));
|
|
17797
17797
|
}
|
|
17798
17798
|
function mT(e) {
|
|
17799
17799
|
const { BYTES: t, ORDER: n } = me, { compressed: r, infinity: i, sort: s, value: o } = nu(e);
|
|
@@ -17810,7 +17810,7 @@ function mT(e) {
|
|
|
17810
17810
|
}
|
|
17811
17811
|
const a = c(o, 0, t), u = c(o, t, 2 * t), f = Pe.create({ c0: me.create(u), c1: me.create(a) }), l = Pe.add(Pe.pow(f, eu), $l.b);
|
|
17812
17812
|
let p = Pe.sqrt(l);
|
|
17813
|
-
const y = p.c1 ===
|
|
17813
|
+
const y = p.c1 === qt ? p.c0 * An / n : p.c1 * An / n ? ga : qt;
|
|
17814
17814
|
return p = s && y > 0 ? p : Pe.neg(p), { x: f, y: p };
|
|
17815
17815
|
} else if (o.length === 192 && !r) {
|
|
17816
17816
|
if (i) {
|
|
@@ -17834,7 +17834,7 @@ function Wd(e) {
|
|
|
17834
17834
|
let y = Pe.sqrt(p);
|
|
17835
17835
|
if (!y)
|
|
17836
17836
|
throw new Error("Failed to find a square root");
|
|
17837
|
-
const { re: g, im: w } = Pe.reim(y), E = BigInt(r), S = w >
|
|
17837
|
+
const { re: g, im: w } = Pe.reim(y), E = BigInt(r), S = w > qt && w * An / t !== E, _ = w === qt && g * An / t !== E;
|
|
17838
17838
|
(S || _) && (y = Pe.neg(y));
|
|
17839
17839
|
const m = s.fromAffine({ x: l, y });
|
|
17840
17840
|
return m.assertValidity(), m;
|
|
@@ -18085,7 +18085,7 @@ const ru = sT({
|
|
|
18085
18085
|
B: me.create(BigInt("0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0")),
|
|
18086
18086
|
Z: me.create(BigInt(11))
|
|
18087
18087
|
}), ST = j1(Pe, {
|
|
18088
|
-
A: Pe.create({ c0: me.create(
|
|
18088
|
+
A: Pe.create({ c0: me.create(qt), c1: me.create(BigInt(240)) }),
|
|
18089
18089
|
// A' = 240 * I
|
|
18090
18090
|
B: Pe.create({ c0: me.create(BigInt(1012)), c1: me.create(BigInt(1012)) }),
|
|
18091
18091
|
// B' = 1012 * (1 + I)
|
|
@@ -18108,10 +18108,10 @@ const vT = BigInt(1e6), W1 = (e) => xt(new Ps(e)), Kl = (e) => {
|
|
|
18108
18108
|
const n = W1(e) / vT;
|
|
18109
18109
|
return new Date(Number(n));
|
|
18110
18110
|
}, Gd = 60 * 1e3, BT = 60, IT = 24, OT = IT * BT, PT = 5, kT = 5, NT = 30 * OT;
|
|
18111
|
-
var
|
|
18111
|
+
var Pt;
|
|
18112
18112
|
(function(e) {
|
|
18113
18113
|
e[e.Empty = 0] = "Empty", e[e.Fork = 1] = "Fork", e[e.Labeled = 2] = "Labeled", e[e.Leaf = 3] = "Leaf", e[e.Pruned = 4] = "Pruned";
|
|
18114
|
-
})(
|
|
18114
|
+
})(Pt || (Pt = {}));
|
|
18115
18115
|
function UT(e, t) {
|
|
18116
18116
|
for (let n = 0; n < e.length; n++)
|
|
18117
18117
|
if (e[n] > t[n])
|
|
@@ -18216,15 +18216,15 @@ function yn(e) {
|
|
|
18216
18216
|
}
|
|
18217
18217
|
async function Vc(e) {
|
|
18218
18218
|
switch (e[0]) {
|
|
18219
|
-
case
|
|
18219
|
+
case Pt.Empty:
|
|
18220
18220
|
return pn(so("ic-hashtree-empty"));
|
|
18221
|
-
case
|
|
18221
|
+
case Pt.Pruned:
|
|
18222
18222
|
return e[1];
|
|
18223
|
-
case
|
|
18223
|
+
case Pt.Leaf:
|
|
18224
18224
|
return pn(Me(so("ic-hashtree-leaf"), e[1]));
|
|
18225
|
-
case
|
|
18225
|
+
case Pt.Labeled:
|
|
18226
18226
|
return pn(Me(so("ic-hashtree-labeled"), e[1], await Vc(e[2])));
|
|
18227
|
-
case
|
|
18227
|
+
case Pt.Fork:
|
|
18228
18228
|
return pn(Me(so("ic-hashtree-fork"), await Vc(e[1]), await Vc(e[2])));
|
|
18229
18229
|
default:
|
|
18230
18230
|
throw hs;
|
|
@@ -18252,11 +18252,11 @@ var nt;
|
|
|
18252
18252
|
function ic(e, t) {
|
|
18253
18253
|
if (e.length === 0)
|
|
18254
18254
|
switch (t[0]) {
|
|
18255
|
-
case
|
|
18255
|
+
case Pt.Empty:
|
|
18256
18256
|
return {
|
|
18257
18257
|
status: En.Absent
|
|
18258
18258
|
};
|
|
18259
|
-
case
|
|
18259
|
+
case Pt.Leaf: {
|
|
18260
18260
|
if (!t[1])
|
|
18261
18261
|
throw rn.fromCode(new ec("Invalid tree structure for leaf"));
|
|
18262
18262
|
if (t[1] instanceof Uint8Array)
|
|
@@ -18266,12 +18266,12 @@ function ic(e, t) {
|
|
|
18266
18266
|
};
|
|
18267
18267
|
throw hs;
|
|
18268
18268
|
}
|
|
18269
|
-
case
|
|
18269
|
+
case Pt.Pruned:
|
|
18270
18270
|
return {
|
|
18271
18271
|
status: En.Unknown
|
|
18272
18272
|
};
|
|
18273
|
-
case
|
|
18274
|
-
case
|
|
18273
|
+
case Pt.Labeled:
|
|
18274
|
+
case Pt.Fork:
|
|
18275
18275
|
return {
|
|
18276
18276
|
status: En.Error
|
|
18277
18277
|
};
|
|
@@ -18322,9 +18322,9 @@ function jl(e, t) {
|
|
|
18322
18322
|
}
|
|
18323
18323
|
function qf(e) {
|
|
18324
18324
|
switch (e[0]) {
|
|
18325
|
-
case
|
|
18325
|
+
case Pt.Empty:
|
|
18326
18326
|
return [];
|
|
18327
|
-
case
|
|
18327
|
+
case Pt.Fork:
|
|
18328
18328
|
return qf(e[1]).concat(qf(e[2]));
|
|
18329
18329
|
default:
|
|
18330
18330
|
return [e];
|
|
@@ -18334,7 +18334,7 @@ function fo(e, t) {
|
|
|
18334
18334
|
switch (t[0]) {
|
|
18335
18335
|
// if we have a labelled node, compare the node's label to the one we are
|
|
18336
18336
|
// looking for
|
|
18337
|
-
case
|
|
18337
|
+
case Pt.Labeled:
|
|
18338
18338
|
return UT(e, t[1]) ? {
|
|
18339
18339
|
status: nt.Greater
|
|
18340
18340
|
} : Ja(e, t[1]) ? {
|
|
@@ -18344,7 +18344,7 @@ function fo(e, t) {
|
|
|
18344
18344
|
status: nt.Less
|
|
18345
18345
|
};
|
|
18346
18346
|
// if we have a fork node, we need to search both sides, starting with the left
|
|
18347
|
-
case
|
|
18347
|
+
case Pt.Fork: {
|
|
18348
18348
|
const n = fo(e, t[1]);
|
|
18349
18349
|
switch (n.status) {
|
|
18350
18350
|
// if the label we're searching for is greater than the left node lookup,
|
|
@@ -18373,7 +18373,7 @@ function fo(e, t) {
|
|
|
18373
18373
|
}
|
|
18374
18374
|
// if we encounter a Pruned node, we can't know for certain if the label
|
|
18375
18375
|
// we're searching for is present or not
|
|
18376
|
-
case
|
|
18376
|
+
case Pt.Pruned:
|
|
18377
18377
|
return {
|
|
18378
18378
|
status: nt.Unknown
|
|
18379
18379
|
};
|
|
@@ -18932,7 +18932,7 @@ const JT = ci(X1.p, { isLE: !0 }), QT = {
|
|
|
18932
18932
|
// Constant-time, u/√v
|
|
18933
18933
|
uvRatio: ZT
|
|
18934
18934
|
}, e8 = WT(QT);
|
|
18935
|
-
var Yd, Zd,
|
|
18935
|
+
var Yd, Zd, Bt, ws;
|
|
18936
18936
|
class t8 {
|
|
18937
18937
|
/**
|
|
18938
18938
|
* Create a new ExpirableMap.
|
|
@@ -18942,19 +18942,19 @@ class t8 {
|
|
|
18942
18942
|
*/
|
|
18943
18943
|
constructor(t = {}) {
|
|
18944
18944
|
// Internals
|
|
18945
|
-
|
|
18946
|
-
|
|
18945
|
+
Qt(this, Bt);
|
|
18946
|
+
Qt(this, ws);
|
|
18947
18947
|
this[Yd] = this.entries.bind(this), this[Zd] = "ExpirableMap";
|
|
18948
18948
|
const { source: n = [], expirationTime: r = 600 * 1e3 } = t, i = Date.now();
|
|
18949
|
-
|
|
18949
|
+
jt(this, Bt, new Map([...n].map(([s, o]) => [s, { value: o, timestamp: i }]))), jt(this, ws, r);
|
|
18950
18950
|
}
|
|
18951
18951
|
/**
|
|
18952
18952
|
* Prune removes all expired entries.
|
|
18953
18953
|
*/
|
|
18954
18954
|
prune() {
|
|
18955
18955
|
const t = Date.now();
|
|
18956
|
-
for (const [n, r] of Ue(this,
|
|
18957
|
-
t - r.timestamp > Ue(this, ws) && Ue(this,
|
|
18956
|
+
for (const [n, r] of Ue(this, Bt).entries())
|
|
18957
|
+
t - r.timestamp > Ue(this, ws) && Ue(this, Bt).delete(n);
|
|
18958
18958
|
return this;
|
|
18959
18959
|
}
|
|
18960
18960
|
// Implementing the Map interface
|
|
@@ -18970,7 +18970,7 @@ class t8 {
|
|
|
18970
18970
|
value: n,
|
|
18971
18971
|
timestamp: Date.now()
|
|
18972
18972
|
};
|
|
18973
|
-
return Ue(this,
|
|
18973
|
+
return Ue(this, Bt).set(t, r), this;
|
|
18974
18974
|
}
|
|
18975
18975
|
/**
|
|
18976
18976
|
* Get the value associated with the key, if it exists and has not expired.
|
|
@@ -18978,10 +18978,10 @@ class t8 {
|
|
|
18978
18978
|
* @returns the value associated with the key, or undefined if the key is not present or has expired.
|
|
18979
18979
|
*/
|
|
18980
18980
|
get(t) {
|
|
18981
|
-
const n = Ue(this,
|
|
18981
|
+
const n = Ue(this, Bt).get(t);
|
|
18982
18982
|
if (n !== void 0) {
|
|
18983
18983
|
if (Date.now() - n.timestamp > Ue(this, ws)) {
|
|
18984
|
-
Ue(this,
|
|
18984
|
+
Ue(this, Bt).delete(t);
|
|
18985
18985
|
return;
|
|
18986
18986
|
}
|
|
18987
18987
|
return n.value;
|
|
@@ -18991,14 +18991,14 @@ class t8 {
|
|
|
18991
18991
|
* Clear all entries.
|
|
18992
18992
|
*/
|
|
18993
18993
|
clear() {
|
|
18994
|
-
Ue(this,
|
|
18994
|
+
Ue(this, Bt).clear();
|
|
18995
18995
|
}
|
|
18996
18996
|
/**
|
|
18997
18997
|
* Entries returns the entries of the map, without the expiration time.
|
|
18998
18998
|
* @returns an iterator over the entries of the map.
|
|
18999
18999
|
*/
|
|
19000
19000
|
entries() {
|
|
19001
|
-
const t = Ue(this,
|
|
19001
|
+
const t = Ue(this, Bt).entries();
|
|
19002
19002
|
return function* () {
|
|
19003
19003
|
for (const [r, i] of t)
|
|
19004
19004
|
yield [r, i.value];
|
|
@@ -19009,7 +19009,7 @@ class t8 {
|
|
|
19009
19009
|
* @returns an iterator over the values of the map.
|
|
19010
19010
|
*/
|
|
19011
19011
|
values() {
|
|
19012
|
-
const t = Ue(this,
|
|
19012
|
+
const t = Ue(this, Bt).values();
|
|
19013
19013
|
return function* () {
|
|
19014
19014
|
for (const r of t)
|
|
19015
19015
|
yield r.value;
|
|
@@ -19020,7 +19020,7 @@ class t8 {
|
|
|
19020
19020
|
* @returns an iterator over the keys of the map.
|
|
19021
19021
|
*/
|
|
19022
19022
|
keys() {
|
|
19023
|
-
return Ue(this,
|
|
19023
|
+
return Ue(this, Bt).keys();
|
|
19024
19024
|
}
|
|
19025
19025
|
/**
|
|
19026
19026
|
* forEach calls the callbackfn on each entry of the map.
|
|
@@ -19028,7 +19028,7 @@ class t8 {
|
|
|
19028
19028
|
* @param thisArg to use as this when calling the callbackfn
|
|
19029
19029
|
*/
|
|
19030
19030
|
forEach(t, n) {
|
|
19031
|
-
for (const [r, i] of Ue(this,
|
|
19031
|
+
for (const [r, i] of Ue(this, Bt).entries())
|
|
19032
19032
|
t.call(n, i.value, r, this);
|
|
19033
19033
|
}
|
|
19034
19034
|
/**
|
|
@@ -19037,7 +19037,7 @@ class t8 {
|
|
|
19037
19037
|
* @returns true if the key exists and has not expired.
|
|
19038
19038
|
*/
|
|
19039
19039
|
has(t) {
|
|
19040
|
-
return Ue(this,
|
|
19040
|
+
return Ue(this, Bt).has(t);
|
|
19041
19041
|
}
|
|
19042
19042
|
/**
|
|
19043
19043
|
* delete the entry for the given key.
|
|
@@ -19045,17 +19045,17 @@ class t8 {
|
|
|
19045
19045
|
* @returns true if the key existed and has been deleted.
|
|
19046
19046
|
*/
|
|
19047
19047
|
delete(t) {
|
|
19048
|
-
return Ue(this,
|
|
19048
|
+
return Ue(this, Bt).delete(t);
|
|
19049
19049
|
}
|
|
19050
19050
|
/**
|
|
19051
19051
|
* get size of the map.
|
|
19052
19052
|
* @returns the size of the map.
|
|
19053
19053
|
*/
|
|
19054
19054
|
get size() {
|
|
19055
|
-
return Ue(this,
|
|
19055
|
+
return Ue(this, Bt).size;
|
|
19056
19056
|
}
|
|
19057
19057
|
}
|
|
19058
|
-
|
|
19058
|
+
Bt = new WeakMap(), ws = new WeakMap(), Yd = Symbol.iterator, Zd = Symbol.toStringTag;
|
|
19059
19059
|
const Jd = (e) => {
|
|
19060
19060
|
if (e <= 127)
|
|
19061
19061
|
return 1;
|
|
@@ -19207,11 +19207,11 @@ var ko, No;
|
|
|
19207
19207
|
const Ai = class Ai {
|
|
19208
19208
|
// `fromRaw` and `fromDer` should be used for instantiation, not this constructor.
|
|
19209
19209
|
constructor(t) {
|
|
19210
|
-
|
|
19211
|
-
|
|
19210
|
+
Qt(this, ko);
|
|
19211
|
+
Qt(this, No);
|
|
19212
19212
|
if (t.byteLength !== Ai.RAW_KEY_LENGTH)
|
|
19213
19213
|
throw Ye.fromCode(new Sr("An Ed25519 public key must be exactly 32 bytes long"));
|
|
19214
|
-
|
|
19214
|
+
jt(this, ko, t), jt(this, No, Ai.derEncode(t));
|
|
19215
19215
|
}
|
|
19216
19216
|
static from(t) {
|
|
19217
19217
|
return this.fromDer(t.toDer());
|
|
@@ -19278,17 +19278,17 @@ const t0 = 0.5, n0 = 1.5, r0 = 500, i0 = 6e4, s0 = 9e5, o0 = 10;
|
|
|
19278
19278
|
var Pn, Uo, Ro, Co, Ho, Fo, Mo, qo, ms;
|
|
19279
19279
|
const xa = class xa {
|
|
19280
19280
|
constructor(t = xa.default) {
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19281
|
+
Qt(this, Pn);
|
|
19282
|
+
Qt(this, Uo);
|
|
19283
|
+
Qt(this, Ro);
|
|
19284
|
+
Qt(this, Co);
|
|
19285
|
+
Qt(this, Ho);
|
|
19286
|
+
Qt(this, Fo);
|
|
19287
|
+
Qt(this, Mo);
|
|
19288
|
+
Qt(this, qo);
|
|
19289
|
+
Qt(this, ms, 0);
|
|
19290
19290
|
const { initialInterval: n = r0, randomizationFactor: r = t0, multiplier: i = n0, maxInterval: s = i0, maxElapsedTime: o = s0, maxIterations: c = o0, date: a = Date } = t;
|
|
19291
|
-
|
|
19291
|
+
jt(this, Pn, n), jt(this, Uo, r), jt(this, Ro, i), jt(this, Co, s), jt(this, qo, a), jt(this, Ho, a.now()), jt(this, Fo, o), jt(this, Mo, c);
|
|
19292
19292
|
}
|
|
19293
19293
|
get ellapsedTimeInMsec() {
|
|
19294
19294
|
return Ue(this, qo).now() - Ue(this, Ho);
|
|
@@ -19304,7 +19304,7 @@ const xa = class xa {
|
|
|
19304
19304
|
return Math.random() * (r - n) + n;
|
|
19305
19305
|
}
|
|
19306
19306
|
incrementCurrentInterval() {
|
|
19307
|
-
return
|
|
19307
|
+
return jt(this, Pn, Math.min(Ue(this, Pn) * Ue(this, Ro), Ue(this, Co))), sh(this, ms)._++, Ue(this, Pn);
|
|
19308
19308
|
}
|
|
19309
19309
|
next() {
|
|
19310
19310
|
return this.ellapsedTimeInMsec >= Ue(this, Fo) || Ue(this, ms) >= Ue(this, Mo) ? null : (this.incrementCurrentInterval(), this.randomValueFromInterval);
|
|
@@ -20249,7 +20249,7 @@ function P8(e, t, n, r) {
|
|
|
20249
20249
|
const s = (...o) => i({}, ...o);
|
|
20250
20250
|
return s.withOptions = (o) => (...c) => i(o, ...c), s;
|
|
20251
20251
|
}
|
|
20252
|
-
const
|
|
20252
|
+
const Dt = {
|
|
20253
20253
|
P2PKH: { P2PKH: null },
|
|
20254
20254
|
P2SH_P2WPKH: { P2SH_P2WPKH: null },
|
|
20255
20255
|
P2WPKH: { P2WPKH: null },
|
|
@@ -20258,7 +20258,7 @@ const Gt = {
|
|
|
20258
20258
|
P2TR: { P2TR: null },
|
|
20259
20259
|
UNKNOWN: { UNKNOWN: null }
|
|
20260
20260
|
};
|
|
20261
|
-
var hi = {}, je = {}, Yu = {},
|
|
20261
|
+
var hi = {}, je = {}, Yu = {}, Wt = {}, 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
|
/**
|
|
@@ -20937,7 +20937,7 @@ function R8() {
|
|
|
20937
20937
|
return u.compile = a, u.TfTypeError = r, u.TfPropertyTypeError = i, rf = u, rf;
|
|
20938
20938
|
}
|
|
20939
20939
|
var w0;
|
|
20940
|
-
function
|
|
20940
|
+
function Kt() {
|
|
20941
20941
|
return w0 || (w0 = 1, (function(e) {
|
|
20942
20942
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.oneOf = e.Null = e.BufferN = e.Function = e.UInt32 = e.UInt8 = e.tuple = e.maybe = e.Hex = e.Buffer = e.String = e.Boolean = e.Array = e.Number = e.Hash256bit = e.Hash160bit = e.Buffer256bit = e.isTaptree = e.isTapleaf = e.TAPLEAF_VERSION_MASK = e.Satoshi = e.isPoint = e.stacksEqual = e.typeforce = void 0;
|
|
20943
20943
|
const t = Vo();
|
|
@@ -20979,7 +20979,7 @@ var m0;
|
|
|
20979
20979
|
function C8() {
|
|
20980
20980
|
if (m0) return yi;
|
|
20981
20981
|
m0 = 1, Object.defineProperty(yi, "__esModule", { value: !0 }), yi.encode = yi.decode = void 0;
|
|
20982
|
-
const e = Q1(), t =
|
|
20982
|
+
const e = Q1(), t = Jt(), n = Kt(), { typeforce: r } = n, i = Buffer.alloc(1, 0);
|
|
20983
20983
|
function s(u) {
|
|
20984
20984
|
let f = 0;
|
|
20985
20985
|
for (; u[f] === 0; ) ++f;
|
|
@@ -21015,7 +21015,7 @@ function C8() {
|
|
|
21015
21015
|
return yi.encode = a, yi;
|
|
21016
21016
|
}
|
|
21017
21017
|
var b0;
|
|
21018
|
-
function
|
|
21018
|
+
function Jt() {
|
|
21019
21019
|
return b0 || (b0 = 1, (function(e) {
|
|
21020
21020
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.signature = e.number = e.isCanonicalScriptSignature = e.isDefinedHashType = e.isCanonicalPubKey = e.toStack = e.fromASM = e.toASM = e.decompile = e.compile = e.countNonPushOnlyOPs = e.isPushOnly = e.OPS = void 0;
|
|
21021
21021
|
const t = Q1(), n = Gl();
|
|
@@ -21025,7 +21025,7 @@ function Zt() {
|
|
|
21025
21025
|
return n.OPS;
|
|
21026
21026
|
}
|
|
21027
21027
|
});
|
|
21028
|
-
const r = k8(), i = N8(), s = C8(), o =
|
|
21028
|
+
const r = k8(), i = N8(), s = C8(), o = Kt(), { typeforce: c } = o, a = n.OPS.OP_RESERVED;
|
|
21029
21029
|
function u(v) {
|
|
21030
21030
|
return o.Number(v) && (v === n.OPS.OP_0 || v >= n.OPS.OP_1 && v <= n.OPS.OP_16 || v === n.OPS.OP_1NEGATE);
|
|
21031
21031
|
}
|
|
@@ -21166,7 +21166,7 @@ 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 =
|
|
21169
|
+
const e = Vn(), t = Jt(), n = Kt(), r = ai(), 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 =
|
|
21205
|
+
const e = Vn(), t = Jt(), n = Kt(), r = ai(), 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 =
|
|
21311
|
+
const e = Vn(), t = Jt(), n = Kt(), r = ai(), 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,10 +21359,10 @@ function M8() {
|
|
|
21359
21359
|
}
|
|
21360
21360
|
return Xs.p2pk = s, Xs;
|
|
21361
21361
|
}
|
|
21362
|
-
var zs = {}, sf = {}, wi = {},
|
|
21362
|
+
var zs = {}, sf = {}, wi = {}, Gt = {}, x0;
|
|
21363
21363
|
function tw() {
|
|
21364
|
-
if (x0) return
|
|
21365
|
-
x0 = 1, Object.defineProperty(
|
|
21364
|
+
if (x0) return Gt;
|
|
21365
|
+
x0 = 1, Object.defineProperty(Gt, "__esModule", { value: !0 }), Gt.ripemd160 = Gt.RIPEMD160 = Gt.md5 = Gt.MD5 = Gt.sha1 = Gt.SHA1 = void 0;
|
|
21366
21366
|
const e = /* @__PURE__ */ Lp(), t = /* @__PURE__ */ ti(), n = /* @__PURE__ */ Uint32Array.from([
|
|
21367
21367
|
1732584193,
|
|
21368
21368
|
4023233417,
|
|
@@ -21402,7 +21402,7 @@ function tw() {
|
|
|
21402
21402
|
this.set(0, 0, 0, 0, 0), (0, t.clean)(this.buffer);
|
|
21403
21403
|
}
|
|
21404
21404
|
}
|
|
21405
|
-
|
|
21405
|
+
Gt.SHA1 = i, Gt.sha1 = (0, t.createHasher)(() => new i());
|
|
21406
21406
|
const s = /* @__PURE__ */ Math.pow(2, 32), o = /* @__PURE__ */ Array.from({ length: 64 }, (M, v) => Math.floor(s * Math.abs(Math.sin(v + 1)))), c = /* @__PURE__ */ n.slice(0, 4), a = /* @__PURE__ */ new Uint32Array(16);
|
|
21407
21407
|
class u extends e.HashMD {
|
|
21408
21408
|
constructor() {
|
|
@@ -21432,7 +21432,7 @@ function tw() {
|
|
|
21432
21432
|
this.set(0, 0, 0, 0), (0, t.clean)(this.buffer);
|
|
21433
21433
|
}
|
|
21434
21434
|
}
|
|
21435
|
-
|
|
21435
|
+
Gt.MD5 = u, Gt.md5 = (0, t.createHasher)(() => new u());
|
|
21436
21436
|
const f = /* @__PURE__ */ Uint8Array.from([
|
|
21437
21437
|
7,
|
|
21438
21438
|
4,
|
|
@@ -21514,7 +21514,7 @@ function tw() {
|
|
|
21514
21514
|
this.destroyed = !0, (0, t.clean)(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
21515
21515
|
}
|
|
21516
21516
|
}
|
|
21517
|
-
return
|
|
21517
|
+
return Gt.RIPEMD160 = U, Gt.ripemd160 = (0, t.createHasher)(() => new U()), Gt;
|
|
21518
21518
|
}
|
|
21519
21519
|
var A0;
|
|
21520
21520
|
function q8() {
|
|
@@ -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 = xr(), t = Vn(), n =
|
|
22306
|
+
const e = xr(), t = Vn(), n = Jt(), r = Kt(), i = ai(), 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 = xr(), t = Vn(), n =
|
|
22406
|
+
const e = xr(), t = Vn(), n = Jt(), r = Kt(), i = ai(), 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 = xr(), t = Vn(), n =
|
|
22551
|
+
const e = xr(), t = Vn(), n = Jt(), r = Kt(), i = ai(), 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 = xr(), t = Vn(), n =
|
|
22655
|
+
const e = xr(), t = Vn(), n = Jt(), r = Kt(), i = ai(), 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
|
}
|
|
@@ -22933,7 +22933,7 @@ var V0;
|
|
|
22933
22933
|
function iu() {
|
|
22934
22934
|
if (V0) return At;
|
|
22935
22935
|
V0 = 1, Object.defineProperty(At, "__esModule", { value: !0 }), At.BufferReader = At.BufferWriter = At.cloneBuffer = At.reverseBuffer = At.writeUInt64LE = At.readUInt64LE = At.varuint = void 0;
|
|
22936
|
-
const e =
|
|
22936
|
+
const e = Kt(), { typeforce: t } = e, n = z8();
|
|
22937
22937
|
At.varuint = n;
|
|
22938
22938
|
function r(f, l) {
|
|
22939
22939
|
if (typeof f != "number")
|
|
@@ -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 = xr(), i = iu(), s =
|
|
23055
|
+
const t = Vo(), n = zl(), r = xr(), 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 $0;
|
|
|
23132
23132
|
function Y8() {
|
|
23133
23133
|
if ($0) return Qs;
|
|
23134
23134
|
$0 = 1, Object.defineProperty(Qs, "__esModule", { value: !0 }), Qs.p2tr = void 0;
|
|
23135
|
-
const e = Vo(), t = Vn(), n =
|
|
23135
|
+
const e = Vo(), t = Vn(), n = Jt(), r = Kt(), i = zl(), s = Yl(), o = ai(), 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");
|
|
@@ -23397,9 +23397,9 @@ function sc() {
|
|
|
23397
23397
|
}
|
|
23398
23398
|
var j0;
|
|
23399
23399
|
function Zl() {
|
|
23400
|
-
if (j0) return
|
|
23401
|
-
j0 = 1, Object.defineProperty(
|
|
23402
|
-
const e = Vn(), t = sc(), n =
|
|
23400
|
+
if (j0) return Wt;
|
|
23401
|
+
j0 = 1, Object.defineProperty(Wt, "__esModule", { value: !0 }), Wt.toOutputScript = Wt.fromOutputScript = Wt.toBech32 = Wt.toBase58Check = Wt.fromBech32 = Wt.fromBase58Check = void 0;
|
|
23402
|
+
const e = Vn(), t = sc(), n = Jt(), r = Kt(), i = Do(), s = Xl(), o = 40, c = 2, a = 16, u = 2, f = 80, l = "WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";
|
|
23403
23403
|
function p(m, T) {
|
|
23404
23404
|
const I = m.slice(2);
|
|
23405
23405
|
if (I.length < c || I.length > o)
|
|
@@ -23418,7 +23418,7 @@ function Zl() {
|
|
|
23418
23418
|
const I = T.readUInt8(0), A = T.slice(1);
|
|
23419
23419
|
return { version: I, hash: A };
|
|
23420
23420
|
}
|
|
23421
|
-
|
|
23421
|
+
Wt.fromBase58Check = y;
|
|
23422
23422
|
function g(m) {
|
|
23423
23423
|
let T, I;
|
|
23424
23424
|
try {
|
|
@@ -23435,7 +23435,7 @@ function Zl() {
|
|
|
23435
23435
|
data: Buffer.from(A)
|
|
23436
23436
|
};
|
|
23437
23437
|
}
|
|
23438
|
-
|
|
23438
|
+
Wt.fromBech32 = g;
|
|
23439
23439
|
function w(m, T) {
|
|
23440
23440
|
(0, r.typeforce)(
|
|
23441
23441
|
(0, r.tuple)(r.Hash160bit, r.UInt8),
|
|
@@ -23444,12 +23444,12 @@ function Zl() {
|
|
|
23444
23444
|
const I = Buffer.allocUnsafe(21);
|
|
23445
23445
|
return I.writeUInt8(T, 0), m.copy(I, 1), s.encode(I);
|
|
23446
23446
|
}
|
|
23447
|
-
|
|
23447
|
+
Wt.toBase58Check = w;
|
|
23448
23448
|
function E(m, T, I) {
|
|
23449
23449
|
const A = i.bech32.toWords(m);
|
|
23450
23450
|
return A.unshift(T), T === 0 ? i.bech32.encode(I, A) : i.bech32m.encode(I, A);
|
|
23451
23451
|
}
|
|
23452
|
-
|
|
23452
|
+
Wt.toBech32 = E;
|
|
23453
23453
|
function S(m, T) {
|
|
23454
23454
|
T = T || e.bitcoin;
|
|
23455
23455
|
try {
|
|
@@ -23478,7 +23478,7 @@ function Zl() {
|
|
|
23478
23478
|
}
|
|
23479
23479
|
throw new Error(n.toASM(m) + " has no matching Address");
|
|
23480
23480
|
}
|
|
23481
|
-
|
|
23481
|
+
Wt.fromOutputScript = S;
|
|
23482
23482
|
function _(m, T) {
|
|
23483
23483
|
T = T || e.bitcoin;
|
|
23484
23484
|
let I, A;
|
|
@@ -23516,7 +23516,7 @@ function Zl() {
|
|
|
23516
23516
|
}
|
|
23517
23517
|
throw new Error(m + " has no matching Script");
|
|
23518
23518
|
}
|
|
23519
|
-
return
|
|
23519
|
+
return Wt.toOutputScript = _, Wt;
|
|
23520
23520
|
}
|
|
23521
23521
|
var eo = {}, to = {}, W0;
|
|
23522
23522
|
function Z8() {
|
|
@@ -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 = xr(), n =
|
|
23547
|
+
const e = iu(), t = xr(), n = Jt(), r = Jt(), i = Kt(), { typeforce: s } = i;
|
|
23548
23548
|
function o(E) {
|
|
23549
23549
|
const S = E.length;
|
|
23550
23550
|
return e.varuint.encodingLength(S) + S;
|
|
@@ -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 = xr(), n = Z8(), r = oc(), i =
|
|
23837
|
+
const e = iu(), t = xr(), 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"
|
|
@@ -23964,7 +23964,7 @@ function J8() {
|
|
|
23964
23964
|
return eo;
|
|
23965
23965
|
}
|
|
23966
23966
|
var ro = {}, Tc = {}, xc = {}, hf = {}, Qi = {}, es = {}, df = {}, X0;
|
|
23967
|
-
function
|
|
23967
|
+
function Ut() {
|
|
23968
23968
|
return X0 || (X0 = 1, (function(e) {
|
|
23969
23969
|
Object.defineProperty(e, "__esModule", { value: !0 }), (function(t) {
|
|
23970
23970
|
t[t.UNSIGNED_TX = 0] = "UNSIGNED_TX", t[t.GLOBAL_XPUB = 1] = "GLOBAL_XPUB";
|
|
@@ -24003,7 +24003,7 @@ var Nr = {}, z0;
|
|
|
24003
24003
|
function Q8() {
|
|
24004
24004
|
if (z0) return Nr;
|
|
24005
24005
|
z0 = 1, Object.defineProperty(Nr, "__esModule", { value: !0 });
|
|
24006
|
-
const e =
|
|
24006
|
+
const e = Ut(), t = (o) => [...Array(o).keys()];
|
|
24007
24007
|
function n(o) {
|
|
24008
24008
|
if (o.key[0] !== e.GlobalTypes.GLOBAL_XPUB)
|
|
24009
24009
|
throw new Error(
|
|
@@ -24058,7 +24058,7 @@ var Ac = {}, Y0;
|
|
|
24058
24058
|
function ex() {
|
|
24059
24059
|
if (Y0) return Ac;
|
|
24060
24060
|
Y0 = 1, Object.defineProperty(Ac, "__esModule", { value: !0 });
|
|
24061
|
-
const e =
|
|
24061
|
+
const e = Ut();
|
|
24062
24062
|
function t(n) {
|
|
24063
24063
|
return {
|
|
24064
24064
|
key: Buffer.from([e.GlobalTypes.UNSIGNED_TX]),
|
|
@@ -24071,7 +24071,7 @@ var Ur = {}, Z0;
|
|
|
24071
24071
|
function tx() {
|
|
24072
24072
|
if (Z0) return Ur;
|
|
24073
24073
|
Z0 = 1, Object.defineProperty(Ur, "__esModule", { value: !0 });
|
|
24074
|
-
const e =
|
|
24074
|
+
const e = Ut();
|
|
24075
24075
|
function t(s) {
|
|
24076
24076
|
if (s.key[0] !== e.InputTypes.FINAL_SCRIPTSIG)
|
|
24077
24077
|
throw new Error(
|
|
@@ -24100,7 +24100,7 @@ var Rr = {}, J0;
|
|
|
24100
24100
|
function nx() {
|
|
24101
24101
|
if (J0) return Rr;
|
|
24102
24102
|
J0 = 1, Object.defineProperty(Rr, "__esModule", { value: !0 });
|
|
24103
|
-
const e =
|
|
24103
|
+
const e = Ut();
|
|
24104
24104
|
function t(s) {
|
|
24105
24105
|
if (s.key[0] !== e.InputTypes.FINAL_SCRIPTWITNESS)
|
|
24106
24106
|
throw new Error(
|
|
@@ -24129,7 +24129,7 @@ var Cr = {}, Q0;
|
|
|
24129
24129
|
function rx() {
|
|
24130
24130
|
if (Q0) return Cr;
|
|
24131
24131
|
Q0 = 1, Object.defineProperty(Cr, "__esModule", { value: !0 });
|
|
24132
|
-
const e =
|
|
24132
|
+
const e = Ut();
|
|
24133
24133
|
function t(s) {
|
|
24134
24134
|
if (s.key[0] !== e.InputTypes.NON_WITNESS_UTXO)
|
|
24135
24135
|
throw new Error(
|
|
@@ -24158,7 +24158,7 @@ var Hr = {}, ep;
|
|
|
24158
24158
|
function ix() {
|
|
24159
24159
|
if (ep) return Hr;
|
|
24160
24160
|
ep = 1, Object.defineProperty(Hr, "__esModule", { value: !0 });
|
|
24161
|
-
const e =
|
|
24161
|
+
const e = Ut();
|
|
24162
24162
|
function t(o) {
|
|
24163
24163
|
if (o.key[0] !== e.InputTypes.PARTIAL_SIG)
|
|
24164
24164
|
throw new Error(
|
|
@@ -24203,7 +24203,7 @@ var Fr = {}, tp;
|
|
|
24203
24203
|
function sx() {
|
|
24204
24204
|
if (tp) return Fr;
|
|
24205
24205
|
tp = 1, Object.defineProperty(Fr, "__esModule", { value: !0 });
|
|
24206
|
-
const e =
|
|
24206
|
+
const e = Ut();
|
|
24207
24207
|
function t(s) {
|
|
24208
24208
|
if (s.key[0] !== e.InputTypes.POR_COMMITMENT)
|
|
24209
24209
|
throw new Error(
|
|
@@ -24232,7 +24232,7 @@ var Mr = {}, np;
|
|
|
24232
24232
|
function ox() {
|
|
24233
24233
|
if (np) return Mr;
|
|
24234
24234
|
np = 1, Object.defineProperty(Mr, "__esModule", { value: !0 });
|
|
24235
|
-
const e =
|
|
24235
|
+
const e = Ut();
|
|
24236
24236
|
function t(s) {
|
|
24237
24237
|
if (s.key[0] !== e.InputTypes.SIGHASH_TYPE)
|
|
24238
24238
|
throw new Error(
|
|
@@ -24262,7 +24262,7 @@ var qr = {}, rp;
|
|
|
24262
24262
|
function cx() {
|
|
24263
24263
|
if (rp) return qr;
|
|
24264
24264
|
rp = 1, Object.defineProperty(qr, "__esModule", { value: !0 });
|
|
24265
|
-
const e =
|
|
24265
|
+
const e = Ut();
|
|
24266
24266
|
function t(s) {
|
|
24267
24267
|
if (s.key[0] !== e.InputTypes.TAP_KEY_SIG || s.key.length !== 1)
|
|
24268
24268
|
throw new Error(
|
|
@@ -24292,7 +24292,7 @@ var Vr = {}, ip;
|
|
|
24292
24292
|
function ax() {
|
|
24293
24293
|
if (ip) return Vr;
|
|
24294
24294
|
ip = 1, Object.defineProperty(Vr, "__esModule", { value: !0 });
|
|
24295
|
-
const e =
|
|
24295
|
+
const e = Ut();
|
|
24296
24296
|
function t(s) {
|
|
24297
24297
|
if (s.key[0] !== e.InputTypes.TAP_LEAF_SCRIPT)
|
|
24298
24298
|
throw new Error(
|
|
@@ -24333,7 +24333,7 @@ var Lr = {}, sp;
|
|
|
24333
24333
|
function ux() {
|
|
24334
24334
|
if (sp) return Lr;
|
|
24335
24335
|
sp = 1, Object.defineProperty(Lr, "__esModule", { value: !0 });
|
|
24336
|
-
const e =
|
|
24336
|
+
const e = Ut();
|
|
24337
24337
|
function t(s) {
|
|
24338
24338
|
if (s.key[0] !== e.InputTypes.TAP_MERKLE_ROOT || s.key.length !== 1)
|
|
24339
24339
|
throw new Error(
|
|
@@ -24361,7 +24361,7 @@ var $r = {}, op;
|
|
|
24361
24361
|
function fx() {
|
|
24362
24362
|
if (op) return $r;
|
|
24363
24363
|
op = 1, Object.defineProperty($r, "__esModule", { value: !0 });
|
|
24364
|
-
const e =
|
|
24364
|
+
const e = Ut();
|
|
24365
24365
|
function t(s) {
|
|
24366
24366
|
if (s.key[0] !== e.InputTypes.TAP_SCRIPT_SIG)
|
|
24367
24367
|
throw new Error(
|
|
@@ -24491,7 +24491,7 @@ var up;
|
|
|
24491
24491
|
function lx() {
|
|
24492
24492
|
if (up) return Kr;
|
|
24493
24493
|
up = 1, Object.defineProperty(Kr, "__esModule", { value: !0 });
|
|
24494
|
-
const e =
|
|
24494
|
+
const e = Ut(), t = Jl(), n = Di();
|
|
24495
24495
|
function r(c) {
|
|
24496
24496
|
if (c.key[0] !== e.InputTypes.WITNESS_UTXO)
|
|
24497
24497
|
throw new Error(
|
|
@@ -24531,7 +24531,7 @@ var jr = {}, fp;
|
|
|
24531
24531
|
function hx() {
|
|
24532
24532
|
if (fp) return jr;
|
|
24533
24533
|
fp = 1, Object.defineProperty(jr, "__esModule", { value: !0 });
|
|
24534
|
-
const e =
|
|
24534
|
+
const e = Ut(), t = Di();
|
|
24535
24535
|
function n(o) {
|
|
24536
24536
|
if (o.key[0] !== e.OutputTypes.TAP_TREE || o.key.length !== 1)
|
|
24537
24537
|
throw new Error(
|
|
@@ -24802,7 +24802,7 @@ var wp;
|
|
|
24802
24802
|
function Ql() {
|
|
24803
24803
|
if (wp) return es;
|
|
24804
24804
|
wp = 1, Object.defineProperty(es, "__esModule", { value: !0 });
|
|
24805
|
-
const e =
|
|
24805
|
+
const e = Ut(), t = Q8(), n = ex(), r = tx(), i = nx(), s = rx(), o = ix(), c = sx(), a = ox(), u = cx(), f = ax(), l = ux(), p = fx(), y = lx(), g = hx(), w = rw(), E = dx(), S = px(), _ = yx(), m = gx(), T = wx(), I = {
|
|
24806
24806
|
unsignedTx: n,
|
|
24807
24807
|
globalXpub: t,
|
|
24808
24808
|
// pass an Array of key bytes that require pubkey beside the key
|
|
@@ -24869,7 +24869,7 @@ var mp;
|
|
|
24869
24869
|
function mx() {
|
|
24870
24870
|
if (mp) return Qi;
|
|
24871
24871
|
mp = 1, Object.defineProperty(Qi, "__esModule", { value: !0 });
|
|
24872
|
-
const e = Ql(), t = Jl(), n = Di(), r =
|
|
24872
|
+
const e = Ql(), t = Jl(), n = Di(), r = Ut();
|
|
24873
24873
|
function i(c, a) {
|
|
24874
24874
|
let u = 0;
|
|
24875
24875
|
function f() {
|
|
@@ -25381,7 +25381,7 @@ var Tp;
|
|
|
25381
25381
|
function _x() {
|
|
25382
25382
|
if (Tp) return Tc;
|
|
25383
25383
|
Tp = 1, Object.defineProperty(Tc, "__esModule", { value: !0 });
|
|
25384
|
-
const e = Ex(), t = iw(), n =
|
|
25384
|
+
const e = Ex(), t = iw(), n = Ut(), r = sw();
|
|
25385
25385
|
class i {
|
|
25386
25386
|
constructor(o) {
|
|
25387
25387
|
this.inputs = [], this.outputs = [], this.globalMap = {
|
|
@@ -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 =
|
|
25495
|
+
const e = Di(), t = Jt(), n = oc(), r = xr(), i = sc();
|
|
25496
25496
|
function s(y) {
|
|
25497
25497
|
return (g) => {
|
|
25498
25498
|
try {
|
|
@@ -25569,7 +25569,7 @@ var Ap;
|
|
|
25569
25569
|
function Sx() {
|
|
25570
25570
|
if (Ap) return ze;
|
|
25571
25571
|
Ap = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.checkTaprootInputForSigs = ze.tapTreeFromList = ze.tapTreeToList = ze.tweakInternalPubKey = ze.checkTaprootOutputFields = ze.checkTaprootInputFields = ze.isTaprootOutput = ze.isTaprootInput = ze.serializeTaprootSignature = ze.tapScriptFinalizer = ze.toXOnly = void 0;
|
|
25572
|
-
const e =
|
|
25572
|
+
const e = Kt(), t = oc(), n = Wf(), r = Yl(), i = sc(), s = Wf(), o = (x) => x.length === 32 ? x : x.slice(1, 33);
|
|
25573
25573
|
ze.toXOnly = o;
|
|
25574
25574
|
function c(x, O, q) {
|
|
25575
25575
|
const P = N(
|
|
@@ -25793,7 +25793,7 @@ var vp;
|
|
|
25793
25793
|
function Tx() {
|
|
25794
25794
|
if (vp) return ro;
|
|
25795
25795
|
vp = 1, Object.defineProperty(ro, "__esModule", { value: !0 }), ro.Psbt = void 0;
|
|
25796
|
-
const e = _x(), t = Di(), n = sw(), r = Zl(), i = iu(), s = Vn(), o = sc(), c = Yl(), a =
|
|
25796
|
+
const e = _x(), t = Di(), n = sw(), r = Zl(), i = iu(), s = Vn(), o = sc(), c = Yl(), a = Jt(), u = oc(), f = Sx(), l = Wf(), p = {
|
|
25797
25797
|
/**
|
|
25798
25798
|
* A bitcoinjs Network object. This is only used if you pass an `address`
|
|
25799
25799
|
* parameter to addOutput. Otherwise it is not needed and can be left default.
|
|
@@ -27004,7 +27004,7 @@ function xx() {
|
|
|
27004
27004
|
e.networks = r;
|
|
27005
27005
|
const i = sc();
|
|
27006
27006
|
e.payments = i;
|
|
27007
|
-
const s =
|
|
27007
|
+
const s = Jt();
|
|
27008
27008
|
e.script = s;
|
|
27009
27009
|
var o = J8();
|
|
27010
27010
|
Object.defineProperty(e, "Block", {
|
|
@@ -27707,18 +27707,18 @@ function ba(e, t = Fa.Testnet) {
|
|
|
27707
27707
|
}
|
|
27708
27708
|
function Zr(e) {
|
|
27709
27709
|
const t = vn, n = Wp, r = Mw;
|
|
27710
|
-
let i, s, o =
|
|
27710
|
+
let i, s, o = Dt.UNKNOWN;
|
|
27711
27711
|
if (e.startsWith("bc1") || e.startsWith("tb1") || e.startsWith("bcrt1"))
|
|
27712
27712
|
try {
|
|
27713
|
-
return s = il(e), s.version === 0 ? s.data.length === 20 ? o =
|
|
27713
|
+
return s = il(e), s.version === 0 ? s.data.length === 20 ? o = Dt.P2WPKH : o = Dt.P2WSH : o = Dt.P2TR, o;
|
|
27714
27714
|
} catch {
|
|
27715
|
-
return
|
|
27715
|
+
return Dt.UNKNOWN;
|
|
27716
27716
|
}
|
|
27717
27717
|
else
|
|
27718
27718
|
try {
|
|
27719
|
-
return i = Ny(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o =
|
|
27719
|
+
return i = Ny(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o = Dt.P2PKH : (i.version === t.scriptHash || (i.version, n.scriptHash), o = Dt.P2SH_P2WPKH), o;
|
|
27720
27720
|
} catch {
|
|
27721
|
-
return
|
|
27721
|
+
return Dt.UNKNOWN;
|
|
27722
27722
|
}
|
|
27723
27723
|
}
|
|
27724
27724
|
function Px(e, t, n) {
|
|
@@ -27758,7 +27758,7 @@ const Y6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
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", Wr = BigInt(546),
|
|
27761
|
+
}, Symbol.toStringTag, { value: "Module" })), kx = "kqs64-paaaa-aaaar-qamza-cai", Nx = "hvyp5-5yaaa-aaaao-qjxha-cai", Wr = BigInt(546), vt = "0:0", Cp = {
|
|
27762
27762
|
P2PKH: 148,
|
|
27763
27763
|
P2SH_P2WPKH: 91,
|
|
27764
27764
|
P2WPKH: 68,
|
|
@@ -27807,7 +27807,7 @@ class xi {
|
|
|
27807
27807
|
) >= 0)
|
|
27808
27808
|
return;
|
|
27809
27809
|
const { address: n } = t;
|
|
27810
|
-
if (Zr(n) ===
|
|
27810
|
+
if (Zr(n) === Dt.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;
|
|
@@ -28007,18 +28007,18 @@ class xi {
|
|
|
28007
28007
|
for (const s of this.intentions) {
|
|
28008
28008
|
for (const a of s.inputCoins) {
|
|
28009
28009
|
const u = i(a.from);
|
|
28010
|
-
a.coin.id ===
|
|
28010
|
+
a.coin.id === vt ? u.needBtc = !0 : u.runeIds.add(a.coin.id);
|
|
28011
28011
|
}
|
|
28012
28012
|
for (const a of s.outputCoins) {
|
|
28013
28013
|
const u = i(a.to);
|
|
28014
|
-
a.coin.id ===
|
|
28014
|
+
a.coin.id === vt ? u.needBtc = !0 : u.runeIds.add(a.coin.id);
|
|
28015
28015
|
}
|
|
28016
28016
|
const o = i(s.poolAddress), c = [
|
|
28017
28017
|
...s.inputCoins.map((a) => a.coin.id),
|
|
28018
28018
|
...s.outputCoins.map((a) => a.coin.id)
|
|
28019
28019
|
];
|
|
28020
28020
|
for (const a of c)
|
|
28021
|
-
a ===
|
|
28021
|
+
a === vt ? o.needBtc = !0 : o.runeIds.add(a);
|
|
28022
28022
|
}
|
|
28023
28023
|
return await Promise.all(
|
|
28024
28024
|
Array.from(r.entries()).map(async ([s, o]) => {
|
|
@@ -28112,7 +28112,7 @@ class xi {
|
|
|
28112
28112
|
i[a] ??= {};
|
|
28113
28113
|
const f = i[a];
|
|
28114
28114
|
u.forEach((l) => {
|
|
28115
|
-
this.addInput(l), f[
|
|
28115
|
+
this.addInput(l), f[vt] = (f[vt] ?? BigInt(0)) + BigInt(l.satoshis), l.runes.forEach((p) => {
|
|
28116
28116
|
f[p.id] = (f[p.id] ?? BigInt(0)) + BigInt(p.amount);
|
|
28117
28117
|
});
|
|
28118
28118
|
});
|
|
@@ -28121,7 +28121,7 @@ class xi {
|
|
|
28121
28121
|
r
|
|
28122
28122
|
))
|
|
28123
28123
|
for (const [f, l] of Object.entries(u))
|
|
28124
|
-
if (f ===
|
|
28124
|
+
if (f === vt) {
|
|
28125
28125
|
if (a === this.config.paymentAddress) {
|
|
28126
28126
|
s += l;
|
|
28127
28127
|
continue;
|
|
@@ -28153,33 +28153,41 @@ class xi {
|
|
|
28153
28153
|
), E = g - l;
|
|
28154
28154
|
if (n.includes(a)) {
|
|
28155
28155
|
i[a] ??= {};
|
|
28156
|
-
const S = i[a], _ = (r[a]?.[
|
|
28157
|
-
w > BigInt(0) && !_ && (S[
|
|
28156
|
+
const S = i[a], _ = (r[a]?.[vt] ?? BigInt(0)) > BigInt(0);
|
|
28157
|
+
w > BigInt(0) && !_ && (S[vt] = (S[vt] ?? BigInt(0)) + w), E > BigInt(0) && (S[f] = (S[f] ?? BigInt(0)) + E);
|
|
28158
28158
|
} else E > BigInt(0) && (i[a] ??= {}, i[a][f] = (i[a][f] ?? BigInt(0)) + E);
|
|
28159
28159
|
y.forEach((S) => this.addInput(S));
|
|
28160
28160
|
}
|
|
28161
28161
|
for (const [a, u] of Object.entries(
|
|
28162
28162
|
i
|
|
28163
|
-
))
|
|
28164
|
-
if (
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
|
|
28173
|
-
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
|
|
28163
|
+
)) {
|
|
28164
|
+
if (r[a] || !n.includes(a) || c.has(a))
|
|
28165
|
+
continue;
|
|
28166
|
+
const f = /* @__PURE__ */ new Set();
|
|
28167
|
+
if (u[vt] !== void 0) {
|
|
28168
|
+
const l = t.btc[a] || [], p = l.reduce(
|
|
28169
|
+
(y, g) => y + BigInt(g.satoshis),
|
|
28170
|
+
BigInt(0)
|
|
28171
|
+
);
|
|
28172
|
+
i[a] ??= {}, i[a][vt] = (i[a][vt] ?? BigInt(0)) + p, l.forEach((y) => {
|
|
28173
|
+
this.addInput(y), f.add(`${y.txid}:${y.vout}`), y.runes.forEach((g) => {
|
|
28174
|
+
i[a] ??= {}, i[a][g.id] = (i[a][g.id] ?? BigInt(0)) + BigInt(g.amount);
|
|
28175
|
+
});
|
|
28176
|
+
});
|
|
28177
|
+
}
|
|
28178
|
+
for (const [l] of Object.entries(u)) {
|
|
28179
|
+
if (l === vt) continue;
|
|
28180
|
+
const y = (t.rune[a]?.[l] || []).filter(
|
|
28181
|
+
(w) => !f.has(`${w.txid}:${w.vout}`)
|
|
28182
|
+
), g = y.reduce((w, E) => {
|
|
28183
|
+
const S = E.runes.find((_) => _.id === l);
|
|
28184
|
+
return w + BigInt(S?.amount ?? 0);
|
|
28185
|
+
}, BigInt(0));
|
|
28186
|
+
i[a] ??= {}, i[a][l] = (i[a][l] ?? BigInt(0)) + g, y.forEach((w) => {
|
|
28187
|
+
this.addInput(w), f.add(`${w.txid}:${w.vout}`);
|
|
28188
|
+
});
|
|
28189
|
+
}
|
|
28190
|
+
}
|
|
28183
28191
|
return { addressOutputCoinAmounts: i, paymentBtcRequired: s };
|
|
28184
28192
|
}
|
|
28185
28193
|
/**
|
|
@@ -28202,7 +28210,7 @@ class xi {
|
|
|
28202
28210
|
const n = this.config.mergeSelfRuneBtcOutputs === !0, r = /* @__PURE__ */ new Set();
|
|
28203
28211
|
for (const [, s] of Object.entries(t))
|
|
28204
28212
|
for (const o of Object.keys(s))
|
|
28205
|
-
o !==
|
|
28213
|
+
o !== vt && r.add(o);
|
|
28206
28214
|
const i = Array.from(r);
|
|
28207
28215
|
if (i.length > 0) {
|
|
28208
28216
|
const s = [], o = [];
|
|
@@ -28221,14 +28229,14 @@ class xi {
|
|
|
28221
28229
|
});
|
|
28222
28230
|
const a = new ns.Runestone(s, ns.none(), ns.none(), ns.none());
|
|
28223
28231
|
this.addScriptOutput(new Uint8Array(a.encipher())), o.forEach((u) => {
|
|
28224
|
-
const f = t[u]?.[
|
|
28225
|
-
this.addOutput(u, y), p ? (f < Wr && (this.additionalDustNeeded += Wr - f), delete t[u][
|
|
28232
|
+
const f = t[u]?.[vt] ?? BigInt(0), l = u === this.config.address, p = f > BigInt(0) && (!l || n), y = p && f > Wr ? f : Wr;
|
|
28233
|
+
this.addOutput(u, y), p ? (f < Wr && (this.additionalDustNeeded += Wr - f), delete t[u][vt]) : this.additionalDustNeeded += Wr;
|
|
28226
28234
|
});
|
|
28227
28235
|
}
|
|
28228
28236
|
for (const [s, o] of Object.entries(
|
|
28229
28237
|
t
|
|
28230
28238
|
)) {
|
|
28231
|
-
const c = o[
|
|
28239
|
+
const c = o[vt] ?? BigInt(0);
|
|
28232
28240
|
c > BigInt(0) && this.addOutput(s, c);
|
|
28233
28241
|
}
|
|
28234
28242
|
}
|
|
@@ -28296,14 +28304,14 @@ class xi {
|
|
|
28296
28304
|
const s = this.psbt.__CACHE.__TX.clone(), o = [];
|
|
28297
28305
|
for (let a = 0; a < this.inputUtxos.length; a++) {
|
|
28298
28306
|
const u = this.inputUtxos[a], f = u.address;
|
|
28299
|
-
if (f !== this.config.paymentAddress
|
|
28307
|
+
if (f !== this.config.paymentAddress && f !== this.config.address)
|
|
28300
28308
|
continue;
|
|
28301
|
-
const l = this.psbt.data.inputs[a]
|
|
28309
|
+
const l = this.psbt.data.inputs[a]?.redeemScript, p = Zr(f);
|
|
28302
28310
|
if (o.push({
|
|
28303
28311
|
index: a,
|
|
28304
|
-
...p ===
|
|
28305
|
-
}), l && p ===
|
|
28306
|
-
const y =
|
|
28312
|
+
...p === Dt.P2TR ? { address: f, disableTweakSigner: !1 } : { publicKey: u.pubkey, disableTweakSigner: !0 }
|
|
28313
|
+
}), l && p === Dt.P2SH_P2WPKH) {
|
|
28314
|
+
const y = Zt([l]);
|
|
28307
28315
|
s.setInputScript(a, y);
|
|
28308
28316
|
}
|
|
28309
28317
|
}
|
|
@@ -28502,7 +28510,7 @@ var as = 9e15, ui = 1e9, Gf = "0123456789abcdef", Ea = "2.3025850929940456840179
|
|
|
28502
28510
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
28503
28511
|
crypto: !1
|
|
28504
28512
|
// true/false
|
|
28505
|
-
}, uw, gr, Te = !0, su = "[DecimalError] ", si = su + "Invalid argument: ", fw = su + "Precision limit exceeded", lw = su + "crypto unavailable", hw = "[object Decimal]",
|
|
28513
|
+
}, uw, gr, Te = !0, su = "[DecimalError] ", si = su + "Invalid argument: ", fw = su + "Precision limit exceeded", lw = su + "crypto unavailable", hw = "[object Decimal]", $t = 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 };
|
|
28506
28514
|
ie.absoluteValue = ie.abs = function() {
|
|
28507
28515
|
var e = new this.constructor(this);
|
|
28508
28516
|
return e.s < 0 && (e.s = 1), we(e);
|
|
@@ -28534,8 +28542,8 @@ ie.cosine = ie.cos = function() {
|
|
|
28534
28542
|
ie.cubeRoot = ie.cbrt = function() {
|
|
28535
28543
|
var e, t, n, r, i, s, o, c, a, u, f = this, l = f.constructor;
|
|
28536
28544
|
if (!f.isFinite() || f.isZero()) return new l(f);
|
|
28537
|
-
for (Te = !1, s = f.s * bt(f.s * f, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n =
|
|
28538
|
-
if (c = r, a = c.times(c).times(c), u = a.plus(f), r = De(u.plus(f).times(c), u.plus(a), o + 2, 1),
|
|
28545
|
+
for (Te = !1, s = f.s * bt(f.s * f, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = kt(f.d), e = f.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = bt(n, 1 / 3), e = $t((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), r = new l(n), r.s = f.s) : r = new l(s.toString()), o = (e = l.precision) + 3; ; )
|
|
28546
|
+
if (c = r, a = c.times(c).times(c), u = a.plus(f), r = De(u.plus(f).times(c), u.plus(a), o + 2, 1), kt(c.d).slice(0, o) === (n = kt(r.d)).slice(0, o))
|
|
28539
28547
|
if (n = n.slice(o - 3, o + 1), n == "9999" || !i && n == "4999") {
|
|
28540
28548
|
if (!i && (we(c, e + 1, 0), c.times(c).times(c).eq(f))) {
|
|
28541
28549
|
r = c;
|
|
@@ -28551,7 +28559,7 @@ ie.cubeRoot = ie.cbrt = function() {
|
|
|
28551
28559
|
ie.decimalPlaces = ie.dp = function() {
|
|
28552
28560
|
var e, t = this.d, n = NaN;
|
|
28553
28561
|
if (t) {
|
|
28554
|
-
if (e = t.length - 1, n = (e -
|
|
28562
|
+
if (e = t.length - 1, n = (e - $t(this.e / be)) * be, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
|
|
28555
28563
|
n < 0 && (n = 0);
|
|
28556
28564
|
}
|
|
28557
28565
|
return n;
|
|
@@ -28642,7 +28650,7 @@ ie.isFinite = function() {
|
|
|
28642
28650
|
return !!this.d;
|
|
28643
28651
|
};
|
|
28644
28652
|
ie.isInteger = ie.isInt = function() {
|
|
28645
|
-
return !!this.d &&
|
|
28653
|
+
return !!this.d && $t(this.e / be) > this.d.length - 2;
|
|
28646
28654
|
};
|
|
28647
28655
|
ie.isNaN = function() {
|
|
28648
28656
|
return !this.s;
|
|
@@ -28682,7 +28690,7 @@ ie.logarithm = ie.log = function(e) {
|
|
|
28682
28690
|
if (Te = !1, c = l + y, o = Jr(u, c), r = t ? Sa(f, c + 10) : Jr(e, c), a = De(o, r, c, 1), Po(a.d, i = l, p))
|
|
28683
28691
|
do
|
|
28684
28692
|
if (c += 10, o = Jr(u, c), r = t ? Sa(f, c + 10) : Jr(e, c), a = De(o, r, c, 1), !s) {
|
|
28685
|
-
+
|
|
28693
|
+
+kt(a.d).slice(i + 1, i + 15) + 1 == 1e14 && (a = we(a, l + 1, 0));
|
|
28686
28694
|
break;
|
|
28687
28695
|
}
|
|
28688
28696
|
while (Po(a.d, i += 10, p));
|
|
@@ -28700,7 +28708,7 @@ ie.minus = ie.sub = function(e) {
|
|
|
28700
28708
|
else return new g(a === 3 ? -0 : 0);
|
|
28701
28709
|
return Te ? we(e, c, a) : e;
|
|
28702
28710
|
}
|
|
28703
|
-
if (n =
|
|
28711
|
+
if (n = $t(e.e / be), f = $t(y.e / be), u = u.slice(), s = f - n, s) {
|
|
28704
28712
|
for (l = s < 0, l ? (t = u, s = -s, o = p.length) : (t = p, n = f, o = u.length), r = Math.max(Math.ceil(c / be), o) + 2, s > r && (s = r, t.length = 1), t.reverse(), r = s; r--; ) t.push(0);
|
|
28705
28713
|
t.reverse();
|
|
28706
28714
|
} else {
|
|
@@ -28745,7 +28753,7 @@ ie.plus = ie.add = function(e) {
|
|
|
28745
28753
|
return e.s = -e.s, l.minus(e);
|
|
28746
28754
|
if (u = l.d, f = e.d, c = p.precision, a = p.rounding, !u[0] || !f[0])
|
|
28747
28755
|
return f[0] || (e = new p(l)), Te ? we(e, c, a) : e;
|
|
28748
|
-
if (s =
|
|
28756
|
+
if (s = $t(l.e / be), r = $t(e.e / be), u = u.slice(), i = s - r, i) {
|
|
28749
28757
|
for (i < 0 ? (n = u, i = -i, o = f.length) : (n = f, r = s, o = u.length), s = Math.ceil(c / be), o = s > o ? s + 1 : o + 1, i > o && (i = o, n.length = 1), n.reverse(); i--; ) n.push(0);
|
|
28750
28758
|
n.reverse();
|
|
28751
28759
|
}
|
|
@@ -28771,8 +28779,8 @@ ie.squareRoot = ie.sqrt = function() {
|
|
|
28771
28779
|
var e, t, n, r, i, s, o = this, c = o.d, a = o.e, u = o.s, f = o.constructor;
|
|
28772
28780
|
if (u !== 1 || !c || !c[0])
|
|
28773
28781
|
return new f(!u || u < 0 && (!c || c[0]) ? NaN : c ? o : 1 / 0);
|
|
28774
|
-
for (Te = !1, u = Math.sqrt(+o), u == 0 || u == 1 / 0 ? (t =
|
|
28775
|
-
if (s = r, r = s.plus(De(o, s, n + 2, 1)).times(0.5),
|
|
28782
|
+
for (Te = !1, u = Math.sqrt(+o), u == 0 || u == 1 / 0 ? (t = kt(c), (t.length + a) % 2 == 0 && (t += "0"), u = Math.sqrt(t), a = $t((a + 1) / 2) - (a < 0 || a % 2), u == 1 / 0 ? t = "5e" + a : (t = u.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + a), r = new f(t)) : r = new f(u.toString()), n = (a = f.precision) + 3; ; )
|
|
28783
|
+
if (s = r, r = s.plus(De(o, s, n + 2, 1)).times(0.5), kt(s.d).slice(0, n) === (t = kt(r.d)).slice(0, n))
|
|
28776
28784
|
if (t = t.slice(n - 3, n + 1), t == "9999" || !i && t == "4999") {
|
|
28777
28785
|
if (!i && (we(s, a + 1, 0), s.times(s).eq(o))) {
|
|
28778
28786
|
r = s;
|
|
@@ -28793,7 +28801,7 @@ ie.times = ie.mul = function(e) {
|
|
|
28793
28801
|
var t, n, r, i, s, o, c, a, u, f = this, l = f.constructor, p = f.d, y = (e = new l(e)).d;
|
|
28794
28802
|
if (e.s *= f.s, !p || !p[0] || !y || !y[0])
|
|
28795
28803
|
return new l(!e.s || p && !p[0] && !y || y && !y[0] && !p ? NaN : !p || !y ? e.s / 0 : e.s * 0);
|
|
28796
|
-
for (n =
|
|
28804
|
+
for (n = $t(f.e / be) + $t(e.e / be), a = p.length, u = y.length, a < u && (s = p, p = y, y = s, o = a, a = u, u = o), s = [], o = a + u, r = o; r--; ) s.push(0);
|
|
28797
28805
|
for (r = u; --r >= 0; ) {
|
|
28798
28806
|
for (t = 0, i = a + r; i > r; )
|
|
28799
28807
|
c = s[i] + y[r] * p[i - r - 1] + t, s[i--] = c % Fn | 0, t = c / Fn | 0;
|
|
@@ -28826,7 +28834,7 @@ ie.toFraction = function(e) {
|
|
|
28826
28834
|
if (c = new w(e), !c.isInt() || c.lt(u)) throw Error(si + c);
|
|
28827
28835
|
e = c.gt(t) ? s > 0 ? t : u : c;
|
|
28828
28836
|
}
|
|
28829
|
-
for (Te = !1, c = new w(
|
|
28837
|
+
for (Te = !1, c = new w(kt(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; )
|
|
28830
28838
|
n = r, r = i, i = u, u = a.plus(l.times(i)), a = i, i = t, t = c.minus(l.times(i)), c = i;
|
|
28831
28839
|
return i = De(e.minus(n), r, 0, 1, 1), a = a.plus(i.times(u)), n = n.plus(i.times(r)), a.s = u.s = y.s, p = De(u, r, s, 1).minus(y).abs().cmp(De(a, n, s, 1).minus(y).abs()) < 1 ? [u, r] : [a, n], w.precision = f, Te = !0, p;
|
|
28832
28840
|
};
|
|
@@ -28856,14 +28864,14 @@ ie.toPower = ie.pow = function(e) {
|
|
|
28856
28864
|
if (!c.d || !e.d || !c.d[0] || !e.d[0]) return new a(bt(+c, u));
|
|
28857
28865
|
if (c = new a(c), c.eq(1)) return c;
|
|
28858
28866
|
if (r = a.precision, s = a.rounding, e.eq(1)) return we(c, r, s);
|
|
28859
|
-
if (t =
|
|
28867
|
+
if (t = $t(e.e / be), t >= e.d.length - 1 && (n = u < 0 ? -u : u) <= Mx)
|
|
28860
28868
|
return i = yw(a, c, n, r), e.s < 0 ? new a(1).div(i) : we(i, r, s);
|
|
28861
28869
|
if (o = c.s, o < 0) {
|
|
28862
28870
|
if (t < e.d.length - 1) return new a(NaN);
|
|
28863
28871
|
if ((e.d[t] & 1) == 0 && (o = 1), c.e == 0 && c.d[0] == 1 && c.d.length == 1)
|
|
28864
28872
|
return c.s = o, c;
|
|
28865
28873
|
}
|
|
28866
|
-
return n = bt(+c, u), t = n == 0 || !isFinite(n) ?
|
|
28874
|
+
return n = bt(+c, u), t = n == 0 || !isFinite(n) ? $t(u * (Math.log("0." + kt(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(Jr(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(Jr(c, t + n)), t), t + 5, 1), +kt(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));
|
|
28867
28875
|
};
|
|
28868
28876
|
ie.toPrecision = function(e, t) {
|
|
28869
28877
|
var n, r = this, i = r.constructor;
|
|
@@ -28884,7 +28892,7 @@ ie.valueOf = ie.toJSON = function() {
|
|
|
28884
28892
|
var e = this, t = e.constructor, n = Zn(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
28885
28893
|
return e.isNeg() ? "-" + n : n;
|
|
28886
28894
|
};
|
|
28887
|
-
function
|
|
28895
|
+
function kt(e) {
|
|
28888
28896
|
var t, n, r, i = e.length - 1, s = "", o = e[0];
|
|
28889
28897
|
if (i > 0) {
|
|
28890
28898
|
for (s += o, t = 1; t < i; t++)
|
|
@@ -28956,7 +28964,7 @@ var De = /* @__PURE__ */ (function() {
|
|
|
28956
28964
|
N && N[0] == 0 || !K ? $ * 0 : $ / 0
|
|
28957
28965
|
)
|
|
28958
28966
|
);
|
|
28959
|
-
for (a ? (y = 1, f = r.e - i.e) : (a = Fn, y = be, f =
|
|
28967
|
+
for (a ? (y = 1, f = r.e - i.e) : (a = Fn, y = be, f = $t(r.e / y) - $t(i.e / y)), V = K.length, v = N.length, S = new H($), _ = S.d = [], l = 0; K[l] == (N[l] || 0); l++) ;
|
|
28960
28968
|
if (K[l] > (N[l] || 0) && f--, s == null ? (A = s = H.precision, o = H.rounding) : c ? A = s + (r.e - i.e) + 1 : A = s, A < 0)
|
|
28961
28969
|
_.push(1), g = !0;
|
|
28962
28970
|
else {
|
|
@@ -29020,7 +29028,7 @@ function we(e, t, n, r) {
|
|
|
29020
29028
|
}
|
|
29021
29029
|
function Zn(e, t, n) {
|
|
29022
29030
|
if (!e.isFinite()) return ww(e);
|
|
29023
|
-
var r, i = e.e, s =
|
|
29031
|
+
var r, i = e.e, s = kt(e.d), o = s.length;
|
|
29024
29032
|
return t ? (n && (r = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) + Yr(r) : o > 1 && (s = s.charAt(0) + "." + s.slice(1)), s = s + (e.e < 0 ? "e" : "e+") + e.e) : i < 0 ? (s = "0." + Yr(-i - 1) + s, n && (r = n - o) > 0 && (s += Yr(r))) : i >= o ? (s += Yr(i + 1 - o), n && (r = n - i - 1) > 0 && (s = s + "." + Yr(r))) : ((r = i + 1) < o && (s = s.slice(0, r) + "." + s.slice(r)), n && (r = n - o) > 0 && (i + 1 === o && (s += "."), s += Yr(r))), s;
|
|
29025
29033
|
}
|
|
29026
29034
|
function ou(e, t) {
|
|
@@ -29052,7 +29060,7 @@ function Yr(e) {
|
|
|
29052
29060
|
function yw(e, t, n, r) {
|
|
29053
29061
|
var i, s = new e(1), o = Math.ceil(r / be + 4);
|
|
29054
29062
|
for (Te = !1; ; ) {
|
|
29055
|
-
if (n % 2 && (s = s.times(t), Mp(s.d, o) && (i = !0)), n =
|
|
29063
|
+
if (n % 2 && (s = s.times(t), Mp(s.d, o) && (i = !0)), n = $t(n / 2), n === 0) {
|
|
29056
29064
|
n = s.d.length - 1, i && s.d[n] === 0 && ++s.d[n];
|
|
29057
29065
|
break;
|
|
29058
29066
|
}
|
|
@@ -29080,7 +29088,7 @@ function zf(e, t) {
|
|
|
29080
29088
|
for (t == null ? (Te = !1, a = g) : a = t, c = new p(0.03125); e.e > -2; )
|
|
29081
29089
|
e = e.times(c), l += 5;
|
|
29082
29090
|
for (r = Math.log(bt(2, l)) / Math.LN10 * 2 + 5 | 0, a += r, n = s = o = new p(1), p.precision = a; ; ) {
|
|
29083
|
-
if (s = we(s.times(e), a, 1), n = n.times(++f), c = o.plus(De(s, n, a, 1)),
|
|
29091
|
+
if (s = we(s.times(e), a, 1), n = n.times(++f), c = o.plus(De(s, n, a, 1)), kt(c.d).slice(0, a) === kt(o.d).slice(0, a)) {
|
|
29084
29092
|
for (i = l; i--; ) o = we(o.times(o), a, 1);
|
|
29085
29093
|
if (t == null)
|
|
29086
29094
|
if (u < 3 && Po(o.d, a - r, y, u))
|
|
@@ -29097,14 +29105,14 @@ function Jr(e, t) {
|
|
|
29097
29105
|
var n, r, i, s, o, c, a, u, f, l, p, y = 1, g = 10, w = e, E = w.d, S = w.constructor, _ = S.rounding, m = S.precision;
|
|
29098
29106
|
if (w.s < 0 || !E || !E[0] || !w.e && E[0] == 1 && E.length == 1)
|
|
29099
29107
|
return new S(E && !E[0] ? -1 / 0 : w.s != 1 ? NaN : E ? 0 : w);
|
|
29100
|
-
if (t == null ? (Te = !1, f = m) : f = t, S.precision = f += g, n =
|
|
29108
|
+
if (t == null ? (Te = !1, f = m) : f = t, S.precision = f += g, n = kt(E), r = n.charAt(0), Math.abs(s = w.e) < 15e14) {
|
|
29101
29109
|
for (; r < 7 && r != 1 || r == 1 && n.charAt(1) > 3; )
|
|
29102
|
-
w = w.times(e), n =
|
|
29110
|
+
w = w.times(e), n = kt(w.d), r = n.charAt(0), y++;
|
|
29103
29111
|
s = w.e, r > 1 ? (w = new S("0." + n), s++) : w = new S(r + "." + n.slice(1));
|
|
29104
29112
|
} else
|
|
29105
29113
|
return u = Sa(S, f + 2, m).times(s + ""), w = Jr(new S(r + "." + n.slice(1)), f - g).plus(u), S.precision = m, t == null ? we(w, m, _, Te = !0) : w;
|
|
29106
29114
|
for (l = w, a = o = w = De(w.minus(1), w.plus(1), f, 1), p = we(w.times(w), f, 1), i = 3; ; ) {
|
|
29107
|
-
if (o = we(o.times(p), f, 1), u = a.plus(De(o, new S(i), f, 1)),
|
|
29115
|
+
if (o = we(o.times(p), f, 1), u = a.plus(De(o, new S(i), f, 1)), kt(u.d).slice(0, f) === kt(a.d).slice(0, f))
|
|
29108
29116
|
if (a = a.times(2), s !== 0 && (a = a.plus(Sa(S, f + 2, m).times(s + ""))), a = De(a, new S(y), f, 1), t == null)
|
|
29109
29117
|
if (Po(a.d, f - g, _, c))
|
|
29110
29118
|
S.precision = f += g, u = o = w = De(l.minus(1), l.plus(1), f, 1), p = we(w.times(w), f, 1), i = c = 1;
|
|
@@ -29290,7 +29298,7 @@ function t6(e) {
|
|
|
29290
29298
|
];
|
|
29291
29299
|
for (t = 0; t < s.length; t += 3)
|
|
29292
29300
|
if (n = s[t], i && (this[n] = Df[n]), (r = e[n]) !== void 0)
|
|
29293
|
-
if (
|
|
29301
|
+
if ($t(r) === r && r >= s[t + 1] && r <= s[t + 2]) this[n] = r;
|
|
29294
29302
|
else throw Error(si + n + ": " + r);
|
|
29295
29303
|
if (n = "crypto", i && (this[n] = Df[n]), (r = e[n]) !== void 0)
|
|
29296
29304
|
if (r === !0 || r === !1 || r === 0 || r === 1)
|