@omnity/ree-client-ts-sdk 0.5.7 → 0.5.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 +6 -6
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +122 -118
- package/dist/react.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var Hh = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Fh = (e, t, n) => t.has(e) || Hh("Cannot " + n);
|
|
5
|
-
var Fe = (e, t, n) => (Fh(e, t, "read from private field"), n ? n.call(e) : t.get(e)),
|
|
5
|
+
var Fe = (e, t, n) => (Fh(e, t, "read from private field"), n ? n.call(e) : t.get(e)), sn = (e, t, n) => t.has(e) ? Hh("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), zt = (e, t, n, r) => (Fh(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
6
6
|
var Mh = (e, t, n, r) => ({
|
|
7
7
|
set _(i) {
|
|
8
8
|
zt(e, t, i, n);
|
|
@@ -5145,7 +5145,7 @@ function Sb(e) {
|
|
|
5145
5145
|
function da(e) {
|
|
5146
5146
|
return e instanceof Uint8Array;
|
|
5147
5147
|
}
|
|
5148
|
-
function
|
|
5148
|
+
function nn(e) {
|
|
5149
5149
|
if (rg(e)) return e;
|
|
5150
5150
|
ct(eg, e);
|
|
5151
5151
|
const t = e.reduce((i, s) => da(s) ? s.length === 1 && ha(s) !== void 0 ? i + 1 : i + Ky(s.length) + s.length : i + 1, 0), n = new Uint8Array(t);
|
|
@@ -5262,7 +5262,7 @@ function Ga(e, t) {
|
|
|
5262
5262
|
}
|
|
5263
5263
|
if (Te(i, "output", () => {
|
|
5264
5264
|
if (e.m && i.n && e.pubkeys)
|
|
5265
|
-
return
|
|
5265
|
+
return nn(
|
|
5266
5266
|
[].concat(
|
|
5267
5267
|
Tc + e.m,
|
|
5268
5268
|
e.pubkeys,
|
|
@@ -5284,7 +5284,7 @@ function Ga(e, t) {
|
|
|
5284
5284
|
return lt(e.input).slice(1);
|
|
5285
5285
|
}), Te(i, "input", () => {
|
|
5286
5286
|
if (e.signatures)
|
|
5287
|
-
return
|
|
5287
|
+
return nn([hs.OP_0].concat(e.signatures));
|
|
5288
5288
|
}), Te(i, "witness", () => {
|
|
5289
5289
|
if (i.input)
|
|
5290
5290
|
return [];
|
|
@@ -5351,7 +5351,7 @@ function ig(e, t) {
|
|
|
5351
5351
|
const n = In(() => lt(e.input)), i = { name: "p2pk", network: e.network || Pn };
|
|
5352
5352
|
if (Te(i, "output", () => {
|
|
5353
5353
|
if (e.pubkey)
|
|
5354
|
-
return
|
|
5354
|
+
return nn([e.pubkey, hd.OP_CHECKSIG]);
|
|
5355
5355
|
}), Te(i, "pubkey", () => {
|
|
5356
5356
|
if (e.output)
|
|
5357
5357
|
return e.output.slice(1, -1);
|
|
@@ -5360,7 +5360,7 @@ function ig(e, t) {
|
|
|
5360
5360
|
return n()[0];
|
|
5361
5361
|
}), Te(i, "input", () => {
|
|
5362
5362
|
if (e.signature)
|
|
5363
|
-
return
|
|
5363
|
+
return nn([e.signature]);
|
|
5364
5364
|
}), Te(i, "witness", () => {
|
|
5365
5365
|
if (i.input)
|
|
5366
5366
|
return [];
|
|
@@ -5912,12 +5912,12 @@ class e2 extends Bl {
|
|
|
5912
5912
|
Li(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 En = /* @__PURE__ */ Wa(() => new dg()), t2 = /* @__PURE__ */ Wa(() => new Zb()), n2 = /* @__PURE__ */ Wa(() => new e2()),
|
|
5915
|
+
const En = /* @__PURE__ */ Wa(() => new dg()), t2 = /* @__PURE__ */ Wa(() => new Zb()), n2 = /* @__PURE__ */ Wa(() => new e2()), en = En;
|
|
5916
5916
|
function Ar(e) {
|
|
5917
|
-
return Lb(
|
|
5917
|
+
return Lb(en(e));
|
|
5918
5918
|
}
|
|
5919
5919
|
function mi(e) {
|
|
5920
|
-
return
|
|
5920
|
+
return en(en(e));
|
|
5921
5921
|
}
|
|
5922
5922
|
const r2 = {
|
|
5923
5923
|
"BIP0340/challenge": Uint8Array.from([
|
|
@@ -6516,7 +6516,7 @@ const r2 = {
|
|
|
6516
6516
|
])
|
|
6517
6517
|
};
|
|
6518
6518
|
function Xa(e, t) {
|
|
6519
|
-
return
|
|
6519
|
+
return en(at([r2[e], t]));
|
|
6520
6520
|
}
|
|
6521
6521
|
function i2(e) {
|
|
6522
6522
|
if (e.length >= 255)
|
|
@@ -6631,7 +6631,7 @@ function o2(e) {
|
|
|
6631
6631
|
};
|
|
6632
6632
|
}
|
|
6633
6633
|
function c2(e) {
|
|
6634
|
-
return
|
|
6634
|
+
return en(en(e));
|
|
6635
6635
|
}
|
|
6636
6636
|
const Io = o2(c2), Mr = Ge;
|
|
6637
6637
|
function oc(e, t) {
|
|
@@ -6665,7 +6665,7 @@ function oc(e, t) {
|
|
|
6665
6665
|
if (e.pubkey || s.pubkey) return Ar(e.pubkey || s.pubkey);
|
|
6666
6666
|
}), Te(s, "output", () => {
|
|
6667
6667
|
if (s.hash)
|
|
6668
|
-
return
|
|
6668
|
+
return nn([
|
|
6669
6669
|
Mr.OP_DUP,
|
|
6670
6670
|
Mr.OP_HASH160,
|
|
6671
6671
|
s.hash,
|
|
@@ -6680,7 +6680,7 @@ function oc(e, t) {
|
|
|
6680
6680
|
return r()[0];
|
|
6681
6681
|
}), Te(s, "input", () => {
|
|
6682
6682
|
if (e.pubkey && e.signature)
|
|
6683
|
-
return
|
|
6683
|
+
return nn([e.signature, e.pubkey]);
|
|
6684
6684
|
}), Te(s, "witness", () => {
|
|
6685
6685
|
if (s.input)
|
|
6686
6686
|
return [];
|
|
@@ -6763,7 +6763,7 @@ function cc(e, t) {
|
|
|
6763
6763
|
return {
|
|
6764
6764
|
network: n,
|
|
6765
6765
|
output: a === Zs.OP_FALSE ? Uint8Array.from([]) : a,
|
|
6766
|
-
input:
|
|
6766
|
+
input: nn(c.slice(0, -1)),
|
|
6767
6767
|
witness: e.witness || []
|
|
6768
6768
|
};
|
|
6769
6769
|
});
|
|
@@ -6777,13 +6777,13 @@ function cc(e, t) {
|
|
|
6777
6777
|
if (r.redeem && r.redeem.output) return Ar(r.redeem.output);
|
|
6778
6778
|
}), Te(r, "output", () => {
|
|
6779
6779
|
if (r.hash)
|
|
6780
|
-
return
|
|
6780
|
+
return nn([Zs.OP_HASH160, r.hash, Zs.OP_EQUAL]);
|
|
6781
6781
|
}), Te(r, "redeem", () => {
|
|
6782
6782
|
if (e.input)
|
|
6783
6783
|
return o();
|
|
6784
6784
|
}), Te(r, "input", () => {
|
|
6785
6785
|
if (!(!e.redeem || !e.redeem.input || !e.redeem.output))
|
|
6786
|
-
return
|
|
6786
|
+
return nn(
|
|
6787
6787
|
[].concat(lt(e.redeem.input), e.redeem.output)
|
|
6788
6788
|
);
|
|
6789
6789
|
}), Te(r, "witness", () => {
|
|
@@ -7040,7 +7040,7 @@ function za(e, t) {
|
|
|
7040
7040
|
if (e.pubkey || i.pubkey) return Ar(e.pubkey || i.pubkey);
|
|
7041
7041
|
}), Te(i, "output", () => {
|
|
7042
7042
|
if (i.hash)
|
|
7043
|
-
return
|
|
7043
|
+
return nn([Ed.OP_0, i.hash]);
|
|
7044
7044
|
}), Te(i, "pubkey", () => {
|
|
7045
7045
|
if (e.pubkey) return e.pubkey;
|
|
7046
7046
|
if (e.witness)
|
|
@@ -7143,10 +7143,10 @@ function uc(e, t) {
|
|
|
7143
7143
|
}), Te(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 en(s.redeem.output);
|
|
7147
7147
|
}), Te(s, "output", () => {
|
|
7148
7148
|
if (s.hash)
|
|
7149
|
-
return
|
|
7149
|
+
return nn([_d.OP_0, s.hash]);
|
|
7150
7150
|
}), Te(s, "redeem", () => {
|
|
7151
7151
|
if (e.witness)
|
|
7152
7152
|
return {
|
|
@@ -7208,7 +7208,7 @@ function uc(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 = en(e.redeem.output);
|
|
7212
7212
|
if (o.length > 0 && de(o, a) !== 0)
|
|
7213
7213
|
throw new TypeError("Hash mismatch");
|
|
7214
7214
|
o = a;
|
|
@@ -7641,7 +7641,7 @@ function fc(e, t) {
|
|
|
7641
7641
|
return null;
|
|
7642
7642
|
}), Te(o, "output", () => {
|
|
7643
7643
|
if (o.pubkey)
|
|
7644
|
-
return
|
|
7644
|
+
return nn([Td.OP_1, o.pubkey]);
|
|
7645
7645
|
}), Te(o, "redeemVersion", () => e.redeemVersion ? e.redeemVersion : e.redeem && e.redeem.redeemVersion !== void 0 && e.redeem.redeemVersion !== null ? e.redeem.redeemVersion : mg), Te(o, "redeem", () => {
|
|
7646
7646
|
const c = r();
|
|
7647
7647
|
if (!(!c || c.length < 2))
|
|
@@ -7874,7 +7874,7 @@ function Ag(e, t) {
|
|
|
7874
7874
|
if (r.data.length === 32)
|
|
7875
7875
|
return fc({ pubkey: r.data }).output;
|
|
7876
7876
|
} else if (r.version >= _g && r.version <= Eg && r.data.length >= bg && r.data.length <= wg)
|
|
7877
|
-
return console.warn(Tg),
|
|
7877
|
+
return console.warn(Tg), nn([
|
|
7878
7878
|
r.version + Sg,
|
|
7879
7879
|
r.data
|
|
7880
7880
|
]);
|
|
@@ -8027,7 +8027,7 @@ let gt = class Ye {
|
|
|
8027
8027
|
n,
|
|
8028
8028
|
r
|
|
8029
8029
|
]), t >= this.ins.length) return vd;
|
|
8030
|
-
const i =
|
|
8030
|
+
const i = nn(
|
|
8031
8031
|
lt(n).filter((c) => c !== Ge.OP_CODESEPARATOR)
|
|
8032
8032
|
), s = this.clone();
|
|
8033
8033
|
if ((r & 31) === Ye.SIGHASH_NONE)
|
|
@@ -8066,18 +8066,18 @@ let gt = class Ye {
|
|
|
8066
8066
|
let T = $t.withCapacity(36 * this.ins.length);
|
|
8067
8067
|
this.ins.forEach((O) => {
|
|
8068
8068
|
T.writeSlice(O.hash), T.writeUInt32(O.index);
|
|
8069
|
-
}), d =
|
|
8069
|
+
}), d = en(T.end()), T = $t.withCapacity(8 * this.ins.length), r.forEach((O) => T.writeInt64(O)), y = en(T.end()), T = $t.withCapacity(
|
|
8070
8070
|
n.map(Jn).reduce((O, A) => O + A)
|
|
8071
8071
|
), n.forEach(
|
|
8072
8072
|
(O) => T.writeVarSlice(O)
|
|
8073
|
-
), g =
|
|
8073
|
+
), g = en(T.end()), T = $t.withCapacity(4 * this.ins.length), this.ins.forEach((O) => T.writeUInt32(O.sequence)), m = en(T.end());
|
|
8074
8074
|
}
|
|
8075
8075
|
if (f || l) {
|
|
8076
8076
|
if (l && t < this.outs.length) {
|
|
8077
8077
|
const T = this.outs[t], O = $t.withCapacity(
|
|
8078
8078
|
8 + Jn(T.script)
|
|
8079
8079
|
);
|
|
8080
|
-
O.writeInt64(T.value), O.writeVarSlice(T.script), E =
|
|
8080
|
+
O.writeInt64(T.value), O.writeVarSlice(T.script), E = en(O.end());
|
|
8081
8081
|
}
|
|
8082
8082
|
} else {
|
|
8083
8083
|
if (!this.outs.length)
|
|
@@ -8085,7 +8085,7 @@ let gt = class Ye {
|
|
|
8085
8085
|
const T = this.outs.map((A) => 8 + Jn(A.script)).reduce((A, R) => A + R), O = $t.withCapacity(T);
|
|
8086
8086
|
this.outs.forEach((A) => {
|
|
8087
8087
|
O.writeInt64(A.value), O.writeVarSlice(A.script);
|
|
8088
|
-
}), E =
|
|
8088
|
+
}), E = en(O.end());
|
|
8089
8089
|
}
|
|
8090
8090
|
const _ = (s ? 2 : 0) + (o ? 1 : 0), S = 174 - (u ? 49 : 0) - (f ? 32 : 0) + (o ? 32 : 0) + (s ? 37 : 0), w = $t.withCapacity(S);
|
|
8091
8091
|
if (w.writeUInt8(i), w.writeInt32(this.version), w.writeUInt32(this.locktime), w.writeSlice(d), w.writeSlice(y), w.writeSlice(g), w.writeSlice(m), f || l || w.writeSlice(E), w.writeUInt8(_), u) {
|
|
@@ -8095,7 +8095,7 @@ let gt = class Ye {
|
|
|
8095
8095
|
w.writeUInt32(t);
|
|
8096
8096
|
if (o) {
|
|
8097
8097
|
const T = $t.withCapacity(Jn(o));
|
|
8098
|
-
T.writeVarSlice(o), w.writeSlice(
|
|
8098
|
+
T.writeVarSlice(o), w.writeSlice(en(T.end()));
|
|
8099
8099
|
}
|
|
8100
8100
|
return l && w.writeSlice(E), s && (w.writeSlice(s), w.writeUInt8(0), w.writeUInt32(4294967295)), Xa(
|
|
8101
8101
|
"TapSighash",
|
|
@@ -16375,12 +16375,12 @@ function Qx(e, t, n) {
|
|
|
16375
16375
|
let u = e - c * r - a * s, f = -c * i - a * o;
|
|
16376
16376
|
const l = u < Fi, d = f < Fi;
|
|
16377
16377
|
l && (u = -u), d && (f = -f);
|
|
16378
|
-
const y = Qi(Math.ceil(Vo(n) / 2)) +
|
|
16378
|
+
const y = Qi(Math.ceil(Vo(n) / 2)) + Qt;
|
|
16379
16379
|
if (u < Fi || u >= y || f < Fi || f >= y)
|
|
16380
16380
|
throw new Error("splitScalar (endomorphism): failed, k=" + e);
|
|
16381
16381
|
return { k1neg: l, k1: u, k2neg: d, k2: f };
|
|
16382
16382
|
}
|
|
16383
|
-
const Fi = BigInt(0),
|
|
16383
|
+
const Fi = BigInt(0), Qt = BigInt(1), pr = BigInt(2), ys = BigInt(3), ol = BigInt(4);
|
|
16384
16384
|
function Ua(e, t) {
|
|
16385
16385
|
const { BYTES: n } = e;
|
|
16386
16386
|
let r;
|
|
@@ -16636,7 +16636,7 @@ function e3(e, t = {}) {
|
|
|
16636
16636
|
throw new Error("invalid scalar: out of range");
|
|
16637
16637
|
if (H === Fi || P.is0())
|
|
16638
16638
|
return v.ZERO;
|
|
16639
|
-
if (H ===
|
|
16639
|
+
if (H === Qt)
|
|
16640
16640
|
return P;
|
|
16641
16641
|
if (V.hasCache(this))
|
|
16642
16642
|
return this.multiply(H);
|
|
@@ -16663,11 +16663,11 @@ function e3(e, t = {}) {
|
|
|
16663
16663
|
*/
|
|
16664
16664
|
isTorsionFree() {
|
|
16665
16665
|
const { isTorsionFree: H } = t;
|
|
16666
|
-
return o ===
|
|
16666
|
+
return o === Qt ? !0 : H ? H(v, this) : V.unsafe(this, c).is0();
|
|
16667
16667
|
}
|
|
16668
16668
|
clearCofactor() {
|
|
16669
16669
|
const { clearCofactor: H } = t;
|
|
16670
|
-
return o ===
|
|
16670
|
+
return o === Qt ? this : H ? H(v, this) : this.multiplyUnsafe(o);
|
|
16671
16671
|
}
|
|
16672
16672
|
isSmallOrder() {
|
|
16673
16673
|
return this.multiplyUnsafe(o).is0();
|
|
@@ -16717,9 +16717,9 @@ function t3(e) {
|
|
|
16717
16717
|
function n3(e, t) {
|
|
16718
16718
|
const n = e.ORDER;
|
|
16719
16719
|
let r = Fi;
|
|
16720
|
-
for (let g = n -
|
|
16721
|
-
r +=
|
|
16722
|
-
const i = r, s = pr << i -
|
|
16720
|
+
for (let g = n - Qt; g % pr === Fi; g /= pr)
|
|
16721
|
+
r += Qt;
|
|
16722
|
+
const i = r, s = pr << i - Qt - Qt, o = s * pr, c = (n - Qt) / o, a = (c - Qt) / pr, u = o - Qt, f = s, l = e.pow(t, c), d = e.pow(t, (c + Qt) / pr);
|
|
16723
16723
|
let y = (g, m) => {
|
|
16724
16724
|
let E = l, _ = e.pow(m, u), S = e.sqr(_);
|
|
16725
16725
|
S = e.mul(S, m);
|
|
@@ -16729,9 +16729,9 @@ function n3(e, t) {
|
|
|
16729
16729
|
w = e.pow(T, f);
|
|
16730
16730
|
let O = e.eql(w, e.ONE);
|
|
16731
16731
|
_ = e.mul(S, d), w = e.mul(T, E), S = e.cmov(_, S, O), T = e.cmov(w, T, O);
|
|
16732
|
-
for (let A = i; A >
|
|
16732
|
+
for (let A = i; A > Qt; A--) {
|
|
16733
16733
|
let R = A - pr;
|
|
16734
|
-
R = pr << R -
|
|
16734
|
+
R = pr << R - Qt;
|
|
16735
16735
|
let M = e.pow(T, R);
|
|
16736
16736
|
const v = e.eql(M, e.ONE);
|
|
16737
16737
|
_ = e.mul(S, E), E = e.mul(E, E), M = e.mul(T, E), S = e.cmov(_, S, v), T = e.cmov(M, T, v);
|
|
@@ -16822,7 +16822,7 @@ function s3(e, t, n) {
|
|
|
16822
16822
|
function o3(e, t) {
|
|
16823
16823
|
const { Fp: n, Fn: r } = t;
|
|
16824
16824
|
function i(o) {
|
|
16825
|
-
return mw(o,
|
|
16825
|
+
return mw(o, Qt, r.ORDER);
|
|
16826
16826
|
}
|
|
16827
16827
|
const s = s3(n, e.a, e.b);
|
|
16828
16828
|
return Object.assign({}, {
|
|
@@ -17101,7 +17101,7 @@ function f3(e) {
|
|
|
17101
17101
|
};
|
|
17102
17102
|
}
|
|
17103
17103
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
17104
|
-
const b0 = BigInt(0), Sr = BigInt(1),
|
|
17104
|
+
const b0 = BigInt(0), Sr = BigInt(1), tn = BigInt(2), E0 = BigInt(3);
|
|
17105
17105
|
function ph(e, t, n, r, i = 1, s) {
|
|
17106
17106
|
const o = BigInt(s === void 0 ? r : s), c = n ** BigInt(r), a = [];
|
|
17107
17107
|
for (let u = 0; u < i; u++) {
|
|
@@ -17115,12 +17115,12 @@ function ph(e, t, n, r, i = 1, s) {
|
|
|
17115
17115
|
return a;
|
|
17116
17116
|
}
|
|
17117
17117
|
function l3(e, t, n) {
|
|
17118
|
-
const r = t.pow(n, (e.ORDER - Sr) / E0), i = t.pow(n, (e.ORDER - Sr) /
|
|
17118
|
+
const r = t.pow(n, (e.ORDER - Sr) / E0), i = t.pow(n, (e.ORDER - Sr) / tn);
|
|
17119
17119
|
function s(d, y) {
|
|
17120
17120
|
const g = t.mul(t.frobeniusMap(d, 1), r), m = t.mul(t.frobeniusMap(y, 1), i);
|
|
17121
17121
|
return [g, m];
|
|
17122
17122
|
}
|
|
17123
|
-
const o = t.pow(n, (e.ORDER **
|
|
17123
|
+
const o = t.pow(n, (e.ORDER ** tn - Sr) / E0), c = t.pow(n, (e.ORDER ** tn - Sr) / tn);
|
|
17124
17124
|
if (!t.eql(c, t.neg(t.ONE)))
|
|
17125
17125
|
throw new Error("psiFrobenius: PSI2_Y!==-1");
|
|
17126
17126
|
function a(d, y) {
|
|
@@ -17142,7 +17142,7 @@ class h3 {
|
|
|
17142
17142
|
constructor(t, n = {}) {
|
|
17143
17143
|
this.MASK = Sr;
|
|
17144
17144
|
const r = t.ORDER, i = r * r;
|
|
17145
|
-
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,
|
|
17145
|
+
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, tn), this.NONRESIDUE = _0(t, n.FP2_NONRESIDUE), this.FROBENIUS_COEFFICIENTS = ph(t, this.Fp_NONRESIDUE, t.ORDER, 2)[0], this.mulByB = n.Fp2mulByB, Object.seal(this);
|
|
17146
17146
|
}
|
|
17147
17147
|
fromBigTuple(t) {
|
|
17148
17148
|
return _0(this.Fp, t);
|
|
@@ -17238,7 +17238,7 @@ class h3 {
|
|
|
17238
17238
|
}
|
|
17239
17239
|
// Same as sgn0_m_eq_2 in RFC 9380
|
|
17240
17240
|
isOdd(t) {
|
|
17241
|
-
const { re: n, im: r } = this.reim(t), i = n %
|
|
17241
|
+
const { re: n, im: r } = this.reim(t), i = n % tn, s = n === b0, o = r % tn;
|
|
17242
17242
|
return BigInt(i || s && o) == Sr;
|
|
17243
17243
|
}
|
|
17244
17244
|
// Bytes util
|
|
@@ -17322,7 +17322,7 @@ class d3 {
|
|
|
17322
17322
|
}
|
|
17323
17323
|
sqr({ c0: t, c1: n, c2: r }) {
|
|
17324
17324
|
const { Fp2: i } = this;
|
|
17325
|
-
let s = i.sqr(t), o = i.mul(i.mul(t, n),
|
|
17325
|
+
let s = i.sqr(t), o = i.mul(i.mul(t, n), tn), c = i.mul(i.mul(n, r), tn), a = i.sqr(r);
|
|
17326
17326
|
return {
|
|
17327
17327
|
c0: i.add(i.mulByNonresidue(c), s),
|
|
17328
17328
|
// T3 * (u + 1) + T0
|
|
@@ -17645,19 +17645,19 @@ class p3 {
|
|
|
17645
17645
|
const { Fp6: r } = this, { Fp2: i } = r, { c0: s, c1: o, c2: c } = t, { c0: a, c1: u, c2: f } = n, { first: l, second: d } = i.Fp4Square(s, u), { first: y, second: g } = i.Fp4Square(a, c), { first: m, second: E } = i.Fp4Square(o, f), _ = i.mulByNonresidue(E);
|
|
17646
17646
|
return {
|
|
17647
17647
|
c0: r.create({
|
|
17648
|
-
c0: i.add(i.mul(i.sub(l, s),
|
|
17648
|
+
c0: i.add(i.mul(i.sub(l, s), tn), l),
|
|
17649
17649
|
// 2 * (T3 - c0c0) + T3
|
|
17650
|
-
c1: i.add(i.mul(i.sub(y, o),
|
|
17650
|
+
c1: i.add(i.mul(i.sub(y, o), tn), y),
|
|
17651
17651
|
// 2 * (T5 - c0c1) + T5
|
|
17652
|
-
c2: i.add(i.mul(i.sub(m, c),
|
|
17652
|
+
c2: i.add(i.mul(i.sub(m, c), tn), m)
|
|
17653
17653
|
}),
|
|
17654
17654
|
// 2 * (T7 - c0c2) + T7
|
|
17655
17655
|
c1: r.create({
|
|
17656
|
-
c0: i.add(i.mul(i.add(_, a),
|
|
17656
|
+
c0: i.add(i.mul(i.add(_, a), tn), _),
|
|
17657
17657
|
// 2 * (T9 + c1c0) + T9
|
|
17658
|
-
c1: i.add(i.mul(i.add(d, u),
|
|
17658
|
+
c1: i.add(i.mul(i.add(d, u), tn), d),
|
|
17659
17659
|
// 2 * (T4 + c1c1) + T4
|
|
17660
|
-
c2: i.add(i.mul(i.add(g, f),
|
|
17660
|
+
c2: i.add(i.mul(i.add(g, f), tn), g)
|
|
17661
17661
|
})
|
|
17662
17662
|
};
|
|
17663
17663
|
}
|
|
@@ -18957,8 +18957,8 @@ class o8 {
|
|
|
18957
18957
|
*/
|
|
18958
18958
|
constructor(t = {}) {
|
|
18959
18959
|
// Internals
|
|
18960
|
-
|
|
18961
|
-
|
|
18960
|
+
sn(this, Pt);
|
|
18961
|
+
sn(this, Os);
|
|
18962
18962
|
this[B0] = this.entries.bind(this), this[N0] = "ExpirableMap";
|
|
18963
18963
|
const { source: n = [], expirationTime: r = 600 * 1e3 } = t, i = Date.now();
|
|
18964
18964
|
zt(this, Pt, new Map([...n].map(([s, o]) => [s, { value: o, timestamp: i }]))), zt(this, Os, r);
|
|
@@ -19222,8 +19222,8 @@ var Go, Wo;
|
|
|
19222
19222
|
const Pi = class Pi {
|
|
19223
19223
|
// `fromRaw` and `fromDer` should be used for instantiation, not this constructor.
|
|
19224
19224
|
constructor(t) {
|
|
19225
|
-
|
|
19226
|
-
|
|
19225
|
+
sn(this, Go);
|
|
19226
|
+
sn(this, Wo);
|
|
19227
19227
|
if (t.byteLength !== Pi.RAW_KEY_LENGTH)
|
|
19228
19228
|
throw et.fromCode(new Nr("An Ed25519 public key must be exactly 32 bytes long"));
|
|
19229
19229
|
zt(this, Go, t), zt(this, Wo, Pi.derEncode(t));
|
|
@@ -19293,15 +19293,15 @@ const U0 = 0.5, C0 = 1.5, H0 = 500, F0 = 6e4, M0 = 9e5, q0 = 10;
|
|
|
19293
19293
|
var Fn, Xo, zo, Yo, Zo, Jo, Qo, ec, Bs;
|
|
19294
19294
|
const La = class La {
|
|
19295
19295
|
constructor(t = La.default) {
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19296
|
+
sn(this, Fn);
|
|
19297
|
+
sn(this, Xo);
|
|
19298
|
+
sn(this, zo);
|
|
19299
|
+
sn(this, Yo);
|
|
19300
|
+
sn(this, Zo);
|
|
19301
|
+
sn(this, Jo);
|
|
19302
|
+
sn(this, Qo);
|
|
19303
|
+
sn(this, ec);
|
|
19304
|
+
sn(this, Bs, 0);
|
|
19305
19305
|
const { initialInterval: n = H0, randomizationFactor: r = U0, multiplier: i = C0, maxInterval: s = F0, maxElapsedTime: o = M0, maxIterations: c = q0, date: a = Date } = t;
|
|
19306
19306
|
zt(this, Fn, n), zt(this, Xo, r), zt(this, zo, i), zt(this, Yo, s), zt(this, ec, a), zt(this, Zo, a.now()), zt(this, Jo, o), zt(this, Qo, c);
|
|
19307
19307
|
}
|
|
@@ -20264,7 +20264,7 @@ function C8(e, t, n, r) {
|
|
|
20264
20264
|
const s = (...o) => i({}, ...o);
|
|
20265
20265
|
return s.withOptions = (o) => (...c) => i(o, ...c), s;
|
|
20266
20266
|
}
|
|
20267
|
-
const
|
|
20267
|
+
const Jt = {
|
|
20268
20268
|
P2PKH: { P2PKH: null },
|
|
20269
20269
|
P2SH_P2WPKH: { P2SH_P2WPKH: null },
|
|
20270
20270
|
P2WPKH: { P2WPKH: null },
|
|
@@ -20994,7 +20994,7 @@ var Z0;
|
|
|
20994
20994
|
function V8() {
|
|
20995
20995
|
if (Z0) return Si;
|
|
20996
20996
|
Z0 = 1, Object.defineProperty(Si, "__esModule", { value: !0 }), Si.encode = Si.decode = void 0;
|
|
20997
|
-
const e = Kw(), t =
|
|
20997
|
+
const e = Kw(), t = rn(), n = Xt(), { typeforce: r } = n, i = Buffer.alloc(1, 0);
|
|
20998
20998
|
function s(u) {
|
|
20999
20999
|
let f = 0;
|
|
21000
21000
|
for (; u[f] === 0; ) ++f;
|
|
@@ -21030,7 +21030,7 @@ function V8() {
|
|
|
21030
21030
|
return Si.encode = a, Si;
|
|
21031
21031
|
}
|
|
21032
21032
|
var J0;
|
|
21033
|
-
function
|
|
21033
|
+
function rn() {
|
|
21034
21034
|
return J0 || (J0 = 1, (function(e) {
|
|
21035
21035
|
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;
|
|
21036
21036
|
const t = Kw(), n = bh();
|
|
@@ -21181,7 +21181,7 @@ var ep;
|
|
|
21181
21181
|
function L8() {
|
|
21182
21182
|
if (ep) return io;
|
|
21183
21183
|
ep = 1, Object.defineProperty(io, "__esModule", { value: !0 }), io.p2data = void 0;
|
|
21184
|
-
const e = Wn(), t =
|
|
21184
|
+
const e = Wn(), t = rn(), n = Xt(), r = yi(), i = t.OPS;
|
|
21185
21185
|
function s(o, c) {
|
|
21186
21186
|
if (!o.data && !o.output) throw new TypeError("Not enough data");
|
|
21187
21187
|
c = Object.assign({ validate: !0 }, c || {}), (0, n.typeforce)(
|
|
@@ -21217,7 +21217,7 @@ var so = {}, tp;
|
|
|
21217
21217
|
function $8() {
|
|
21218
21218
|
if (tp) return so;
|
|
21219
21219
|
tp = 1, Object.defineProperty(so, "__esModule", { value: !0 }), so.p2ms = void 0;
|
|
21220
|
-
const e = Wn(), t =
|
|
21220
|
+
const e = Wn(), t = rn(), n = Xt(), r = yi(), i = t.OPS, s = i.OP_RESERVED;
|
|
21221
21221
|
function o(c, a) {
|
|
21222
21222
|
if (!c.input && !c.output && !(c.pubkeys && c.m !== void 0) && !c.signatures)
|
|
21223
21223
|
throw new TypeError("Not enough data");
|
|
@@ -21323,7 +21323,7 @@ var oo = {}, np;
|
|
|
21323
21323
|
function D8() {
|
|
21324
21324
|
if (np) return oo;
|
|
21325
21325
|
np = 1, Object.defineProperty(oo, "__esModule", { value: !0 }), oo.p2pk = void 0;
|
|
21326
|
-
const e = Wn(), t =
|
|
21326
|
+
const e = Wn(), t = rn(), n = Xt(), r = yi(), i = t.OPS;
|
|
21327
21327
|
function s(o, c) {
|
|
21328
21328
|
if (!o.input && !o.output && !o.pubkey && !o.input && !o.signature)
|
|
21329
21329
|
throw new TypeError("Not enough data");
|
|
@@ -22318,7 +22318,7 @@ var hp;
|
|
|
22318
22318
|
function z8() {
|
|
22319
22319
|
if (hp) return co;
|
|
22320
22320
|
hp = 1, Object.defineProperty(co, "__esModule", { value: !0 }), co.p2pkh = void 0;
|
|
22321
|
-
const e = Pr(), t = Wn(), n =
|
|
22321
|
+
const e = Pr(), t = Wn(), n = rn(), r = Xt(), i = yi(), s = _h(), o = n.OPS;
|
|
22322
22322
|
function c(a, u) {
|
|
22323
22323
|
if (!a.address && !a.hash && !a.output && !a.pubkey && !a.input)
|
|
22324
22324
|
throw new TypeError("Not enough data");
|
|
@@ -22418,7 +22418,7 @@ var ao = {}, dp;
|
|
|
22418
22418
|
function Y8() {
|
|
22419
22419
|
if (dp) return ao;
|
|
22420
22420
|
dp = 1, Object.defineProperty(ao, "__esModule", { value: !0 }), ao.p2sh = void 0;
|
|
22421
|
-
const e = Pr(), t = Wn(), n =
|
|
22421
|
+
const e = Pr(), t = Wn(), n = rn(), r = Xt(), i = yi(), s = _h(), o = n.OPS;
|
|
22422
22422
|
function c(a, u) {
|
|
22423
22423
|
if (!a.address && !a.hash && !a.output && !a.redeem && !a.input)
|
|
22424
22424
|
throw new TypeError("Not enough data");
|
|
@@ -22563,7 +22563,7 @@ var uo = {}, pp;
|
|
|
22563
22563
|
function Z8() {
|
|
22564
22564
|
if (pp) return uo;
|
|
22565
22565
|
pp = 1, Object.defineProperty(uo, "__esModule", { value: !0 }), uo.p2wpkh = void 0;
|
|
22566
|
-
const e = Pr(), t = Wn(), n =
|
|
22566
|
+
const e = Pr(), t = Wn(), n = rn(), r = Xt(), i = yi(), s = ac(), o = n.OPS, c = Buffer.alloc(0);
|
|
22567
22567
|
function a(u, f) {
|
|
22568
22568
|
if (!u.address && !u.hash && !u.output && !u.pubkey && !u.witness)
|
|
22569
22569
|
throw new TypeError("Not enough data");
|
|
@@ -22667,7 +22667,7 @@ var fo = {}, yp;
|
|
|
22667
22667
|
function J8() {
|
|
22668
22668
|
if (yp) return fo;
|
|
22669
22669
|
yp = 1, Object.defineProperty(fo, "__esModule", { value: !0 }), fo.p2wsh = void 0;
|
|
22670
|
-
const e = Pr(), t = Wn(), n =
|
|
22670
|
+
const e = Pr(), t = Wn(), n = rn(), r = Xt(), i = yi(), s = ac(), o = n.OPS, c = Buffer.alloc(0);
|
|
22671
22671
|
function a(f) {
|
|
22672
22672
|
return !!(Buffer.isBuffer(f) && f.length === 65 && f[0] === 4 && (0, r.isPoint)(f));
|
|
22673
22673
|
}
|
|
@@ -23147,7 +23147,7 @@ var _p;
|
|
|
23147
23147
|
function tA() {
|
|
23148
23148
|
if (_p) return lo;
|
|
23149
23149
|
_p = 1, Object.defineProperty(lo, "__esModule", { value: !0 }), lo.p2tr = void 0;
|
|
23150
|
-
const e = tc(), t = Wn(), n =
|
|
23150
|
+
const e = tc(), t = Wn(), n = rn(), r = Xt(), i = Sh(), s = Th(), o = yi(), c = ac(), a = xh(), u = n.OPS, f = 1, l = 80;
|
|
23151
23151
|
function d(y, g) {
|
|
23152
23152
|
if (!y.address && !y.output && !y.pubkey && !y.internalPubkey && !(y.witness && y.witness.length > 1))
|
|
23153
23153
|
throw new TypeError("Not enough data");
|
|
@@ -23414,7 +23414,7 @@ var Tp;
|
|
|
23414
23414
|
function xh() {
|
|
23415
23415
|
if (Tp) return Yt;
|
|
23416
23416
|
Tp = 1, Object.defineProperty(Yt, "__esModule", { value: !0 }), Yt.toOutputScript = Yt.fromOutputScript = Yt.toBech32 = Yt.toBase58Check = Yt.fromBech32 = Yt.fromBase58Check = void 0;
|
|
23417
|
-
const e = Wn(), t = Ec(), n =
|
|
23417
|
+
const e = Wn(), t = Ec(), n = rn(), r = Xt(), i = ac(), s = _h(), 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.";
|
|
23418
23418
|
function d(w, T) {
|
|
23419
23419
|
const O = w.slice(2);
|
|
23420
23420
|
if (O.length < c || O.length > o)
|
|
@@ -23559,7 +23559,7 @@ var yo = {}, Ap;
|
|
|
23559
23559
|
function _c() {
|
|
23560
23560
|
if (Ap) return yo;
|
|
23561
23561
|
Ap = 1, Object.defineProperty(yo, "__esModule", { value: !0 }), yo.Transaction = void 0;
|
|
23562
|
-
const e = Eu(), t = Pr(), n =
|
|
23562
|
+
const e = Eu(), t = Pr(), n = rn(), r = rn(), i = Xt(), { typeforce: s } = i;
|
|
23563
23563
|
function o(E) {
|
|
23564
23564
|
const _ = E.length;
|
|
23565
23565
|
return e.varuint.encodingLength(_) + _;
|
|
@@ -25507,7 +25507,7 @@ var Qe = {}, ze = {}, ry;
|
|
|
25507
25507
|
function dl() {
|
|
25508
25508
|
if (ry) return ze;
|
|
25509
25509
|
ry = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.signatureBlocksAction = ze.checkInputForSig = ze.pubkeyInScript = ze.pubkeyPositionInScript = ze.witnessStackToScriptWitness = ze.isP2TR = ze.isP2SHScript = ze.isP2WSHScript = ze.isP2WPKH = ze.isP2PKH = ze.isP2PK = ze.isP2MS = void 0;
|
|
25510
|
-
const e = ts(), t =
|
|
25510
|
+
const e = ts(), t = rn(), n = _c(), r = Pr(), i = Ec();
|
|
25511
25511
|
function s(y) {
|
|
25512
25512
|
return (g) => {
|
|
25513
25513
|
try {
|
|
@@ -25808,7 +25808,7 @@ var sy;
|
|
|
25808
25808
|
function OA() {
|
|
25809
25809
|
if (sy) return go;
|
|
25810
25810
|
sy = 1, Object.defineProperty(go, "__esModule", { value: !0 }), go.Psbt = void 0;
|
|
25811
|
-
const e = vA(), t = ts(), n = Zw(), r = xh(), i = Eu(), s = Wn(), o = Ec(), c = Th(), a =
|
|
25811
|
+
const e = vA(), t = ts(), n = Zw(), r = xh(), i = Eu(), s = Wn(), o = Ec(), c = Th(), a = rn(), u = _c(), f = IA(), l = dl(), d = {
|
|
25812
25812
|
/**
|
|
25813
25813
|
* A bitcoinjs Network object. This is only used if you pass an `address`
|
|
25814
25814
|
* parameter to addOutput. Otherwise it is not needed and can be left default.
|
|
@@ -27019,7 +27019,7 @@ function BA() {
|
|
|
27019
27019
|
e.networks = r;
|
|
27020
27020
|
const i = Ec();
|
|
27021
27021
|
e.payments = i;
|
|
27022
|
-
const s =
|
|
27022
|
+
const s = rn();
|
|
27023
27023
|
e.script = s;
|
|
27024
27024
|
var o = rA();
|
|
27025
27025
|
Object.defineProperty(e, "Block", {
|
|
@@ -27722,18 +27722,18 @@ function Bh(e, t = Bo.Testnet) {
|
|
|
27722
27722
|
}
|
|
27723
27723
|
function si(e) {
|
|
27724
27724
|
const t = Pn, n = Fy, r = D1;
|
|
27725
|
-
let i, s, o =
|
|
27725
|
+
let i, s, o = Jt.UNKNOWN;
|
|
27726
27726
|
if (e.startsWith("bc1") || e.startsWith("tb1") || e.startsWith("bcrt1"))
|
|
27727
27727
|
try {
|
|
27728
|
-
return s = kl(e), s.version === 0 ? s.data.length === 20 ? o =
|
|
27728
|
+
return s = kl(e), s.version === 0 ? s.data.length === 20 ? o = Jt.P2WPKH : o = Jt.P2WSH : o = Jt.P2TR, o;
|
|
27729
27729
|
} catch {
|
|
27730
|
-
return
|
|
27730
|
+
return Jt.UNKNOWN;
|
|
27731
27731
|
}
|
|
27732
27732
|
else
|
|
27733
27733
|
try {
|
|
27734
|
-
return i = xg(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o =
|
|
27734
|
+
return i = xg(e), i.version === t.pubKeyHash || i.version === n.pubKeyHash || i.version === r.pubKeyHash ? o = Jt.P2PKH : (i.version === t.scriptHash || (i.version, n.scriptHash), o = Jt.P2SH_P2WPKH), o;
|
|
27735
27735
|
} catch {
|
|
27736
|
-
return
|
|
27736
|
+
return Jt.UNKNOWN;
|
|
27737
27737
|
}
|
|
27738
27738
|
}
|
|
27739
27739
|
function CA(e, t, n) {
|
|
@@ -27773,7 +27773,7 @@ const aI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
27773
27773
|
getUtxoProof: e1,
|
|
27774
27774
|
hexToBytes: bo,
|
|
27775
27775
|
toBitcoinNetwork: Oh
|
|
27776
|
-
}, Symbol.toStringTag, { value: "Module" })), HA = "kqs64-paaaa-aaaar-qamza-cai", FA = "hvyp5-5yaaa-aaaao-qjxha-cai", Qr = BigInt(546),
|
|
27776
|
+
}, Symbol.toStringTag, { value: "Module" })), HA = "kqs64-paaaa-aaaar-qamza-cai", FA = "hvyp5-5yaaa-aaaao-qjxha-cai", Qr = BigInt(546), on = "0:0", MA = "https://runescan-hasura-mainnet.omnity.network/v1/graphql", qA = "https://runescan-hasura-testnet.omnity.network/v1/graphql", py = {
|
|
27777
27777
|
P2PKH: 148,
|
|
27778
27778
|
P2SH_P2WPKH: 91,
|
|
27779
27779
|
P2WPKH: 68,
|
|
@@ -27822,7 +27822,7 @@ class ki {
|
|
|
27822
27822
|
) >= 0)
|
|
27823
27823
|
return;
|
|
27824
27824
|
const { address: n } = t;
|
|
27825
|
-
if (si(n) ===
|
|
27825
|
+
if (si(n) === Jt.P2TR) {
|
|
27826
27826
|
let i = t.pubkey;
|
|
27827
27827
|
i || t.address === this.config.address && this.config.publicKey && (i = this.config.publicKey);
|
|
27828
27828
|
const s = i ? i.length === 66 ? i.slice(2) : i : void 0;
|
|
@@ -27833,7 +27833,7 @@ class ki {
|
|
|
27833
27833
|
value: BigInt(t.satoshis),
|
|
27834
27834
|
script: bo(t.scriptPk)
|
|
27835
27835
|
},
|
|
27836
|
-
|
|
27836
|
+
tapInternalKey: bo(s)
|
|
27837
27837
|
}) : this.psbt.data.addInput({
|
|
27838
27838
|
hash: t.txid,
|
|
27839
27839
|
index: t.vout,
|
|
@@ -28009,18 +28009,18 @@ class ki {
|
|
|
28009
28009
|
for (const o of this.intentions) {
|
|
28010
28010
|
for (const u of o.inputCoins) {
|
|
28011
28011
|
const f = s(u.from);
|
|
28012
|
-
u.coin.id ===
|
|
28012
|
+
u.coin.id === on ? f.needBtc = !0 : f.runeIds.add(u.coin.id);
|
|
28013
28013
|
}
|
|
28014
28014
|
for (const u of o.outputCoins) {
|
|
28015
28015
|
const f = s(u.to);
|
|
28016
|
-
u.coin.id ===
|
|
28016
|
+
u.coin.id === on ? f.needBtc = !0 : f.runeIds.add(u.coin.id);
|
|
28017
28017
|
}
|
|
28018
28018
|
const c = s(o.poolAddress), a = [
|
|
28019
28019
|
...o.inputCoins.map((u) => u.coin.id),
|
|
28020
28020
|
...o.outputCoins.map((u) => u.coin.id)
|
|
28021
28021
|
];
|
|
28022
28022
|
for (const u of a)
|
|
28023
|
-
u ===
|
|
28023
|
+
u === on ? c.needBtc = !0 : c.runeIds.add(u);
|
|
28024
28024
|
}
|
|
28025
28025
|
return await Promise.all(
|
|
28026
28026
|
Array.from(r.entries()).map(async ([o, c]) => {
|
|
@@ -28117,7 +28117,7 @@ class ki {
|
|
|
28117
28117
|
i[a] ??= {};
|
|
28118
28118
|
const f = i[a];
|
|
28119
28119
|
u.forEach((l) => {
|
|
28120
|
-
this.addInput(l), f[
|
|
28120
|
+
this.addInput(l), f[on] = (f[on] ?? BigInt(0)) + BigInt(l.satoshis), l.runes.forEach((d) => {
|
|
28121
28121
|
f[d.id] = (f[d.id] ?? BigInt(0)) + BigInt(d.amount);
|
|
28122
28122
|
});
|
|
28123
28123
|
});
|
|
@@ -28126,7 +28126,7 @@ class ki {
|
|
|
28126
28126
|
r
|
|
28127
28127
|
))
|
|
28128
28128
|
for (const [f, l] of Object.entries(u))
|
|
28129
|
-
if (f ===
|
|
28129
|
+
if (f === on) {
|
|
28130
28130
|
if (a === this.config.paymentAddress) {
|
|
28131
28131
|
s += l;
|
|
28132
28132
|
continue;
|
|
@@ -28158,8 +28158,8 @@ class ki {
|
|
|
28158
28158
|
), E = g - l;
|
|
28159
28159
|
if (n.includes(a)) {
|
|
28160
28160
|
i[a] ??= {};
|
|
28161
|
-
const _ = i[a], S = (r[a]?.[
|
|
28162
|
-
m > BigInt(0) && !S && (_[
|
|
28161
|
+
const _ = i[a], S = (r[a]?.[on] ?? BigInt(0)) > BigInt(0);
|
|
28162
|
+
m > BigInt(0) && !S && (_[on] = (_[on] ?? BigInt(0)) + m), E > BigInt(0) && (_[f] = (_[f] ?? BigInt(0)) + E);
|
|
28163
28163
|
} else E > BigInt(0) && (i[a] ??= {}, i[a][f] = (i[a][f] ?? BigInt(0)) + E);
|
|
28164
28164
|
y.forEach((_) => this.addInput(_));
|
|
28165
28165
|
}
|
|
@@ -28168,7 +28168,7 @@ class ki {
|
|
|
28168
28168
|
))
|
|
28169
28169
|
if (!(r[a] || !n.includes(a) || c.has(a)))
|
|
28170
28170
|
for (const [f] of Object.entries(u))
|
|
28171
|
-
if (f ===
|
|
28171
|
+
if (f === on) {
|
|
28172
28172
|
const l = t.btc[a] || [], d = l.reduce(
|
|
28173
28173
|
(y, g) => y + BigInt(g.satoshis),
|
|
28174
28174
|
BigInt(0)
|
|
@@ -28207,7 +28207,7 @@ class ki {
|
|
|
28207
28207
|
const n = this.config.mergeSelfRuneBtcOutputs === !0, r = /* @__PURE__ */ new Set();
|
|
28208
28208
|
for (const [, s] of Object.entries(t))
|
|
28209
28209
|
for (const o of Object.keys(s))
|
|
28210
|
-
o !==
|
|
28210
|
+
o !== on && r.add(o);
|
|
28211
28211
|
const i = Array.from(r);
|
|
28212
28212
|
if (i.length > 0) {
|
|
28213
28213
|
const s = [], o = [];
|
|
@@ -28226,14 +28226,14 @@ class ki {
|
|
|
28226
28226
|
});
|
|
28227
28227
|
const a = new fs.Runestone(s, fs.none(), fs.none(), fs.none());
|
|
28228
28228
|
this.addScriptOutput(new Uint8Array(a.encipher())), o.forEach((u) => {
|
|
28229
|
-
const f = t[u]?.[
|
|
28230
|
-
this.addOutput(u, y), d ? (f < Qr && (this.additionalDustNeeded += Qr - f), delete t[u][
|
|
28229
|
+
const f = t[u]?.[on] ?? BigInt(0), l = u === this.config.address, d = f > BigInt(0) && (!l || n), y = d && f > Qr ? f : Qr;
|
|
28230
|
+
this.addOutput(u, y), d ? (f < Qr && (this.additionalDustNeeded += Qr - f), delete t[u][on]) : this.additionalDustNeeded += Qr;
|
|
28231
28231
|
});
|
|
28232
28232
|
}
|
|
28233
28233
|
for (const [s, o] of Object.entries(
|
|
28234
28234
|
t
|
|
28235
28235
|
)) {
|
|
28236
|
-
const c = o[
|
|
28236
|
+
const c = o[on] ?? BigInt(0);
|
|
28237
28237
|
c > BigInt(0) && this.addOutput(s, c);
|
|
28238
28238
|
}
|
|
28239
28239
|
}
|
|
@@ -28283,34 +28283,38 @@ class ki {
|
|
|
28283
28283
|
*/
|
|
28284
28284
|
async build() {
|
|
28285
28285
|
const t = await this.getInvolvedAddressUtxos();
|
|
28286
|
-
for (const
|
|
28287
|
-
const
|
|
28288
|
-
if (!
|
|
28289
|
-
t.btc[
|
|
28290
|
-
const
|
|
28291
|
-
for (const
|
|
28292
|
-
for (const
|
|
28286
|
+
for (const f of this.intentions) {
|
|
28287
|
+
const l = f.poolUtxos;
|
|
28288
|
+
if (!l) continue;
|
|
28289
|
+
t.btc[f.poolAddress] = l, t.rune[f.poolAddress] = {};
|
|
28290
|
+
const d = t.rune[f.poolAddress];
|
|
28291
|
+
for (const y of l)
|
|
28292
|
+
for (const g of y.runes) (d[g.id] ??= []).push(y);
|
|
28293
28293
|
}
|
|
28294
28294
|
const { addressOutputCoinAmounts: n, paymentBtcRequired: r } = this.addInputsAndCalculateOutputs(t);
|
|
28295
28295
|
this.addOutputs(n);
|
|
28296
28296
|
const i = this.config.paymentAddress, s = t.btc[i] ?? [];
|
|
28297
28297
|
await this.addBtcAndFees(s, r);
|
|
28298
|
-
const c = this.psbt.__CACHE.__TX.clone();
|
|
28299
|
-
for (let
|
|
28300
|
-
const l = this.inputUtxos[
|
|
28301
|
-
if (
|
|
28298
|
+
const c = this.psbt.__CACHE.__TX.clone(), a = [];
|
|
28299
|
+
for (let f = 0; f < this.inputUtxos.length; f++) {
|
|
28300
|
+
const l = this.inputUtxos[f], d = l.address;
|
|
28301
|
+
if (d !== this.config.paymentAddress || d !== this.config.address)
|
|
28302
28302
|
continue;
|
|
28303
|
-
const
|
|
28304
|
-
if (
|
|
28305
|
-
|
|
28306
|
-
|
|
28303
|
+
const y = this.psbt.data.inputs[f].redeemScript, g = si(d);
|
|
28304
|
+
if (a.push({
|
|
28305
|
+
index: f,
|
|
28306
|
+
...g === Jt.P2TR ? { address: d, disableTweakSigner: !1 } : { publicKey: l.pubkey, disableTweakSigner: !0 }
|
|
28307
|
+
}), y && g === Jt.P2SH_P2WPKH) {
|
|
28308
|
+
const m = nn([y]);
|
|
28309
|
+
c.setInputScript(f, m);
|
|
28307
28310
|
}
|
|
28308
28311
|
}
|
|
28309
|
-
const
|
|
28312
|
+
const u = c.getId();
|
|
28310
28313
|
return {
|
|
28311
28314
|
psbt: this.psbt,
|
|
28312
|
-
txid:
|
|
28313
|
-
fee: this.txFee
|
|
28315
|
+
txid: u,
|
|
28316
|
+
fee: this.txFee,
|
|
28317
|
+
toSignInputs: a
|
|
28314
28318
|
};
|
|
28315
28319
|
}
|
|
28316
28320
|
static estimateTxVirtualSize(t, n) {
|