@meshsdk/core 1.5.20 → 1.5.22
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.cjs +3 -3
- package/dist/core.js +110 -106
- package/dist/transaction/transaction.service.d.ts +8 -1
- package/dist/wallet/app.service.d.ts +12 -11
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -12,7 +12,7 @@ const on = (s) => {
|
|
|
12
12
|
}, Xr = ["testnet", "preview", "preprod", "mainnet"], Zr = (s) => Xr.includes(s), Gt = {
|
|
13
13
|
mem: 7e6,
|
|
14
14
|
steps: 3e9
|
|
15
|
-
},
|
|
15
|
+
}, mt = {
|
|
16
16
|
epoch: 0,
|
|
17
17
|
coinsPerUTxOSize: "4310",
|
|
18
18
|
priceMem: 0.0577,
|
|
@@ -459,14 +459,14 @@ const on = (s) => {
|
|
|
459
459
|
...i.less_than(r) ? us(r.clamped_sub(i).to_str(), e.filter((l) => !n.some((p) => p.input.txHash === l.input.txHash && p.input.outputIndex === l.input.outputIndex))) : [],
|
|
460
460
|
...n
|
|
461
461
|
];
|
|
462
|
-
}, cn = (s, e, t = !1, { maxTxSize: r, minFeeA: n, minFeeB: i } =
|
|
462
|
+
}, cn = (s, e, t = !1, { maxTxSize: r, minFeeA: n, minFeeB: i } = mt) => {
|
|
463
463
|
const c = e.filter((b) => Cr(b) === !1).sort(Fe), l = a.BigNum.from_str(qr(r, n, i)), p = t ? a.BigNum.from_str(s).checked_add(l).to_str() : s;
|
|
464
|
-
return
|
|
464
|
+
return ie(c, /* @__PURE__ */ new Map([
|
|
465
465
|
["lovelace", p]
|
|
466
466
|
]));
|
|
467
|
-
}, is = (s, e, t = !1, r =
|
|
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;
|
|
469
|
-
return s.set("lovelace", l),
|
|
469
|
+
return s.set("lovelace", l), ie(n, s);
|
|
470
470
|
}, as = (s, e) => Array.from(e, (t) => ({ unit: t[0], quantity: a.BigNum.from_str(t[1]) })).every((t) => s.filter((r) => r.output.amount.find((n) => n.unit === t.unit) !== void 0).reduce((r, n) => {
|
|
471
471
|
const i = n.output.amount.reduce((c, l) => c.checked_add(a.BigNum.from_str(t.unit === l.unit ? l.quantity : "0")), a.BigNum.from_str("0"));
|
|
472
472
|
return r.checked_add(i);
|
|
@@ -483,10 +483,10 @@ const on = (s) => {
|
|
|
483
483
|
return e.checked_add(a.BigNum.from_str(r));
|
|
484
484
|
}, a.BigNum.from_str("0")), us = (s, e) => {
|
|
485
485
|
const t = e.sort(Fe);
|
|
486
|
-
return
|
|
486
|
+
return ie(t, /* @__PURE__ */ new Map([
|
|
487
487
|
["lovelace", s]
|
|
488
488
|
]));
|
|
489
|
-
},
|
|
489
|
+
}, ie = (s, e, t = []) => s.length === 0 || as(t, e) ? t : ls(s[0], e) ? ie(s.slice(1), e, [...t, s[0]]) : ie(s.slice(1), e, t), ls = (s, e) => Array.from(e.keys()).some((t) => s.output.amount.find((r) => r.unit === t) !== void 0), hs = (s, e) => {
|
|
490
490
|
const t = fs(e), r = gs(s, e);
|
|
491
491
|
return {
|
|
492
492
|
coseKey: ut(t.to_bytes()),
|
|
@@ -518,7 +518,7 @@ const on = (s) => {
|
|
|
518
518
|
if (s !== e.to_bech32())
|
|
519
519
|
return !1;
|
|
520
520
|
try {
|
|
521
|
-
return
|
|
521
|
+
return se(s) === t.hash().to_hex();
|
|
522
522
|
} catch {
|
|
523
523
|
return !1;
|
|
524
524
|
}
|
|
@@ -600,23 +600,23 @@ function xs(s) {
|
|
|
600
600
|
return s.charCodeAt(0);
|
|
601
601
|
}
|
|
602
602
|
var wt = Er, W = _s(), vt = 64, me = [];
|
|
603
|
-
Et.exports =
|
|
603
|
+
Et.exports = At;
|
|
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 At(s, e, t, r, n) {
|
|
610
|
+
if (!(this instanceof At))
|
|
611
|
+
return new At(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
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(vt), vt += 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, vt, vt + e.length), W.memory[this.pointer + 200] = 128);
|
|
615
615
|
}
|
|
616
|
-
|
|
616
|
+
At.prototype.update = function(s) {
|
|
617
617
|
return wt(this.finalized === !1, "Hash instance finalized"), wt(s, "input must be TypedArray or Buffer"), vt + s.length > W.memory.length && W.realloc(vt + s.length), W.memory.set(s, vt), W.exports.blake2b_update(this.pointer, vt, vt + s.length), this;
|
|
618
618
|
};
|
|
619
|
-
|
|
619
|
+
At.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 @@ mt.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
|
+
At.prototype.final = At.prototype.digest;
|
|
630
|
+
At.WASM = W && W.buffer;
|
|
631
|
+
At.SUPPORTED = typeof WebAssembly < "u";
|
|
632
|
+
At.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 @@ mt.ready = function(s) {
|
|
|
639
639
|
});
|
|
640
640
|
return e;
|
|
641
641
|
};
|
|
642
|
-
|
|
642
|
+
At.prototype.ready = At.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 = Er,
|
|
653
|
+
var Ut = Er, 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;
|
|
@@ -665,7 +665,7 @@ function Sr(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 =
|
|
668
|
+
var c = re[n], l = re[n + 1], p = 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
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, p, 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;
|
|
@@ -882,13 +882,13 @@ var br = new Uint32Array([
|
|
|
882
882
|
3
|
|
883
883
|
], it = new Uint8Array(Es.map(function(s) {
|
|
884
884
|
return s * 2;
|
|
885
|
-
})), H = new Uint32Array(32),
|
|
885
|
+
})), H = new Uint32Array(32), re = new Uint32Array(32);
|
|
886
886
|
function vr(s, e) {
|
|
887
887
|
var t = 0;
|
|
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
|
-
|
|
891
|
+
re[t] = Sr(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++)
|
|
@@ -975,7 +975,7 @@ Wt.prototype.digest = function(s) {
|
|
|
975
975
|
};
|
|
976
976
|
Wt.prototype.final = Wt.prototype.digest;
|
|
977
977
|
Wt.ready = function(s) {
|
|
978
|
-
|
|
978
|
+
ae.ready(function() {
|
|
979
979
|
s();
|
|
980
980
|
});
|
|
981
981
|
};
|
|
@@ -1004,19 +1004,19 @@ 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
|
};
|
|
1006
1006
|
ot.exports.ready = function(s) {
|
|
1007
|
-
|
|
1007
|
+
ae.ready(function() {
|
|
1008
1008
|
s();
|
|
1009
1009
|
});
|
|
1010
1010
|
};
|
|
1011
|
-
ot.exports.WASM_SUPPORTED =
|
|
1011
|
+
ot.exports.WASM_SUPPORTED = ae.SUPPORTED;
|
|
1012
1012
|
ot.exports.WASM_LOADED = !1;
|
|
1013
1013
|
var ir = ot.exports.BYTES_MIN = 16, ar = ot.exports.BYTES_MAX = 64;
|
|
1014
1014
|
ot.exports.BYTES = 32;
|
|
1015
1015
|
var or = ot.exports.KEYBYTES_MIN = 16, cr = ot.exports.KEYBYTES_MAX = 64;
|
|
1016
1016
|
ot.exports.KEYBYTES = 32;
|
|
1017
1017
|
var ur = ot.exports.SALTBYTES = 16, lr = ot.exports.PERSONALBYTES = 16;
|
|
1018
|
-
|
|
1019
|
-
s || (ot.exports.WASM_LOADED = !0, Dr =
|
|
1018
|
+
ae.ready(function(s) {
|
|
1019
|
+
s || (ot.exports.WASM_LOADED = !0, Dr = ae);
|
|
1020
1020
|
});
|
|
1021
1021
|
var Jt = {};
|
|
1022
1022
|
Object.defineProperty(Jt, "__esModule", { value: !0 });
|
|
@@ -1157,23 +1157,23 @@ var Ts = Te && Te.__importDefault || function(s) {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
Object.defineProperty(Br, "__esModule", { value: !0 });
|
|
1159
1159
|
const Ns = Ts(ot.exports), le = Jt, ve = "asset";
|
|
1160
|
-
class
|
|
1160
|
+
class ne {
|
|
1161
1161
|
constructor(e) {
|
|
1162
1162
|
this.hashBuf = e;
|
|
1163
1163
|
}
|
|
1164
1164
|
static fromHash(e) {
|
|
1165
|
-
return new
|
|
1165
|
+
return new ne(e);
|
|
1166
1166
|
}
|
|
1167
1167
|
static fromParts(e, t) {
|
|
1168
1168
|
const r = (0, Ns.default)(20).update(new Uint8Array([...e, ...t])).digest("binary");
|
|
1169
|
-
return
|
|
1169
|
+
return ne.fromHash(r);
|
|
1170
1170
|
}
|
|
1171
1171
|
static fromBech32(e) {
|
|
1172
1172
|
const { prefix: t, words: r } = le.bech32.decode(e);
|
|
1173
1173
|
if (t !== ve)
|
|
1174
1174
|
throw new Error("Invalid asset fingerprint");
|
|
1175
1175
|
const n = Buffer.from(le.bech32.fromWords(r));
|
|
1176
|
-
return
|
|
1176
|
+
return ne.fromHash(n);
|
|
1177
1177
|
}
|
|
1178
1178
|
fingerprint() {
|
|
1179
1179
|
const e = le.bech32.toWords(this.hashBuf);
|
|
@@ -1189,7 +1189,7 @@ class se {
|
|
|
1189
1189
|
return this.fingerprint().slice(-6);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
var Us = Br.default =
|
|
1192
|
+
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 };
|
|
@@ -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
|
+
}, Xt = (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(Xt(n));
|
|
1249
1249
|
}), r;
|
|
1250
1250
|
};
|
|
1251
1251
|
switch (s.type) {
|
|
@@ -1349,13 +1349,13 @@ const Ps = Us, Os = (s, e) => {
|
|
|
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
1354
|
const e = jt(s.code, s.version);
|
|
1355
1355
|
return a.ScriptRef.new_plutus_script(e);
|
|
1356
1356
|
}
|
|
1357
|
-
return a.ScriptRef.new_native_script(
|
|
1358
|
-
},
|
|
1357
|
+
return a.ScriptRef.new_native_script(Xt(s));
|
|
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;
|
|
1361
1361
|
return {
|
|
@@ -1371,7 +1371,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1371
1371
|
scriptRef: r
|
|
1372
1372
|
}
|
|
1373
1373
|
};
|
|
1374
|
-
},
|
|
1374
|
+
}, gt = (s) => {
|
|
1375
1375
|
const e = a.TransactionInput.new(Ur(s.input.txHash), s.input.outputIndex), t = a.TransactionOutput.new(yt(s.output.address), Qt(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) => {
|
|
@@ -1408,7 +1408,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1408
1408
|
}, mr = (s, e, t) => a.BaseAddress.new(s, a.StakeCredential.from_keyhash(e), a.StakeCredential.from_keyhash(t)), Fr = (s, e = "") => a.Bip32PrivateKey.from_bip39_entropy(G(s), G(ht(e))), Ue = (s) => a.DataCost.new_coins_per_byte(a.BigNum.from_str(s)), Gs = (s) => {
|
|
1409
1409
|
if (typeof s != "object" || !("input" in s))
|
|
1410
1410
|
return a.DatumSource.new(Ot(s));
|
|
1411
|
-
const e =
|
|
1411
|
+
const e = gt(s);
|
|
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()}`);
|
|
@@ -1432,7 +1432,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1432
1432
|
}, Pe = (s, e) => a.RewardAddress.new(s, a.StakeCredential.from_keyhash(e)), Oe = (s) => {
|
|
1433
1433
|
if ("code" in s)
|
|
1434
1434
|
return a.PlutusScriptSource.new(jt(s.code, s.version));
|
|
1435
|
-
const e =
|
|
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()) {
|
|
@@ -1444,12 +1444,12 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1444
1444
|
}, he = (s) => {
|
|
1445
1445
|
const e = a.ScriptPubkey.new(s);
|
|
1446
1446
|
return a.NativeScript.new_script_pubkey(e);
|
|
1447
|
-
}, pe = (s =
|
|
1447
|
+
}, pe = (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) => {
|
|
1451
1451
|
const e = a.TxInputsBuilder.new();
|
|
1452
|
-
return s.map((t) => t instanceof a.TransactionUnspentOutput ? t :
|
|
1452
|
+
return s.map((t) => t instanceof a.TransactionUnspentOutput ? t : gt(t)).forEach((t) => {
|
|
1453
1453
|
e.add_input(t.output().address(), t.input(), t.output().amount());
|
|
1454
1454
|
}), e;
|
|
1455
1455
|
}, de = (s) => {
|
|
@@ -1461,7 +1461,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1461
1461
|
e = e.with_data_hash(a.hash_plutus_data(n)), r && (e = e.with_plutus_data(n));
|
|
1462
1462
|
}
|
|
1463
1463
|
if (s.script) {
|
|
1464
|
-
const t =
|
|
1464
|
+
const t = Zt(s.script);
|
|
1465
1465
|
e = e.with_script_ref(t);
|
|
1466
1466
|
}
|
|
1467
1467
|
return e;
|
|
@@ -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 = Xt(s);
|
|
1486
1486
|
return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
|
|
1487
|
-
}, gn = (s) =>
|
|
1487
|
+
}, gn = (s) => Xt(s).hash().to_hex(), Yt = (s) => {
|
|
1488
1488
|
var e, t;
|
|
1489
1489
|
try {
|
|
1490
1490
|
const r = [
|
|
@@ -1512,7 +1512,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1512
1512
|
}, pn = (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
|
-
}, In = (s) =>
|
|
1515
|
+
}, In = (s) => Zt(s).to_hex(), _n = (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();
|
|
@@ -1527,7 +1527,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1527
1527
|
} catch (e) {
|
|
1528
1528
|
throw new Error(`An error occurred during resolveRewardAddress: ${e}.`);
|
|
1529
1529
|
}
|
|
1530
|
-
},
|
|
1530
|
+
}, se = (s) => {
|
|
1531
1531
|
var e, t;
|
|
1532
1532
|
try {
|
|
1533
1533
|
const r = [
|
|
@@ -1540,7 +1540,7 @@ const Ps = Us, Os = (s, e) => {
|
|
|
1540
1540
|
} catch (r) {
|
|
1541
1541
|
throw new Error(`An error occurred during resolveStakeKeyHash: ${r}.`);
|
|
1542
1542
|
}
|
|
1543
|
-
}, qr = (s, e =
|
|
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
|
}, yn = (s = "", e = 32) => {
|
|
@@ -1601,7 +1601,7 @@ class Cn {
|
|
|
1601
1601
|
code: await this.fetchPlutusScriptCBOR(e),
|
|
1602
1602
|
version: t.type.replace("plutus", "")
|
|
1603
1603
|
} : await this.fetchNativeScriptJSON(e);
|
|
1604
|
-
return
|
|
1604
|
+
return Zt(n).to_hex();
|
|
1605
1605
|
}
|
|
1606
1606
|
throw E(t);
|
|
1607
1607
|
}
|
|
@@ -2086,7 +2086,7 @@ class En {
|
|
|
2086
2086
|
code: e.bytes,
|
|
2087
2087
|
version: e.type.replace("plutus", "")
|
|
2088
2088
|
} : Ge(Ve(e.bytes));
|
|
2089
|
-
return
|
|
2089
|
+
return Zt(t).to_hex();
|
|
2090
2090
|
}
|
|
2091
2091
|
};
|
|
2092
2092
|
}
|
|
@@ -2443,7 +2443,7 @@ class bn {
|
|
|
2443
2443
|
code: e.reference_script.bytes,
|
|
2444
2444
|
version: e.reference_script.type.replace("plutusv", "V")
|
|
2445
2445
|
};
|
|
2446
|
-
return
|
|
2446
|
+
return Zt(t).to_hex();
|
|
2447
2447
|
} else
|
|
2448
2448
|
return;
|
|
2449
2449
|
};
|
|
@@ -2480,7 +2480,7 @@ class vn {
|
|
|
2480
2480
|
code: await this.fetchPlutusScriptCBOR(e),
|
|
2481
2481
|
version: t.type.replace("plutus", "")
|
|
2482
2482
|
} : await this.fetchNativeScriptJSON(e);
|
|
2483
|
-
return
|
|
2483
|
+
return Zt(n).to_hex();
|
|
2484
2484
|
}
|
|
2485
2485
|
throw E(t);
|
|
2486
2486
|
}
|
|
@@ -2729,7 +2729,7 @@ class Qn {
|
|
|
2729
2729
|
return a.NativeScript.new_script_any(r).to_hex();
|
|
2730
2730
|
}
|
|
2731
2731
|
static fromNativeScript(e) {
|
|
2732
|
-
return
|
|
2732
|
+
return Xt(e).to_hex();
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
2735
|
function Ht(s, e, t, r) {
|
|
@@ -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 ??
|
|
2768
|
+
this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? mt, this._txBuilder = pe(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;
|
|
@@ -2815,11 +2815,11 @@ let Bt = class {
|
|
|
2815
2815
|
return this._mintBuilder.add_asset(pr(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
|
-
const r = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(Ct(
|
|
2818
|
+
const r = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(Ct(se(e))), a.Ed25519KeyHash.from_bech32(t)));
|
|
2819
2819
|
return this._txCertificates.add(r), this;
|
|
2820
2820
|
}
|
|
2821
2821
|
deregisterStake(e) {
|
|
2822
|
-
const t = a.Certificate.new_stake_deregistration(a.StakeDeregistration.new(a.StakeCredential.from_keyhash(Ct(
|
|
2822
|
+
const t = a.Certificate.new_stake_deregistration(a.StakeDeregistration.new(a.StakeCredential.from_keyhash(Ct(se(e)))));
|
|
2823
2823
|
return this._txCertificates.add(t), this;
|
|
2824
2824
|
}
|
|
2825
2825
|
mintAsset(e, t, r) {
|
|
@@ -2833,7 +2833,7 @@ let Bt = class {
|
|
|
2833
2833
|
}, i = (b) => {
|
|
2834
2834
|
if ("code" in b)
|
|
2835
2835
|
return jt(b.code, b.version);
|
|
2836
|
-
const w =
|
|
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()) {
|
|
@@ -2858,11 +2858,11 @@ let Bt = class {
|
|
|
2858
2858
|
fields: []
|
|
2859
2859
|
},
|
|
2860
2860
|
...e.redeemer
|
|
2861
|
-
}, r =
|
|
2861
|
+
}, r = gt(e.value), n = e.datum ? a.PlutusWitness.new_with_ref(Oe(e.script), Gs(e.datum), Ne(t)) : a.PlutusWitness.new_with_ref_without_datum(Oe(e.script), Ne(t));
|
|
2862
2862
|
return this._txInputsBuilder.add_plutus_script_input(n, r.input(), r.output().amount()), this;
|
|
2863
2863
|
}
|
|
2864
2864
|
registerStake(e) {
|
|
2865
|
-
const t = a.Certificate.new_stake_registration(a.StakeRegistration.new(a.StakeCredential.from_keyhash(Ct(
|
|
2865
|
+
const t = a.Certificate.new_stake_registration(a.StakeRegistration.new(a.StakeCredential.from_keyhash(Ct(se(e)))));
|
|
2866
2866
|
return this._txCertificates.add(t), this;
|
|
2867
2867
|
}
|
|
2868
2868
|
registerPool(e) {
|
|
@@ -2912,10 +2912,14 @@ let Bt = class {
|
|
|
2912
2912
|
return this._txBuilder.add_json_metadatum_with_schema(a.BigNum.from_str(e.toString()), JSON.stringify(t), a.MetadataJsonSchema.NoConversions), this;
|
|
2913
2913
|
}
|
|
2914
2914
|
setRequiredSigners(e) {
|
|
2915
|
-
return Array.from(new Set(e.map((r) => r.startsWith("addr") ? Yt(r) :
|
|
2915
|
+
return Array.from(new Set(e.map((r) => r.startsWith("addr") ? Yt(r) : se(r)).map((r) => Ct(r)))).forEach((r) => {
|
|
2916
2916
|
this._txBuilder.add_required_signer(r);
|
|
2917
2917
|
}), this;
|
|
2918
2918
|
}
|
|
2919
|
+
setNativeScriptInput(e, t) {
|
|
2920
|
+
const r = gt(t);
|
|
2921
|
+
return this._txBuilder.add_native_script_input(Xt(e), r.input(), r.output().amount()), this;
|
|
2922
|
+
}
|
|
2919
2923
|
setTimeToStart(e) {
|
|
2920
2924
|
return this._txBuilder.set_validity_start_interval_bignum(a.BigNum.from_str(e)), this;
|
|
2921
2925
|
}
|
|
@@ -2923,12 +2927,12 @@ let Bt = class {
|
|
|
2923
2927
|
return this._txBuilder.set_ttl_bignum(a.BigNum.from_str(e)), this;
|
|
2924
2928
|
}
|
|
2925
2929
|
setTxInputs(e) {
|
|
2926
|
-
return e.map((t) =>
|
|
2930
|
+
return e.map((t) => gt(t)).forEach((t) => {
|
|
2927
2931
|
this._txInputsBuilder.add_input(t.output().address(), t.input(), t.output().amount());
|
|
2928
2932
|
}), this;
|
|
2929
2933
|
}
|
|
2930
2934
|
setTxRefInputs(e) {
|
|
2931
|
-
return e.map((t) =>
|
|
2935
|
+
return e.map((t) => gt(t)).forEach((t) => {
|
|
2932
2936
|
this._txBuilder.add_reference_input(t.input());
|
|
2933
2937
|
}), this;
|
|
2934
2938
|
}
|
|
@@ -2939,7 +2943,7 @@ let Bt = class {
|
|
|
2939
2943
|
async addBurnInputsIfNeeded() {
|
|
2940
2944
|
if (this._initiator && this._totalBurns.size > 0 && this.notVisited("setTxInputs")) {
|
|
2941
2945
|
const e = await this._initiator.getUsedUTxOs();
|
|
2942
|
-
is(this._totalBurns, e.map((r) =>
|
|
2946
|
+
is(this._totalBurns, e.map((r) => oe(r))).map((r) => gt(r)).forEach((r) => {
|
|
2943
2947
|
this._txInputsBuilder.add_input(r.output().address(), r.input(), r.output().amount());
|
|
2944
2948
|
});
|
|
2945
2949
|
}
|
|
@@ -2966,7 +2970,7 @@ let Bt = class {
|
|
|
2966
2970
|
async addTxInputsAsNeeded() {
|
|
2967
2971
|
if (this.notVisited("setTxInputs")) {
|
|
2968
2972
|
const e = await this.filterAvailableUTxOs();
|
|
2969
|
-
ns(this._txOutputs, e.map((r) =>
|
|
2973
|
+
ns(this._txOutputs, e.map((r) => oe(r))).map((r) => gt(r)).forEach((r) => {
|
|
2970
2974
|
this._txInputsBuilder.add_input(r.output().address(), r.input(), r.output().amount());
|
|
2971
2975
|
});
|
|
2972
2976
|
}
|
|
@@ -3154,7 +3158,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3154
3158
|
(function(e) {
|
|
3155
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: ", p = 1e14, y = 14, B = 9007199254740991, b = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], w = 1e7, v = 1e9;
|
|
3156
3160
|
function U(O) {
|
|
3157
|
-
var M, z, X, D = S.prototype = { constructor: S, toString: null, valueOf: null }, F = new S(1), q = 20, J = 4, st = -7, ct = 21, Ft = -1e7,
|
|
3161
|
+
var M, z, X, D = S.prototype = { constructor: S, toString: null, valueOf: null }, F = new S(1), q = 20, J = 4, st = -7, ct = 21, Ft = -1e7, pt = 1e7, Rt = !1, te = 1, kt = 0, xe = {
|
|
3158
3162
|
prefix: "",
|
|
3159
3163
|
groupSize: 3,
|
|
3160
3164
|
secondaryGroupSize: 0,
|
|
@@ -3170,14 +3174,14 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3170
3174
|
return new S(o, u);
|
|
3171
3175
|
if (u == null) {
|
|
3172
3176
|
if (o && o._isBigNumber === !0) {
|
|
3173
|
-
A.s = o.s, !o.c || o.e >
|
|
3177
|
+
A.s = o.s, !o.c || o.e > pt ? A.c = A.e = null : o.e < Ft ? A.c = [A.e = 0] : (A.e = o.e, A.c = o.c.slice());
|
|
3174
3178
|
return;
|
|
3175
3179
|
}
|
|
3176
3180
|
if ((d = typeof o == "number") && o * 0 == 0) {
|
|
3177
3181
|
if (A.s = 1 / o < 0 ? (o = -o, -1) : 1, o === ~~o) {
|
|
3178
3182
|
for (m = 0, x = o; x >= 10; x /= 10, m++)
|
|
3179
3183
|
;
|
|
3180
|
-
m >
|
|
3184
|
+
m > pt ? A.c = A.e = null : (A.e = m, A.c = [o]);
|
|
3181
3185
|
return;
|
|
3182
3186
|
}
|
|
3183
3187
|
_ = String(o);
|
|
@@ -3219,7 +3223,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3219
3223
|
if (_ = _.slice(x, ++g)) {
|
|
3220
3224
|
if (g -= x, d && S.DEBUG && g > 15 && (o > B || o !== i(o)))
|
|
3221
3225
|
throw Error(l + A.s * o);
|
|
3222
|
-
if ((m = m - x - 1) >
|
|
3226
|
+
if ((m = m - x - 1) > pt)
|
|
3223
3227
|
A.c = A.e = null;
|
|
3224
3228
|
else if (m < Ft)
|
|
3225
3229
|
A.c = [A.e = 0];
|
|
@@ -3243,9 +3247,9 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3243
3247
|
if (typeof o == "object") {
|
|
3244
3248
|
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"))
|
|
3245
3249
|
if (h = o[u], h && h.pop)
|
|
3246
|
-
Q(h[0], -v, -1, u), Q(h[1], 1, v, u), Ft = h[0],
|
|
3250
|
+
Q(h[0], -v, -1, u), Q(h[1], 1, v, u), Ft = h[0], pt = h[1];
|
|
3247
3251
|
else if (Q(h, -v, v, u), h)
|
|
3248
|
-
Ft = -(
|
|
3252
|
+
Ft = -(pt = h < 0 ? -h : h);
|
|
3249
3253
|
else
|
|
3250
3254
|
throw Error(c + u + " cannot be zero: " + h);
|
|
3251
3255
|
if (o.hasOwnProperty(u = "CRYPTO"))
|
|
@@ -3259,7 +3263,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3259
3263
|
Rt = h;
|
|
3260
3264
|
else
|
|
3261
3265
|
throw Error(c + u + " not true or false: " + h);
|
|
3262
|
-
if (o.hasOwnProperty(u = "MODULO_MODE") && (h = o[u], Q(h, 0, 9, u),
|
|
3266
|
+
if (o.hasOwnProperty(u = "MODULO_MODE") && (h = o[u], Q(h, 0, 9, u), te = h), o.hasOwnProperty(u = "POW_PRECISION") && (h = o[u], Q(h, 0, v, u), kt = h), o.hasOwnProperty(u = "FORMAT"))
|
|
3263
3267
|
if (h = o[u], typeof h == "object")
|
|
3264
3268
|
xe = h;
|
|
3265
3269
|
else
|
|
@@ -3275,9 +3279,9 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3275
3279
|
DECIMAL_PLACES: q,
|
|
3276
3280
|
ROUNDING_MODE: J,
|
|
3277
3281
|
EXPONENTIAL_AT: [st, ct],
|
|
3278
|
-
RANGE: [Ft,
|
|
3282
|
+
RANGE: [Ft, pt],
|
|
3279
3283
|
CRYPTO: Rt,
|
|
3280
|
-
MODULO_MODE:
|
|
3284
|
+
MODULO_MODE: te,
|
|
3281
3285
|
POW_PRECISION: kt,
|
|
3282
3286
|
FORMAT: xe,
|
|
3283
3287
|
ALPHABET: qt
|
|
@@ -3412,7 +3416,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3412
3416
|
;
|
|
3413
3417
|
}
|
|
3414
3418
|
return function(I, f, m, x, d) {
|
|
3415
|
-
var g, _, A, C, P, K, L, Z, et, V, $, nt, ce, Ee, Se, xt,
|
|
3419
|
+
var g, _, A, C, P, K, L, Z, et, V, $, nt, ce, Ee, Se, xt, ee, ft = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
|
|
3416
3420
|
if (!at || !at[0] || !tt || !tt[0])
|
|
3417
3421
|
return new S(
|
|
3418
3422
|
!I.s || !f.s || (at ? tt && at[0] == tt[0] : !tt) ? NaN : at && at[0] == 0 || !tt ? ft * 0 : ft / 0
|
|
@@ -3424,17 +3428,17 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3424
3428
|
else {
|
|
3425
3429
|
for (Ee = at.length, xt = tt.length, A = 0, ft += 2, P = i(d / (tt[0] + 1)), P > 1 && (tt = o(tt, P, d), at = o(at, P, d), xt = tt.length, Ee = at.length), ce = xt, V = at.slice(0, xt), $ = V.length; $ < xt; V[$++] = 0)
|
|
3426
3430
|
;
|
|
3427
|
-
|
|
3431
|
+
ee = tt.slice(), ee = [0].concat(ee), Se = tt[0], tt[1] >= d / 2 && Se++;
|
|
3428
3432
|
do {
|
|
3429
3433
|
if (P = 0, g = u(tt, V, xt, $), g < 0) {
|
|
3430
3434
|
if (nt = V[0], xt != $ && (nt = nt * d + (V[1] || 0)), P = i(nt / Se), P > 1)
|
|
3431
3435
|
for (P >= d && (P = d - 1), K = o(tt, P, d), L = K.length, $ = V.length; u(K, V, L, $) == 1; )
|
|
3432
|
-
P--, h(K, xt < L ?
|
|
3436
|
+
P--, h(K, xt < L ? ee : tt, L, d), L = K.length, g = 1;
|
|
3433
3437
|
else
|
|
3434
3438
|
P == 0 && (g = P = 1), K = tt.slice(), L = K.length;
|
|
3435
3439
|
if (L < $ && (K = [0].concat(K)), h(V, K, $, d), $ = V.length, g == -1)
|
|
3436
3440
|
for (; u(tt, V, xt, $) < 1; )
|
|
3437
|
-
P++, h(V, xt < $ ?
|
|
3441
|
+
P++, h(V, xt < $ ? ee : tt, $, d), $ = V.length;
|
|
3438
3442
|
} else
|
|
3439
3443
|
g === 0 && (P++, V = [0]);
|
|
3440
3444
|
et[A++] = P, V[0] ? V[$++] = at[ce] || 0 : (V = [at[ce]], $ = 1);
|
|
@@ -3479,7 +3483,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3479
3483
|
;
|
|
3480
3484
|
for (f = u[0]; f >= 10; f /= 10, I++)
|
|
3481
3485
|
;
|
|
3482
|
-
return (h = I + h * y - 1) >
|
|
3486
|
+
return (h = I + h * y - 1) > pt ? o.c = o.e = null : h < Ft ? o.c = [o.e = 0] : (o.e = h, o.c = u), o;
|
|
3483
3487
|
}
|
|
3484
3488
|
X = function() {
|
|
3485
3489
|
var o = /^(-?)0([xbo])(?=\w[\w.]*$)/i, u = /^([^.]+)\.$/, h = /^\.([^.]+)$/, I = /^-?(Infinity|NaN)$/, f = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
@@ -3538,7 +3542,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3538
3542
|
for (m = C.length; C[--m] === 0; C.pop())
|
|
3539
3543
|
;
|
|
3540
3544
|
}
|
|
3541
|
-
o.e >
|
|
3545
|
+
o.e > pt ? o.c = o.e = null : o.e < Ft && (o.c = [o.e = 0]);
|
|
3542
3546
|
}
|
|
3543
3547
|
return o;
|
|
3544
3548
|
}
|
|
@@ -3664,7 +3668,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3664
3668
|
return A[0] ? Be(o, A, _) : (o.s = J == 3 ? -1 : 1, o.c = [o.e = 0], o);
|
|
3665
3669
|
}, D.modulo = D.mod = function(o, u) {
|
|
3666
3670
|
var h, I, f = this;
|
|
3667
|
-
return o = new S(o, u), !f.c || !o.s || o.c && !o.c[0] ? new S(NaN) : !o.c || f.c && !f.c[0] ? new S(f) : (
|
|
3671
|
+
return o = new S(o, u), !f.c || !o.s || o.c && !o.c[0] ? new S(NaN) : !o.c || f.c && !f.c[0] ? new S(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);
|
|
3668
3672
|
}, D.multipliedBy = D.times = function(o, u) {
|
|
3669
3673
|
var h, I, f, m, x, d, g, _, A, C, P, K, L, Z, et, V = this, $ = V.c, nt = (o = new S(o, u)).c;
|
|
3670
3674
|
if (!$ || !nt || !$[0] || !nt[0])
|
|
@@ -3764,11 +3768,11 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
|
|
|
3764
3768
|
throw Error(c + "Argument " + (d.isInteger() ? "out of range: " : "not an integer: ") + St(d));
|
|
3765
3769
|
if (!L)
|
|
3766
3770
|
return new S(K);
|
|
3767
|
-
for (u = new S(F), _ = h = new S(F), I = g = new S(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 =
|
|
3771
|
+
for (u = new S(F), _ = h = new S(F), I = g = new S(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 = pt, pt = 1 / 0, d = new S(P), g.c[0] = 0; A = M(d, u, 0, 1), f = h.plus(A.times(I)), f.comparedTo(o) != 1; )
|
|
3768
3772
|
h = I, I = f, _ = g.plus(A.times(f = _)), g = f, u = d.minus(A.times(f = u)), d = f;
|
|
3769
3773
|
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(
|
|
3770
3774
|
M(g, h, m, J).minus(K).abs()
|
|
3771
|
-
) < 1 ? [_, I] : [g, h],
|
|
3775
|
+
) < 1 ? [_, I] : [g, h], pt = x, C;
|
|
3772
3776
|
}, D.toNumber = function() {
|
|
3773
3777
|
return +St(this);
|
|
3774
3778
|
}, D.toPrecision = function(o, u) {
|
|
@@ -4058,7 +4062,7 @@ class en {
|
|
|
4058
4062
|
txHex = "";
|
|
4059
4063
|
txBuilder = pe();
|
|
4060
4064
|
txEvaluationMultiplier = 1.1;
|
|
4061
|
-
_protocolParams =
|
|
4065
|
+
_protocolParams = mt;
|
|
4062
4066
|
txOutput;
|
|
4063
4067
|
addingScriptInput = !1;
|
|
4064
4068
|
addingPlutusMint = !1;
|
|
@@ -4068,7 +4072,7 @@ class en {
|
|
|
4068
4072
|
txInQueueItem;
|
|
4069
4073
|
collateralQueueItem;
|
|
4070
4074
|
refScriptTxInQueueItem;
|
|
4071
|
-
reset = () => (this.txHex = "", this.txBuilder = pe(), this.txEvaluationMultiplier = 1.1, this._protocolParams =
|
|
4075
|
+
reset = () => (this.txHex = "", this.txBuilder = pe(), 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);
|
|
4072
4076
|
emptyTxBuilderBody = () => ({
|
|
4073
4077
|
inputs: [],
|
|
4074
4078
|
outputs: [],
|
|
@@ -4362,7 +4366,7 @@ class en {
|
|
|
4362
4366
|
invalidHereafter = (e) => (this.meshTxBuilderBody.validityRange.invalidHereafter = e, this);
|
|
4363
4367
|
metadataValue = (e, t) => (this.meshTxBuilderBody.metadata.push({ tag: e, metadata: t }), this);
|
|
4364
4368
|
protocolParams = (e) => {
|
|
4365
|
-
const t = { ...
|
|
4369
|
+
const t = { ...mt, ...e };
|
|
4366
4370
|
return this._protocolParams = t, this.txBuilder = pe(t), this;
|
|
4367
4371
|
};
|
|
4368
4372
|
signingKey = (e) => (this.meshTxBuilderBody.signingKey.push(e), this);
|
|
@@ -4889,7 +4893,7 @@ class rt {
|
|
|
4889
4893
|
]);
|
|
4890
4894
|
}
|
|
4891
4895
|
}
|
|
4892
|
-
const
|
|
4896
|
+
const It = "MARI0TIME";
|
|
4893
4897
|
class Qe {
|
|
4894
4898
|
_fetcher;
|
|
4895
4899
|
_submitter;
|
|
@@ -4897,40 +4901,40 @@ class Qe {
|
|
|
4897
4901
|
constructor(e) {
|
|
4898
4902
|
switch (this._fetcher = e.fetcher, this._submitter = e.submitter, e.key.type) {
|
|
4899
4903
|
case "mnemonic":
|
|
4900
|
-
this._wallet = new rt(e.networkId, rt.encryptMnemonic(e.key.words,
|
|
4904
|
+
this._wallet = new rt(e.networkId, rt.encryptMnemonic(e.key.words, It));
|
|
4901
4905
|
break;
|
|
4902
4906
|
case "root":
|
|
4903
|
-
this._wallet = new rt(e.networkId, rt.encryptPrivateKey(e.key.bech32,
|
|
4907
|
+
this._wallet = new rt(e.networkId, rt.encryptPrivateKey(e.key.bech32, It));
|
|
4904
4908
|
break;
|
|
4905
4909
|
case "cli":
|
|
4906
|
-
this._wallet = new rt(e.networkId, rt.encryptSigningKeys(e.key.payment, e.key.stake ?? "f0".repeat(34),
|
|
4910
|
+
this._wallet = new rt(e.networkId, rt.encryptSigningKeys(e.key.payment, e.key.stake ?? "f0".repeat(34), It));
|
|
4907
4911
|
}
|
|
4908
4912
|
}
|
|
4909
4913
|
getBaseAddress(e = 0) {
|
|
4910
|
-
return this._wallet.getAccount(e,
|
|
4914
|
+
return this._wallet.getAccount(e, It).baseAddress;
|
|
4911
4915
|
}
|
|
4912
4916
|
getPaymentAddress(e = 0) {
|
|
4913
|
-
return this._wallet.getAccount(e,
|
|
4917
|
+
return this._wallet.getAccount(e, It).enterpriseAddress;
|
|
4914
4918
|
}
|
|
4915
4919
|
getRewardAddress(e = 0) {
|
|
4916
|
-
return this._wallet.getAccount(e,
|
|
4920
|
+
return this._wallet.getAccount(e, It).rewardAddress;
|
|
4917
4921
|
}
|
|
4918
4922
|
getUsedAddress(e = 0) {
|
|
4919
|
-
const t = this._wallet.getAccount(e,
|
|
4923
|
+
const t = this._wallet.getAccount(e, It);
|
|
4920
4924
|
return yt(t.enterpriseAddress);
|
|
4921
4925
|
}
|
|
4922
|
-
getUsedCollateral(e =
|
|
4926
|
+
getUsedCollateral(e = mt.maxCollateralInputs) {
|
|
4923
4927
|
throw new Error("getUsedCollateral not implemented.");
|
|
4924
4928
|
}
|
|
4925
4929
|
async getUsedUTxOs(e = 0) {
|
|
4926
4930
|
if (!this._fetcher)
|
|
4927
4931
|
throw new Error("[AppWallet] Fetcher is required to fetch UTxOs. Please provide a fetcher.");
|
|
4928
|
-
const t = this._wallet.getAccount(e,
|
|
4929
|
-
return (await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map((n) =>
|
|
4932
|
+
const t = this._wallet.getAccount(e, It);
|
|
4933
|
+
return (await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map((n) => gt(n));
|
|
4930
4934
|
}
|
|
4931
4935
|
signData(e, t, r = 0) {
|
|
4932
4936
|
try {
|
|
4933
|
-
return this._wallet.signData(r,
|
|
4937
|
+
return this._wallet.signData(r, It, e, t);
|
|
4934
4938
|
} catch (n) {
|
|
4935
4939
|
throw new Error(`[AppWallet] An error occurred during signData: ${n}.`);
|
|
4936
4940
|
}
|
|
@@ -4939,7 +4943,7 @@ class Qe {
|
|
|
4939
4943
|
try {
|
|
4940
4944
|
if (!this._fetcher)
|
|
4941
4945
|
throw new Error("[AppWallet] Fetcher is required to fetch UTxOs. Please provide a fetcher.");
|
|
4942
|
-
const n = this._wallet.getAccount(r,
|
|
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), p = l.witness_set(), y = Me(p, c);
|
|
4943
4947
|
return p.set_vkeys(y), a.Transaction.new(l.body(), p, l.auxiliary_data()).to_hex();
|
|
4944
4948
|
} catch (n) {
|
|
4945
4949
|
throw new Error(`[AppWallet] An error occurred during signTx: ${n}.`);
|
|
@@ -4998,8 +5002,8 @@ class Ke {
|
|
|
4998
5002
|
const e = await this._walletInstance.getChangeAddress();
|
|
4999
5003
|
return Lt(e).to_bech32();
|
|
5000
5004
|
}
|
|
5001
|
-
async getCollateral(e =
|
|
5002
|
-
return (await this.getUsedCollateral(e)).map((r) =>
|
|
5005
|
+
async getCollateral(e = mt.maxCollateralInputs) {
|
|
5006
|
+
return (await this.getUsedCollateral(e)).map((r) => oe(r));
|
|
5003
5007
|
}
|
|
5004
5008
|
getNetworkId() {
|
|
5005
5009
|
return this._walletInstance.getNetworkId();
|
|
@@ -5014,7 +5018,7 @@ class Ke {
|
|
|
5014
5018
|
return (await this._walletInstance.getUsedAddresses()).map((t) => Lt(t).to_bech32());
|
|
5015
5019
|
}
|
|
5016
5020
|
async getUtxos(e = void 0) {
|
|
5017
|
-
return (await this.getUsedUTxOs(e)).map((r) =>
|
|
5021
|
+
return (await this.getUsedUTxOs(e)).map((r) => oe(r));
|
|
5018
5022
|
}
|
|
5019
5023
|
signData(e, t) {
|
|
5020
5024
|
const r = yt(e).to_hex();
|
|
@@ -5062,7 +5066,7 @@ class Ke {
|
|
|
5062
5066
|
const e = await this._walletInstance.getUsedAddresses();
|
|
5063
5067
|
return Lt(e[0]);
|
|
5064
5068
|
}
|
|
5065
|
-
async getUsedCollateral(e =
|
|
5069
|
+
async getUsedCollateral(e = mt.maxCollateralInputs) {
|
|
5066
5070
|
return (await this._walletInstance.experimental.getCollateral() ?? []).map((r) => dr(r)).slice(0, e);
|
|
5067
5071
|
}
|
|
5068
5072
|
async getUsedUTxOs(e = void 0) {
|
|
@@ -5179,7 +5183,7 @@ class Tn {
|
|
|
5179
5183
|
return [this.getChangeAddress()];
|
|
5180
5184
|
}
|
|
5181
5185
|
async getUtxos() {
|
|
5182
|
-
return (await this.getUsedUTxOs()).map((t) =>
|
|
5186
|
+
return (await this.getUsedUTxOs()).map((t) => oe(t));
|
|
5183
5187
|
}
|
|
5184
5188
|
signData(e) {
|
|
5185
5189
|
return this._wallet.signData(this.getChangeAddress(), e);
|
|
@@ -5202,7 +5206,7 @@ class Tn {
|
|
|
5202
5206
|
return this._wallet.getUsedAddress();
|
|
5203
5207
|
}
|
|
5204
5208
|
async getUsedCollateral() {
|
|
5205
|
-
return (await this.getCollateral()).map((r) =>
|
|
5209
|
+
return (await this.getCollateral()).map((r) => gt(r));
|
|
5206
5210
|
}
|
|
5207
5211
|
async getUsedUTxOs() {
|
|
5208
5212
|
return await this._wallet.getUtxos();
|
|
@@ -5278,7 +5282,7 @@ export {
|
|
|
5278
5282
|
ye as resolveRewardAddress,
|
|
5279
5283
|
In as resolveScriptRef,
|
|
5280
5284
|
_n as resolveSlotNo,
|
|
5281
|
-
|
|
5285
|
+
se as resolveStakeKeyHash,
|
|
5282
5286
|
qr as resolveTxFees,
|
|
5283
5287
|
$s as resolveTxHash
|
|
5284
5288
|
};
|