@meshsdk/core 1.5.22 → 1.5.23
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/core.js
CHANGED
|
@@ -9,7 +9,7 @@ const on = (s) => {
|
|
|
9
9
|
const r = e.find((n) => n.unit === t.unit);
|
|
10
10
|
r ? r.quantity = (parseInt(r.quantity) + parseInt(t.quantity)).toString() : e.push(t);
|
|
11
11
|
}), e;
|
|
12
|
-
}, Xr = ["testnet", "preview", "preprod", "mainnet"], Zr = (s) => Xr.includes(s),
|
|
12
|
+
}, Xr = ["testnet", "preview", "preprod", "mainnet"], Zr = (s) => Xr.includes(s), Yt = {
|
|
13
13
|
mem: 7e6,
|
|
14
14
|
steps: 3e9
|
|
15
15
|
}, mt = {
|
|
@@ -33,7 +33,7 @@ const on = (s) => {
|
|
|
33
33
|
maxTxExSteps: "10000000000",
|
|
34
34
|
maxBlockExMem: "80000000",
|
|
35
35
|
maxBlockExSteps: "40000000000"
|
|
36
|
-
}, be = 2147483648,
|
|
36
|
+
}, be = 2147483648, vt = {
|
|
37
37
|
V1: a.Language.new_plutus_v1(),
|
|
38
38
|
V2: a.Language.new_plutus_v2()
|
|
39
39
|
}, lt = 56, ts = {
|
|
@@ -454,15 +454,15 @@ const on = (s) => {
|
|
|
454
454
|
"vespr",
|
|
455
455
|
"yoroi"
|
|
456
456
|
], ns = (s, e, t = "5000000") => {
|
|
457
|
-
const r = a.BigNum.from_str(s.get("lovelace") ?? "0").checked_add(a.BigNum.from_str(t)), n = e.filter((l) => l.output.amount.filter((
|
|
457
|
+
const r = a.BigNum.from_str(s.get("lovelace") ?? "0").checked_add(a.BigNum.from_str(t)), n = e.filter((l) => l.output.amount.filter((A) => A.unit !== "lovelace").some((A) => s.has(A.unit))), i = cs(n);
|
|
458
458
|
return [
|
|
459
|
-
...i.less_than(r) ? us(r.clamped_sub(i).to_str(), e.filter((l) => !n.some((
|
|
459
|
+
...i.less_than(r) ? us(r.clamped_sub(i).to_str(), e.filter((l) => !n.some((A) => A.input.txHash === l.input.txHash && A.input.outputIndex === l.input.outputIndex))) : [],
|
|
460
460
|
...n
|
|
461
461
|
];
|
|
462
462
|
}, cn = (s, e, t = !1, { maxTxSize: r, minFeeA: n, minFeeB: i } = mt) => {
|
|
463
|
-
const c = e.filter((b) => Cr(b) === !1).sort(Fe), l = a.BigNum.from_str(qr(r, n, i)),
|
|
463
|
+
const c = e.filter((b) => Cr(b) === !1).sort(Fe), l = a.BigNum.from_str(qr(r, n, i)), A = t ? a.BigNum.from_str(s).checked_add(l).to_str() : s;
|
|
464
464
|
return ie(c, /* @__PURE__ */ new Map([
|
|
465
|
-
["lovelace",
|
|
465
|
+
["lovelace", A]
|
|
466
466
|
]));
|
|
467
467
|
}, is = (s, e, t = !1, r = mt) => {
|
|
468
468
|
const n = e.filter(Cr).sort(Fe), i = os(r), c = s.get("lovelace") ?? "0", l = t ? a.BigNum.from_str(c).checked_add(i).to_str() : c;
|
|
@@ -496,8 +496,8 @@ const on = (s) => {
|
|
|
496
496
|
var c, l;
|
|
497
497
|
const n = xr.from_bytes(G(t)), i = $r.from_bytes(G(r));
|
|
498
498
|
if ((s == null ? void 0 : s.length) > 0) {
|
|
499
|
-
const
|
|
500
|
-
if (ht(s) !==
|
|
499
|
+
const A = ut(i.payload() ?? new Uint8Array());
|
|
500
|
+
if (ht(s) !== A)
|
|
501
501
|
return !1;
|
|
502
502
|
}
|
|
503
503
|
if ((e == null ? void 0 : e.length) > 0) {
|
|
@@ -507,7 +507,7 @@ const on = (s) => {
|
|
|
507
507
|
const B = (l = n.header(Pt.new_int(ge.new_negative(De.from_str("2"))))) == null ? void 0 : l.as_bytes();
|
|
508
508
|
if (B === void 0)
|
|
509
509
|
throw new Error("Couldn't find a signer key in signature");
|
|
510
|
-
const b =
|
|
510
|
+
const b = Gt(ut(y)), w = Fs(ut(B));
|
|
511
511
|
if (ds(e, b, w) === !1)
|
|
512
512
|
throw new Error("Couldn't check signature because of address mismatch");
|
|
513
513
|
const v = Hs(ut(i.signature())), U = i.signed_data().to_bytes();
|
|
@@ -534,18 +534,18 @@ const on = (s) => {
|
|
|
534
534
|
return i.build(l.to_bytes());
|
|
535
535
|
};
|
|
536
536
|
var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Br = {}, ot = { exports: {} };
|
|
537
|
-
Dt.notEqual =
|
|
538
|
-
Dt.notOk =
|
|
537
|
+
Dt.notEqual = ps;
|
|
538
|
+
Dt.notOk = As;
|
|
539
539
|
Dt.equal = ms;
|
|
540
540
|
Dt.ok = Dt;
|
|
541
|
-
var
|
|
541
|
+
var Sr = Dt;
|
|
542
542
|
function ms(s, e, t) {
|
|
543
543
|
Dt(s == e, t);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function ps(s, e, t) {
|
|
546
546
|
Dt(s != e, t);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function As(s, e) {
|
|
549
549
|
Dt(!s, e);
|
|
550
550
|
}
|
|
551
551
|
function Dt(s, e) {
|
|
@@ -570,14 +570,14 @@ function Re(s) {
|
|
|
570
570
|
};
|
|
571
571
|
return c(function() {
|
|
572
572
|
}), n;
|
|
573
|
-
function i(
|
|
574
|
-
n.exports.memory.grow(Math.ceil(Math.abs(
|
|
573
|
+
function i(A) {
|
|
574
|
+
n.exports.memory.grow(Math.ceil(Math.abs(A - n.memory.length) / 65536)), n.memory = new Uint8Array(n.exports.memory.buffer);
|
|
575
575
|
}
|
|
576
|
-
function c(
|
|
576
|
+
function c(A) {
|
|
577
577
|
if (n.exports)
|
|
578
|
-
return
|
|
578
|
+
return A();
|
|
579
579
|
if (r) {
|
|
580
|
-
r.then(
|
|
580
|
+
r.then(A.bind(null, null)).catch(A);
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
try {
|
|
@@ -587,10 +587,10 @@ function Re(s) {
|
|
|
587
587
|
} catch {
|
|
588
588
|
r = WebAssembly.instantiate(t, e).then(l);
|
|
589
589
|
}
|
|
590
|
-
c(
|
|
590
|
+
c(A);
|
|
591
591
|
}
|
|
592
|
-
function l(
|
|
593
|
-
n.exports =
|
|
592
|
+
function l(A) {
|
|
593
|
+
n.exports = A.instance.exports, n.memory = n.exports.memory && n.exports.memory.buffer && new Uint8Array(n.exports.memory.buffer);
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
function ys(s) {
|
|
@@ -599,24 +599,24 @@ function ys(s) {
|
|
|
599
599
|
function xs(s) {
|
|
600
600
|
return s.charCodeAt(0);
|
|
601
601
|
}
|
|
602
|
-
var wt =
|
|
603
|
-
Et.exports =
|
|
602
|
+
var wt = Sr, W = _s(), Qt = 64, me = [];
|
|
603
|
+
Et.exports = pt;
|
|
604
604
|
var Xe = Et.exports.BYTES_MIN = 16, Ze = Et.exports.BYTES_MAX = 64;
|
|
605
605
|
Et.exports.BYTES = 32;
|
|
606
606
|
var tr = Et.exports.KEYBYTES_MIN = 16, er = Et.exports.KEYBYTES_MAX = 64;
|
|
607
607
|
Et.exports.KEYBYTES = 32;
|
|
608
608
|
var rr = Et.exports.SALTBYTES = 16, sr = Et.exports.PERSONALBYTES = 16;
|
|
609
|
-
function
|
|
610
|
-
if (!(this instanceof
|
|
611
|
-
return new
|
|
609
|
+
function pt(s, e, t, r, n) {
|
|
610
|
+
if (!(this instanceof pt))
|
|
611
|
+
return new pt(s, e, t, r, n);
|
|
612
612
|
if (!(W && W.exports))
|
|
613
613
|
throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");
|
|
614
|
-
s || (s = 32), n !== !0 && (wt(s >= Xe, "digestLength must be at least " + Xe + ", was given " + s), wt(s <= Ze, "digestLength must be at most " + Ze + ", was given " + s), e != null && wt(e.length >= tr, "key must be at least " + tr + ", was given " + e.length), e != null && wt(e.length <= er, "key must be at least " + er + ", was given " + e.length), t != null && wt(t.length === rr, "salt must be exactly " + rr + ", was given " + t.length), r != null && wt(r.length === sr, "personal must be exactly " + sr + ", was given " + r.length)), me.length || (me.push(
|
|
614
|
+
s || (s = 32), n !== !0 && (wt(s >= Xe, "digestLength must be at least " + Xe + ", was given " + s), wt(s <= Ze, "digestLength must be at most " + Ze + ", was given " + s), e != null && wt(e.length >= tr, "key must be at least " + tr + ", was given " + e.length), e != null && wt(e.length <= er, "key must be at least " + er + ", was given " + e.length), t != null && wt(t.length === rr, "salt must be exactly " + rr + ", was given " + t.length), r != null && wt(r.length === sr, "personal must be exactly " + sr + ", was given " + r.length)), me.length || (me.push(Qt), Qt += 216), this.digestLength = s, this.finalized = !1, this.pointer = me.pop(), W.memory.fill(0, 0, 64), W.memory[0] = this.digestLength, W.memory[1] = e ? e.length : 0, W.memory[2] = 1, W.memory[3] = 1, t && W.memory.set(t, 32), r && W.memory.set(r, 48), this.pointer + 216 > W.memory.length && W.realloc(this.pointer + 216), W.exports.blake2b_init(this.pointer, this.digestLength), e && (this.update(e), W.memory.fill(0, Qt, Qt + e.length), W.memory[this.pointer + 200] = 128);
|
|
615
615
|
}
|
|
616
|
-
|
|
617
|
-
return wt(this.finalized === !1, "Hash instance finalized"), wt(s, "input must be TypedArray or Buffer"),
|
|
616
|
+
pt.prototype.update = function(s) {
|
|
617
|
+
return wt(this.finalized === !1, "Hash instance finalized"), wt(s, "input must be TypedArray or Buffer"), Qt + s.length > W.memory.length && W.realloc(Qt + s.length), W.memory.set(s, Qt), W.exports.blake2b_update(this.pointer, Qt, Qt + s.length), this;
|
|
618
618
|
};
|
|
619
|
-
|
|
619
|
+
pt.prototype.digest = function(s) {
|
|
620
620
|
if (wt(this.finalized === !1, "Hash instance finalized"), this.finalized = !0, me.push(this.pointer), W.exports.blake2b_final(this.pointer), !s || s === "binary")
|
|
621
621
|
return W.memory.slice(this.pointer + 128, this.pointer + 128 + this.digestLength);
|
|
622
622
|
if (s === "hex")
|
|
@@ -626,10 +626,10 @@ At.prototype.digest = function(s) {
|
|
|
626
626
|
s[e] = W.memory[this.pointer + 128 + e];
|
|
627
627
|
return s;
|
|
628
628
|
};
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
629
|
+
pt.prototype.final = pt.prototype.digest;
|
|
630
|
+
pt.WASM = W && W.buffer;
|
|
631
|
+
pt.SUPPORTED = typeof WebAssembly < "u";
|
|
632
|
+
pt.ready = function(s) {
|
|
633
633
|
if (s || (s = ws), !W)
|
|
634
634
|
return s(new Error("WebAssembly not supported"));
|
|
635
635
|
var e = new Promise(function(t, r) {
|
|
@@ -639,7 +639,7 @@ At.ready = function(s) {
|
|
|
639
639
|
});
|
|
640
640
|
return e;
|
|
641
641
|
};
|
|
642
|
-
|
|
642
|
+
pt.prototype.ready = pt.ready;
|
|
643
643
|
function ws() {
|
|
644
644
|
}
|
|
645
645
|
function Cs(s, e, t) {
|
|
@@ -650,7 +650,7 @@ function Cs(s, e, t) {
|
|
|
650
650
|
function Bs(s) {
|
|
651
651
|
return s < 16 ? "0" + s.toString(16) : s.toString(16);
|
|
652
652
|
}
|
|
653
|
-
var Ut =
|
|
653
|
+
var Ut = Sr, ae = Et.exports;
|
|
654
654
|
function ue(s, e, t) {
|
|
655
655
|
var r = s[e] + s[t], n = s[e + 1] + s[t + 1];
|
|
656
656
|
r >= 4294967296 && n++, s[e] = r, s[e + 1] = n;
|
|
@@ -661,14 +661,14 @@ function nr(s, e, t, r) {
|
|
|
661
661
|
var i = s[e + 1] + r;
|
|
662
662
|
n >= 4294967296 && i++, s[e] = n, s[e + 1] = i;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Er(s, e) {
|
|
665
665
|
return s[e] ^ s[e + 1] << 8 ^ s[e + 2] << 16 ^ s[e + 3] << 24;
|
|
666
666
|
}
|
|
667
667
|
function Tt(s, e, t, r, n, i) {
|
|
668
|
-
var c = re[n], l = re[n + 1],
|
|
668
|
+
var c = re[n], l = re[n + 1], A = re[i], y = re[i + 1];
|
|
669
669
|
ue(H, s, e), nr(H, s, c, l);
|
|
670
670
|
var B = H[r] ^ H[s], b = H[r + 1] ^ H[s + 1];
|
|
671
|
-
H[r] = b, H[r + 1] = B, ue(H, t, r), B = H[e] ^ H[t], b = H[e + 1] ^ H[t + 1], H[e] = B >>> 24 ^ b << 8, H[e + 1] = b >>> 24 ^ B << 8, ue(H, s, e), nr(H, s,
|
|
671
|
+
H[r] = b, H[r + 1] = B, ue(H, t, r), B = H[e] ^ H[t], b = H[e + 1] ^ H[t + 1], H[e] = B >>> 24 ^ b << 8, H[e + 1] = b >>> 24 ^ B << 8, ue(H, s, e), nr(H, s, A, y), B = H[r] ^ H[s], b = H[r + 1] ^ H[s + 1], H[r] = B >>> 16 ^ b << 16, H[r + 1] = b >>> 16 ^ B << 16, ue(H, t, r), B = H[e] ^ H[t], b = H[e + 1] ^ H[t + 1], H[e] = b >>> 31 ^ B << 1, H[e + 1] = B >>> 31 ^ b << 1;
|
|
672
672
|
}
|
|
673
673
|
var br = new Uint32Array([
|
|
674
674
|
4089235720,
|
|
@@ -687,7 +687,7 @@ var br = new Uint32Array([
|
|
|
687
687
|
528734635,
|
|
688
688
|
327033209,
|
|
689
689
|
1541459225
|
|
690
|
-
]),
|
|
690
|
+
]), Ss = [
|
|
691
691
|
0,
|
|
692
692
|
1,
|
|
693
693
|
2,
|
|
@@ -880,7 +880,7 @@ var br = new Uint32Array([
|
|
|
880
880
|
7,
|
|
881
881
|
5,
|
|
882
882
|
3
|
|
883
|
-
], it = new Uint8Array(
|
|
883
|
+
], it = new Uint8Array(Ss.map(function(s) {
|
|
884
884
|
return s * 2;
|
|
885
885
|
})), H = new Uint32Array(32), re = new Uint32Array(32);
|
|
886
886
|
function vr(s, e) {
|
|
@@ -888,7 +888,7 @@ function vr(s, e) {
|
|
|
888
888
|
for (t = 0; t < 16; t++)
|
|
889
889
|
H[t] = s.h[t], H[t + 16] = br[t];
|
|
890
890
|
for (H[24] = H[24] ^ s.t, H[25] = H[25] ^ s.t / 4294967296, e && (H[28] = ~H[28], H[29] = ~H[29]), t = 0; t < 32; t++)
|
|
891
|
-
re[t] =
|
|
891
|
+
re[t] = Er(s.b, 4 * t);
|
|
892
892
|
for (t = 0; t < 12; t++)
|
|
893
893
|
Tt(0, 8, 16, 24, it[t * 16 + 0], it[t * 16 + 1]), Tt(2, 10, 18, 26, it[t * 16 + 2], it[t * 16 + 3]), Tt(4, 12, 20, 28, it[t * 16 + 4], it[t * 16 + 5]), Tt(6, 14, 22, 30, it[t * 16 + 6], it[t * 16 + 7]), Tt(0, 10, 20, 30, it[t * 16 + 8], it[t * 16 + 9]), Tt(2, 12, 22, 24, it[t * 16 + 10], it[t * 16 + 11]), Tt(4, 14, 16, 26, it[t * 16 + 12], it[t * 16 + 13]), Tt(6, 8, 18, 28, it[t * 16 + 14], it[t * 16 + 15]);
|
|
894
894
|
for (t = 0; t < 16; t++)
|
|
@@ -960,21 +960,21 @@ var Nt = new Uint8Array([
|
|
|
960
960
|
0,
|
|
961
961
|
0
|
|
962
962
|
]);
|
|
963
|
-
function
|
|
963
|
+
function Jt(s, e, t, r) {
|
|
964
964
|
Nt.fill(0), this.b = new Uint8Array(128), this.h = new Uint32Array(16), this.t = 0, this.c = 0, this.outlen = s, Nt[0] = s, e && (Nt[1] = e.length), Nt[2] = 1, Nt[3] = 1, t && Nt.set(t, 32), r && Nt.set(r, 48);
|
|
965
965
|
for (var n = 0; n < 16; n++)
|
|
966
|
-
this.h[n] = br[n] ^
|
|
966
|
+
this.h[n] = br[n] ^ Er(Nt, n * 4);
|
|
967
967
|
e && (Qr(this, e), this.c = 128);
|
|
968
968
|
}
|
|
969
|
-
|
|
969
|
+
Jt.prototype.update = function(s) {
|
|
970
970
|
return Ut(s != null, "input must be Uint8Array or Buffer"), Qr(this, s), this;
|
|
971
971
|
};
|
|
972
|
-
|
|
972
|
+
Jt.prototype.digest = function(s) {
|
|
973
973
|
var e = !s || s === "binary" || s === "hex" ? new Uint8Array(this.outlen) : s;
|
|
974
|
-
return Ut(e.length >= this.outlen, "out must have at least outlen bytes of space"),
|
|
974
|
+
return Ut(e.length >= this.outlen, "out must have at least outlen bytes of space"), Es(this, e), s === "hex" ? bs(e) : e;
|
|
975
975
|
};
|
|
976
|
-
|
|
977
|
-
|
|
976
|
+
Jt.prototype.final = Jt.prototype.digest;
|
|
977
|
+
Jt.ready = function(s) {
|
|
978
978
|
ae.ready(function() {
|
|
979
979
|
s();
|
|
980
980
|
});
|
|
@@ -983,7 +983,7 @@ function Qr(s, e) {
|
|
|
983
983
|
for (var t = 0; t < e.length; t++)
|
|
984
984
|
s.c === 128 && (s.t += s.c, vr(s, !1), s.c = 0), s.b[s.c++] = e[t];
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function Es(s, e) {
|
|
987
987
|
for (s.t += s.c; s.c < 128; )
|
|
988
988
|
s.b[s.c++] = 0;
|
|
989
989
|
vr(s, !0);
|
|
@@ -999,7 +999,7 @@ function bs(s) {
|
|
|
999
999
|
function vs(s) {
|
|
1000
1000
|
return s < 16 ? "0" + s.toString(16) : s.toString(16);
|
|
1001
1001
|
}
|
|
1002
|
-
var Dr =
|
|
1002
|
+
var Dr = Jt;
|
|
1003
1003
|
ot.exports = function(e, t, r, n, i) {
|
|
1004
1004
|
return i !== !0 && (Ut(e >= ir, "outlen must be at least " + ir + ", was given " + e), Ut(e <= ar, "outlen must be at most " + ar + ", was given " + e), t != null && Ut(t.length >= or, "key must be at least " + or + ", was given " + t.length), t != null && Ut(t.length <= cr, "key must be at most " + cr + ", was given " + t.length), r != null && Ut(r.length === ur, "salt must be exactly " + ur + ", was given " + r.length), n != null && Ut(n.length === lr, "personal must be exactly " + lr + ", was given " + n.length)), new Dr(e, t, r, n);
|
|
1005
1005
|
};
|
|
@@ -1018,15 +1018,15 @@ var ur = ot.exports.SALTBYTES = 16, lr = ot.exports.PERSONALBYTES = 16;
|
|
|
1018
1018
|
ae.ready(function(s) {
|
|
1019
1019
|
s || (ot.exports.WASM_LOADED = !0, Dr = ae);
|
|
1020
1020
|
});
|
|
1021
|
-
var
|
|
1022
|
-
Object.defineProperty(
|
|
1023
|
-
|
|
1021
|
+
var jt = {};
|
|
1022
|
+
Object.defineProperty(jt, "__esModule", { value: !0 });
|
|
1023
|
+
jt.bech32m = jt.bech32 = void 0;
|
|
1024
1024
|
const _e = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", kr = {};
|
|
1025
1025
|
for (let s = 0; s < _e.length; s++) {
|
|
1026
1026
|
const e = _e.charAt(s);
|
|
1027
1027
|
kr[e] = s;
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function zt(s) {
|
|
1030
1030
|
const e = s >> 25;
|
|
1031
1031
|
return (s & 33554431) << 5 ^ -(e >> 0 & 1) & 996825010 ^ -(e >> 1 & 1) & 642813549 ^ -(e >> 2 & 1) & 513874426 ^ -(e >> 3 & 1) & 1027748829 ^ -(e >> 4 & 1) & 705979059;
|
|
1032
1032
|
}
|
|
@@ -1036,20 +1036,20 @@ function hr(s) {
|
|
|
1036
1036
|
const r = s.charCodeAt(t);
|
|
1037
1037
|
if (r < 33 || r > 126)
|
|
1038
1038
|
return "Invalid prefix (" + s + ")";
|
|
1039
|
-
e =
|
|
1039
|
+
e = zt(e) ^ r >> 5;
|
|
1040
1040
|
}
|
|
1041
|
-
e =
|
|
1041
|
+
e = zt(e);
|
|
1042
1042
|
for (let t = 0; t < s.length; ++t) {
|
|
1043
1043
|
const r = s.charCodeAt(t);
|
|
1044
|
-
e =
|
|
1044
|
+
e = zt(e) ^ r & 31;
|
|
1045
1045
|
}
|
|
1046
1046
|
return e;
|
|
1047
1047
|
}
|
|
1048
1048
|
function qe(s, e, t, r) {
|
|
1049
1049
|
let n = 0, i = 0;
|
|
1050
1050
|
const c = (1 << t) - 1, l = [];
|
|
1051
|
-
for (let
|
|
1052
|
-
for (n = n << e | s[
|
|
1051
|
+
for (let A = 0; A < s.length; ++A)
|
|
1052
|
+
for (n = n << e | s[A], i += e; i >= t; )
|
|
1053
1053
|
i -= t, l.push(n >> i & c);
|
|
1054
1054
|
if (r)
|
|
1055
1055
|
i > 0 && l.push(n << t - i & c);
|
|
@@ -1078,8 +1078,8 @@ function ks(s) {
|
|
|
1078
1078
|
function Tr(s) {
|
|
1079
1079
|
let e;
|
|
1080
1080
|
s === "bech32" ? e = 1 : e = 734539939;
|
|
1081
|
-
function t(c, l,
|
|
1082
|
-
if (
|
|
1081
|
+
function t(c, l, A) {
|
|
1082
|
+
if (A = A || 90, c.length + 7 + l.length > A)
|
|
1083
1083
|
throw new TypeError("Exceeds length limit");
|
|
1084
1084
|
c = c.toLowerCase();
|
|
1085
1085
|
let y = hr(c);
|
|
@@ -1090,10 +1090,10 @@ function Tr(s) {
|
|
|
1090
1090
|
const w = l[b];
|
|
1091
1091
|
if (w >> 5 !== 0)
|
|
1092
1092
|
throw new Error("Non 5-bit word");
|
|
1093
|
-
y =
|
|
1093
|
+
y = zt(y) ^ w, B += _e.charAt(w);
|
|
1094
1094
|
}
|
|
1095
1095
|
for (let b = 0; b < 6; ++b)
|
|
1096
|
-
y =
|
|
1096
|
+
y = zt(y);
|
|
1097
1097
|
y ^= e;
|
|
1098
1098
|
for (let b = 0; b < 6; ++b) {
|
|
1099
1099
|
const w = y >> (5 - b) * 5 & 31;
|
|
@@ -1106,10 +1106,10 @@ function Tr(s) {
|
|
|
1106
1106
|
return c + " too short";
|
|
1107
1107
|
if (c.length > l)
|
|
1108
1108
|
return "Exceeds length limit";
|
|
1109
|
-
const
|
|
1110
|
-
if (c !==
|
|
1109
|
+
const A = c.toLowerCase(), y = c.toUpperCase();
|
|
1110
|
+
if (c !== A && c !== y)
|
|
1111
1111
|
return "Mixed-case string " + c;
|
|
1112
|
-
c =
|
|
1112
|
+
c = A;
|
|
1113
1113
|
const B = c.lastIndexOf("1");
|
|
1114
1114
|
if (B === -1)
|
|
1115
1115
|
return "No separator character for " + c;
|
|
@@ -1126,20 +1126,20 @@ function Tr(s) {
|
|
|
1126
1126
|
const N = w.charAt(k), T = kr[N];
|
|
1127
1127
|
if (T === void 0)
|
|
1128
1128
|
return "Unknown character " + N;
|
|
1129
|
-
v =
|
|
1129
|
+
v = zt(v) ^ T, !(k + 6 >= w.length) && U.push(T);
|
|
1130
1130
|
}
|
|
1131
1131
|
return v !== e ? "Invalid checksum for " + c : { prefix: b, words: U };
|
|
1132
1132
|
}
|
|
1133
1133
|
function n(c, l) {
|
|
1134
|
-
const
|
|
1135
|
-
if (typeof
|
|
1136
|
-
return
|
|
1134
|
+
const A = r(c, l);
|
|
1135
|
+
if (typeof A == "object")
|
|
1136
|
+
return A;
|
|
1137
1137
|
}
|
|
1138
1138
|
function i(c, l) {
|
|
1139
|
-
const
|
|
1140
|
-
if (typeof
|
|
1141
|
-
return
|
|
1142
|
-
throw new Error(
|
|
1139
|
+
const A = r(c, l);
|
|
1140
|
+
if (typeof A == "object")
|
|
1141
|
+
return A;
|
|
1142
|
+
throw new Error(A);
|
|
1143
1143
|
}
|
|
1144
1144
|
return {
|
|
1145
1145
|
decodeUnsafe: n,
|
|
@@ -1150,13 +1150,13 @@ function Tr(s) {
|
|
|
1150
1150
|
fromWords: ks
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1153
|
+
jt.bech32 = Tr("bech32");
|
|
1154
|
+
jt.bech32m = Tr("bech32m");
|
|
1155
1155
|
var Ts = Te && Te.__importDefault || function(s) {
|
|
1156
1156
|
return s && s.__esModule ? s : { default: s };
|
|
1157
1157
|
};
|
|
1158
1158
|
Object.defineProperty(Br, "__esModule", { value: !0 });
|
|
1159
|
-
const Ns = Ts(ot.exports), le =
|
|
1159
|
+
const Ns = Ts(ot.exports), le = jt, ve = "asset";
|
|
1160
1160
|
class ne {
|
|
1161
1161
|
constructor(e) {
|
|
1162
1162
|
this.hashBuf = e;
|
|
@@ -1193,7 +1193,7 @@ var Us = Br.default = ne;
|
|
|
1193
1193
|
const Ps = Us, Os = (s, e) => {
|
|
1194
1194
|
const t = Ms(s), r = t.derive(be + 1852).derive(be + 1815).derive(be + e), n = r.derive(0).derive(0).to_raw_key(), i = r.derive(2).derive(0).to_raw_key();
|
|
1195
1195
|
return r.free(), t.free(), { paymentKey: n, stakeKey: i };
|
|
1196
|
-
},
|
|
1196
|
+
}, Gt = (s) => a.Address.from_bytes(G(s)), Ms = (s) => a.Bip32PrivateKey.from_bytes(G(s)), Ks = (s) => a.DataHash.from_bytes(G(s)), Ct = (s) => a.Ed25519KeyHash.from_bytes(G(s)), Hs = (s) => a.Ed25519Signature.from_bytes(G(s)), Ve = (s) => a.NativeScript.from_bytes(G(s)), Fs = (s) => a.PublicKey.from_bytes(G(s)), Nr = (s) => a.PlutusData.from_bytes(G(s)), Xt = (s, e) => a.PlutusScript.from_bytes_with_version(G(s), vt[e]), Rs = (s) => a.ScriptRef.from_bytes(G(s)), qs = (s) => a.ScriptHash.from_bytes(G(s)), _t = (s) => a.Transaction.from_bytes(G(s)), Ur = (s) => a.TransactionHash.from_bytes(G(s)), dr = (s) => a.TransactionUnspentOutput.from_bytes(G(s)), fr = (s) => a.TransactionWitnessSet.from_bytes(G(s)), Vs = (s) => a.Value.from_bytes(G(s)), yt = (s) => a.Address.from_bech32(s), Le = (s) => a.BaseAddress.from_address(yt(s)), Pr = (s) => a.EnterpriseAddress.from_address(yt(s)), Or = (s) => a.RewardAddress.from_address(yt(s)), ut = (s) => Buffer.from(s).toString("hex"), G = (s) => s.length % 2 === 0 && /^[0-9A-F]*$/i.test(s) ? Buffer.from(s, "hex") : Buffer.from(s, "utf-8"), Ge = (s) => {
|
|
1197
1197
|
const e = (t) => {
|
|
1198
1198
|
const r = new Array();
|
|
1199
1199
|
for (let n = 0; n < t.len(); n += 1)
|
|
@@ -1241,11 +1241,11 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1241
1241
|
default:
|
|
1242
1242
|
throw new Error(`Script Kind: ${s.kind()}, is not supported`);
|
|
1243
1243
|
}
|
|
1244
|
-
},
|
|
1244
|
+
}, Vt = (s) => {
|
|
1245
1245
|
const e = (t) => {
|
|
1246
1246
|
const r = a.NativeScripts.new();
|
|
1247
1247
|
return t.forEach((n) => {
|
|
1248
|
-
r.add(
|
|
1248
|
+
r.add(Vt(n));
|
|
1249
1249
|
}), r;
|
|
1250
1250
|
};
|
|
1251
1251
|
switch (s.type) {
|
|
@@ -1262,18 +1262,18 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1262
1262
|
case "sig":
|
|
1263
1263
|
return a.NativeScript.new_script_pubkey(a.ScriptPubkey.new(Ct(s.keyHash)));
|
|
1264
1264
|
}
|
|
1265
|
-
},
|
|
1265
|
+
}, pe = (s) => {
|
|
1266
1266
|
var r, n, i;
|
|
1267
1267
|
const e = (c) => {
|
|
1268
1268
|
const l = [];
|
|
1269
|
-
for (let
|
|
1270
|
-
l.push(
|
|
1269
|
+
for (let A = 0; A < c.len(); A += 1)
|
|
1270
|
+
l.push(pe(c.get(A)));
|
|
1271
1271
|
return l;
|
|
1272
1272
|
}, t = (c) => {
|
|
1273
1273
|
const l = /* @__PURE__ */ new Map();
|
|
1274
|
-
for (let
|
|
1275
|
-
const y = c.keys().get(
|
|
1276
|
-
l.set(
|
|
1274
|
+
for (let A = 0; A < c.len(); A += 1) {
|
|
1275
|
+
const y = c.keys().get(A), B = c.get(y) ?? a.PlutusData.from_hex(ht("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));
|
|
1276
|
+
l.set(pe(y), pe(B));
|
|
1277
1277
|
}
|
|
1278
1278
|
return l;
|
|
1279
1279
|
};
|
|
@@ -1344,17 +1344,17 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1344
1344
|
const t = s.plutus_script();
|
|
1345
1345
|
return {
|
|
1346
1346
|
code: t.to_hex(),
|
|
1347
|
-
version: Object.keys(
|
|
1347
|
+
version: Object.keys(vt).find((r) => vt[r].to_hex() === t.language_version().to_hex())
|
|
1348
1348
|
};
|
|
1349
1349
|
}
|
|
1350
1350
|
const e = s.native_script();
|
|
1351
1351
|
return Ge(e);
|
|
1352
1352
|
}, Zt = (s) => {
|
|
1353
1353
|
if ("code" in s) {
|
|
1354
|
-
const e =
|
|
1354
|
+
const e = Xt(s.code, s.version);
|
|
1355
1355
|
return a.ScriptRef.new_plutus_script(e);
|
|
1356
1356
|
}
|
|
1357
|
-
return a.ScriptRef.new_native_script(
|
|
1357
|
+
return a.ScriptRef.new_native_script(Vt(s));
|
|
1358
1358
|
}, oe = (s) => {
|
|
1359
1359
|
var n, i, c;
|
|
1360
1360
|
const e = s.output().has_data_hash() ? (n = s.output().data_hash()) == null ? void 0 : n.to_hex() : void 0, t = s.output().has_plutus_data() ? (i = s.output().plutus_data()) == null ? void 0 : i.to_hex() : void 0, r = s.output().has_script_ref() ? (c = s.output().script_ref()) == null ? void 0 : c.to_hex() : void 0;
|
|
@@ -1372,7 +1372,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
};
|
|
1374
1374
|
}, gt = (s) => {
|
|
1375
|
-
const e = a.TransactionInput.new(Ur(s.input.txHash), s.input.outputIndex), t = a.TransactionOutput.new(yt(s.output.address),
|
|
1375
|
+
const e = a.TransactionInput.new(Ur(s.input.txHash), s.input.outputIndex), t = a.TransactionOutput.new(yt(s.output.address), Bt(s.output.amount));
|
|
1376
1376
|
return s.output.dataHash !== void 0 && t.set_data_hash(Ks(s.output.dataHash)), s.output.plutusData !== void 0 && t.set_plutus_data(Nr(s.output.plutusData)), s.output.scriptRef !== void 0 && t.set_script_ref(Rs(s.output.scriptRef)), a.TransactionUnspentOutput.new(e, t);
|
|
1377
1377
|
}, gr = (s) => {
|
|
1378
1378
|
const e = s.split(".")[1] ?? "0", t = `${parseInt(e, 10)}`, r = "1" + "0".repeat(e.length);
|
|
@@ -1387,15 +1387,15 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1387
1387
|
const i = r.get(n), c = t.get(i);
|
|
1388
1388
|
if (c !== void 0) {
|
|
1389
1389
|
const l = c.keys();
|
|
1390
|
-
for (let
|
|
1391
|
-
const y = l.get(
|
|
1390
|
+
for (let A = 0; A < l.len(); A += 1) {
|
|
1391
|
+
const y = l.get(A), B = c.get(y) ?? a.BigNum.from_str("0"), b = i.to_hex() + ut(y.name());
|
|
1392
1392
|
e.push({ unit: b, quantity: B.to_str() });
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
return e;
|
|
1398
|
-
},
|
|
1398
|
+
}, Bt = (s) => {
|
|
1399
1399
|
const e = s.find((i) => i.unit === "lovelace"), t = Array.from(new Set(s.filter((i) => i.unit !== "lovelace").map((i) => i.unit.slice(0, lt)))), r = a.MultiAsset.new();
|
|
1400
1400
|
t.forEach((i) => {
|
|
1401
1401
|
const c = a.Assets.new();
|
|
@@ -1412,7 +1412,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1412
1412
|
if (e.output().has_plutus_data())
|
|
1413
1413
|
return a.DatumSource.new_ref_input(e.input());
|
|
1414
1414
|
throw new Error(`No inline datum found in UTxO: ${e.input().transaction_id().to_hex()}`);
|
|
1415
|
-
},
|
|
1415
|
+
}, pr = (s, e) => a.EnterpriseAddress.new(s, a.StakeCredential.from_keyhash(e)), Ar = (s, e) => {
|
|
1416
1416
|
if (typeof s == "string")
|
|
1417
1417
|
return a.MintWitness.new_native_script(Ve(s));
|
|
1418
1418
|
if (e === void 0)
|
|
@@ -1422,7 +1422,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1422
1422
|
return a.MintWitness.new_plutus_script(Oe(s), Ne({
|
|
1423
1423
|
tag: "MINT",
|
|
1424
1424
|
index: 0,
|
|
1425
|
-
budget:
|
|
1425
|
+
budget: Yt,
|
|
1426
1426
|
data: {
|
|
1427
1427
|
alternative: 0,
|
|
1428
1428
|
fields: []
|
|
@@ -1431,20 +1431,20 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1431
1431
|
}));
|
|
1432
1432
|
}, Pe = (s, e) => a.RewardAddress.new(s, a.StakeCredential.from_keyhash(e)), Oe = (s) => {
|
|
1433
1433
|
if ("code" in s)
|
|
1434
|
-
return a.PlutusScriptSource.new(
|
|
1434
|
+
return a.PlutusScriptSource.new(Xt(s.code, s.version));
|
|
1435
1435
|
const e = gt(s);
|
|
1436
1436
|
if (e.output().has_script_ref()) {
|
|
1437
1437
|
const t = e.output().script_ref();
|
|
1438
1438
|
if (t.is_plutus_script()) {
|
|
1439
|
-
const r = Kr(t), n =
|
|
1440
|
-
return a.PlutusScriptSource.new_ref_input_with_lang_ver(n, e.input(),
|
|
1439
|
+
const r = Kr(t), n = Xt(r.code, r.version).hash();
|
|
1440
|
+
return a.PlutusScriptSource.new_ref_input_with_lang_ver(n, e.input(), vt[r.version]);
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
throw new Error(`No plutus script reference found in UTxO: ${e.input().transaction_id().to_hex()}`);
|
|
1444
1444
|
}, he = (s) => {
|
|
1445
1445
|
const e = a.ScriptPubkey.new(s);
|
|
1446
1446
|
return a.NativeScript.new_script_pubkey(e);
|
|
1447
|
-
},
|
|
1447
|
+
}, Ae = (s = mt) => {
|
|
1448
1448
|
const e = a.TransactionBuilderConfigBuilder.new().coins_per_utxo_byte(a.BigNum.from_str(s.coinsPerUTxOSize)).ex_unit_prices(a.ExUnitPrices.new(gr(s.priceMem.toString()), gr(s.priceStep.toString()))).fee_algo(a.LinearFee.new(a.BigNum.from_str(s.minFeeA.toString()), a.BigNum.from_str(s.minFeeB.toString()))).key_deposit(a.BigNum.from_str(s.keyDeposit)).max_tx_size(s.maxTxSize).max_value_size(parseInt(s.maxValSize, 10)).pool_deposit(a.BigNum.from_str(s.poolDeposit)).build();
|
|
1449
1449
|
return a.TransactionBuilder.new(e);
|
|
1450
1450
|
}, Ir = (s) => {
|
|
@@ -1468,7 +1468,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1468
1468
|
}, Kt = (s) => {
|
|
1469
1469
|
const e = s.slice(0, lt), t = s.includes(".") ? ht(s.split(".")[1]) : s.slice(lt);
|
|
1470
1470
|
return { policyId: e, assetName: t };
|
|
1471
|
-
},
|
|
1471
|
+
}, S = (s) => Mt.isAxiosError(s) ? s.response ? JSON.stringify({
|
|
1472
1472
|
data: s.response.data,
|
|
1473
1473
|
headers: s.response.headers,
|
|
1474
1474
|
status: s.response.status
|
|
@@ -1482,9 +1482,9 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
throw new Error(`Couldn't resolve EpochNo for network: ${s}`);
|
|
1484
1484
|
}, Rr = (s, e) => Ps.fromParts(G(s), G(e)).fingerprint(), dn = (s, e) => es[s][e], fn = (s, e = 0) => {
|
|
1485
|
-
const t =
|
|
1485
|
+
const t = Vt(s);
|
|
1486
1486
|
return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
|
|
1487
|
-
}, gn = (s) =>
|
|
1487
|
+
}, gn = (s) => Vt(s).hash().to_hex(), mn = (s) => Vt(s).to_hex(), $t = (s) => {
|
|
1488
1488
|
var e, t;
|
|
1489
1489
|
try {
|
|
1490
1490
|
const r = [
|
|
@@ -1497,8 +1497,8 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1497
1497
|
} catch (r) {
|
|
1498
1498
|
throw new Error(`An error occurred during resolvePaymentKeyHash: ${r}.`);
|
|
1499
1499
|
}
|
|
1500
|
-
},
|
|
1501
|
-
const t =
|
|
1500
|
+
}, pn = (s, e = 0) => {
|
|
1501
|
+
const t = Xt(s.code, s.version);
|
|
1502
1502
|
return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
|
|
1503
1503
|
}, An = (s) => {
|
|
1504
1504
|
try {
|
|
@@ -1509,10 +1509,10 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1509
1509
|
} catch (e) {
|
|
1510
1510
|
throw new Error(`An error occurred during resolveScriptHash: ${e}.`);
|
|
1511
1511
|
}
|
|
1512
|
-
},
|
|
1512
|
+
}, In = (s) => a.Ed25519KeyHash.from_hex(s).to_bech32("pool1"), Ys = (s) => {
|
|
1513
1513
|
const e = yr(s.join(" ")), t = Fr(e), r = t.to_bech32();
|
|
1514
1514
|
return t.free(), r;
|
|
1515
|
-
},
|
|
1515
|
+
}, _n = (s) => Zt(s).to_hex(), yn = (s, e = Date.now()) => {
|
|
1516
1516
|
if (Ie[s]) {
|
|
1517
1517
|
const [t, r, n] = Ie[s];
|
|
1518
1518
|
return a.BigNum.from_str(e.toString()).div_floor(a.BigNum.from_str("1000")).checked_sub(a.BigNum.from_str(n)).checked_add(a.BigNum.from_str(r)).to_str();
|
|
@@ -1543,7 +1543,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1543
1543
|
}, qr = (s, e = mt.minFeeA, t = mt.minFeeB) => (BigInt(e) * BigInt(s) + BigInt(t)).toString(), $s = (s) => {
|
|
1544
1544
|
const e = _t(s).body();
|
|
1545
1545
|
return a.hash_transaction(e).to_hex();
|
|
1546
|
-
},
|
|
1546
|
+
}, xn = (s = "", e = 32) => {
|
|
1547
1547
|
if (e <= 0 || e > 2048)
|
|
1548
1548
|
throw new Error("Length must be bewteen 1 and 2048");
|
|
1549
1549
|
const r = _r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(e);
|
|
@@ -1562,8 +1562,8 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1562
1562
|
}), n;
|
|
1563
1563
|
}
|
|
1564
1564
|
return e;
|
|
1565
|
-
},
|
|
1566
|
-
class
|
|
1565
|
+
}, wn = (s) => pe(Nr(s)), Cn = (s) => _t(s).to_js_value();
|
|
1566
|
+
class Bn {
|
|
1567
1567
|
_axiosInstance;
|
|
1568
1568
|
constructor(...e) {
|
|
1569
1569
|
if (typeof e[0] == "string" && e[0].startsWith("http"))
|
|
@@ -1588,9 +1588,9 @@ class Cn {
|
|
|
1588
1588
|
rewards: r.withdrawable_amount,
|
|
1589
1589
|
withdrawals: r.withdrawals_sum
|
|
1590
1590
|
};
|
|
1591
|
-
throw
|
|
1591
|
+
throw S(r);
|
|
1592
1592
|
} catch (r) {
|
|
1593
|
-
throw
|
|
1593
|
+
throw S(r);
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
1596
|
resolveScriptRef = async (e) => {
|
|
@@ -1603,7 +1603,7 @@ class Cn {
|
|
|
1603
1603
|
} : await this.fetchNativeScriptJSON(e);
|
|
1604
1604
|
return Zt(n).to_hex();
|
|
1605
1605
|
}
|
|
1606
|
-
throw
|
|
1606
|
+
throw S(t);
|
|
1607
1607
|
}
|
|
1608
1608
|
};
|
|
1609
1609
|
toUTxO = async (e, t) => ({
|
|
@@ -1622,13 +1622,13 @@ class Cn {
|
|
|
1622
1622
|
});
|
|
1623
1623
|
async fetchAddressUTxOs(e, t) {
|
|
1624
1624
|
const r = t !== void 0 ? `/${t}` : "", n = `addresses/${e}/utxos` + r, i = async (c = 1, l = []) => {
|
|
1625
|
-
const { data:
|
|
1625
|
+
const { data: A, status: y } = await this._axiosInstance.get(`${n}?page=${c}`);
|
|
1626
1626
|
if (y === 200)
|
|
1627
|
-
return
|
|
1627
|
+
return A.length > 0 ? i(c + 1, [
|
|
1628
1628
|
...l,
|
|
1629
|
-
...await Promise.all(
|
|
1629
|
+
...await Promise.all(A.map((B) => this.toUTxO(B, B.tx_hash)))
|
|
1630
1630
|
]) : l;
|
|
1631
|
-
throw
|
|
1631
|
+
throw S(A);
|
|
1632
1632
|
};
|
|
1633
1633
|
try {
|
|
1634
1634
|
return await i();
|
|
@@ -1638,10 +1638,10 @@ class Cn {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
async fetchAssetAddresses(e) {
|
|
1640
1640
|
const t = async (r = 1, n = []) => {
|
|
1641
|
-
const { policyId: i, assetName: c } = Kt(e), { data: l, status:
|
|
1642
|
-
if (
|
|
1641
|
+
const { policyId: i, assetName: c } = Kt(e), { data: l, status: A } = await this._axiosInstance.get(`assets/${i}${c}/addresses?page=${r}`);
|
|
1642
|
+
if (A === 200)
|
|
1643
1643
|
return l.length > 0 ? t(r + 1, [...n, ...l]) : n;
|
|
1644
|
-
throw
|
|
1644
|
+
throw S(l);
|
|
1645
1645
|
};
|
|
1646
1646
|
try {
|
|
1647
1647
|
return await t();
|
|
@@ -1656,9 +1656,9 @@ class Cn {
|
|
|
1656
1656
|
return {
|
|
1657
1657
|
...n.onchain_metadata
|
|
1658
1658
|
};
|
|
1659
|
-
throw
|
|
1659
|
+
throw S(n);
|
|
1660
1660
|
} catch (t) {
|
|
1661
|
-
throw
|
|
1661
|
+
throw S(t);
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
async fetchBlockInfo(e) {
|
|
@@ -1682,9 +1682,9 @@ class Cn {
|
|
|
1682
1682
|
txCount: t.tx_count,
|
|
1683
1683
|
VRFKey: t.block_vrf
|
|
1684
1684
|
};
|
|
1685
|
-
throw
|
|
1685
|
+
throw S(t);
|
|
1686
1686
|
} catch (t) {
|
|
1687
|
-
throw
|
|
1687
|
+
throw S(t);
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
1690
|
async fetchCollectionAssets(e, t = 1) {
|
|
@@ -1698,7 +1698,7 @@ class Cn {
|
|
|
1698
1698
|
})),
|
|
1699
1699
|
next: r.length === 100 ? t + 1 : null
|
|
1700
1700
|
};
|
|
1701
|
-
throw
|
|
1701
|
+
throw S(r);
|
|
1702
1702
|
} catch {
|
|
1703
1703
|
return { assets: [], next: null };
|
|
1704
1704
|
}
|
|
@@ -1708,9 +1708,9 @@ class Cn {
|
|
|
1708
1708
|
const t = ht(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${He[1]}${t}/addresses`);
|
|
1709
1709
|
if (n === 200)
|
|
1710
1710
|
return r[0].address;
|
|
1711
|
-
throw
|
|
1711
|
+
throw S(r);
|
|
1712
1712
|
} catch (t) {
|
|
1713
|
-
throw
|
|
1713
|
+
throw S(t);
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
async fetchProtocolParameters(e = Number.NaN) {
|
|
@@ -1739,9 +1739,9 @@ class Cn {
|
|
|
1739
1739
|
priceMem: t.price_mem,
|
|
1740
1740
|
priceStep: t.price_step
|
|
1741
1741
|
};
|
|
1742
|
-
throw
|
|
1742
|
+
throw S(t);
|
|
1743
1743
|
} catch (t) {
|
|
1744
|
-
throw
|
|
1744
|
+
throw S(t);
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
async fetchTxInfo(e) {
|
|
@@ -1759,9 +1759,9 @@ class Cn {
|
|
|
1759
1759
|
slot: t.slot.toString(),
|
|
1760
1760
|
size: t.size
|
|
1761
1761
|
};
|
|
1762
|
-
throw
|
|
1762
|
+
throw S(t);
|
|
1763
1763
|
} catch (t) {
|
|
1764
|
-
throw
|
|
1764
|
+
throw S(t);
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
1767
|
async fetchUTxOs(e) {
|
|
@@ -1773,9 +1773,9 @@ class Cn {
|
|
|
1773
1773
|
i.push(this.toUTxO(l, e));
|
|
1774
1774
|
}), await Promise.all(i);
|
|
1775
1775
|
}
|
|
1776
|
-
throw
|
|
1776
|
+
throw S(t);
|
|
1777
1777
|
} catch (t) {
|
|
1778
|
-
throw
|
|
1778
|
+
throw S(t);
|
|
1779
1779
|
}
|
|
1780
1780
|
}
|
|
1781
1781
|
onTxConfirmed(e, t, r = 100) {
|
|
@@ -1797,25 +1797,25 @@ class Cn {
|
|
|
1797
1797
|
const t = { "Content-Type": "application/cbor" }, { data: r, status: n } = await this._axiosInstance.post("tx/submit", G(e), { headers: t });
|
|
1798
1798
|
if (n === 200)
|
|
1799
1799
|
return r;
|
|
1800
|
-
throw
|
|
1800
|
+
throw S(r);
|
|
1801
1801
|
} catch (t) {
|
|
1802
|
-
throw
|
|
1802
|
+
throw S(t);
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
async fetchPlutusScriptCBOR(e) {
|
|
1806
1806
|
const { data: t, status: r } = await this._axiosInstance.get(`scripts/${e}/cbor`);
|
|
1807
1807
|
if (r === 200)
|
|
1808
1808
|
return t.cbor;
|
|
1809
|
-
throw
|
|
1809
|
+
throw S(t);
|
|
1810
1810
|
}
|
|
1811
1811
|
async fetchNativeScriptJSON(e) {
|
|
1812
1812
|
const { data: t, status: r } = await this._axiosInstance.get(`scripts/${e}/json`);
|
|
1813
1813
|
if (r === 200)
|
|
1814
1814
|
return t.json;
|
|
1815
|
-
throw
|
|
1815
|
+
throw S(t);
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
|
-
class
|
|
1818
|
+
class Sn {
|
|
1819
1819
|
_axiosInstance;
|
|
1820
1820
|
constructor(e, t, r) {
|
|
1821
1821
|
const n = r.host ?? "ipfs.infura.io", i = r.port ?? 5001, c = r.version ?? 0;
|
|
@@ -1829,9 +1829,9 @@ class Bn {
|
|
|
1829
1829
|
const r = { "Content-Type": "multipart/form-data" }, { data: n, status: i } = await this._axiosInstance.post(`add?recursive=${t}`, e, { headers: r });
|
|
1830
1830
|
if (i === 200)
|
|
1831
1831
|
return n;
|
|
1832
|
-
throw
|
|
1832
|
+
throw S(n);
|
|
1833
1833
|
} catch (r) {
|
|
1834
|
-
throw
|
|
1834
|
+
throw S(r);
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
@@ -1869,9 +1869,9 @@ class En {
|
|
|
1869
1869
|
rewards: r[0].rewards_available,
|
|
1870
1870
|
withdrawals: r[0].withdrawals
|
|
1871
1871
|
};
|
|
1872
|
-
throw
|
|
1872
|
+
throw S(r);
|
|
1873
1873
|
} catch (t) {
|
|
1874
|
-
throw
|
|
1874
|
+
throw S(t);
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
async fetchAddressUTxOs(e, t) {
|
|
@@ -1883,7 +1883,7 @@ class En {
|
|
|
1883
1883
|
const i = r.flatMap((c) => c.utxo_set).map((c) => this.toUTxO(c, e));
|
|
1884
1884
|
return t !== void 0 ? i.filter((c) => c.output.amount.find((l) => l.unit === t) !== void 0) : i;
|
|
1885
1885
|
}
|
|
1886
|
-
throw
|
|
1886
|
+
throw S(r);
|
|
1887
1887
|
} catch {
|
|
1888
1888
|
return [];
|
|
1889
1889
|
}
|
|
@@ -1896,9 +1896,9 @@ class En {
|
|
|
1896
1896
|
address: c.payment_address,
|
|
1897
1897
|
quantity: c.quantity
|
|
1898
1898
|
}));
|
|
1899
|
-
throw
|
|
1899
|
+
throw S(n);
|
|
1900
1900
|
} catch (t) {
|
|
1901
|
-
throw
|
|
1901
|
+
throw S(t);
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
1904
|
async fetchAssetMetadata(e) {
|
|
@@ -1908,9 +1908,9 @@ class En {
|
|
|
1908
1908
|
return {
|
|
1909
1909
|
...n[0].minting_tx_metadata[721][t][Ye(r)]
|
|
1910
1910
|
};
|
|
1911
|
-
throw
|
|
1911
|
+
throw S(n);
|
|
1912
1912
|
} catch (t) {
|
|
1913
|
-
throw
|
|
1913
|
+
throw S(t);
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
1916
|
async fetchBlockInfo(e) {
|
|
@@ -1936,9 +1936,9 @@ class En {
|
|
|
1936
1936
|
txCount: t[0].tx_count,
|
|
1937
1937
|
VRFKey: t[0].vrf_key
|
|
1938
1938
|
};
|
|
1939
|
-
throw
|
|
1939
|
+
throw S(t);
|
|
1940
1940
|
} catch (t) {
|
|
1941
|
-
throw
|
|
1941
|
+
throw S(t);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
1944
|
async fetchCollectionAssets(e, t = 0) {
|
|
@@ -1952,9 +1952,9 @@ class En {
|
|
|
1952
1952
|
})),
|
|
1953
1953
|
next: r.length === 100 ? t + 100 : null
|
|
1954
1954
|
};
|
|
1955
|
-
throw
|
|
1955
|
+
throw S(r);
|
|
1956
1956
|
} catch (r) {
|
|
1957
|
-
throw
|
|
1957
|
+
throw S(r);
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
1960
|
async fetchHandleAddress(e) {
|
|
@@ -1962,9 +1962,9 @@ class En {
|
|
|
1962
1962
|
const t = ht(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`asset_address_list?_asset_policy=${He[1]}&_asset_name=${t}`);
|
|
1963
1963
|
if (n === 200)
|
|
1964
1964
|
return r[0].payment_address;
|
|
1965
|
-
throw
|
|
1965
|
+
throw S(r);
|
|
1966
1966
|
} catch (t) {
|
|
1967
|
-
throw
|
|
1967
|
+
throw S(t);
|
|
1968
1968
|
}
|
|
1969
1969
|
}
|
|
1970
1970
|
async fetchProtocolParameters(e) {
|
|
@@ -1993,9 +1993,9 @@ class En {
|
|
|
1993
1993
|
priceMem: t[0].price_mem,
|
|
1994
1994
|
priceStep: t[0].price_step
|
|
1995
1995
|
};
|
|
1996
|
-
throw
|
|
1996
|
+
throw S(t);
|
|
1997
1997
|
} catch (t) {
|
|
1998
|
-
throw
|
|
1998
|
+
throw S(t);
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
2001
|
async fetchTxInfo(e) {
|
|
@@ -2016,9 +2016,9 @@ class En {
|
|
|
2016
2016
|
slot: n[0].absolute_slot.toString(),
|
|
2017
2017
|
size: n[0].tx_size
|
|
2018
2018
|
};
|
|
2019
|
-
throw
|
|
2019
|
+
throw S(n);
|
|
2020
2020
|
} catch (n) {
|
|
2021
|
-
throw
|
|
2021
|
+
throw S(n);
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
2024
2024
|
async fetchUTxOs(e) {
|
|
@@ -2028,9 +2028,9 @@ class En {
|
|
|
2028
2028
|
});
|
|
2029
2029
|
if (r === 200)
|
|
2030
2030
|
return t[0].outputs.map((i) => this.toUTxO(i, i.payment_addr.bech32));
|
|
2031
|
-
throw
|
|
2031
|
+
throw S(t);
|
|
2032
2032
|
} catch (t) {
|
|
2033
|
-
throw
|
|
2033
|
+
throw S(t);
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
2036
|
onTxConfirmed(e, t, r = 100) {
|
|
@@ -2052,9 +2052,9 @@ class En {
|
|
|
2052
2052
|
const t = { "Content-Type": "application/cbor" }, { data: r, status: n } = await this._axiosInstance.post("submittx", G(e), { headers: t });
|
|
2053
2053
|
if (n === 202)
|
|
2054
2054
|
return r;
|
|
2055
|
-
throw
|
|
2055
|
+
throw S(r);
|
|
2056
2056
|
} catch (t) {
|
|
2057
|
-
throw
|
|
2057
|
+
throw S(t);
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
2060
|
toUTxO(e, t) {
|
|
@@ -2090,7 +2090,7 @@ class En {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
};
|
|
2092
2092
|
}
|
|
2093
|
-
class
|
|
2093
|
+
class bn {
|
|
2094
2094
|
_baseUrl;
|
|
2095
2095
|
constructor(...e) {
|
|
2096
2096
|
this._baseUrl = Zr(e[0]) ? rs[e[0]] : e[0];
|
|
@@ -2157,7 +2157,7 @@ class Sn {
|
|
|
2157
2157
|
}));
|
|
2158
2158
|
}
|
|
2159
2159
|
}
|
|
2160
|
-
class
|
|
2160
|
+
class vn {
|
|
2161
2161
|
_axiosInstance;
|
|
2162
2162
|
_amountsAsStrings = {
|
|
2163
2163
|
headers: {
|
|
@@ -2182,13 +2182,13 @@ class bn {
|
|
|
2182
2182
|
wdrl: "REWARD"
|
|
2183
2183
|
};
|
|
2184
2184
|
return t.map((c) => {
|
|
2185
|
-
const l = c.ex_units,
|
|
2186
|
-
return { budget: l, index:
|
|
2185
|
+
const l = c.ex_units, A = c.redeemer_index, y = n[c.redeemer_tag];
|
|
2186
|
+
return { budget: l, index: A, tag: y };
|
|
2187
2187
|
});
|
|
2188
2188
|
}
|
|
2189
|
-
throw
|
|
2189
|
+
throw S(t);
|
|
2190
2190
|
} catch (t) {
|
|
2191
|
-
throw
|
|
2191
|
+
throw S(t);
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
2194
|
async fetchAccountInfo(e) {
|
|
@@ -2205,19 +2205,19 @@ class bn {
|
|
|
2205
2205
|
withdrawals: i.total_withdrawn
|
|
2206
2206
|
};
|
|
2207
2207
|
}
|
|
2208
|
-
throw
|
|
2208
|
+
throw S(r);
|
|
2209
2209
|
} catch (r) {
|
|
2210
|
-
throw
|
|
2210
|
+
throw S(r);
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
async fetchAddressUTxOs(e, t) {
|
|
2214
2214
|
const r = (() => e.startsWith("addr_vkh") || e.startsWith("addr_shared_vkh") ? `addresses/cred/${e}` : `addresses/${e}`)(), n = t ? `&asset=${t}` : "", i = async (c = null, l = []) => {
|
|
2215
|
-
const
|
|
2215
|
+
const A = c === null ? "" : `&cursor=${c}`, { data: y, status: B } = await this._axiosInstance.get(`${r}/utxos?count=100${n}${A}`, this._amountsAsStrings);
|
|
2216
2216
|
if (B === 200) {
|
|
2217
2217
|
const w = y.data.map(this.toUTxO), v = [...l, ...w], U = y.next_cursor;
|
|
2218
2218
|
return U == null ? v : i(U, v);
|
|
2219
2219
|
}
|
|
2220
|
-
throw
|
|
2220
|
+
throw S(y);
|
|
2221
2221
|
};
|
|
2222
2222
|
try {
|
|
2223
2223
|
return await i();
|
|
@@ -2227,15 +2227,15 @@ class bn {
|
|
|
2227
2227
|
}
|
|
2228
2228
|
async fetchAssetAddresses(e) {
|
|
2229
2229
|
const { policyId: t, assetName: r } = Kt(e), n = async (i = null, c = []) => {
|
|
2230
|
-
const l = i === null ? "" : `&cursor=${i}`, { data:
|
|
2230
|
+
const l = i === null ? "" : `&cursor=${i}`, { data: A, status: y } = await this._axiosInstance.get(`assets/${t}${r}/addresses?count=100${l}`, this._amountsAsStrings);
|
|
2231
2231
|
if (y === 200) {
|
|
2232
|
-
const b =
|
|
2232
|
+
const b = A.data.map((U) => ({ address: U.address, quantity: U.amount })), w = A.next_cursor, v = [
|
|
2233
2233
|
...c,
|
|
2234
2234
|
...b
|
|
2235
2235
|
];
|
|
2236
2236
|
return w == null ? v : n(w, v);
|
|
2237
2237
|
}
|
|
2238
|
-
throw
|
|
2238
|
+
throw S(A);
|
|
2239
2239
|
};
|
|
2240
2240
|
try {
|
|
2241
2241
|
return await n();
|
|
@@ -2253,9 +2253,9 @@ class bn {
|
|
|
2253
2253
|
...c.asset_standards.cip68_metadata
|
|
2254
2254
|
};
|
|
2255
2255
|
}
|
|
2256
|
-
throw
|
|
2256
|
+
throw S(n);
|
|
2257
2257
|
} catch (t) {
|
|
2258
|
-
throw
|
|
2258
|
+
throw S(t);
|
|
2259
2259
|
}
|
|
2260
2260
|
}
|
|
2261
2261
|
async fetchBlockInfo(e) {
|
|
@@ -2282,9 +2282,9 @@ class bn {
|
|
|
2282
2282
|
VRFKey: a.VRFVKey.from_hex(i.vrf_key).to_bech32("vrf_vk")
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
|
-
throw
|
|
2285
|
+
throw S(r);
|
|
2286
2286
|
} catch (r) {
|
|
2287
|
-
throw
|
|
2287
|
+
throw S(r);
|
|
2288
2288
|
}
|
|
2289
2289
|
}
|
|
2290
2290
|
async fetchCollectionAssets(e, t) {
|
|
@@ -2298,7 +2298,7 @@ class bn {
|
|
|
2298
2298
|
})),
|
|
2299
2299
|
next: r.next_cursor
|
|
2300
2300
|
};
|
|
2301
|
-
throw
|
|
2301
|
+
throw S(r);
|
|
2302
2302
|
} catch {
|
|
2303
2303
|
return { assets: [], next: null };
|
|
2304
2304
|
}
|
|
@@ -2308,9 +2308,9 @@ class bn {
|
|
|
2308
2308
|
const t = e.charAt(0) === "$" ? e.substring(1) : e, { data: r, status: n } = await this._axiosInstance.get(`ecosystem/adahandle/${t}`);
|
|
2309
2309
|
if (n === 200)
|
|
2310
2310
|
return r.data;
|
|
2311
|
-
throw
|
|
2311
|
+
throw S(r);
|
|
2312
2312
|
} catch (t) {
|
|
2313
|
-
throw
|
|
2313
|
+
throw S(t);
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
2316
|
async fetchProtocolParameters(e = Number.NaN) {
|
|
@@ -2327,12 +2327,12 @@ class bn {
|
|
|
2327
2327
|
try {
|
|
2328
2328
|
const { data: c, status: l } = await this._axiosInstance.get("epochs/current");
|
|
2329
2329
|
if (l === 200) {
|
|
2330
|
-
const
|
|
2330
|
+
const A = c.data;
|
|
2331
2331
|
return {
|
|
2332
2332
|
coinsPerUTxOSize: i.coins_per_utxo_byte.toString(),
|
|
2333
2333
|
collateralPercent: parseInt(i.collateral_percentage),
|
|
2334
2334
|
decentralisation: 0,
|
|
2335
|
-
epoch: parseInt(
|
|
2335
|
+
epoch: parseInt(A.epoch_no),
|
|
2336
2336
|
keyDeposit: i.stake_key_deposit.toString(),
|
|
2337
2337
|
maxBlockExMem: i.max_execution_units_per_block.memory.toString(),
|
|
2338
2338
|
maxBlockExSteps: i.max_execution_units_per_block.steps.toString(),
|
|
@@ -2351,14 +2351,14 @@ class bn {
|
|
|
2351
2351
|
priceStep: t(i.prices.steps)
|
|
2352
2352
|
};
|
|
2353
2353
|
}
|
|
2354
|
-
throw
|
|
2354
|
+
throw S(c);
|
|
2355
2355
|
} catch (c) {
|
|
2356
|
-
throw
|
|
2356
|
+
throw S(c);
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
|
-
throw
|
|
2359
|
+
throw S(r);
|
|
2360
2360
|
} catch (r) {
|
|
2361
|
-
throw
|
|
2361
|
+
throw S(r);
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
2364
|
async fetchTxInfo(e) {
|
|
@@ -2378,9 +2378,9 @@ class bn {
|
|
|
2378
2378
|
size: n.size - 1
|
|
2379
2379
|
};
|
|
2380
2380
|
}
|
|
2381
|
-
throw
|
|
2381
|
+
throw S(t);
|
|
2382
2382
|
} catch (t) {
|
|
2383
|
-
throw
|
|
2383
|
+
throw S(t);
|
|
2384
2384
|
}
|
|
2385
2385
|
}
|
|
2386
2386
|
async fetchUTxOs(e) {
|
|
@@ -2388,9 +2388,9 @@ class bn {
|
|
|
2388
2388
|
const { data: t, status: r } = await this._axiosInstance.get(`transactions/${e}`, this._amountsAsStrings);
|
|
2389
2389
|
if (r === 200)
|
|
2390
2390
|
return t.data.outputs.map(this.toUTxO);
|
|
2391
|
-
throw
|
|
2391
|
+
throw S(t);
|
|
2392
2392
|
} catch (t) {
|
|
2393
|
-
throw
|
|
2393
|
+
throw S(t);
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
2396
|
onTxConfirmed(e, t, r = 100) {
|
|
@@ -2412,9 +2412,9 @@ class bn {
|
|
|
2412
2412
|
const t = { "Content-Type": "application/cbor" }, { data: r, status: n } = await this._axiosInstance.post(this.submitUrl, G(e), { headers: t });
|
|
2413
2413
|
if (n === 202)
|
|
2414
2414
|
return r;
|
|
2415
|
-
throw
|
|
2415
|
+
throw S(r);
|
|
2416
2416
|
} catch (t) {
|
|
2417
|
-
throw
|
|
2417
|
+
throw S(t);
|
|
2418
2418
|
}
|
|
2419
2419
|
}
|
|
2420
2420
|
toUTxO = (e) => {
|
|
@@ -2448,7 +2448,7 @@ class bn {
|
|
|
2448
2448
|
return;
|
|
2449
2449
|
};
|
|
2450
2450
|
}
|
|
2451
|
-
class
|
|
2451
|
+
class Qn {
|
|
2452
2452
|
_axiosInstance;
|
|
2453
2453
|
constructor(e = "http://localhost:8080/api/v1") {
|
|
2454
2454
|
this._axiosInstance = Mt.create({
|
|
@@ -2467,9 +2467,9 @@ class vn {
|
|
|
2467
2467
|
rewards: r.withdrawable_amount,
|
|
2468
2468
|
withdrawals: r.withdrawals_sum
|
|
2469
2469
|
};
|
|
2470
|
-
throw
|
|
2470
|
+
throw S(r);
|
|
2471
2471
|
} catch (r) {
|
|
2472
|
-
throw
|
|
2472
|
+
throw S(r);
|
|
2473
2473
|
}
|
|
2474
2474
|
}
|
|
2475
2475
|
resolveScriptRef = async (e) => {
|
|
@@ -2482,7 +2482,7 @@ class vn {
|
|
|
2482
2482
|
} : await this.fetchNativeScriptJSON(e);
|
|
2483
2483
|
return Zt(n).to_hex();
|
|
2484
2484
|
}
|
|
2485
|
-
throw
|
|
2485
|
+
throw S(t);
|
|
2486
2486
|
}
|
|
2487
2487
|
};
|
|
2488
2488
|
toUTxO = async (e, t) => ({
|
|
@@ -2501,13 +2501,13 @@ class vn {
|
|
|
2501
2501
|
});
|
|
2502
2502
|
async fetchAddressUTxOs(e, t) {
|
|
2503
2503
|
const r = t !== void 0 ? `/${t}` : "", n = `addresses/${e}/utxos` + r, i = async (c = 1, l = []) => {
|
|
2504
|
-
const { data:
|
|
2504
|
+
const { data: A, status: y } = await this._axiosInstance.get(`${n}?page=${c}`);
|
|
2505
2505
|
if (y === 200)
|
|
2506
|
-
return
|
|
2506
|
+
return A.length > 0 ? i(c + 1, [
|
|
2507
2507
|
...l,
|
|
2508
|
-
...await Promise.all(
|
|
2508
|
+
...await Promise.all(A.map((B) => this.toUTxO(B, B.tx_hash)))
|
|
2509
2509
|
]) : l;
|
|
2510
|
-
throw
|
|
2510
|
+
throw S(A);
|
|
2511
2511
|
};
|
|
2512
2512
|
try {
|
|
2513
2513
|
return await i();
|
|
@@ -2517,10 +2517,10 @@ class vn {
|
|
|
2517
2517
|
}
|
|
2518
2518
|
async fetchAssetAddresses(e) {
|
|
2519
2519
|
const t = async (r = 1, n = []) => {
|
|
2520
|
-
const { policyId: i, assetName: c } = Kt(e), { data: l, status:
|
|
2521
|
-
if (
|
|
2520
|
+
const { policyId: i, assetName: c } = Kt(e), { data: l, status: A } = await this._axiosInstance.get(`assets/${i}${c}/addresses?page=${r}`);
|
|
2521
|
+
if (A === 200)
|
|
2522
2522
|
return l.length > 0 ? t(r + 1, [...n, ...l]) : n;
|
|
2523
|
-
throw
|
|
2523
|
+
throw S(l);
|
|
2524
2524
|
};
|
|
2525
2525
|
try {
|
|
2526
2526
|
return await t();
|
|
@@ -2535,9 +2535,9 @@ class vn {
|
|
|
2535
2535
|
return {
|
|
2536
2536
|
...n.onchain_metadata
|
|
2537
2537
|
};
|
|
2538
|
-
throw
|
|
2538
|
+
throw S(n);
|
|
2539
2539
|
} catch (t) {
|
|
2540
|
-
throw
|
|
2540
|
+
throw S(t);
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
2543
|
async fetchBlockInfo(e) {
|
|
@@ -2561,9 +2561,9 @@ class vn {
|
|
|
2561
2561
|
txCount: t.tx_count,
|
|
2562
2562
|
VRFKey: t.block_vrf
|
|
2563
2563
|
};
|
|
2564
|
-
throw
|
|
2564
|
+
throw S(t);
|
|
2565
2565
|
} catch (t) {
|
|
2566
|
-
throw
|
|
2566
|
+
throw S(t);
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
2569
|
async fetchCollectionAssets(e, t = 1) {
|
|
@@ -2577,7 +2577,7 @@ class vn {
|
|
|
2577
2577
|
})),
|
|
2578
2578
|
next: r.length === 100 ? t + 1 : null
|
|
2579
2579
|
};
|
|
2580
|
-
throw
|
|
2580
|
+
throw S(r);
|
|
2581
2581
|
} catch {
|
|
2582
2582
|
return { assets: [], next: null };
|
|
2583
2583
|
}
|
|
@@ -2587,9 +2587,9 @@ class vn {
|
|
|
2587
2587
|
const t = ht(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${He[1]}${t}/addresses`);
|
|
2588
2588
|
if (n === 200)
|
|
2589
2589
|
return r[0].address;
|
|
2590
|
-
throw
|
|
2590
|
+
throw S(r);
|
|
2591
2591
|
} catch (t) {
|
|
2592
|
-
throw
|
|
2592
|
+
throw S(t);
|
|
2593
2593
|
}
|
|
2594
2594
|
}
|
|
2595
2595
|
async fetchProtocolParameters(e = Number.NaN) {
|
|
@@ -2618,9 +2618,9 @@ class vn {
|
|
|
2618
2618
|
priceMem: t.price_mem,
|
|
2619
2619
|
priceStep: t.price_step
|
|
2620
2620
|
};
|
|
2621
|
-
throw
|
|
2621
|
+
throw S(t);
|
|
2622
2622
|
} catch (t) {
|
|
2623
|
-
throw
|
|
2623
|
+
throw S(t);
|
|
2624
2624
|
}
|
|
2625
2625
|
}
|
|
2626
2626
|
async fetchTxInfo(e) {
|
|
@@ -2638,9 +2638,9 @@ class vn {
|
|
|
2638
2638
|
slot: t.slot.toString(),
|
|
2639
2639
|
size: t.size
|
|
2640
2640
|
};
|
|
2641
|
-
throw
|
|
2641
|
+
throw S(t);
|
|
2642
2642
|
} catch (t) {
|
|
2643
|
-
throw
|
|
2643
|
+
throw S(t);
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
2646
2646
|
async fetchUTxOs(e) {
|
|
@@ -2652,9 +2652,9 @@ class vn {
|
|
|
2652
2652
|
i.push(this.toUTxO(l, e));
|
|
2653
2653
|
}), await Promise.all(i);
|
|
2654
2654
|
}
|
|
2655
|
-
throw
|
|
2655
|
+
throw S(t);
|
|
2656
2656
|
} catch (t) {
|
|
2657
|
-
throw
|
|
2657
|
+
throw S(t);
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
2660
|
onTxConfirmed(e, t, r = 100) {
|
|
@@ -2678,33 +2678,33 @@ class vn {
|
|
|
2678
2678
|
});
|
|
2679
2679
|
if (r === 202)
|
|
2680
2680
|
return n;
|
|
2681
|
-
throw
|
|
2681
|
+
throw S(n);
|
|
2682
2682
|
} catch (t) {
|
|
2683
|
-
throw console.log("error", t),
|
|
2683
|
+
throw console.log("error", t), S(t);
|
|
2684
2684
|
}
|
|
2685
2685
|
}
|
|
2686
2686
|
async fetchPlutusScriptCBOR(e) {
|
|
2687
2687
|
const { data: t, status: r } = await this._axiosInstance.get(`scripts/${e}/cbor`);
|
|
2688
2688
|
if (r === 200)
|
|
2689
2689
|
return t.cbor;
|
|
2690
|
-
throw
|
|
2690
|
+
throw S(t);
|
|
2691
2691
|
}
|
|
2692
2692
|
async fetchNativeScriptJSON(e) {
|
|
2693
2693
|
const { data: t, status: r } = await this._axiosInstance.get(`scripts/${e}/json`);
|
|
2694
2694
|
if (r === 200)
|
|
2695
2695
|
return t.json;
|
|
2696
|
-
throw
|
|
2696
|
+
throw S(t);
|
|
2697
2697
|
}
|
|
2698
2698
|
}
|
|
2699
|
-
class
|
|
2699
|
+
class Dn {
|
|
2700
2700
|
static withOneSignature(e) {
|
|
2701
|
-
const t = Ct(
|
|
2701
|
+
const t = Ct($t(e));
|
|
2702
2702
|
return he(t).to_hex();
|
|
2703
2703
|
}
|
|
2704
2704
|
static withAtLeastNSignatures(e, t) {
|
|
2705
2705
|
const r = a.NativeScripts.new();
|
|
2706
2706
|
e.forEach((i) => {
|
|
2707
|
-
const c = Ct(
|
|
2707
|
+
const c = Ct($t(i));
|
|
2708
2708
|
r.add(he(c));
|
|
2709
2709
|
});
|
|
2710
2710
|
const n = a.ScriptNOfK.new(t, r);
|
|
@@ -2713,7 +2713,7 @@ class Qn {
|
|
|
2713
2713
|
static withAnySignature(e) {
|
|
2714
2714
|
const t = a.NativeScripts.new();
|
|
2715
2715
|
e.forEach((n) => {
|
|
2716
|
-
const i = Ct(
|
|
2716
|
+
const i = Ct($t(n));
|
|
2717
2717
|
t.add(he(i));
|
|
2718
2718
|
});
|
|
2719
2719
|
const r = a.ScriptAny.new(t);
|
|
@@ -2722,14 +2722,14 @@ class Qn {
|
|
|
2722
2722
|
static withAllSignatures(e) {
|
|
2723
2723
|
const t = a.NativeScripts.new();
|
|
2724
2724
|
e.forEach((n) => {
|
|
2725
|
-
const i = Ct(
|
|
2725
|
+
const i = Ct($t(n));
|
|
2726
2726
|
t.add(he(i));
|
|
2727
2727
|
});
|
|
2728
2728
|
const r = a.ScriptAll.new(t);
|
|
2729
2729
|
return a.NativeScript.new_script_any(r).to_hex();
|
|
2730
2730
|
}
|
|
2731
2731
|
static fromNativeScript(e) {
|
|
2732
|
-
return
|
|
2732
|
+
return Vt(e).to_hex();
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
2735
|
function Ht(s, e, t, r) {
|
|
@@ -2743,14 +2743,14 @@ function Ht(s, e, t, r) {
|
|
|
2743
2743
|
}
|
|
2744
2744
|
const zs = (s) => class extends s {
|
|
2745
2745
|
__visits = [];
|
|
2746
|
-
},
|
|
2746
|
+
}, Lt = () => function(s, e, t) {
|
|
2747
2747
|
const r = t.value;
|
|
2748
2748
|
t.value = function(...n) {
|
|
2749
2749
|
const i = r.call(this, ...n);
|
|
2750
2750
|
return this.__visits && this.__visits.push(e), i;
|
|
2751
2751
|
};
|
|
2752
2752
|
};
|
|
2753
|
-
let
|
|
2753
|
+
let St = class {
|
|
2754
2754
|
_changeAddress;
|
|
2755
2755
|
_txOutputs = /* @__PURE__ */ new Map();
|
|
2756
2756
|
_recipients = /* @__PURE__ */ new Map();
|
|
@@ -2765,7 +2765,7 @@ let Bt = class {
|
|
|
2765
2765
|
_txInputsBuilder;
|
|
2766
2766
|
_txWithdrawals;
|
|
2767
2767
|
constructor(e = {}) {
|
|
2768
|
-
this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? mt, this._txBuilder =
|
|
2768
|
+
this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? mt, this._txBuilder = Ae(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
|
|
2769
2769
|
}
|
|
2770
2770
|
static attachMetadata(e, t, r = "BABBAGE") {
|
|
2771
2771
|
var c;
|
|
@@ -2783,8 +2783,8 @@ let Bt = class {
|
|
|
2783
2783
|
const r = _t(e), n = (i = r.auxiliary_data()) == null ? void 0 : i.metadata();
|
|
2784
2784
|
if (n !== void 0) {
|
|
2785
2785
|
const c = a.GeneralTransactionMetadata.new();
|
|
2786
|
-
for (let
|
|
2787
|
-
const y = n.keys().get(
|
|
2786
|
+
for (let A = 0; A < n.len(); A += 1) {
|
|
2787
|
+
const y = n.keys().get(A), B = n.get(y);
|
|
2788
2788
|
c.insert(y, a.TransactionMetadatum.from_hex("0".repeat(((B == null ? void 0 : B.to_hex()) ?? "").length)));
|
|
2789
2789
|
}
|
|
2790
2790
|
const l = r.auxiliary_data();
|
|
@@ -2812,7 +2812,7 @@ let Bt = class {
|
|
|
2812
2812
|
}
|
|
2813
2813
|
burnAsset(e, t, r) {
|
|
2814
2814
|
const n = this._totalBurns.has(t.unit) ? a.BigNum.from_str(this._totalBurns.get(t.unit) ?? "0").checked_add(a.BigNum.from_str(t.quantity)).to_str() : t.quantity;
|
|
2815
|
-
return this._mintBuilder.add_asset(
|
|
2815
|
+
return this._mintBuilder.add_asset(Ar(e, r), a.AssetName.new(G(t.unit.slice(lt))), a.Int.new_negative(a.BigNum.from_str(t.quantity))), this._totalBurns.set(t.unit, n), this;
|
|
2816
2816
|
}
|
|
2817
2817
|
delegateStake(e, t) {
|
|
2818
2818
|
const r = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(Ct(se(e))), a.Ed25519KeyHash.from_bech32(t)));
|
|
@@ -2832,26 +2832,26 @@ let Bt = class {
|
|
|
2832
2832
|
};
|
|
2833
2833
|
}, i = (b) => {
|
|
2834
2834
|
if ("code" in b)
|
|
2835
|
-
return
|
|
2835
|
+
return Xt(b.code, b.version);
|
|
2836
2836
|
const w = gt(b);
|
|
2837
2837
|
if (w.output().has_script_ref()) {
|
|
2838
2838
|
const v = w.output().script_ref();
|
|
2839
2839
|
if (v.is_plutus_script()) {
|
|
2840
2840
|
const U = Kr(v);
|
|
2841
|
-
return
|
|
2841
|
+
return Xt(U.code, U.version);
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
2844
2844
|
throw new Error(`[Transaction] No plutus script reference found in UTxO: ${w.input().transaction_id().to_hex()}`);
|
|
2845
|
-
}, c = n(e, t),
|
|
2846
|
-
return this._mintBuilder.add_asset(
|
|
2845
|
+
}, c = n(e, t), A = a.BigNum.from_str(((y = this._totalMints.get(c.unit)) == null ? void 0 : y.assetQuantity) ?? "0").checked_add(a.BigNum.from_str(c.quantity));
|
|
2846
|
+
return this._mintBuilder.add_asset(Ar(e, r), a.AssetName.new(G(ht(t.assetName))), a.Int.new(a.BigNum.from_str(c.quantity))), this._recipients.has(t.recipient) ? (B = this._recipients.get(t.recipient)) == null || B.push(c) : this._recipients.set(t.recipient, [c]), this._totalMints.set(c.unit, {
|
|
2847
2847
|
...t,
|
|
2848
|
-
assetQuantity:
|
|
2848
|
+
assetQuantity: A.to_str()
|
|
2849
2849
|
}), this;
|
|
2850
2850
|
}
|
|
2851
2851
|
redeemValue(e) {
|
|
2852
2852
|
const t = {
|
|
2853
2853
|
tag: "SPEND",
|
|
2854
|
-
budget:
|
|
2854
|
+
budget: Yt,
|
|
2855
2855
|
index: this._txInputsBuilder.inputs().len(),
|
|
2856
2856
|
data: {
|
|
2857
2857
|
alternative: 0,
|
|
@@ -2874,7 +2874,7 @@ let Bt = class {
|
|
|
2874
2874
|
return this._txCertificates.add(r), this;
|
|
2875
2875
|
}
|
|
2876
2876
|
sendAssets(e, t) {
|
|
2877
|
-
const r =
|
|
2877
|
+
const r = Bt(t), n = r.multiasset();
|
|
2878
2878
|
if (r.is_zero() || n === void 0)
|
|
2879
2879
|
return this;
|
|
2880
2880
|
const i = de(e).next(), c = r.coin().is_zero() ? i.with_asset_and_min_required_coin_by_utxo_cost(n, Ue(this._protocolParameters.coinsPerUTxOSize)).build() : i.with_coin_and_asset(r.coin(), n).build();
|
|
@@ -2890,13 +2890,15 @@ let Bt = class {
|
|
|
2890
2890
|
}), this._txBuilder.add_output(n), this;
|
|
2891
2891
|
}
|
|
2892
2892
|
sendToken(e, t, r) {
|
|
2893
|
-
return this.sendAssets(e, [
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2893
|
+
return this.sendAssets(e, [
|
|
2894
|
+
{
|
|
2895
|
+
quantity: r,
|
|
2896
|
+
unit: ss[t]
|
|
2897
|
+
}
|
|
2898
|
+
]), this;
|
|
2897
2899
|
}
|
|
2898
2900
|
sendValue(e, t) {
|
|
2899
|
-
const r =
|
|
2901
|
+
const r = Bt(t.output.amount), i = de(e).next().with_value(r).build();
|
|
2900
2902
|
return t.output.amount.forEach((c) => {
|
|
2901
2903
|
this.setTxOutput(c);
|
|
2902
2904
|
}), this._txBuilder.add_output(i), this;
|
|
@@ -2912,13 +2914,13 @@ let Bt = class {
|
|
|
2912
2914
|
return this._txBuilder.add_json_metadatum_with_schema(a.BigNum.from_str(e.toString()), JSON.stringify(t), a.MetadataJsonSchema.NoConversions), this;
|
|
2913
2915
|
}
|
|
2914
2916
|
setRequiredSigners(e) {
|
|
2915
|
-
return Array.from(new Set(e.map((r) => r.startsWith("addr") ?
|
|
2917
|
+
return Array.from(new Set(e.map((r) => r.startsWith("addr") ? $t(r) : se(r)).map((r) => Ct(r)))).forEach((r) => {
|
|
2916
2918
|
this._txBuilder.add_required_signer(r);
|
|
2917
2919
|
}), this;
|
|
2918
2920
|
}
|
|
2919
2921
|
setNativeScriptInput(e, t) {
|
|
2920
2922
|
const r = gt(t);
|
|
2921
|
-
return this._txBuilder.add_native_script_input(
|
|
2923
|
+
return this._txBuilder.add_native_script_input(Vt(e), r.input(), r.output().amount()), this;
|
|
2922
2924
|
}
|
|
2923
2925
|
setTimeToStart(e) {
|
|
2924
2926
|
return this._txBuilder.set_validity_start_interval_bignum(a.BigNum.from_str(e)), this;
|
|
@@ -2963,7 +2965,7 @@ let Bt = class {
|
|
|
2963
2965
|
}
|
|
2964
2966
|
async addRequiredSignersIfNeeded() {
|
|
2965
2967
|
if (this._initiator && this.notVisited("setRequiredSigners")) {
|
|
2966
|
-
const e = await this._initiator.getUsedAddress(), t =
|
|
2968
|
+
const e = await this._initiator.getUsedAddress(), t = $t(e.to_bech32());
|
|
2967
2969
|
this._txBuilder.add_required_signer(Ct(t));
|
|
2968
2970
|
}
|
|
2969
2971
|
}
|
|
@@ -2985,7 +2987,7 @@ let Bt = class {
|
|
|
2985
2987
|
if (t.data.label === "777")
|
|
2986
2988
|
return i;
|
|
2987
2989
|
if (r && r[c]) {
|
|
2988
|
-
const { [c]: l, ...
|
|
2990
|
+
const { [c]: l, ...A } = r, y = {
|
|
2989
2991
|
[n]: i,
|
|
2990
2992
|
...l
|
|
2991
2993
|
};
|
|
@@ -2993,7 +2995,7 @@ let Bt = class {
|
|
|
2993
2995
|
[c]: {
|
|
2994
2996
|
...y
|
|
2995
2997
|
},
|
|
2996
|
-
...
|
|
2998
|
+
...A
|
|
2997
2999
|
};
|
|
2998
3000
|
}
|
|
2999
3001
|
return r !== void 0 ? {
|
|
@@ -3017,7 +3019,7 @@ let Bt = class {
|
|
|
3017
3019
|
}
|
|
3018
3020
|
addMintOutputs() {
|
|
3019
3021
|
this._recipients.forEach((e, t) => {
|
|
3020
|
-
const n =
|
|
3022
|
+
const n = Bt(e).multiasset();
|
|
3021
3023
|
if (n !== void 0) {
|
|
3022
3024
|
const c = de(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Ue(this._protocolParameters.coinsPerUTxOSize)).build();
|
|
3023
3025
|
this._txBuilder.add_output(c);
|
|
@@ -3033,36 +3035,36 @@ let Bt = class {
|
|
|
3033
3035
|
}
|
|
3034
3036
|
};
|
|
3035
3037
|
Ht([
|
|
3036
|
-
|
|
3037
|
-
],
|
|
3038
|
+
Lt()
|
|
3039
|
+
], St.prototype, "mintAsset", null);
|
|
3038
3040
|
Ht([
|
|
3039
|
-
|
|
3040
|
-
],
|
|
3041
|
+
Lt()
|
|
3042
|
+
], St.prototype, "redeemValue", null);
|
|
3041
3043
|
Ht([
|
|
3042
|
-
|
|
3043
|
-
],
|
|
3044
|
+
Lt()
|
|
3045
|
+
], St.prototype, "sendAssets", null);
|
|
3044
3046
|
Ht([
|
|
3045
|
-
|
|
3046
|
-
],
|
|
3047
|
+
Lt()
|
|
3048
|
+
], St.prototype, "sendValue", null);
|
|
3047
3049
|
Ht([
|
|
3048
|
-
|
|
3049
|
-
],
|
|
3050
|
+
Lt()
|
|
3051
|
+
], St.prototype, "setCollateral", null);
|
|
3050
3052
|
Ht([
|
|
3051
|
-
|
|
3052
|
-
],
|
|
3053
|
+
Lt()
|
|
3054
|
+
], St.prototype, "setRequiredSigners", null);
|
|
3053
3055
|
Ht([
|
|
3054
|
-
|
|
3055
|
-
],
|
|
3056
|
-
|
|
3056
|
+
Lt()
|
|
3057
|
+
], St.prototype, "setTxInputs", null);
|
|
3058
|
+
St = Ht([
|
|
3057
3059
|
zs
|
|
3058
|
-
],
|
|
3060
|
+
], St);
|
|
3059
3061
|
const Ws = (s, e, t) => {
|
|
3060
3062
|
const r = new Map(e);
|
|
3061
3063
|
r.set("lovelace", String(Number(r.get("lovelace")) + Number(t)));
|
|
3062
3064
|
const n = /* @__PURE__ */ new Map();
|
|
3063
3065
|
for (let w = 0; w < s.length; w++)
|
|
3064
3066
|
n.set(w, s[w]);
|
|
3065
|
-
const i = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(),
|
|
3067
|
+
const i = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
|
|
3066
3068
|
for (let w = 0; w < s.length; w++)
|
|
3067
3069
|
switch (s[w].output.amount.length) {
|
|
3068
3070
|
case 1: {
|
|
@@ -3074,7 +3076,7 @@ const Ws = (s, e, t) => {
|
|
|
3074
3076
|
break;
|
|
3075
3077
|
}
|
|
3076
3078
|
case 3: {
|
|
3077
|
-
|
|
3079
|
+
A.add(w);
|
|
3078
3080
|
break;
|
|
3079
3081
|
}
|
|
3080
3082
|
default: {
|
|
@@ -3101,11 +3103,11 @@ const Ws = (s, e, t) => {
|
|
|
3101
3103
|
break;
|
|
3102
3104
|
B(v, w, l);
|
|
3103
3105
|
}
|
|
3104
|
-
for (const v of
|
|
3106
|
+
for (const v of A) {
|
|
3105
3107
|
const U = r.get(w);
|
|
3106
3108
|
if (!U || Number(U) <= 0)
|
|
3107
3109
|
break;
|
|
3108
|
-
B(v, w,
|
|
3110
|
+
B(v, w, A);
|
|
3109
3111
|
}
|
|
3110
3112
|
for (const v of y) {
|
|
3111
3113
|
const U = r.get(w);
|
|
@@ -3126,11 +3128,11 @@ const Ws = (s, e, t) => {
|
|
|
3126
3128
|
break;
|
|
3127
3129
|
B(w, "lovelace", l);
|
|
3128
3130
|
}
|
|
3129
|
-
for (const w of
|
|
3131
|
+
for (const w of A) {
|
|
3130
3132
|
const v = r.get("lovelace");
|
|
3131
3133
|
if (!v || Number(v) <= 0)
|
|
3132
3134
|
break;
|
|
3133
|
-
B(w, "lovelace",
|
|
3135
|
+
B(w, "lovelace", A);
|
|
3134
3136
|
}
|
|
3135
3137
|
for (const w of y) {
|
|
3136
3138
|
const v = r.get("lovelace");
|
|
@@ -3153,12 +3155,12 @@ const Ws = (s, e, t) => {
|
|
|
3153
3155
|
return t.quantity;
|
|
3154
3156
|
return "0";
|
|
3155
3157
|
};
|
|
3156
|
-
var
|
|
3158
|
+
var Wt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
3157
3159
|
(function(s) {
|
|
3158
3160
|
(function(e) {
|
|
3159
|
-
var t, r = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, n = Math.ceil, i = Math.floor, c = "[BigNumber Error] ", l = c + "Number primitive has more than 15 significant digits: ",
|
|
3161
|
+
var t, r = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, n = Math.ceil, i = Math.floor, c = "[BigNumber Error] ", l = c + "Number primitive has more than 15 significant digits: ", A = 1e14, y = 14, B = 9007199254740991, b = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], w = 1e7, v = 1e9;
|
|
3160
3162
|
function U(O) {
|
|
3161
|
-
var M, z, X, D =
|
|
3163
|
+
var M, z, X, D = E.prototype = { constructor: E, toString: null, valueOf: null }, F = new E(1), q = 20, J = 4, st = -7, ct = 21, Ft = -1e7, At = 1e7, Rt = !1, te = 1, kt = 0, xe = {
|
|
3162
3164
|
prefix: "",
|
|
3163
3165
|
groupSize: 3,
|
|
3164
3166
|
secondaryGroupSize: 0,
|
|
@@ -3168,39 +3170,39 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3168
3170
|
fractionGroupSeparator: "\xA0",
|
|
3169
3171
|
suffix: ""
|
|
3170
3172
|
}, qt = "0123456789abcdefghijklmnopqrstuvwxyz", we = !0;
|
|
3171
|
-
function
|
|
3172
|
-
var h, I, f, m, x, d, g, _,
|
|
3173
|
-
if (!(
|
|
3174
|
-
return new
|
|
3173
|
+
function E(o, u) {
|
|
3174
|
+
var h, I, f, m, x, d, g, _, p = this;
|
|
3175
|
+
if (!(p instanceof E))
|
|
3176
|
+
return new E(o, u);
|
|
3175
3177
|
if (u == null) {
|
|
3176
3178
|
if (o && o._isBigNumber === !0) {
|
|
3177
|
-
|
|
3179
|
+
p.s = o.s, !o.c || o.e > At ? p.c = p.e = null : o.e < Ft ? p.c = [p.e = 0] : (p.e = o.e, p.c = o.c.slice());
|
|
3178
3180
|
return;
|
|
3179
3181
|
}
|
|
3180
3182
|
if ((d = typeof o == "number") && o * 0 == 0) {
|
|
3181
|
-
if (
|
|
3183
|
+
if (p.s = 1 / o < 0 ? (o = -o, -1) : 1, o === ~~o) {
|
|
3182
3184
|
for (m = 0, x = o; x >= 10; x /= 10, m++)
|
|
3183
3185
|
;
|
|
3184
|
-
m >
|
|
3186
|
+
m > At ? p.c = p.e = null : (p.e = m, p.c = [o]);
|
|
3185
3187
|
return;
|
|
3186
3188
|
}
|
|
3187
3189
|
_ = String(o);
|
|
3188
3190
|
} else {
|
|
3189
3191
|
if (!r.test(_ = String(o)))
|
|
3190
|
-
return X(
|
|
3191
|
-
|
|
3192
|
+
return X(p, _, d);
|
|
3193
|
+
p.s = _.charCodeAt(0) == 45 ? (_ = _.slice(1), -1) : 1;
|
|
3192
3194
|
}
|
|
3193
3195
|
(m = _.indexOf(".")) > -1 && (_ = _.replace(".", "")), (x = _.search(/e/i)) > 0 ? (m < 0 && (m = x), m += +_.slice(x + 1), _ = _.substring(0, x)) : m < 0 && (m = _.length);
|
|
3194
3196
|
} else {
|
|
3195
3197
|
if (Q(u, 2, qt.length, "Base"), u == 10 && we)
|
|
3196
|
-
return
|
|
3198
|
+
return p = new E(o), dt(p, q + p.e + 1, J);
|
|
3197
3199
|
if (_ = String(o), d = typeof o == "number") {
|
|
3198
3200
|
if (o * 0 != 0)
|
|
3199
|
-
return X(
|
|
3200
|
-
if (
|
|
3201
|
+
return X(p, _, d, u);
|
|
3202
|
+
if (p.s = 1 / o < 0 ? (_ = _.slice(1), -1) : 1, E.DEBUG && _.replace(/^0\.0*|\./, "").length > 15)
|
|
3201
3203
|
throw Error(l + o);
|
|
3202
3204
|
} else
|
|
3203
|
-
|
|
3205
|
+
p.s = _.charCodeAt(0) === 45 ? (_ = _.slice(1), -1) : 1;
|
|
3204
3206
|
for (h = qt.slice(0, u), m = x = 0, g = _.length; x < g; x++)
|
|
3205
3207
|
if (h.indexOf(I = _.charAt(x)) < 0) {
|
|
3206
3208
|
if (I == ".") {
|
|
@@ -3212,44 +3214,44 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3212
3214
|
f = !0, x = -1, m = 0;
|
|
3213
3215
|
continue;
|
|
3214
3216
|
}
|
|
3215
|
-
return X(
|
|
3217
|
+
return X(p, String(o), d, u);
|
|
3216
3218
|
}
|
|
3217
|
-
d = !1, _ = z(_, u, 10,
|
|
3219
|
+
d = !1, _ = z(_, u, 10, p.s), (m = _.indexOf(".")) > -1 ? _ = _.replace(".", "") : m = _.length;
|
|
3218
3220
|
}
|
|
3219
3221
|
for (x = 0; _.charCodeAt(x) === 48; x++)
|
|
3220
3222
|
;
|
|
3221
3223
|
for (g = _.length; _.charCodeAt(--g) === 48; )
|
|
3222
3224
|
;
|
|
3223
3225
|
if (_ = _.slice(x, ++g)) {
|
|
3224
|
-
if (g -= x, d &&
|
|
3225
|
-
throw Error(l +
|
|
3226
|
-
if ((m = m - x - 1) >
|
|
3227
|
-
|
|
3226
|
+
if (g -= x, d && E.DEBUG && g > 15 && (o > B || o !== i(o)))
|
|
3227
|
+
throw Error(l + p.s * o);
|
|
3228
|
+
if ((m = m - x - 1) > At)
|
|
3229
|
+
p.c = p.e = null;
|
|
3228
3230
|
else if (m < Ft)
|
|
3229
|
-
|
|
3231
|
+
p.c = [p.e = 0];
|
|
3230
3232
|
else {
|
|
3231
|
-
if (
|
|
3232
|
-
for (x &&
|
|
3233
|
-
|
|
3233
|
+
if (p.e = m, p.c = [], x = (m + 1) % y, m < 0 && (x += y), x < g) {
|
|
3234
|
+
for (x && p.c.push(+_.slice(0, x)), g -= y; x < g; )
|
|
3235
|
+
p.c.push(+_.slice(x, x += y));
|
|
3234
3236
|
x = y - (_ = _.slice(x)).length;
|
|
3235
3237
|
} else
|
|
3236
3238
|
x -= g;
|
|
3237
3239
|
for (; x--; _ += "0")
|
|
3238
3240
|
;
|
|
3239
|
-
|
|
3241
|
+
p.c.push(+_);
|
|
3240
3242
|
}
|
|
3241
3243
|
} else
|
|
3242
|
-
|
|
3244
|
+
p.c = [p.e = 0];
|
|
3243
3245
|
}
|
|
3244
|
-
|
|
3246
|
+
E.clone = U, E.ROUND_UP = 0, E.ROUND_DOWN = 1, E.ROUND_CEIL = 2, E.ROUND_FLOOR = 3, E.ROUND_HALF_UP = 4, E.ROUND_HALF_DOWN = 5, E.ROUND_HALF_EVEN = 6, E.ROUND_HALF_CEIL = 7, E.ROUND_HALF_FLOOR = 8, E.EUCLID = 9, E.config = E.set = function(o) {
|
|
3245
3247
|
var u, h;
|
|
3246
3248
|
if (o != null)
|
|
3247
3249
|
if (typeof o == "object") {
|
|
3248
3250
|
if (o.hasOwnProperty(u = "DECIMAL_PLACES") && (h = o[u], Q(h, 0, v, u), q = h), o.hasOwnProperty(u = "ROUNDING_MODE") && (h = o[u], Q(h, 0, 8, u), J = h), o.hasOwnProperty(u = "EXPONENTIAL_AT") && (h = o[u], h && h.pop ? (Q(h[0], -v, 0, u), Q(h[1], 0, v, u), st = h[0], ct = h[1]) : (Q(h, -v, v, u), st = -(ct = h < 0 ? -h : h))), o.hasOwnProperty(u = "RANGE"))
|
|
3249
3251
|
if (h = o[u], h && h.pop)
|
|
3250
|
-
Q(h[0], -v, -1, u), Q(h[1], 1, v, u), Ft = h[0],
|
|
3252
|
+
Q(h[0], -v, -1, u), Q(h[1], 1, v, u), Ft = h[0], At = h[1];
|
|
3251
3253
|
else if (Q(h, -v, v, u), h)
|
|
3252
|
-
Ft = -(
|
|
3254
|
+
Ft = -(At = h < 0 ? -h : h);
|
|
3253
3255
|
else
|
|
3254
3256
|
throw Error(c + u + " cannot be zero: " + h);
|
|
3255
3257
|
if (o.hasOwnProperty(u = "CRYPTO"))
|
|
@@ -3279,17 +3281,17 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3279
3281
|
DECIMAL_PLACES: q,
|
|
3280
3282
|
ROUNDING_MODE: J,
|
|
3281
3283
|
EXPONENTIAL_AT: [st, ct],
|
|
3282
|
-
RANGE: [Ft,
|
|
3284
|
+
RANGE: [Ft, At],
|
|
3283
3285
|
CRYPTO: Rt,
|
|
3284
3286
|
MODULO_MODE: te,
|
|
3285
3287
|
POW_PRECISION: kt,
|
|
3286
3288
|
FORMAT: xe,
|
|
3287
3289
|
ALPHABET: qt
|
|
3288
3290
|
};
|
|
3289
|
-
},
|
|
3291
|
+
}, E.isBigNumber = function(o) {
|
|
3290
3292
|
if (!o || o._isBigNumber !== !0)
|
|
3291
3293
|
return !1;
|
|
3292
|
-
if (!
|
|
3294
|
+
if (!E.DEBUG)
|
|
3293
3295
|
return !0;
|
|
3294
3296
|
var u, h, I = o.c, f = o.e, m = o.s;
|
|
3295
3297
|
t:
|
|
@@ -3302,7 +3304,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3302
3304
|
}
|
|
3303
3305
|
if (u = (f + 1) % y, u < 1 && (u += y), String(I[0]).length == u) {
|
|
3304
3306
|
for (u = 0; u < I.length; u++)
|
|
3305
|
-
if (h = I[u], h < 0 || h >=
|
|
3307
|
+
if (h = I[u], h < 0 || h >= A || h !== i(h))
|
|
3306
3308
|
break t;
|
|
3307
3309
|
if (h !== 0)
|
|
3308
3310
|
return !0;
|
|
@@ -3311,18 +3313,18 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3311
3313
|
} else if (I === null && f === null && (m === null || m === 1 || m === -1))
|
|
3312
3314
|
return !0;
|
|
3313
3315
|
throw Error(c + "Invalid BigNumber: " + o);
|
|
3314
|
-
},
|
|
3316
|
+
}, E.maximum = E.max = function() {
|
|
3315
3317
|
return ze(arguments, -1);
|
|
3316
|
-
},
|
|
3318
|
+
}, E.minimum = E.min = function() {
|
|
3317
3319
|
return ze(arguments, 1);
|
|
3318
|
-
},
|
|
3320
|
+
}, E.random = function() {
|
|
3319
3321
|
var o = 9007199254740992, u = Math.random() * o & 2097151 ? function() {
|
|
3320
3322
|
return i(Math.random() * o);
|
|
3321
3323
|
} : function() {
|
|
3322
3324
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
3323
3325
|
};
|
|
3324
3326
|
return function(h) {
|
|
3325
|
-
var I, f, m, x, d, g = 0, _ = [],
|
|
3327
|
+
var I, f, m, x, d, g = 0, _ = [], p = new E(F);
|
|
3326
3328
|
if (h == null ? h = q : Q(h, 0, v), x = n(h / y), Rt)
|
|
3327
3329
|
if (crypto.getRandomValues) {
|
|
3328
3330
|
for (I = crypto.getRandomValues(new Uint32Array(x *= 2)); g < x; )
|
|
@@ -3348,16 +3350,16 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3348
3350
|
;
|
|
3349
3351
|
g < y && (m -= y - g);
|
|
3350
3352
|
}
|
|
3351
|
-
return
|
|
3353
|
+
return p.e = m, p.c = _, p;
|
|
3352
3354
|
};
|
|
3353
|
-
}(),
|
|
3354
|
-
for (var o = 1, u = arguments, h = new
|
|
3355
|
+
}(), E.sum = function() {
|
|
3356
|
+
for (var o = 1, u = arguments, h = new E(u[0]); o < u.length; )
|
|
3355
3357
|
h = h.plus(u[o++]);
|
|
3356
3358
|
return h;
|
|
3357
3359
|
}, z = function() {
|
|
3358
3360
|
var o = "0123456789";
|
|
3359
3361
|
function u(h, I, f, m) {
|
|
3360
|
-
for (var x, d = [0], g, _ = 0,
|
|
3362
|
+
for (var x, d = [0], g, _ = 0, p = h.length; _ < p; ) {
|
|
3361
3363
|
for (g = d.length; g--; d[g] *= I)
|
|
3362
3364
|
;
|
|
3363
3365
|
for (d[0] += m.indexOf(h.charAt(_++)), x = 0; x < d.length; x++)
|
|
@@ -3366,25 +3368,25 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3366
3368
|
return d.reverse();
|
|
3367
3369
|
}
|
|
3368
3370
|
return function(h, I, f, m, x) {
|
|
3369
|
-
var d, g, _,
|
|
3370
|
-
for (Z >= 0 && (
|
|
3371
|
+
var d, g, _, p, C, P, K, L, Z = h.indexOf("."), et = q, V = J;
|
|
3372
|
+
for (Z >= 0 && (p = kt, kt = 0, h = h.replace(".", ""), L = new E(I), P = L.pow(h.length - Z), kt = p, L.c = u(
|
|
3371
3373
|
Y(N(P.c), P.e, "0"),
|
|
3372
3374
|
10,
|
|
3373
3375
|
f,
|
|
3374
3376
|
o
|
|
3375
|
-
), L.e = L.c.length), K = u(h, I, f, x ? (d = qt, o) : (d = o, qt)), _ =
|
|
3377
|
+
), L.e = L.c.length), K = u(h, I, f, x ? (d = qt, o) : (d = o, qt)), _ = p = K.length; K[--p] == 0; K.pop())
|
|
3376
3378
|
;
|
|
3377
3379
|
if (!K[0])
|
|
3378
3380
|
return d.charAt(0);
|
|
3379
|
-
if (Z < 0 ? --_ : (P.c = K, P.e = _, P.s = m, P = M(P, L, et, V, f), K = P.c, C = P.r, _ = P.e), g = _ + et + 1, Z = K[g],
|
|
3381
|
+
if (Z < 0 ? --_ : (P.c = K, P.e = _, P.s = m, P = M(P, L, et, V, f), K = P.c, C = P.r, _ = P.e), g = _ + et + 1, Z = K[g], p = f / 2, C = C || g < 0 || K[g + 1] != null, C = V < 4 ? (Z != null || C) && (V == 0 || V == (P.s < 0 ? 3 : 2)) : Z > p || Z == p && (V == 4 || C || V == 6 && K[g - 1] & 1 || V == (P.s < 0 ? 8 : 7)), g < 1 || !K[0])
|
|
3380
3382
|
h = C ? Y(d.charAt(1), -et, d.charAt(0)) : d.charAt(0);
|
|
3381
3383
|
else {
|
|
3382
3384
|
if (K.length = g, C)
|
|
3383
3385
|
for (--f; ++K[--g] > f; )
|
|
3384
3386
|
K[g] = 0, g || (++_, K = [1].concat(K));
|
|
3385
|
-
for (
|
|
3387
|
+
for (p = K.length; !K[--p]; )
|
|
3386
3388
|
;
|
|
3387
|
-
for (Z = 0, h = ""; Z <=
|
|
3389
|
+
for (Z = 0, h = ""; Z <= p; h += d.charAt(K[Z++]))
|
|
3388
3390
|
;
|
|
3389
3391
|
h = Y(h, _, d.charAt(0));
|
|
3390
3392
|
}
|
|
@@ -3392,10 +3394,10 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3392
3394
|
};
|
|
3393
3395
|
}(), M = function() {
|
|
3394
3396
|
function o(I, f, m) {
|
|
3395
|
-
var x, d, g, _,
|
|
3397
|
+
var x, d, g, _, p = 0, C = I.length, P = f % w, K = f / w | 0;
|
|
3396
3398
|
for (I = I.slice(); C--; )
|
|
3397
|
-
g = I[C] % w, _ = I[C] / w | 0, x = K * g + _ * P, d = P * g + x % w * w +
|
|
3398
|
-
return
|
|
3399
|
+
g = I[C] % w, _ = I[C] / w | 0, x = K * g + _ * P, d = P * g + x % w * w + p, p = (d / m | 0) + (x / w | 0) + K * _, I[C] = d % m;
|
|
3400
|
+
return p && (I = [p].concat(I)), I;
|
|
3399
3401
|
}
|
|
3400
3402
|
function u(I, f, m, x) {
|
|
3401
3403
|
var d, g;
|
|
@@ -3416,22 +3418,22 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3416
3418
|
;
|
|
3417
3419
|
}
|
|
3418
3420
|
return function(I, f, m, x, d) {
|
|
3419
|
-
var g, _,
|
|
3421
|
+
var g, _, p, C, P, K, L, Z, et, V, $, nt, ce, Se, Ee, xt, ee, ft = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
|
|
3420
3422
|
if (!at || !at[0] || !tt || !tt[0])
|
|
3421
|
-
return new
|
|
3423
|
+
return new E(
|
|
3422
3424
|
!I.s || !f.s || (at ? tt && at[0] == tt[0] : !tt) ? NaN : at && at[0] == 0 || !tt ? ft * 0 : ft / 0
|
|
3423
3425
|
);
|
|
3424
|
-
for (Z = new
|
|
3426
|
+
for (Z = new E(ft), et = Z.c = [], _ = I.e - f.e, ft = m + _ + 1, d || (d = A, _ = k(I.e / y) - k(f.e / y), ft = ft / y | 0), p = 0; tt[p] == (at[p] || 0); p++)
|
|
3425
3427
|
;
|
|
3426
|
-
if (tt[
|
|
3428
|
+
if (tt[p] > (at[p] || 0) && _--, ft < 0)
|
|
3427
3429
|
et.push(1), C = !0;
|
|
3428
3430
|
else {
|
|
3429
|
-
for (
|
|
3431
|
+
for (Se = at.length, xt = tt.length, p = 0, ft += 2, P = i(d / (tt[0] + 1)), P > 1 && (tt = o(tt, P, d), at = o(at, P, d), xt = tt.length, Se = at.length), ce = xt, V = at.slice(0, xt), $ = V.length; $ < xt; V[$++] = 0)
|
|
3430
3432
|
;
|
|
3431
|
-
ee = tt.slice(), ee = [0].concat(ee),
|
|
3433
|
+
ee = tt.slice(), ee = [0].concat(ee), Ee = tt[0], tt[1] >= d / 2 && Ee++;
|
|
3432
3434
|
do {
|
|
3433
3435
|
if (P = 0, g = u(tt, V, xt, $), g < 0) {
|
|
3434
|
-
if (nt = V[0], xt != $ && (nt = nt * d + (V[1] || 0)), P = i(nt /
|
|
3436
|
+
if (nt = V[0], xt != $ && (nt = nt * d + (V[1] || 0)), P = i(nt / Ee), P > 1)
|
|
3435
3437
|
for (P >= d && (P = d - 1), K = o(tt, P, d), L = K.length, $ = V.length; u(K, V, L, $) == 1; )
|
|
3436
3438
|
P--, h(K, xt < L ? ee : tt, L, d), L = K.length, g = 1;
|
|
3437
3439
|
else
|
|
@@ -3441,14 +3443,14 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3441
3443
|
P++, h(V, xt < $ ? ee : tt, $, d), $ = V.length;
|
|
3442
3444
|
} else
|
|
3443
3445
|
g === 0 && (P++, V = [0]);
|
|
3444
|
-
et[
|
|
3445
|
-
} while ((ce++ <
|
|
3446
|
+
et[p++] = P, V[0] ? V[$++] = at[ce] || 0 : (V = [at[ce]], $ = 1);
|
|
3447
|
+
} while ((ce++ < Se || V[0] != null) && ft--);
|
|
3446
3448
|
C = V[0] != null, et[0] || et.splice(0, 1);
|
|
3447
3449
|
}
|
|
3448
|
-
if (d ==
|
|
3449
|
-
for (
|
|
3450
|
+
if (d == A) {
|
|
3451
|
+
for (p = 1, ft = et[0]; ft >= 10; ft /= 10, p++)
|
|
3450
3452
|
;
|
|
3451
|
-
dt(Z, m + (Z.e =
|
|
3453
|
+
dt(Z, m + (Z.e = p + _ * y - 1) + 1, x, C);
|
|
3452
3454
|
} else
|
|
3453
3455
|
Z.e = _, Z.r = +C;
|
|
3454
3456
|
return Z;
|
|
@@ -3460,7 +3462,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3460
3462
|
return o.toString();
|
|
3461
3463
|
if (f = o.c[0], x = o.e, u == null)
|
|
3462
3464
|
g = N(o.c), g = I == 1 || I == 2 && (x <= st || x >= ct) ? j(g, x) : Y(g, x, "0");
|
|
3463
|
-
else if (o = dt(new
|
|
3465
|
+
else if (o = dt(new E(o), u, h), m = o.e, g = N(o.c), d = g.length, I == 1 || I == 2 && (u <= m || m <= st)) {
|
|
3464
3466
|
for (; d < u; g += "0", d++)
|
|
3465
3467
|
;
|
|
3466
3468
|
g = j(g, m);
|
|
@@ -3474,8 +3476,8 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3474
3476
|
return o.s < 0 && f ? "-" + g : g;
|
|
3475
3477
|
}
|
|
3476
3478
|
function ze(o, u) {
|
|
3477
|
-
for (var h, I, f = 1, m = new
|
|
3478
|
-
I = new
|
|
3479
|
+
for (var h, I, f = 1, m = new E(o[0]); f < o.length; f++)
|
|
3480
|
+
I = new E(o[f]), (!I.s || (h = T(m, I)) === u || h === 0 && m.s === u) && (m = I);
|
|
3479
3481
|
return m;
|
|
3480
3482
|
}
|
|
3481
3483
|
function Be(o, u, h) {
|
|
@@ -3483,20 +3485,20 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3483
3485
|
;
|
|
3484
3486
|
for (f = u[0]; f >= 10; f /= 10, I++)
|
|
3485
3487
|
;
|
|
3486
|
-
return (h = I + h * y - 1) >
|
|
3488
|
+
return (h = I + h * y - 1) > At ? o.c = o.e = null : h < Ft ? o.c = [o.e = 0] : (o.e = h, o.c = u), o;
|
|
3487
3489
|
}
|
|
3488
3490
|
X = function() {
|
|
3489
3491
|
var o = /^(-?)0([xbo])(?=\w[\w.]*$)/i, u = /^([^.]+)\.$/, h = /^\.([^.]+)$/, I = /^-?(Infinity|NaN)$/, f = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
3490
3492
|
return function(m, x, d, g) {
|
|
3491
|
-
var _,
|
|
3492
|
-
if (I.test(
|
|
3493
|
-
m.s = isNaN(
|
|
3493
|
+
var _, p = d ? x : x.replace(f, "");
|
|
3494
|
+
if (I.test(p))
|
|
3495
|
+
m.s = isNaN(p) ? null : p < 0 ? -1 : 1;
|
|
3494
3496
|
else {
|
|
3495
|
-
if (!d && (
|
|
3497
|
+
if (!d && (p = p.replace(o, function(C, P, K) {
|
|
3496
3498
|
return _ = (K = K.toLowerCase()) == "x" ? 16 : K == "b" ? 2 : 8, !g || g == _ ? P : C;
|
|
3497
|
-
}), g && (_ = g,
|
|
3498
|
-
return new
|
|
3499
|
-
if (
|
|
3499
|
+
}), g && (_ = g, p = p.replace(u, "$1").replace(h, "0.$1")), x != p))
|
|
3500
|
+
return new E(p, _);
|
|
3501
|
+
if (E.DEBUG)
|
|
3500
3502
|
throw Error(c + "Not a" + (g ? " base " + g : "") + " number: " + x);
|
|
3501
3503
|
m.s = null;
|
|
3502
3504
|
}
|
|
@@ -3504,26 +3506,26 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3504
3506
|
};
|
|
3505
3507
|
}();
|
|
3506
3508
|
function dt(o, u, h, I) {
|
|
3507
|
-
var f, m, x, d, g, _,
|
|
3509
|
+
var f, m, x, d, g, _, p, C = o.c, P = b;
|
|
3508
3510
|
if (C) {
|
|
3509
3511
|
t: {
|
|
3510
3512
|
for (f = 1, d = C[0]; d >= 10; d /= 10, f++)
|
|
3511
3513
|
;
|
|
3512
3514
|
if (m = u - f, m < 0)
|
|
3513
|
-
m += y, x = u, g = C[_ = 0],
|
|
3515
|
+
m += y, x = u, g = C[_ = 0], p = i(g / P[f - x - 1] % 10);
|
|
3514
3516
|
else if (_ = n((m + 1) / y), _ >= C.length)
|
|
3515
3517
|
if (I) {
|
|
3516
3518
|
for (; C.length <= _; C.push(0))
|
|
3517
3519
|
;
|
|
3518
|
-
g =
|
|
3520
|
+
g = p = 0, f = 1, m %= y, x = m - y + 1;
|
|
3519
3521
|
} else
|
|
3520
3522
|
break t;
|
|
3521
3523
|
else {
|
|
3522
3524
|
for (g = d = C[_], f = 1; d >= 10; d /= 10, f++)
|
|
3523
3525
|
;
|
|
3524
|
-
m %= y, x = m - y + f,
|
|
3526
|
+
m %= y, x = m - y + f, p = x < 0 ? 0 : i(g / P[f - x - 1] % 10);
|
|
3525
3527
|
}
|
|
3526
|
-
if (I = I || u < 0 || C[_ + 1] != null || (x < 0 ? g : g % P[f - x - 1]), I = h < 4 ? (
|
|
3528
|
+
if (I = I || u < 0 || C[_ + 1] != null || (x < 0 ? g : g % P[f - x - 1]), I = h < 4 ? (p || I) && (h == 0 || h == (o.s < 0 ? 3 : 2)) : p > 5 || p == 5 && (h == 4 || I || h == 6 && (m > 0 ? x > 0 ? g / P[f - x] : 0 : C[_ - 1]) % 10 & 1 || h == (o.s < 0 ? 8 : 7)), u < 1 || !C[0])
|
|
3527
3529
|
return C.length = 0, I ? (u -= o.e + 1, C[0] = P[(y - u % y) % y], o.e = -u || 0) : C[0] = o.e = 0, o;
|
|
3528
3530
|
if (m == 0 ? (C.length = _, d = 1, _--) : (C.length = _ + 1, d = P[y - m], C[_] = x > 0 ? i(g / P[f - x] % P[x]) * d : 0), I)
|
|
3529
3531
|
for (; ; )
|
|
@@ -3532,33 +3534,33 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3532
3534
|
;
|
|
3533
3535
|
for (x = C[0] += d, d = 1; x >= 10; x /= 10, d++)
|
|
3534
3536
|
;
|
|
3535
|
-
m != d && (o.e++, C[0] ==
|
|
3537
|
+
m != d && (o.e++, C[0] == A && (C[0] = 1));
|
|
3536
3538
|
break;
|
|
3537
3539
|
} else {
|
|
3538
|
-
if (C[_] += d, C[_] !=
|
|
3540
|
+
if (C[_] += d, C[_] != A)
|
|
3539
3541
|
break;
|
|
3540
3542
|
C[_--] = 0, d = 1;
|
|
3541
3543
|
}
|
|
3542
3544
|
for (m = C.length; C[--m] === 0; C.pop())
|
|
3543
3545
|
;
|
|
3544
3546
|
}
|
|
3545
|
-
o.e >
|
|
3547
|
+
o.e > At ? o.c = o.e = null : o.e < Ft && (o.c = [o.e = 0]);
|
|
3546
3548
|
}
|
|
3547
3549
|
return o;
|
|
3548
3550
|
}
|
|
3549
|
-
function
|
|
3551
|
+
function bt(o) {
|
|
3550
3552
|
var u, h = o.e;
|
|
3551
3553
|
return h === null ? o.toString() : (u = N(o.c), u = h <= st || h >= ct ? j(u, h) : Y(u, h, "0"), o.s < 0 ? "-" + u : u);
|
|
3552
3554
|
}
|
|
3553
3555
|
return D.absoluteValue = D.abs = function() {
|
|
3554
|
-
var o = new
|
|
3556
|
+
var o = new E(this);
|
|
3555
3557
|
return o.s < 0 && (o.s = 1), o;
|
|
3556
3558
|
}, D.comparedTo = function(o, u) {
|
|
3557
|
-
return T(this, new
|
|
3559
|
+
return T(this, new E(o, u));
|
|
3558
3560
|
}, D.decimalPlaces = D.dp = function(o, u) {
|
|
3559
3561
|
var h, I, f, m = this;
|
|
3560
3562
|
if (o != null)
|
|
3561
|
-
return Q(o, 0, v), u == null ? u = J : Q(u, 0, 8), dt(new
|
|
3563
|
+
return Q(o, 0, v), u == null ? u = J : Q(u, 0, 8), dt(new E(m), o + m.e + 1, u);
|
|
3562
3564
|
if (!(h = m.c))
|
|
3563
3565
|
return null;
|
|
3564
3566
|
if (I = ((f = h.length - 1) - k(this.e / y)) * y, f = h[f])
|
|
@@ -3566,29 +3568,29 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3566
3568
|
;
|
|
3567
3569
|
return I < 0 && (I = 0), I;
|
|
3568
3570
|
}, D.dividedBy = D.div = function(o, u) {
|
|
3569
|
-
return M(this, new
|
|
3571
|
+
return M(this, new E(o, u), q, J);
|
|
3570
3572
|
}, D.dividedToIntegerBy = D.idiv = function(o, u) {
|
|
3571
|
-
return M(this, new
|
|
3573
|
+
return M(this, new E(o, u), 0, 1);
|
|
3572
3574
|
}, D.exponentiatedBy = D.pow = function(o, u) {
|
|
3573
|
-
var h, I, f, m, x, d, g, _,
|
|
3574
|
-
if (o = new
|
|
3575
|
-
throw Error(c + "Exponent not an integer: " +
|
|
3576
|
-
if (u != null && (u = new
|
|
3577
|
-
return
|
|
3575
|
+
var h, I, f, m, x, d, g, _, p, C = this;
|
|
3576
|
+
if (o = new E(o), o.c && !o.isInteger())
|
|
3577
|
+
throw Error(c + "Exponent not an integer: " + bt(o));
|
|
3578
|
+
if (u != null && (u = new E(u)), d = o.e > 14, !C.c || !C.c[0] || C.c[0] == 1 && !C.e && C.c.length == 1 || !o.c || !o.c[0])
|
|
3579
|
+
return p = new E(Math.pow(+bt(C), d ? o.s * (2 - R(o)) : +bt(o))), u ? p.mod(u) : p;
|
|
3578
3580
|
if (g = o.s < 0, u) {
|
|
3579
3581
|
if (u.c ? !u.c[0] : !u.s)
|
|
3580
|
-
return new
|
|
3582
|
+
return new E(NaN);
|
|
3581
3583
|
I = !g && C.isInteger() && u.isInteger(), I && (C = C.mod(u));
|
|
3582
3584
|
} else {
|
|
3583
3585
|
if (o.e > 9 && (C.e > 0 || C.e < -1 || (C.e == 0 ? C.c[0] > 1 || d && C.c[1] >= 24e7 : C.c[0] < 8e13 || d && C.c[0] <= 9999975e7)))
|
|
3584
|
-
return m = C.s < 0 && R(o) ? -0 : 0, C.e > -1 && (m = 1 / m), new
|
|
3586
|
+
return m = C.s < 0 && R(o) ? -0 : 0, C.e > -1 && (m = 1 / m), new E(g ? 1 / m : m);
|
|
3585
3587
|
kt && (m = n(kt / y + 2));
|
|
3586
3588
|
}
|
|
3587
|
-
for (d ? (h = new
|
|
3589
|
+
for (d ? (h = new E(0.5), g && (o.s = 1), _ = R(o)) : (f = Math.abs(+bt(o)), _ = f % 2), p = new E(F); ; ) {
|
|
3588
3590
|
if (_) {
|
|
3589
|
-
if (
|
|
3591
|
+
if (p = p.times(C), !p.c)
|
|
3590
3592
|
break;
|
|
3591
|
-
m ?
|
|
3593
|
+
m ? p.c.length > m && (p.c.length = m) : I && (p = p.mod(u));
|
|
3592
3594
|
}
|
|
3593
3595
|
if (f) {
|
|
3594
3596
|
if (f = i(f / 2), f === 0)
|
|
@@ -3597,30 +3599,30 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3597
3599
|
} else if (o = o.times(h), dt(o, o.e + 1, 1), o.e > 14)
|
|
3598
3600
|
_ = R(o);
|
|
3599
3601
|
else {
|
|
3600
|
-
if (f = +
|
|
3602
|
+
if (f = +bt(o), f === 0)
|
|
3601
3603
|
break;
|
|
3602
3604
|
_ = f % 2;
|
|
3603
3605
|
}
|
|
3604
3606
|
C = C.times(C), m ? C.c && C.c.length > m && (C.c.length = m) : I && (C = C.mod(u));
|
|
3605
3607
|
}
|
|
3606
|
-
return I ?
|
|
3608
|
+
return I ? p : (g && (p = F.div(p)), u ? p.mod(u) : m ? dt(p, kt, J, x) : p);
|
|
3607
3609
|
}, D.integerValue = function(o) {
|
|
3608
|
-
var u = new
|
|
3610
|
+
var u = new E(this);
|
|
3609
3611
|
return o == null ? o = J : Q(o, 0, 8), dt(u, u.e + 1, o);
|
|
3610
3612
|
}, D.isEqualTo = D.eq = function(o, u) {
|
|
3611
|
-
return T(this, new
|
|
3613
|
+
return T(this, new E(o, u)) === 0;
|
|
3612
3614
|
}, D.isFinite = function() {
|
|
3613
3615
|
return !!this.c;
|
|
3614
3616
|
}, D.isGreaterThan = D.gt = function(o, u) {
|
|
3615
|
-
return T(this, new
|
|
3617
|
+
return T(this, new E(o, u)) > 0;
|
|
3616
3618
|
}, D.isGreaterThanOrEqualTo = D.gte = function(o, u) {
|
|
3617
|
-
return (u = T(this, new
|
|
3619
|
+
return (u = T(this, new E(o, u))) === 1 || u === 0;
|
|
3618
3620
|
}, D.isInteger = function() {
|
|
3619
3621
|
return !!this.c && k(this.e / y) > this.c.length - 2;
|
|
3620
3622
|
}, D.isLessThan = D.lt = function(o, u) {
|
|
3621
|
-
return T(this, new
|
|
3623
|
+
return T(this, new E(o, u)) < 0;
|
|
3622
3624
|
}, D.isLessThanOrEqualTo = D.lte = function(o, u) {
|
|
3623
|
-
return (u = T(this, new
|
|
3625
|
+
return (u = T(this, new E(o, u))) === -1 || u === 0;
|
|
3624
3626
|
}, D.isNaN = function() {
|
|
3625
3627
|
return !this.s;
|
|
3626
3628
|
}, D.isNegative = function() {
|
|
@@ -3631,71 +3633,71 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3631
3633
|
return !!this.c && this.c[0] == 0;
|
|
3632
3634
|
}, D.minus = function(o, u) {
|
|
3633
3635
|
var h, I, f, m, x = this, d = x.s;
|
|
3634
|
-
if (o = new
|
|
3635
|
-
return new
|
|
3636
|
+
if (o = new E(o, u), u = o.s, !d || !u)
|
|
3637
|
+
return new E(NaN);
|
|
3636
3638
|
if (d != u)
|
|
3637
3639
|
return o.s = -u, x.plus(o);
|
|
3638
|
-
var g = x.e / y, _ = o.e / y,
|
|
3640
|
+
var g = x.e / y, _ = o.e / y, p = x.c, C = o.c;
|
|
3639
3641
|
if (!g || !_) {
|
|
3640
|
-
if (!
|
|
3641
|
-
return
|
|
3642
|
-
if (!
|
|
3643
|
-
return C[0] ? (o.s = -u, o) : new
|
|
3642
|
+
if (!p || !C)
|
|
3643
|
+
return p ? (o.s = -u, o) : new E(C ? x : NaN);
|
|
3644
|
+
if (!p[0] || !C[0])
|
|
3645
|
+
return C[0] ? (o.s = -u, o) : new E(p[0] ? x : J == 3 ? -0 : 0);
|
|
3644
3646
|
}
|
|
3645
|
-
if (g = k(g), _ = k(_),
|
|
3646
|
-
for ((m = d < 0) ? (d = -d, f =
|
|
3647
|
+
if (g = k(g), _ = k(_), p = p.slice(), d = g - _) {
|
|
3648
|
+
for ((m = d < 0) ? (d = -d, f = p) : (_ = g, f = C), f.reverse(), u = d; u--; f.push(0))
|
|
3647
3649
|
;
|
|
3648
3650
|
f.reverse();
|
|
3649
3651
|
} else
|
|
3650
|
-
for (I = (m = (d =
|
|
3651
|
-
if (
|
|
3652
|
-
m =
|
|
3652
|
+
for (I = (m = (d = p.length) < (u = C.length)) ? d : u, d = u = 0; u < I; u++)
|
|
3653
|
+
if (p[u] != C[u]) {
|
|
3654
|
+
m = p[u] < C[u];
|
|
3653
3655
|
break;
|
|
3654
3656
|
}
|
|
3655
|
-
if (m && (f =
|
|
3656
|
-
for (; u--;
|
|
3657
|
+
if (m && (f = p, p = C, C = f, o.s = -o.s), u = (I = C.length) - (h = p.length), u > 0)
|
|
3658
|
+
for (; u--; p[h++] = 0)
|
|
3657
3659
|
;
|
|
3658
|
-
for (u =
|
|
3659
|
-
if (
|
|
3660
|
-
for (h = I; h && !
|
|
3660
|
+
for (u = A - 1; I > d; ) {
|
|
3661
|
+
if (p[--I] < C[I]) {
|
|
3662
|
+
for (h = I; h && !p[--h]; p[h] = u)
|
|
3661
3663
|
;
|
|
3662
|
-
--
|
|
3664
|
+
--p[h], p[I] += A;
|
|
3663
3665
|
}
|
|
3664
|
-
|
|
3666
|
+
p[I] -= C[I];
|
|
3665
3667
|
}
|
|
3666
|
-
for (;
|
|
3668
|
+
for (; p[0] == 0; p.splice(0, 1), --_)
|
|
3667
3669
|
;
|
|
3668
|
-
return
|
|
3670
|
+
return p[0] ? Be(o, p, _) : (o.s = J == 3 ? -1 : 1, o.c = [o.e = 0], o);
|
|
3669
3671
|
}, D.modulo = D.mod = function(o, u) {
|
|
3670
3672
|
var h, I, f = this;
|
|
3671
|
-
return o = new
|
|
3673
|
+
return o = new E(o, u), !f.c || !o.s || o.c && !o.c[0] ? new E(NaN) : !o.c || f.c && !f.c[0] ? new E(f) : (te == 9 ? (I = o.s, o.s = 1, h = M(f, o, 0, 3), o.s = I, h.s *= I) : h = M(f, o, 0, te), o = f.minus(h.times(o)), !o.c[0] && te == 1 && (o.s = f.s), o);
|
|
3672
3674
|
}, D.multipliedBy = D.times = function(o, u) {
|
|
3673
|
-
var h, I, f, m, x, d, g, _,
|
|
3675
|
+
var h, I, f, m, x, d, g, _, p, C, P, K, L, Z, et, V = this, $ = V.c, nt = (o = new E(o, u)).c;
|
|
3674
3676
|
if (!$ || !nt || !$[0] || !nt[0])
|
|
3675
3677
|
return !V.s || !o.s || $ && !$[0] && !nt || nt && !nt[0] && !$ ? o.c = o.e = o.s = null : (o.s *= V.s, !$ || !nt ? o.c = o.e = null : (o.c = [0], o.e = 0)), o;
|
|
3676
3678
|
for (I = k(V.e / y) + k(o.e / y), o.s *= V.s, g = $.length, C = nt.length, g < C && (L = $, $ = nt, nt = L, f = g, g = C, C = f), f = g + C, L = []; f--; L.push(0))
|
|
3677
3679
|
;
|
|
3678
|
-
for (Z =
|
|
3680
|
+
for (Z = A, et = w, f = C; --f >= 0; ) {
|
|
3679
3681
|
for (h = 0, P = nt[f] % et, K = nt[f] / et | 0, x = g, m = f + x; m > f; )
|
|
3680
|
-
_ = $[--x] % et,
|
|
3682
|
+
_ = $[--x] % et, p = $[x] / et | 0, d = K * _ + p * P, _ = P * _ + d % et * et + L[m] + h, h = (_ / Z | 0) + (d / et | 0) + K * p, L[m--] = _ % Z;
|
|
3681
3683
|
L[m] = h;
|
|
3682
3684
|
}
|
|
3683
3685
|
return h ? ++I : L.splice(0, 1), Be(o, L, I);
|
|
3684
3686
|
}, D.negated = function() {
|
|
3685
|
-
var o = new
|
|
3687
|
+
var o = new E(this);
|
|
3686
3688
|
return o.s = -o.s || null, o;
|
|
3687
3689
|
}, D.plus = function(o, u) {
|
|
3688
3690
|
var h, I = this, f = I.s;
|
|
3689
|
-
if (o = new
|
|
3690
|
-
return new
|
|
3691
|
+
if (o = new E(o, u), u = o.s, !f || !u)
|
|
3692
|
+
return new E(NaN);
|
|
3691
3693
|
if (f != u)
|
|
3692
3694
|
return o.s = -u, I.minus(o);
|
|
3693
3695
|
var m = I.e / y, x = o.e / y, d = I.c, g = o.c;
|
|
3694
3696
|
if (!m || !x) {
|
|
3695
3697
|
if (!d || !g)
|
|
3696
|
-
return new
|
|
3698
|
+
return new E(f / 0);
|
|
3697
3699
|
if (!d[0] || !g[0])
|
|
3698
|
-
return g[0] ? o : new
|
|
3700
|
+
return g[0] ? o : new E(d[0] ? I : f * 0);
|
|
3699
3701
|
}
|
|
3700
3702
|
if (m = k(m), x = k(x), d = d.slice(), f = m - x) {
|
|
3701
3703
|
for (f > 0 ? (x = m, h = g) : (f = -f, h = d), h.reverse(); f--; h.push(0))
|
|
@@ -3703,12 +3705,12 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3703
3705
|
h.reverse();
|
|
3704
3706
|
}
|
|
3705
3707
|
for (f = d.length, u = g.length, f - u < 0 && (h = g, g = d, d = h, u = f), f = 0; u; )
|
|
3706
|
-
f = (d[--u] = d[u] + g[u] + f) /
|
|
3708
|
+
f = (d[--u] = d[u] + g[u] + f) / A | 0, d[u] = A === d[u] ? 0 : d[u] % A;
|
|
3707
3709
|
return f && (d = [f].concat(d), ++x), Be(o, d, x);
|
|
3708
3710
|
}, D.precision = D.sd = function(o, u) {
|
|
3709
3711
|
var h, I, f, m = this;
|
|
3710
3712
|
if (o != null && o !== !!o)
|
|
3711
|
-
return Q(o, 1, v), u == null ? u = J : Q(u, 0, 8), dt(new
|
|
3713
|
+
return Q(o, 1, v), u == null ? u = J : Q(u, 0, 8), dt(new E(m), o, u);
|
|
3712
3714
|
if (!(h = m.c))
|
|
3713
3715
|
return null;
|
|
3714
3716
|
if (f = h.length - 1, I = f * y + 1, f = h[f]) {
|
|
@@ -3721,12 +3723,12 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3721
3723
|
}, D.shiftedBy = function(o) {
|
|
3722
3724
|
return Q(o, -B, B), this.times("1e" + o);
|
|
3723
3725
|
}, D.squareRoot = D.sqrt = function() {
|
|
3724
|
-
var o, u, h, I, f, m = this, x = m.c, d = m.s, g = m.e, _ = q + 4,
|
|
3726
|
+
var o, u, h, I, f, m = this, x = m.c, d = m.s, g = m.e, _ = q + 4, p = new E("0.5");
|
|
3725
3727
|
if (d !== 1 || !x || !x[0])
|
|
3726
|
-
return new
|
|
3727
|
-
if (d = Math.sqrt(+
|
|
3728
|
+
return new E(!d || d < 0 && (!x || x[0]) ? NaN : x ? m : 1 / 0);
|
|
3729
|
+
if (d = Math.sqrt(+bt(m)), d == 0 || d == 1 / 0 ? (u = N(x), (u.length + g) % 2 == 0 && (u += "0"), d = Math.sqrt(+u), g = k((g + 1) / 2) - (g < 0 || g % 2), d == 1 / 0 ? u = "5e" + g : (u = d.toExponential(), u = u.slice(0, u.indexOf("e") + 1) + g), h = new E(u)) : h = new E(d + ""), h.c[0]) {
|
|
3728
3730
|
for (g = h.e, d = g + _, d < 3 && (d = 0); ; )
|
|
3729
|
-
if (f = h, h =
|
|
3731
|
+
if (f = h, h = p.times(f.plus(M(m, f, _, 1))), N(f.c).slice(0, d) === (u = N(h.c)).slice(0, d))
|
|
3730
3732
|
if (h.e < g && --d, u = u.slice(d - 3, d + 1), u == "9999" || !I && u == "4999") {
|
|
3731
3733
|
if (!I && (dt(f, f.e + q + 2, 0), f.times(f).eq(m))) {
|
|
3732
3734
|
h = f;
|
|
@@ -3750,39 +3752,39 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3750
3752
|
else if (typeof h != "object")
|
|
3751
3753
|
throw Error(c + "Argument not an object: " + h);
|
|
3752
3754
|
if (I = f.toFixed(o, u), f.c) {
|
|
3753
|
-
var m, x = I.split("."), d = +h.groupSize, g = +h.secondaryGroupSize, _ = h.groupSeparator || "",
|
|
3755
|
+
var m, x = I.split("."), d = +h.groupSize, g = +h.secondaryGroupSize, _ = h.groupSeparator || "", p = x[0], C = x[1], P = f.s < 0, K = P ? p.slice(1) : p, L = K.length;
|
|
3754
3756
|
if (g && (m = d, d = g, g = m, L -= m), d > 0 && L > 0) {
|
|
3755
|
-
for (m = L % d || d,
|
|
3756
|
-
|
|
3757
|
-
g > 0 && (
|
|
3757
|
+
for (m = L % d || d, p = K.substr(0, m); m < L; m += d)
|
|
3758
|
+
p += _ + K.substr(m, d);
|
|
3759
|
+
g > 0 && (p += _ + K.slice(m)), P && (p = "-" + p);
|
|
3758
3760
|
}
|
|
3759
|
-
I = C ?
|
|
3761
|
+
I = C ? p + (h.decimalSeparator || "") + ((g = +h.fractionGroupSize) ? C.replace(
|
|
3760
3762
|
new RegExp("\\d{" + g + "}\\B", "g"),
|
|
3761
3763
|
"$&" + (h.fractionGroupSeparator || "")
|
|
3762
|
-
) : C) :
|
|
3764
|
+
) : C) : p;
|
|
3763
3765
|
}
|
|
3764
3766
|
return (h.prefix || "") + I + (h.suffix || "");
|
|
3765
3767
|
}, D.toFraction = function(o) {
|
|
3766
|
-
var u, h, I, f, m, x, d, g, _,
|
|
3767
|
-
if (o != null && (d = new
|
|
3768
|
-
throw Error(c + "Argument " + (d.isInteger() ? "out of range: " : "not an integer: ") +
|
|
3768
|
+
var u, h, I, f, m, x, d, g, _, p, C, P, K = this, L = K.c;
|
|
3769
|
+
if (o != null && (d = new E(o), !d.isInteger() && (d.c || d.s !== 1) || d.lt(F)))
|
|
3770
|
+
throw Error(c + "Argument " + (d.isInteger() ? "out of range: " : "not an integer: ") + bt(d));
|
|
3769
3771
|
if (!L)
|
|
3770
|
-
return new
|
|
3771
|
-
for (u = new
|
|
3772
|
-
h = I, I = f, _ = g.plus(
|
|
3772
|
+
return new E(K);
|
|
3773
|
+
for (u = new E(F), _ = h = new E(F), I = g = new E(F), P = N(L), m = u.e = P.length - K.e - 1, u.c[0] = b[(x = m % y) < 0 ? y + x : x], o = !o || d.comparedTo(u) > 0 ? m > 0 ? u : _ : d, x = At, At = 1 / 0, d = new E(P), g.c[0] = 0; p = M(d, u, 0, 1), f = h.plus(p.times(I)), f.comparedTo(o) != 1; )
|
|
3774
|
+
h = I, I = f, _ = g.plus(p.times(f = _)), g = f, u = d.minus(p.times(f = u)), d = f;
|
|
3773
3775
|
return f = M(o.minus(h), I, 0, 1), g = g.plus(f.times(_)), h = h.plus(f.times(I)), g.s = _.s = K.s, m = m * 2, C = M(_, I, m, J).minus(K).abs().comparedTo(
|
|
3774
3776
|
M(g, h, m, J).minus(K).abs()
|
|
3775
|
-
) < 1 ? [_, I] : [g, h],
|
|
3777
|
+
) < 1 ? [_, I] : [g, h], At = x, C;
|
|
3776
3778
|
}, D.toNumber = function() {
|
|
3777
|
-
return +
|
|
3779
|
+
return +bt(this);
|
|
3778
3780
|
}, D.toPrecision = function(o, u) {
|
|
3779
3781
|
return o != null && Q(o, 1, v), Ce(this, o, u, 2);
|
|
3780
3782
|
}, D.toString = function(o) {
|
|
3781
3783
|
var u, h = this, I = h.s, f = h.e;
|
|
3782
|
-
return f === null ? I ? (u = "Infinity", I < 0 && (u = "-" + u)) : u = "NaN" : (o == null ? u = f <= st || f >= ct ? j(N(h.c), f) : Y(N(h.c), f, "0") : o === 10 && we ? (h = dt(new
|
|
3784
|
+
return f === null ? I ? (u = "Infinity", I < 0 && (u = "-" + u)) : u = "NaN" : (o == null ? u = f <= st || f >= ct ? j(N(h.c), f) : Y(N(h.c), f, "0") : o === 10 && we ? (h = dt(new E(h), q + f + 1, J), u = Y(N(h.c), h.e, "0")) : (Q(o, 2, qt.length, "Base"), u = z(Y(N(h.c), f, "0"), 10, o, I, !0)), I < 0 && h.c[0] && (u = "-" + u)), u;
|
|
3783
3785
|
}, D.valueOf = D.toJSON = function() {
|
|
3784
|
-
return
|
|
3785
|
-
}, D._isBigNumber = !0, O != null &&
|
|
3786
|
+
return bt(this);
|
|
3787
|
+
}, D._isBigNumber = !0, O != null && E.set(O), E;
|
|
3786
3788
|
}
|
|
3787
3789
|
function k(O) {
|
|
3788
3790
|
var M = O | 0;
|
|
@@ -3855,7 +3857,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3855
3857
|
'"': '\\"',
|
|
3856
3858
|
"\\": "\\\\"
|
|
3857
3859
|
}, l;
|
|
3858
|
-
function
|
|
3860
|
+
function A(B) {
|
|
3859
3861
|
return r.lastIndex = 0, r.test(B) ? '"' + B.replace(r, function(b) {
|
|
3860
3862
|
var w = c[b];
|
|
3861
3863
|
return typeof w == "string" ? w : "\\u" + ("0000" + b.charCodeAt(0).toString(16)).slice(-4);
|
|
@@ -3865,7 +3867,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3865
3867
|
var w, v, U, k, N = n, T, Q = b[B], R = Q != null && (Q instanceof e || e.isBigNumber(Q));
|
|
3866
3868
|
switch (Q && typeof Q == "object" && typeof Q.toJSON == "function" && (Q = Q.toJSON(B)), typeof l == "function" && (Q = l.call(b, B, Q)), typeof Q) {
|
|
3867
3869
|
case "string":
|
|
3868
|
-
return R ? Q :
|
|
3870
|
+
return R ? Q : A(Q);
|
|
3869
3871
|
case "number":
|
|
3870
3872
|
return isFinite(Q) ? String(Q) : "null";
|
|
3871
3873
|
case "boolean":
|
|
@@ -3885,11 +3887,11 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3885
3887
|
}
|
|
3886
3888
|
if (l && typeof l == "object")
|
|
3887
3889
|
for (k = l.length, w = 0; w < k; w += 1)
|
|
3888
|
-
typeof l[w] == "string" && (v = l[w], U = y(v, Q), U && T.push(
|
|
3890
|
+
typeof l[w] == "string" && (v = l[w], U = y(v, Q), U && T.push(A(v) + (n ? ": " : ":") + U));
|
|
3889
3891
|
else
|
|
3890
3892
|
Object.keys(Q).forEach(function(j) {
|
|
3891
3893
|
var Y = y(j, Q);
|
|
3892
|
-
Y && T.push(
|
|
3894
|
+
Y && T.push(A(j) + (n ? ": " : ":") + Y);
|
|
3893
3895
|
});
|
|
3894
3896
|
return U = T.length === 0 ? "{}" : n ? `{
|
|
3895
3897
|
` + n + T.join(`,
|
|
@@ -3956,7 +3958,7 @@ var Zs = function(s) {
|
|
|
3956
3958
|
};
|
|
3957
3959
|
}, l = function(k) {
|
|
3958
3960
|
return k && k !== r && c("Expected '" + k + "' instead of '" + r + "'"), r = i.charAt(t), t += 1, r;
|
|
3959
|
-
},
|
|
3961
|
+
}, A = function() {
|
|
3960
3962
|
var k, N = "";
|
|
3961
3963
|
for (r === "-" && (N = "-", l("-")); r >= "0" && r <= "9"; )
|
|
3962
3964
|
N += r, l();
|
|
@@ -4036,9 +4038,9 @@ var Zs = function(s) {
|
|
|
4036
4038
|
case '"':
|
|
4037
4039
|
return y();
|
|
4038
4040
|
case "-":
|
|
4039
|
-
return
|
|
4041
|
+
return A();
|
|
4040
4042
|
default:
|
|
4041
|
-
return r >= "0" && r <= "9" ?
|
|
4043
|
+
return r >= "0" && r <= "9" ? A() : b();
|
|
4042
4044
|
}
|
|
4043
4045
|
}, function(k, N) {
|
|
4044
4046
|
var T;
|
|
@@ -4050,17 +4052,17 @@ var Zs = function(s) {
|
|
|
4050
4052
|
}({ "": T }, "") : T;
|
|
4051
4053
|
};
|
|
4052
4054
|
}, tn = Zs, Lr = Vr.exports.stringify, Gr = tn;
|
|
4053
|
-
|
|
4055
|
+
Wt.exports = function(s) {
|
|
4054
4056
|
return {
|
|
4055
4057
|
parse: Gr(s),
|
|
4056
4058
|
stringify: Lr
|
|
4057
4059
|
};
|
|
4058
4060
|
};
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
+
Wt.exports.parse = Gr();
|
|
4062
|
+
Wt.exports.stringify = Lr;
|
|
4061
4063
|
class en {
|
|
4062
4064
|
txHex = "";
|
|
4063
|
-
txBuilder =
|
|
4065
|
+
txBuilder = Ae();
|
|
4064
4066
|
txEvaluationMultiplier = 1.1;
|
|
4065
4067
|
_protocolParams = mt;
|
|
4066
4068
|
txOutput;
|
|
@@ -4072,7 +4074,7 @@ class en {
|
|
|
4072
4074
|
txInQueueItem;
|
|
4073
4075
|
collateralQueueItem;
|
|
4074
4076
|
refScriptTxInQueueItem;
|
|
4075
|
-
reset = () => (this.txHex = "", this.txBuilder =
|
|
4077
|
+
reset = () => (this.txHex = "", this.txBuilder = Ae(), this.txEvaluationMultiplier = 1.1, this._protocolParams = mt, this.txOutput = void 0, this.addingScriptInput = !1, this.addingPlutusMint = !1, this.mintItem = void 0, this.txInQueueItem = void 0, this.collateralQueueItem = void 0, this.refScriptTxInQueueItem = void 0, this.meshTxBuilderBody = this.emptyTxBuilderBody(), this);
|
|
4076
4078
|
emptyTxBuilderBody = () => ({
|
|
4077
4079
|
inputs: [],
|
|
4078
4080
|
outputs: [],
|
|
@@ -4097,7 +4099,7 @@ class en {
|
|
|
4097
4099
|
return e.length > 0 && this.addAllSigningKeys(e), this.txHex;
|
|
4098
4100
|
};
|
|
4099
4101
|
serializeTxBody = (e) => {
|
|
4100
|
-
const { inputs: t, outputs: r, extraInputs: n, selectionThreshold: i, collaterals: c, referenceInputs: l, mints:
|
|
4102
|
+
const { inputs: t, outputs: r, extraInputs: n, selectionThreshold: i, collaterals: c, referenceInputs: l, mints: A, changeAddress: y, certificates: B, validityRange: b, requiredSignatures: w, metadata: v } = e;
|
|
4101
4103
|
if (this.isHydra ? this.protocolParams({
|
|
4102
4104
|
minFeeA: 0,
|
|
4103
4105
|
minFeeB: 0,
|
|
@@ -4105,7 +4107,7 @@ class en {
|
|
|
4105
4107
|
priceStep: 0,
|
|
4106
4108
|
collateralPercent: 0,
|
|
4107
4109
|
coinsPerUTxOSize: "0"
|
|
4108
|
-
}) : this.protocolParams({}), n.length > 0 && this.addUtxosFrom(n, String(i)), this.removeDuplicateInputs(), this.meshTxBuilderBody.mints.sort((U, k) => U.policyId.localeCompare(k.policyId)), this.meshTxBuilderBody.inputs.sort((U, k) => U.txIn.txHash === k.txIn.txHash ? U.txIn.txIndex - k.txIn.txIndex : U.txIn.txHash.localeCompare(k.txIn.txHash)), this.addAllInputs(t), this.addAllOutputs(r), this.addAllCollaterals(c), this.addAllReferenceInputs(l), this.addAllMints(
|
|
4110
|
+
}) : this.protocolParams({}), n.length > 0 && this.addUtxosFrom(n, String(i)), this.removeDuplicateInputs(), this.meshTxBuilderBody.mints.sort((U, k) => U.policyId.localeCompare(k.policyId)), this.meshTxBuilderBody.inputs.sort((U, k) => U.txIn.txHash === k.txIn.txHash ? U.txIn.txIndex - k.txIn.txIndex : U.txIn.txHash.localeCompare(k.txIn.txHash)), this.addAllInputs(t), this.addAllOutputs(r), this.addAllCollaterals(c), this.addAllReferenceInputs(l), this.addAllMints(A), this.addAllCertificates(B), this.addValidityRange(b), this.addAllRequiredSignatures(w), this.addAllMetadata(v), this.addCostModels(), y) {
|
|
4109
4111
|
const U = this.meshTxBuilderBody.collaterals.map((T) => {
|
|
4110
4112
|
var Q, R;
|
|
4111
4113
|
return ((R = (Q = T.txIn.amount) == null ? void 0 : Q.find((j) => j.unit === "lovelace")) == null ? void 0 : R.quantity) || "0";
|
|
@@ -4137,24 +4139,37 @@ class en {
|
|
|
4137
4139
|
address: n
|
|
4138
4140
|
}
|
|
4139
4141
|
}, this.addingScriptInput = !1, this);
|
|
4140
|
-
txInScript = (e, t
|
|
4142
|
+
txInScript = (e, t) => {
|
|
4141
4143
|
if (!this.txInQueueItem)
|
|
4142
4144
|
throw Error("Undefined input");
|
|
4143
|
-
if (this.txInQueueItem.type === "PubKey"
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4145
|
+
if (this.txInQueueItem.type === "PubKey" && (this.txInQueueItem = {
|
|
4146
|
+
type: "SimpleScript",
|
|
4147
|
+
txIn: this.txInQueueItem.txIn,
|
|
4148
|
+
simpleScriptTxIn: {
|
|
4149
|
+
scriptSource: {
|
|
4150
|
+
type: "Provided",
|
|
4151
|
+
script: e
|
|
4152
|
+
}
|
|
4150
4153
|
}
|
|
4151
|
-
}, this
|
|
4154
|
+
}), this.txInQueueItem.type === "Script") {
|
|
4155
|
+
const r = t || "V2";
|
|
4156
|
+
this.txInQueueItem.scriptTxIn.scriptSource = {
|
|
4157
|
+
type: "Provided",
|
|
4158
|
+
script: {
|
|
4159
|
+
code: e,
|
|
4160
|
+
version: r
|
|
4161
|
+
}
|
|
4162
|
+
};
|
|
4163
|
+
}
|
|
4164
|
+
return this;
|
|
4152
4165
|
};
|
|
4153
4166
|
txInDatumValue = (e, t = "Mesh") => {
|
|
4154
4167
|
if (!this.txInQueueItem)
|
|
4155
4168
|
throw Error("Undefined input");
|
|
4156
4169
|
if (this.txInQueueItem.type === "PubKey")
|
|
4157
4170
|
throw Error("Datum value attempted to be called a non script input");
|
|
4171
|
+
if (this.txInQueueItem.type === "SimpleScript")
|
|
4172
|
+
throw Error("Datum value attempted to be called on a simple script input");
|
|
4158
4173
|
let r = e;
|
|
4159
4174
|
return t === "JSON" && (r = this.castRawDataToJsonString(e)), t === "Mesh" ? (this.txInQueueItem.scriptTxIn.datumSource = {
|
|
4160
4175
|
type: "Provided",
|
|
@@ -4175,6 +4190,8 @@ class en {
|
|
|
4175
4190
|
throw Error("Undefined input");
|
|
4176
4191
|
if (this.txInQueueItem.type === "PubKey")
|
|
4177
4192
|
throw Error("Inline datum present attempted to be called a non script input");
|
|
4193
|
+
if (this.txInQueueItem.type === "SimpleScript")
|
|
4194
|
+
throw Error("Inline datum present attempted to be called on a simple script input");
|
|
4178
4195
|
const { txHash: e, txIndex: t } = this.txInQueueItem.txIn;
|
|
4179
4196
|
return e && t.toString() && (this.txInQueueItem.scriptTxIn.datumSource = {
|
|
4180
4197
|
type: "Inline",
|
|
@@ -4182,11 +4199,13 @@ class en {
|
|
|
4182
4199
|
txIndex: t
|
|
4183
4200
|
}), this;
|
|
4184
4201
|
};
|
|
4185
|
-
txInRedeemerValue = (e, t = { ...
|
|
4202
|
+
txInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => {
|
|
4186
4203
|
if (!this.txInQueueItem)
|
|
4187
4204
|
throw Error("Undefined input");
|
|
4188
4205
|
if (this.txInQueueItem.type === "PubKey")
|
|
4189
4206
|
throw Error("Spending tx in reference redeemer attempted to be called a non script input");
|
|
4207
|
+
if (this.txInQueueItem.type === "SimpleScript")
|
|
4208
|
+
throw Error("Spending tx in reference redeemer attempted to be called on a simple script input");
|
|
4190
4209
|
let n = e;
|
|
4191
4210
|
return r === "Mesh" ? (this.txInQueueItem.scriptTxIn.redeemer = {
|
|
4192
4211
|
data: {
|
|
@@ -4255,6 +4274,8 @@ class en {
|
|
|
4255
4274
|
throw Error("Undefined input");
|
|
4256
4275
|
if (this.txInQueueItem.type === "PubKey")
|
|
4257
4276
|
throw Error("Spending tx in reference attempted to be called a non script input");
|
|
4277
|
+
if (this.txInQueueItem.type === "SimpleScript")
|
|
4278
|
+
throw Error("Spending tx in reference attempted to be called on a simple script input");
|
|
4258
4279
|
return this.txInQueueItem.scriptTxIn.scriptSource = {
|
|
4259
4280
|
type: "Inline",
|
|
4260
4281
|
txInInfo: {
|
|
@@ -4266,7 +4287,7 @@ class en {
|
|
|
4266
4287
|
}, this;
|
|
4267
4288
|
};
|
|
4268
4289
|
spendingReferenceTxInInlineDatumPresent = () => (this.txInInlineDatumPresent(), this);
|
|
4269
|
-
spendingReferenceTxInRedeemerValue = (e, t = { ...
|
|
4290
|
+
spendingReferenceTxInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => (this.txInRedeemerValue(e, t, r), this);
|
|
4270
4291
|
readOnlyTxInReference = (e, t) => (this.meshTxBuilderBody.referenceInputs.push({ txHash: e, txIndex: t }), this);
|
|
4271
4292
|
mintPlutusScriptV2 = () => (this.addingPlutusMint = !0, this);
|
|
4272
4293
|
mint = (e, t, r) => (this.mintItem && this.queueMint(), this.mintItem = {
|
|
@@ -4301,7 +4322,7 @@ class en {
|
|
|
4301
4322
|
version: r
|
|
4302
4323
|
}, this;
|
|
4303
4324
|
};
|
|
4304
|
-
mintReferenceTxInRedeemerValue = (e, t = { ...
|
|
4325
|
+
mintReferenceTxInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => {
|
|
4305
4326
|
if (!this.mintItem)
|
|
4306
4327
|
throw Error("Undefined mint");
|
|
4307
4328
|
if (this.mintItem.type == "Native")
|
|
@@ -4328,7 +4349,7 @@ class en {
|
|
|
4328
4349
|
}
|
|
4329
4350
|
return this;
|
|
4330
4351
|
};
|
|
4331
|
-
mintRedeemerValue = (e, t = { ...
|
|
4352
|
+
mintRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => (this.mintReferenceTxInRedeemerValue(e, t, r), this);
|
|
4332
4353
|
requiredSignerHash = (e) => (this.meshTxBuilderBody.requiredSignatures.push(e), this);
|
|
4333
4354
|
txInCollateral = (e, t, r, n) => (this.collateralQueueItem && this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem), this.collateralQueueItem = {
|
|
4334
4355
|
type: "PubKey",
|
|
@@ -4367,27 +4388,27 @@ class en {
|
|
|
4367
4388
|
metadataValue = (e, t) => (this.meshTxBuilderBody.metadata.push({ tag: e, metadata: t }), this);
|
|
4368
4389
|
protocolParams = (e) => {
|
|
4369
4390
|
const t = { ...mt, ...e };
|
|
4370
|
-
return this._protocolParams = t, this.txBuilder =
|
|
4391
|
+
return this._protocolParams = t, this.txBuilder = Ae(t), this;
|
|
4371
4392
|
};
|
|
4372
4393
|
signingKey = (e) => (this.meshTxBuilderBody.signingKey.push(e), this);
|
|
4373
4394
|
selectUtxosFrom = (e, t = 5e6) => (this.meshTxBuilderBody.extraInputs = e, this.meshTxBuilderBody.selectionThreshold = t, this);
|
|
4374
4395
|
addUtxosFrom = (e, t) => {
|
|
4375
|
-
const r = this.meshTxBuilderBody.outputs.reduce((i, c) => (c.amount.forEach((
|
|
4376
|
-
const { unit: y, quantity: B } =
|
|
4396
|
+
const r = this.meshTxBuilderBody.outputs.reduce((i, c) => (c.amount.forEach((A) => {
|
|
4397
|
+
const { unit: y, quantity: B } = A, b = Number(i.get(y)) || 0;
|
|
4377
4398
|
i.set(y, String(b + Number(B)));
|
|
4378
4399
|
}), i), /* @__PURE__ */ new Map());
|
|
4379
4400
|
this.meshTxBuilderBody.inputs.reduce((i, c) => {
|
|
4380
4401
|
const l = c.txIn.amount;
|
|
4381
|
-
return l == null || l.forEach((
|
|
4382
|
-
const { unit: y, quantity: B } =
|
|
4402
|
+
return l == null || l.forEach((A) => {
|
|
4403
|
+
const { unit: y, quantity: B } = A, b = Number(i.get(y)) || 0;
|
|
4383
4404
|
i.set(y, String(b - Number(B)));
|
|
4384
4405
|
}), i;
|
|
4385
4406
|
}, r), this.meshTxBuilderBody.mints.reduce((i, c) => {
|
|
4386
4407
|
const l = {
|
|
4387
4408
|
unit: c.policyId + c.assetName,
|
|
4388
4409
|
quantity: String(c.amount)
|
|
4389
|
-
},
|
|
4390
|
-
return i.set(l.unit, String(
|
|
4410
|
+
}, A = Number(i.get(l.unit)) || 0;
|
|
4411
|
+
return i.set(l.unit, String(A - Number(l.quantity))), i;
|
|
4391
4412
|
}, r), Ws(e, r, t).forEach((i) => {
|
|
4392
4413
|
const c = {
|
|
4393
4414
|
type: "PubKey",
|
|
@@ -4405,7 +4426,7 @@ class en {
|
|
|
4405
4426
|
if (e.length > 0) {
|
|
4406
4427
|
const t = a.Vkeywitnesses.new(), r = a.Transaction.from_hex(this.txHex), n = r.body();
|
|
4407
4428
|
e.forEach((l) => {
|
|
4408
|
-
const
|
|
4429
|
+
const A = l.slice(0, 4) === "5820" ? l.slice(4) : l, y = a.PrivateKey.from_hex(A), B = a.make_vkey_witness(a.hash_transaction(n), y);
|
|
4409
4430
|
t.add(B);
|
|
4410
4431
|
});
|
|
4411
4432
|
const i = r.witness_set();
|
|
@@ -4442,7 +4463,7 @@ class en {
|
|
|
4442
4463
|
};
|
|
4443
4464
|
makePlutusScriptSource = (e) => {
|
|
4444
4465
|
const t = a.ScriptHash.from_hex(e.spendingScriptHash), r = a.TransactionInput.new(a.TransactionHash.from_hex(e.txHash), e.txIndex);
|
|
4445
|
-
return a.PlutusScriptSource.new_ref_input_with_lang_ver(t, r,
|
|
4466
|
+
return a.PlutusScriptSource.new_ref_input_with_lang_ver(t, r, vt[e.version]);
|
|
4446
4467
|
};
|
|
4447
4468
|
removeDuplicateInputs = () => {
|
|
4448
4469
|
const e = this.meshTxBuilderBody.inputs, t = (n) => `${n.txHash}#${n.txIndex}`, r = [];
|
|
@@ -4458,6 +4479,9 @@ class en {
|
|
|
4458
4479
|
case "PubKey":
|
|
4459
4480
|
this.addTxIn(r);
|
|
4460
4481
|
break;
|
|
4482
|
+
case "SimpleScript":
|
|
4483
|
+
this.addNativeScriptTxIn(r);
|
|
4484
|
+
break;
|
|
4461
4485
|
case "Script":
|
|
4462
4486
|
this.addScriptTxIn(r);
|
|
4463
4487
|
break;
|
|
@@ -4465,7 +4489,10 @@ class en {
|
|
|
4465
4489
|
}
|
|
4466
4490
|
};
|
|
4467
4491
|
addTxIn = (e) => {
|
|
4468
|
-
this.txBuilder.add_input(a.Address.from_bech32(e.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(e.txIn.txHash), e.txIn.txIndex),
|
|
4492
|
+
this.txBuilder.add_input(a.Address.from_bech32(e.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(e.txIn.txHash), e.txIn.txIndex), Bt(e.txIn.amount));
|
|
4493
|
+
};
|
|
4494
|
+
addNativeScriptTxIn = ({ txIn: e, simpleScriptTxIn: t }) => {
|
|
4495
|
+
t.scriptSource.type === "Provided" && this.txBuilder.add_native_script_input(a.NativeScript.from_hex(t.scriptSource.script), a.TransactionInput.new(a.TransactionHash.from_hex(e.txHash), e.txIndex), Bt(e.amount));
|
|
4469
4496
|
};
|
|
4470
4497
|
addScriptTxIn = ({ scriptTxIn: e, txIn: t }) => {
|
|
4471
4498
|
let r;
|
|
@@ -4477,9 +4504,9 @@ class en {
|
|
|
4477
4504
|
r = a.DatumSource.new_ref_input(y);
|
|
4478
4505
|
}
|
|
4479
4506
|
let l;
|
|
4480
|
-
i.type == "Inline" ? l = this.makePlutusScriptSource(i.txInInfo) : l = a.PlutusScriptSource.new(a.PlutusScript.from_hex_with_version(i.script.code,
|
|
4481
|
-
const
|
|
4482
|
-
this.txBuilder.add_plutus_script_input(a.PlutusWitness.new_with_ref(l, r,
|
|
4507
|
+
i.type == "Inline" ? l = this.makePlutusScriptSource(i.txInInfo) : l = a.PlutusScriptSource.new(a.PlutusScript.from_hex_with_version(i.script.code, vt[i.script.version]));
|
|
4508
|
+
const A = a.Redeemer.new(a.RedeemerTag.new_spend(), a.BigNum.from_str("0"), this.castDataToPlutusData(c.data), a.ExUnits.new(a.BigNum.from_str(String(c.exUnits.mem)), a.BigNum.from_str(String(c.exUnits.steps))));
|
|
4509
|
+
this.txBuilder.add_plutus_script_input(a.PlutusWitness.new_with_ref(l, r, A), a.TransactionInput.new(a.TransactionHash.from_hex(t.txHash), t.txIndex), Bt(t.amount));
|
|
4483
4510
|
};
|
|
4484
4511
|
addAllOutputs = (e) => {
|
|
4485
4512
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -4488,17 +4515,17 @@ class en {
|
|
|
4488
4515
|
}
|
|
4489
4516
|
};
|
|
4490
4517
|
addOutput = ({ amount: e, address: t, datum: r, referenceScript: n }) => {
|
|
4491
|
-
const i =
|
|
4518
|
+
const i = Bt(e), c = i.multiasset();
|
|
4492
4519
|
if (i.is_zero() && c === void 0)
|
|
4493
4520
|
throw Error("Invalid output amount");
|
|
4494
4521
|
let l = a.TransactionOutputBuilder.new().with_address(yt(t));
|
|
4495
|
-
r && r.type === "Hash" && (l = l.with_data_hash(a.hash_plutus_data(this.castDataToPlutusData(r.data)))), r && r.type === "Inline" && (l = l.with_plutus_data(this.castDataToPlutusData(r.data))), n && (l = l.with_script_ref(a.ScriptRef.new_plutus_script(a.PlutusScript.from_hex_with_version(n.code,
|
|
4496
|
-
const
|
|
4522
|
+
r && r.type === "Hash" && (l = l.with_data_hash(a.hash_plutus_data(this.castDataToPlutusData(r.data)))), r && r.type === "Inline" && (l = l.with_plutus_data(this.castDataToPlutusData(r.data))), n && (l = l.with_script_ref(a.ScriptRef.new_plutus_script(a.PlutusScript.from_hex_with_version(n.code, vt[n.version]))));
|
|
4523
|
+
const A = l.next();
|
|
4497
4524
|
if (c) {
|
|
4498
|
-
const y = i.coin().is_zero() ?
|
|
4525
|
+
const y = i.coin().is_zero() ? A.with_asset_and_min_required_coin_by_utxo_cost(c, Ue(this._protocolParams.coinsPerUTxOSize)).build() : A.with_coin_and_asset(i.coin(), c).build();
|
|
4499
4526
|
this.txBuilder.add_output(y);
|
|
4500
4527
|
} else {
|
|
4501
|
-
const y =
|
|
4528
|
+
const y = A.with_coin(i.coin()).build();
|
|
4502
4529
|
this.txBuilder.add_output(y);
|
|
4503
4530
|
}
|
|
4504
4531
|
};
|
|
@@ -4511,7 +4538,7 @@ class en {
|
|
|
4511
4538
|
this.txBuilder.set_collateral(t);
|
|
4512
4539
|
};
|
|
4513
4540
|
addCollateral = (e, t) => {
|
|
4514
|
-
e.add_input(a.Address.from_bech32(t.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(t.txIn.txHash), t.txIn.txIndex),
|
|
4541
|
+
e.add_input(a.Address.from_bech32(t.txIn.address), a.TransactionInput.new(a.TransactionHash.from_hex(t.txIn.txHash), t.txIn.txIndex), Bt(t.txIn.amount));
|
|
4515
4542
|
};
|
|
4516
4543
|
addCollateralReturn = (e) => {
|
|
4517
4544
|
var r;
|
|
@@ -4547,8 +4574,8 @@ class en {
|
|
|
4547
4574
|
this.txBuilder.set_mint_builder(t);
|
|
4548
4575
|
};
|
|
4549
4576
|
addPlutusMint = (e, { redeemer: t, policyId: r, scriptSource: n, assetName: i, amount: c }, l) => {
|
|
4550
|
-
const
|
|
4551
|
-
e.add_asset(a.MintWitness.new_plutus_script(y,
|
|
4577
|
+
const A = a.Redeemer.new(a.RedeemerTag.new_mint(), a.BigNum.from_str(String(l)), this.castDataToPlutusData(t.data), a.ExUnits.new(a.BigNum.from_str(String(t.exUnits.mem)), a.BigNum.from_str(String(t.exUnits.steps)))), y = n.type === "Reference Script" ? a.PlutusScriptSource.new_ref_input_with_lang_ver(a.ScriptHash.from_hex(r), a.TransactionInput.new(a.TransactionHash.from_hex(n.txHash), n.txIndex), vt[n.version]) : a.PlutusScriptSource.new(a.PlutusScript.from_hex_with_version(n.script.code, vt[n.script.version]));
|
|
4578
|
+
e.add_asset(a.MintWitness.new_plutus_script(y, A), a.AssetName.new(Buffer.from(i, "hex")), a.Int.from_str(c));
|
|
4552
4579
|
};
|
|
4553
4580
|
addNativeMint = (e, { scriptSource: t, assetName: r, amount: n }) => {
|
|
4554
4581
|
if (t.type === "Reference Script")
|
|
@@ -4570,7 +4597,7 @@ class en {
|
|
|
4570
4597
|
const i = a.Ed25519KeyHashes.new();
|
|
4571
4598
|
return e.owners.forEach((c) => {
|
|
4572
4599
|
i.add(a.Ed25519KeyHash.from_hex(c));
|
|
4573
|
-
}), a.PoolParams.new(a.Ed25519KeyHash.from_hex(e.operator), a.VRFKeyHash.from_hex(e.VRFKeyHash), a.BigNum.from_str(e.pledge), a.BigNum.from_str(e.cost), a.UnitInterval.new(a.BigNum.from_str(t[0].toString()), a.BigNum.from_str(t[1].toString())), n, i, r, e.metadata ? a.PoolMetadata.from_json(
|
|
4600
|
+
}), a.PoolParams.new(a.Ed25519KeyHash.from_hex(e.operator), a.VRFKeyHash.from_hex(e.VRFKeyHash), a.BigNum.from_str(e.pledge), a.BigNum.from_str(e.cost), a.UnitInterval.new(a.BigNum.from_str(t[0].toString()), a.BigNum.from_str(t[1].toString())), n, i, r, e.metadata ? a.PoolMetadata.from_json(Wt.exports.stringify(e.metadata)) : void 0);
|
|
4574
4601
|
};
|
|
4575
4602
|
addCertificate = (e, t) => {
|
|
4576
4603
|
switch (t.type) {
|
|
@@ -4615,7 +4642,7 @@ class en {
|
|
|
4615
4642
|
};
|
|
4616
4643
|
addAllMetadata = (e) => {
|
|
4617
4644
|
e.forEach(({ tag: t, metadata: r }) => {
|
|
4618
|
-
this.txBuilder.add_json_metadatum(a.BigNum.from_str(t),
|
|
4645
|
+
this.txBuilder.add_json_metadatum(a.BigNum.from_str(t), Wt.exports.stringify(r));
|
|
4619
4646
|
});
|
|
4620
4647
|
};
|
|
4621
4648
|
updateRedeemer = (e, t) => {
|
|
@@ -4634,10 +4661,10 @@ class en {
|
|
|
4634
4661
|
}
|
|
4635
4662
|
});
|
|
4636
4663
|
};
|
|
4637
|
-
castRawDataToJsonString = (e) => typeof e == "object" ?
|
|
4664
|
+
castRawDataToJsonString = (e) => typeof e == "object" ? Wt.exports.stringify(e) : e;
|
|
4638
4665
|
castDataToPlutusData = ({ type: e, content: t }) => e === "Mesh" ? Ot(t) : e === "CBOR" ? a.PlutusData.from_hex(t) : a.PlutusData.from_json(t, a.PlutusDatumSchema.DetailedSchema);
|
|
4639
4666
|
}
|
|
4640
|
-
class
|
|
4667
|
+
class Tn extends en {
|
|
4641
4668
|
_fetcher;
|
|
4642
4669
|
_submitter;
|
|
4643
4670
|
_evaluator;
|
|
@@ -4715,7 +4742,7 @@ class rt {
|
|
|
4715
4742
|
}
|
|
4716
4743
|
getAccount(e, t) {
|
|
4717
4744
|
return this.accountContext(e, t, (r, n) => {
|
|
4718
|
-
const i = mr(this._networkId, r.to_public().hash(), n.to_public().hash()).to_address().to_bech32(), c =
|
|
4745
|
+
const i = mr(this._networkId, r.to_public().hash(), n.to_public().hash()).to_address().to_bech32(), c = pr(this._networkId, r.to_public().hash()).to_address().to_bech32(), l = Pe(this._networkId, n.to_public().hash()).to_address().to_bech32();
|
|
4719
4746
|
return {
|
|
4720
4747
|
baseAddress: i,
|
|
4721
4748
|
enterpriseAddress: c,
|
|
@@ -4726,10 +4753,10 @@ class rt {
|
|
|
4726
4753
|
signData(e, t, r, n) {
|
|
4727
4754
|
try {
|
|
4728
4755
|
return this.accountContext(e, t, (i, c) => {
|
|
4729
|
-
const l = { payload: n },
|
|
4756
|
+
const l = { payload: n }, A = {
|
|
4730
4757
|
address: rt.resolveAddress(this._networkId, r, i, c),
|
|
4731
4758
|
key: r.startsWith("stake") ? c : i
|
|
4732
|
-
}, { coseSign1: y, coseKey: B } = hs(l,
|
|
4759
|
+
}, { coseSign1: y, coseKey: B } = hs(l, A);
|
|
4733
4760
|
return { signature: y, key: B };
|
|
4734
4761
|
});
|
|
4735
4762
|
} catch (i) {
|
|
@@ -4739,13 +4766,13 @@ class rt {
|
|
|
4739
4766
|
signTx(e, t, r, n, i) {
|
|
4740
4767
|
try {
|
|
4741
4768
|
const c = Ur($s(n));
|
|
4742
|
-
return this.accountContext(e, t, (l,
|
|
4769
|
+
return this.accountContext(e, t, (l, A) => {
|
|
4743
4770
|
const y = a.Vkeywitnesses.new();
|
|
4744
4771
|
return rt.resolveSigners(n, r, l.to_public().hash().to_hex()).forEach((b) => {
|
|
4745
4772
|
if (b === l.to_public().hash().to_hex())
|
|
4746
4773
|
y.add(a.make_vkey_witness(c, l));
|
|
4747
|
-
else if (b ===
|
|
4748
|
-
y.add(a.make_vkey_witness(c,
|
|
4774
|
+
else if (b === A.to_public().hash().to_hex())
|
|
4775
|
+
y.add(a.make_vkey_witness(c, A));
|
|
4749
4776
|
else if (i === !1)
|
|
4750
4777
|
throw new Error(`Missing key witness for: ${b}`);
|
|
4751
4778
|
}), y;
|
|
@@ -4787,7 +4814,7 @@ class rt {
|
|
|
4787
4814
|
static resolveAddress(e, t, r, n) {
|
|
4788
4815
|
const i = [
|
|
4789
4816
|
mr(e, r.to_public().hash(), n.to_public().hash()),
|
|
4790
|
-
|
|
4817
|
+
pr(e, r.to_public().hash()),
|
|
4791
4818
|
Pe(e, n.to_public().hash())
|
|
4792
4819
|
].find((c) => c.to_address().to_bech32() === t);
|
|
4793
4820
|
if (i !== void 0)
|
|
@@ -4807,7 +4834,7 @@ class rt {
|
|
|
4807
4834
|
}
|
|
4808
4835
|
static resolveSigners(e, t, r) {
|
|
4809
4836
|
const n = (l) => {
|
|
4810
|
-
const
|
|
4837
|
+
const A = (T, Q = [], R = 0) => {
|
|
4811
4838
|
var O, M, z, X, D;
|
|
4812
4839
|
if (T === void 0 || R >= T.len())
|
|
4813
4840
|
return Q;
|
|
@@ -4843,7 +4870,7 @@ class rt {
|
|
|
4843
4870
|
break;
|
|
4844
4871
|
}
|
|
4845
4872
|
}
|
|
4846
|
-
return
|
|
4873
|
+
return A(T, [...Q, ...Y], R + 1);
|
|
4847
4874
|
}, y = (T, Q = [], R = 0) => {
|
|
4848
4875
|
if (T === void 0 || R >= T.len())
|
|
4849
4876
|
return Q;
|
|
@@ -4856,14 +4883,14 @@ class rt {
|
|
|
4856
4883
|
return b(T, Y ? [...Q, Y.to_hex()] : Q, R + 1);
|
|
4857
4884
|
}, w = l.certs(), v = l.collateral(), U = l.inputs(), k = l.required_signers(), N = l.withdrawals();
|
|
4858
4885
|
return [
|
|
4859
|
-
...
|
|
4886
|
+
...A(w),
|
|
4860
4887
|
...y(v),
|
|
4861
4888
|
...y(U),
|
|
4862
4889
|
...B(k),
|
|
4863
4890
|
...b(N)
|
|
4864
4891
|
];
|
|
4865
4892
|
}, i = (l) => {
|
|
4866
|
-
const
|
|
4893
|
+
const A = (B, b = []) => {
|
|
4867
4894
|
var w, v, U, k;
|
|
4868
4895
|
if (B)
|
|
4869
4896
|
for (let N = 0; N < B.len(); N += 1) {
|
|
@@ -4874,17 +4901,17 @@ class rt {
|
|
|
4874
4901
|
return Q ? [...b, Q] : b;
|
|
4875
4902
|
}
|
|
4876
4903
|
case a.NativeScriptKind.ScriptAll:
|
|
4877
|
-
return
|
|
4904
|
+
return A((v = T.as_script_all()) == null ? void 0 : v.native_scripts(), b);
|
|
4878
4905
|
case a.NativeScriptKind.ScriptAny:
|
|
4879
|
-
return
|
|
4906
|
+
return A((U = T.as_script_any()) == null ? void 0 : U.native_scripts(), b);
|
|
4880
4907
|
case a.NativeScriptKind.ScriptNOfK:
|
|
4881
|
-
return
|
|
4908
|
+
return A((k = T.as_script_n_of_k()) == null ? void 0 : k.native_scripts(), b);
|
|
4882
4909
|
}
|
|
4883
4910
|
}
|
|
4884
4911
|
return b;
|
|
4885
4912
|
}, y = l.native_scripts();
|
|
4886
4913
|
return [
|
|
4887
|
-
...
|
|
4914
|
+
...A(y)
|
|
4888
4915
|
];
|
|
4889
4916
|
}, c = _t(e);
|
|
4890
4917
|
return /* @__PURE__ */ new Set([
|
|
@@ -4943,8 +4970,8 @@ class Qe {
|
|
|
4943
4970
|
try {
|
|
4944
4971
|
if (!this._fetcher)
|
|
4945
4972
|
throw new Error("[AppWallet] Fetcher is required to fetch UTxOs. Please provide a fetcher.");
|
|
4946
|
-
const n = this._wallet.getAccount(r, It), i = await this._fetcher.fetchAddressUTxOs(n.enterpriseAddress), c = this._wallet.signTx(r, It, i, e, t), l = _t(e),
|
|
4947
|
-
return
|
|
4973
|
+
const n = this._wallet.getAccount(r, It), i = await this._fetcher.fetchAddressUTxOs(n.enterpriseAddress), c = this._wallet.signTx(r, It, i, e, t), l = _t(e), A = l.witness_set(), y = Me(A, c);
|
|
4974
|
+
return A.set_vkeys(y), a.Transaction.new(l.body(), A, l.auxiliary_data()).to_hex();
|
|
4948
4975
|
} catch (n) {
|
|
4949
4976
|
throw new Error(`[AppWallet] An error occurred during signTx: ${n}.`);
|
|
4950
4977
|
}
|
|
@@ -5000,7 +5027,7 @@ class Ke {
|
|
|
5000
5027
|
}
|
|
5001
5028
|
async getChangeAddress() {
|
|
5002
5029
|
const e = await this._walletInstance.getChangeAddress();
|
|
5003
|
-
return
|
|
5030
|
+
return Gt(e).to_bech32();
|
|
5004
5031
|
}
|
|
5005
5032
|
async getCollateral(e = mt.maxCollateralInputs) {
|
|
5006
5033
|
return (await this.getUsedCollateral(e)).map((r) => oe(r));
|
|
@@ -5009,13 +5036,13 @@ class Ke {
|
|
|
5009
5036
|
return this._walletInstance.getNetworkId();
|
|
5010
5037
|
}
|
|
5011
5038
|
async getRewardAddresses() {
|
|
5012
|
-
return (await this._walletInstance.getRewardAddresses()).map((t) =>
|
|
5039
|
+
return (await this._walletInstance.getRewardAddresses()).map((t) => Gt(t).to_bech32());
|
|
5013
5040
|
}
|
|
5014
5041
|
async getUnusedAddresses() {
|
|
5015
|
-
return (await this._walletInstance.getUnusedAddresses()).map((t) =>
|
|
5042
|
+
return (await this._walletInstance.getUnusedAddresses()).map((t) => Gt(t).to_bech32());
|
|
5016
5043
|
}
|
|
5017
5044
|
async getUsedAddresses() {
|
|
5018
|
-
return (await this._walletInstance.getUsedAddresses()).map((t) =>
|
|
5045
|
+
return (await this._walletInstance.getUsedAddresses()).map((t) => Gt(t).to_bech32());
|
|
5019
5046
|
}
|
|
5020
5047
|
async getUtxos(e = void 0) {
|
|
5021
5048
|
return (await this.getUsedUTxOs(e)).map((r) => oe(r));
|
|
@@ -5052,7 +5079,7 @@ class Ke {
|
|
|
5052
5079
|
throw new Error("Wallet does not support signTxs");
|
|
5053
5080
|
const n = [];
|
|
5054
5081
|
for (let i = 0; i < r.length; i++) {
|
|
5055
|
-
const c = _t(e[i]), l = c.witness_set(),
|
|
5082
|
+
const c = _t(e[i]), l = c.witness_set(), A = fr(r[i]).vkeys() ?? a.Vkeywitnesses.new(), y = Me(l, A);
|
|
5056
5083
|
l.set_vkeys(y);
|
|
5057
5084
|
const B = ut(a.Transaction.new(c.body(), l, c.auxiliary_data()).to_bytes());
|
|
5058
5085
|
n.push(B);
|
|
@@ -5064,13 +5091,13 @@ class Ke {
|
|
|
5064
5091
|
}
|
|
5065
5092
|
async getUsedAddress() {
|
|
5066
5093
|
const e = await this._walletInstance.getUsedAddresses();
|
|
5067
|
-
return
|
|
5094
|
+
return Gt(e[0]);
|
|
5068
5095
|
}
|
|
5069
5096
|
async getUsedCollateral(e = mt.maxCollateralInputs) {
|
|
5070
5097
|
return (await this._walletInstance.experimental.getCollateral() ?? []).map((r) => dr(r)).slice(0, e);
|
|
5071
5098
|
}
|
|
5072
5099
|
async getUsedUTxOs(e = void 0) {
|
|
5073
|
-
const t = e ?
|
|
5100
|
+
const t = e ? Bt(e).to_hex() : void 0;
|
|
5074
5101
|
return (await this._walletInstance.getUtxos(t) ?? []).map((n) => dr(n));
|
|
5075
5102
|
}
|
|
5076
5103
|
async getAssets() {
|
|
@@ -5103,7 +5130,7 @@ class Ke {
|
|
|
5103
5130
|
return t == null ? void 0 : t.enable();
|
|
5104
5131
|
}
|
|
5105
5132
|
}
|
|
5106
|
-
class
|
|
5133
|
+
class Nn {
|
|
5107
5134
|
_wallet;
|
|
5108
5135
|
_network;
|
|
5109
5136
|
constructor(e) {
|
|
@@ -5149,8 +5176,8 @@ class Tn {
|
|
|
5149
5176
|
n.output.amount.map((i) => {
|
|
5150
5177
|
const c = i.unit, l = Number(i.quantity);
|
|
5151
5178
|
if (t.has(c)) {
|
|
5152
|
-
const
|
|
5153
|
-
t.set(c,
|
|
5179
|
+
const A = t.get(c);
|
|
5180
|
+
t.set(c, A + l);
|
|
5154
5181
|
} else
|
|
5155
5182
|
t.set(c, l);
|
|
5156
5183
|
});
|
|
@@ -5235,7 +5262,7 @@ class Tn {
|
|
|
5235
5262
|
return Array.from(new Set(e.map((t) => t.unit.slice(0, lt)))).filter((t) => t !== "lovelace");
|
|
5236
5263
|
}
|
|
5237
5264
|
async createCollateral() {
|
|
5238
|
-
const t = await new
|
|
5265
|
+
const t = await new St({ initiator: this._wallet }).sendLovelace(this.getChangeAddress(), "5000000").build(), r = await this.signTx(t);
|
|
5239
5266
|
return await this.submitTx(r);
|
|
5240
5267
|
}
|
|
5241
5268
|
static brew(e = !1, t = 256) {
|
|
@@ -5245,43 +5272,44 @@ class Tn {
|
|
|
5245
5272
|
}
|
|
5246
5273
|
export {
|
|
5247
5274
|
Qe as AppWallet,
|
|
5248
|
-
|
|
5275
|
+
Bn as BlockfrostProvider,
|
|
5249
5276
|
Ke as BrowserWallet,
|
|
5250
5277
|
rt as EmbeddedWallet,
|
|
5251
|
-
|
|
5252
|
-
|
|
5278
|
+
Dn as ForgeScript,
|
|
5279
|
+
Sn as InfuraProvider,
|
|
5253
5280
|
En as KoiosProvider,
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5281
|
+
vn as MaestroProvider,
|
|
5282
|
+
Tn as MeshTxBuilder,
|
|
5283
|
+
Nn as MeshWallet,
|
|
5284
|
+
bn as OgmiosProvider,
|
|
5285
|
+
St as Transaction,
|
|
5286
|
+
Qn as YaciProvider,
|
|
5260
5287
|
un as checkSignature,
|
|
5261
|
-
|
|
5288
|
+
xn as generateNonce,
|
|
5262
5289
|
Zr as isNetwork,
|
|
5263
5290
|
ns as keepRelevant,
|
|
5264
5291
|
cn as largestFirst,
|
|
5265
5292
|
is as largestFirstMultiAsset,
|
|
5266
5293
|
on as mergeAssets,
|
|
5267
5294
|
Kt as parseAssetUnit,
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5295
|
+
S as parseHttpError,
|
|
5296
|
+
wn as readPlutusData,
|
|
5297
|
+
Cn as readTransaction,
|
|
5271
5298
|
ln as resolveDataHash,
|
|
5272
5299
|
hn as resolveEpochNo,
|
|
5273
5300
|
Rr as resolveFingerprint,
|
|
5274
5301
|
dn as resolveLanguageView,
|
|
5275
5302
|
fn as resolveNativeScriptAddress,
|
|
5276
5303
|
gn as resolveNativeScriptHash,
|
|
5277
|
-
|
|
5278
|
-
|
|
5304
|
+
mn as resolveNativeScriptHex,
|
|
5305
|
+
$t as resolvePaymentKeyHash,
|
|
5306
|
+
pn as resolvePlutusScriptAddress,
|
|
5279
5307
|
An as resolvePlutusScriptHash,
|
|
5280
|
-
|
|
5308
|
+
In as resolvePoolId,
|
|
5281
5309
|
Ys as resolvePrivateKey,
|
|
5282
5310
|
ye as resolveRewardAddress,
|
|
5283
|
-
|
|
5284
|
-
|
|
5311
|
+
_n as resolveScriptRef,
|
|
5312
|
+
yn as resolveSlotNo,
|
|
5285
5313
|
se as resolveStakeKeyHash,
|
|
5286
5314
|
qr as resolveTxFees,
|
|
5287
5315
|
$s as resolveTxHash
|