@meshsdk/core 1.5.18 → 1.5.19

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
@@ -2,7 +2,7 @@ import { customAlphabet as _r } from "nanoid";
2
2
  import * as a from "@emurgo/cardano-serialization-lib-nodejs";
3
3
  import Mt from "axios";
4
4
  import { mnemonicToEntropy as yr, generateMnemonic as Yr } from "bip39";
5
- import { COSEKey as xr, COSESign1 as $r, Label as Pt, Int as fe, BigNum as De, KeyType as zr, AlgorithmId as wr, CBORValue as ke, HeaderMap as Je, Headers as Jr, ProtectedHeaderMap as Wr, COSESign1Builder as jr } from "@emurgo/cardano-message-signing-nodejs";
5
+ import { COSEKey as xr, COSESign1 as $r, Label as Pt, Int as ge, BigNum as De, KeyType as zr, AlgorithmId as wr, CBORValue as ke, HeaderMap as Je, Headers as Jr, ProtectedHeaderMap as Wr, COSESign1Builder as jr } from "@emurgo/cardano-message-signing-nodejs";
6
6
  const on = (s) => {
7
7
  const e = [];
8
8
  return s.forEach((t) => {
@@ -41,7 +41,7 @@ const on = (s) => {
41
41
  MINT: a.RedeemerTag.new_mint(),
42
42
  REWARD: a.RedeemerTag.new_reward(),
43
43
  SPEND: a.RedeemerTag.new_spend()
44
- }, pe = {
44
+ }, Ie = {
45
45
  testnet: ["74", "1598400", "1595967616", "432000"],
46
46
  preview: ["183", "15811222", "1682467200", "86400"],
47
47
  preprod: ["65", "26438400", "1682121600", "432000"],
@@ -504,7 +504,7 @@ const on = (s) => {
504
504
  const y = (c = i.headers().protected().deserialized_headers().header(Pt.new_text("address"))) == null ? void 0 : c.as_bytes();
505
505
  if (y === void 0)
506
506
  throw new Error("Couldn't find a signer address in signature");
507
- const B = (l = n.header(Pt.new_int(fe.new_negative(De.from_str("2"))))) == null ? void 0 : l.as_bytes();
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
510
  const b = Lt(ut(y)), w = Fs(ut(B));
@@ -524,7 +524,7 @@ const on = (s) => {
524
524
  }
525
525
  }, fs = (s) => {
526
526
  const e = xr.new(Pt.from_key_type(zr.OKP));
527
- return e.set_algorithm_id(Pt.from_algorithm_id(wr.EdDSA)), e.set_header(Pt.new_int(fe.new_negative(De.from_str("1"))), ke.new_int(fe.new_i32(6))), e.set_header(Pt.new_int(fe.new_negative(De.from_str("2"))), ke.new_bytes(s.key.to_public().as_bytes())), e;
527
+ return e.set_algorithm_id(Pt.from_algorithm_id(wr.EdDSA)), e.set_header(Pt.new_int(ge.new_negative(De.from_str("1"))), ke.new_int(ge.new_i32(6))), e.set_header(Pt.new_int(ge.new_negative(De.from_str("2"))), ke.new_bytes(s.key.to_public().as_bytes())), e;
528
528
  }, gs = (s, e) => {
529
529
  const t = Je.new(), r = Je.new();
530
530
  t.set_algorithm_id(Pt.from_algorithm_id(wr.EdDSA)), t.set_header(Pt.new_text("address"), ke.new_bytes(e.address.to_bytes()));
@@ -599,7 +599,7 @@ function ys(s) {
599
599
  function xs(s) {
600
600
  return s.charCodeAt(0);
601
601
  }
602
- var wt = Er, J = _s(), vt = 64, ge = [];
602
+ var wt = Er, J = _s(), vt = 64, me = [];
603
603
  Et.exports = mt;
604
604
  var Xe = Et.exports.BYTES_MIN = 16, Ze = Et.exports.BYTES_MAX = 64;
605
605
  Et.exports.BYTES = 32;
@@ -611,13 +611,13 @@ function mt(s, e, t, r, n) {
611
611
  return new mt(s, e, t, r, n);
612
612
  if (!(J && J.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)), ge.length || (ge.push(vt), vt += 216), this.digestLength = s, this.finalized = !1, this.pointer = ge.pop(), J.memory.fill(0, 0, 64), J.memory[0] = this.digestLength, J.memory[1] = e ? e.length : 0, J.memory[2] = 1, J.memory[3] = 1, t && J.memory.set(t, 32), r && J.memory.set(r, 48), this.pointer + 216 > J.memory.length && J.realloc(this.pointer + 216), J.exports.blake2b_init(this.pointer, this.digestLength), e && (this.update(e), J.memory.fill(0, vt, vt + e.length), J.memory[this.pointer + 200] = 128);
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(), J.memory.fill(0, 0, 64), J.memory[0] = this.digestLength, J.memory[1] = e ? e.length : 0, J.memory[2] = 1, J.memory[3] = 1, t && J.memory.set(t, 32), r && J.memory.set(r, 48), this.pointer + 216 > J.memory.length && J.realloc(this.pointer + 216), J.exports.blake2b_init(this.pointer, this.digestLength), e && (this.update(e), J.memory.fill(0, vt, vt + e.length), J.memory[this.pointer + 200] = 128);
615
615
  }
616
616
  mt.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 > J.memory.length && J.realloc(vt + s.length), J.memory.set(s, vt), J.exports.blake2b_update(this.pointer, vt, vt + s.length), this;
618
618
  };
619
619
  mt.prototype.digest = function(s) {
620
- if (wt(this.finalized === !1, "Hash instance finalized"), this.finalized = !0, ge.push(this.pointer), J.exports.blake2b_final(this.pointer), !s || s === "binary")
620
+ if (wt(this.finalized === !1, "Hash instance finalized"), this.finalized = !0, me.push(this.pointer), J.exports.blake2b_final(this.pointer), !s || s === "binary")
621
621
  return J.memory.slice(this.pointer + 128, this.pointer + 128 + this.digestLength);
622
622
  if (s === "hex")
623
623
  return Cs(J.memory, this.pointer + 128, this.digestLength);
@@ -651,7 +651,7 @@ function Bs(s) {
651
651
  return s < 16 ? "0" + s.toString(16) : s.toString(16);
652
652
  }
653
653
  var Ut = Er, ie = Et.exports;
654
- function ce(s, e, t) {
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;
657
657
  }
@@ -666,9 +666,9 @@ function Sr(s, e) {
666
666
  }
667
667
  function Tt(s, e, t, r, n, i) {
668
668
  var c = ee[n], l = ee[n + 1], p = ee[i], y = ee[i + 1];
669
- ce(H, s, e), nr(H, s, c, l);
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, ce(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, ce(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, ce(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;
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;
672
672
  }
673
673
  var br = new Uint32Array([
674
674
  4089235720,
@@ -1021,9 +1021,9 @@ ie.ready(function(s) {
1021
1021
  var Wt = {};
1022
1022
  Object.defineProperty(Wt, "__esModule", { value: !0 });
1023
1023
  Wt.bech32m = Wt.bech32 = void 0;
1024
- const Ie = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", kr = {};
1025
- for (let s = 0; s < Ie.length; s++) {
1026
- const e = Ie.charAt(s);
1024
+ const _e = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", kr = {};
1025
+ for (let s = 0; s < _e.length; s++) {
1026
+ const e = _e.charAt(s);
1027
1027
  kr[e] = s;
1028
1028
  }
1029
1029
  function $t(s) {
@@ -1090,14 +1090,14 @@ 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 = $t(y) ^ w, B += Ie.charAt(w);
1093
+ y = $t(y) ^ w, B += _e.charAt(w);
1094
1094
  }
1095
1095
  for (let b = 0; b < 6; ++b)
1096
1096
  y = $t(y);
1097
1097
  y ^= e;
1098
1098
  for (let b = 0; b < 6; ++b) {
1099
1099
  const w = y >> (5 - b) * 5 & 31;
1100
- B += Ie.charAt(w);
1100
+ B += _e.charAt(w);
1101
1101
  }
1102
1102
  return B;
1103
1103
  }
@@ -1156,7 +1156,7 @@ 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), ue = Wt, ve = "asset";
1159
+ const Ns = Ts(ot.exports), le = Wt, ve = "asset";
1160
1160
  class se {
1161
1161
  constructor(e) {
1162
1162
  this.hashBuf = e;
@@ -1169,15 +1169,15 @@ class se {
1169
1169
  return se.fromHash(r);
1170
1170
  }
1171
1171
  static fromBech32(e) {
1172
- const { prefix: t, words: r } = ue.bech32.decode(e);
1172
+ const { prefix: t, words: r } = le.bech32.decode(e);
1173
1173
  if (t !== ve)
1174
1174
  throw new Error("Invalid asset fingerprint");
1175
- const n = Buffer.from(ue.bech32.fromWords(r));
1175
+ const n = Buffer.from(le.bech32.fromWords(r));
1176
1176
  return se.fromHash(n);
1177
1177
  }
1178
1178
  fingerprint() {
1179
- const e = ue.bech32.toWords(this.hashBuf);
1180
- return ue.bech32.encode(ve, e);
1179
+ const e = le.bech32.toWords(this.hashBuf);
1180
+ return le.bech32.encode(ve, e);
1181
1181
  }
1182
1182
  hash() {
1183
1183
  return Buffer.from(this.hashBuf).toString("hex");
@@ -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
- }, _e = (s) => {
1244
+ }, oe = (s) => {
1245
1245
  const e = (t) => {
1246
1246
  const r = a.NativeScripts.new();
1247
1247
  return t.forEach((n) => {
1248
- r.add(_e(n));
1248
+ r.add(oe(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
- }, me = (s) => {
1265
+ }, Ae = (s) => {
1266
1266
  var r, n, i;
1267
1267
  const e = (c) => {
1268
1268
  const l = [];
1269
1269
  for (let p = 0; p < c.len(); p += 1)
1270
- l.push(me(c.get(p)));
1270
+ l.push(Ae(c.get(p)));
1271
1271
  return l;
1272
1272
  }, t = (c) => {
1273
1273
  const l = /* @__PURE__ */ new Map();
1274
1274
  for (let p = 0; p < c.len(); p += 1) {
1275
1275
  const y = c.keys().get(p), B = c.get(y) ?? a.PlutusData.from_hex(ht("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));
1276
- l.set(me(y), me(B));
1276
+ l.set(Ae(y), Ae(B));
1277
1277
  }
1278
1278
  return l;
1279
1279
  };
@@ -1354,7 +1354,7 @@ const Ps = Us, Os = (s, e) => {
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(_e(s));
1357
+ return a.ScriptRef.new_native_script(oe(s));
1358
1358
  }, ae = (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;
@@ -1441,10 +1441,10 @@ const Ps = Us, Os = (s, e) => {
1441
1441
  }
1442
1442
  }
1443
1443
  throw new Error(`No plutus script reference found in UTxO: ${e.input().transaction_id().to_hex()}`);
1444
- }, le = (s) => {
1444
+ }, he = (s) => {
1445
1445
  const e = a.ScriptPubkey.new(s);
1446
1446
  return a.NativeScript.new_script_pubkey(e);
1447
- }, Ae = (s = gt) => {
1447
+ }, pe = (s = gt) => {
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) => {
@@ -1452,7 +1452,7 @@ const Ps = Us, Os = (s, e) => {
1452
1452
  return s.map((t) => t instanceof a.TransactionUnspentOutput ? t : It(t)).forEach((t) => {
1453
1453
  e.add_input(t.output().address(), t.input(), t.output().amount());
1454
1454
  }), e;
1455
- }, he = (s) => {
1455
+ }, de = (s) => {
1456
1456
  if (typeof s == "string")
1457
1457
  return a.TransactionOutputBuilder.new().with_address(yt(s));
1458
1458
  let e = a.TransactionOutputBuilder.new().with_address(yt(s.address));
@@ -1476,12 +1476,15 @@ const Ps = Us, Os = (s, e) => {
1476
1476
  const e = Ot(s);
1477
1477
  return a.hash_plutus_data(e).to_hex();
1478
1478
  }, hn = (s, e = Date.now()) => {
1479
- if (pe[s]) {
1480
- const [t, r, n, i] = pe[s];
1479
+ if (Ie[s]) {
1480
+ const [t, r, n, i] = Ie[s];
1481
1481
  return parseInt(a.BigNum.from_str(e.toString()).div_floor(a.BigNum.from_str("1000")).checked_sub(a.BigNum.from_str(n)).div_floor(a.BigNum.from_str(i)).checked_add(a.BigNum.from_str(t)).to_str(), 10);
1482
1482
  }
1483
1483
  throw new Error(`Couldn't resolve EpochNo for network: ${s}`);
1484
- }, Rr = (s, e) => Ps.fromParts(G(s), G(e)).fingerprint(), dn = (s, e) => es[s][e], fn = (s) => _e(s).hash().to_hex(), Yt = (s) => {
1484
+ }, Rr = (s, e) => Ps.fromParts(G(s), G(e)).fingerprint(), dn = (s, e) => es[s][e], fn = (s, e = 0) => {
1485
+ const t = oe(s);
1486
+ return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
1487
+ }, gn = (s) => oe(s).hash().to_hex(), Yt = (s) => {
1485
1488
  var e, t;
1486
1489
  try {
1487
1490
  const r = [
@@ -1494,10 +1497,10 @@ const Ps = Us, Os = (s, e) => {
1494
1497
  } catch (r) {
1495
1498
  throw new Error(`An error occurred during resolvePaymentKeyHash: ${r}.`);
1496
1499
  }
1497
- }, gn = (s, e = 0) => {
1500
+ }, mn = (s, e = 0) => {
1498
1501
  const t = jt(s.code, s.version);
1499
1502
  return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
1500
- }, mn = (s) => {
1503
+ }, An = (s) => {
1501
1504
  try {
1502
1505
  const e = Pr(s), t = e == null ? void 0 : e.payment_cred().to_scripthash();
1503
1506
  if (t !== void 0)
@@ -1506,12 +1509,12 @@ const Ps = Us, Os = (s, e) => {
1506
1509
  } catch (e) {
1507
1510
  throw new Error(`An error occurred during resolveScriptHash: ${e}.`);
1508
1511
  }
1509
- }, An = (s) => a.Ed25519KeyHash.from_hex(s).to_bech32("pool1"), Ys = (s) => {
1512
+ }, pn = (s) => a.Ed25519KeyHash.from_hex(s).to_bech32("pool1"), Ys = (s) => {
1510
1513
  const e = yr(s.join(" ")), t = Fr(e), r = t.to_bech32();
1511
1514
  return t.free(), r;
1512
- }, pn = (s) => Xt(s).to_hex(), In = (s, e = Date.now()) => {
1513
- if (pe[s]) {
1514
- const [t, r, n] = pe[s];
1515
+ }, In = (s) => Xt(s).to_hex(), _n = (s, e = Date.now()) => {
1516
+ if (Ie[s]) {
1517
+ const [t, r, n] = Ie[s];
1515
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();
1516
1519
  }
1517
1520
  throw new Error(`Couldn't resolve SlotNo for network: ${s}`);
@@ -1540,7 +1543,7 @@ const Ps = Us, Os = (s, e) => {
1540
1543
  }, qr = (s, e = gt.minFeeA, t = gt.minFeeB) => (BigInt(e) * BigInt(s) + BigInt(t)).toString(), $s = (s) => {
1541
1544
  const e = _t(s).body();
1542
1545
  return a.hash_transaction(e).to_hex();
1543
- }, _n = (s = "", e = 32) => {
1546
+ }, yn = (s = "", e = 32) => {
1544
1547
  if (e <= 0 || e > 2048)
1545
1548
  throw new Error("Length must be bewteen 1 and 2048");
1546
1549
  const r = _r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(e);
@@ -1559,8 +1562,8 @@ const Ps = Us, Os = (s, e) => {
1559
1562
  }), n;
1560
1563
  }
1561
1564
  return e;
1562
- }, yn = (s) => me(Nr(s)), xn = (s) => _t(s).to_js_value();
1563
- class wn {
1565
+ }, xn = (s) => Ae(Nr(s)), wn = (s) => _t(s).to_js_value();
1566
+ class Cn {
1564
1567
  _axiosInstance;
1565
1568
  constructor(...e) {
1566
1569
  if (typeof e[0] == "string" && e[0].startsWith("http"))
@@ -1812,7 +1815,7 @@ class wn {
1812
1815
  throw E(t);
1813
1816
  }
1814
1817
  }
1815
- class Cn {
1818
+ class Bn {
1816
1819
  _axiosInstance;
1817
1820
  constructor(e, t, r) {
1818
1821
  const n = r.host ?? "ipfs.infura.io", i = r.port ?? 5001, c = r.version ?? 0;
@@ -1832,7 +1835,7 @@ class Cn {
1832
1835
  }
1833
1836
  }
1834
1837
  }
1835
- class Bn {
1838
+ class En {
1836
1839
  _axiosInstance;
1837
1840
  constructor(...e) {
1838
1841
  if (typeof e[0] == "string" && e[0].startsWith("http"))
@@ -2087,7 +2090,7 @@ class Bn {
2087
2090
  }
2088
2091
  };
2089
2092
  }
2090
- class En {
2093
+ class Sn {
2091
2094
  _baseUrl;
2092
2095
  constructor(...e) {
2093
2096
  this._baseUrl = Zr(e[0]) ? rs[e[0]] : e[0];
@@ -2154,7 +2157,7 @@ class En {
2154
2157
  }));
2155
2158
  }
2156
2159
  }
2157
- class Sn {
2160
+ class bn {
2158
2161
  _axiosInstance;
2159
2162
  _amountsAsStrings = {
2160
2163
  headers: {
@@ -2445,7 +2448,7 @@ class Sn {
2445
2448
  return;
2446
2449
  };
2447
2450
  }
2448
- class bn {
2451
+ class vn {
2449
2452
  _axiosInstance;
2450
2453
  constructor(e = "http://localhost:8080/api/v1") {
2451
2454
  this._axiosInstance = Mt.create({
@@ -2693,16 +2696,16 @@ class bn {
2693
2696
  throw E(t);
2694
2697
  }
2695
2698
  }
2696
- class vn {
2699
+ class Qn {
2697
2700
  static withOneSignature(e) {
2698
2701
  const t = Ct(Yt(e));
2699
- return le(t).to_hex();
2702
+ return he(t).to_hex();
2700
2703
  }
2701
2704
  static withAtLeastNSignatures(e, t) {
2702
2705
  const r = a.NativeScripts.new();
2703
2706
  e.forEach((i) => {
2704
2707
  const c = Ct(Yt(i));
2705
- r.add(le(c));
2708
+ r.add(he(c));
2706
2709
  });
2707
2710
  const n = a.ScriptNOfK.new(t, r);
2708
2711
  return a.NativeScript.new_script_any(n).to_hex();
@@ -2711,7 +2714,7 @@ class vn {
2711
2714
  const t = a.NativeScripts.new();
2712
2715
  e.forEach((n) => {
2713
2716
  const i = Ct(Yt(n));
2714
- t.add(le(i));
2717
+ t.add(he(i));
2715
2718
  });
2716
2719
  const r = a.ScriptAny.new(t);
2717
2720
  return a.NativeScript.new_script_any(r).to_hex();
@@ -2720,13 +2723,13 @@ class vn {
2720
2723
  const t = a.NativeScripts.new();
2721
2724
  e.forEach((n) => {
2722
2725
  const i = Ct(Yt(n));
2723
- t.add(le(i));
2726
+ t.add(he(i));
2724
2727
  });
2725
2728
  const r = a.ScriptAll.new(t);
2726
2729
  return a.NativeScript.new_script_any(r).to_hex();
2727
2730
  }
2728
2731
  static fromNativeScript(e) {
2729
- return _e(e).to_hex();
2732
+ return oe(e).to_hex();
2730
2733
  }
2731
2734
  }
2732
2735
  function Ht(s, e, t, r) {
@@ -2762,7 +2765,7 @@ let Bt = class {
2762
2765
  _txInputsBuilder;
2763
2766
  _txWithdrawals;
2764
2767
  constructor(e = {}) {
2765
- this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? gt, this._txBuilder = Ae(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
2768
+ this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? gt, this._txBuilder = pe(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
2766
2769
  }
2767
2770
  static attachMetadata(e, t, r = "BABBAGE") {
2768
2771
  var c;
@@ -2874,13 +2877,13 @@ let Bt = class {
2874
2877
  const r = Qt(t), n = r.multiasset();
2875
2878
  if (r.is_zero() || n === void 0)
2876
2879
  return this;
2877
- const i = he(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();
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();
2878
2881
  return t.forEach((l) => {
2879
2882
  this.setTxOutput(l);
2880
2883
  }), this._txBuilder.add_output(c), this;
2881
2884
  }
2882
2885
  sendLovelace(e, t) {
2883
- const n = he(e).next().with_coin(a.BigNum.from_str(t)).build();
2886
+ const n = de(e).next().with_coin(a.BigNum.from_str(t)).build();
2884
2887
  return this.setTxOutput({
2885
2888
  unit: "lovelace",
2886
2889
  quantity: t
@@ -2893,7 +2896,7 @@ let Bt = class {
2893
2896
  }]), this;
2894
2897
  }
2895
2898
  sendValue(e, t) {
2896
- const r = Qt(t.output.amount), i = he(e).next().with_value(r).build();
2899
+ const r = Qt(t.output.amount), i = de(e).next().with_value(r).build();
2897
2900
  return t.output.amount.forEach((c) => {
2898
2901
  this.setTxOutput(c);
2899
2902
  }), this._txBuilder.add_output(i), this;
@@ -3012,7 +3015,7 @@ let Bt = class {
3012
3015
  this._recipients.forEach((e, t) => {
3013
3016
  const n = Qt(e).multiasset();
3014
3017
  if (n !== void 0) {
3015
- const c = he(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Ue(this._protocolParameters.coinsPerUTxOSize)).build();
3018
+ const c = de(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Ue(this._protocolParameters.coinsPerUTxOSize)).build();
3016
3019
  this._txBuilder.add_output(c);
3017
3020
  }
3018
3021
  });
@@ -3409,7 +3412,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
3409
3412
  ;
3410
3413
  }
3411
3414
  return function(I, f, m, x, d) {
3412
- var g, _, A, C, P, K, L, Z, et, V, $, nt, oe, Ee, Se, xt, te, ft = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
3415
+ var g, _, A, C, P, K, L, Z, et, V, $, nt, ce, Ee, Se, xt, te, ft = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
3413
3416
  if (!at || !at[0] || !tt || !tt[0])
3414
3417
  return new S(
3415
3418
  !I.s || !f.s || (at ? tt && at[0] == tt[0] : !tt) ? NaN : at && at[0] == 0 || !tt ? ft * 0 : ft / 0
@@ -3419,7 +3422,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
3419
3422
  if (tt[A] > (at[A] || 0) && _--, ft < 0)
3420
3423
  et.push(1), C = !0;
3421
3424
  else {
3422
- 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), oe = xt, V = at.slice(0, xt), $ = V.length; $ < xt; V[$++] = 0)
3425
+ 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)
3423
3426
  ;
3424
3427
  te = tt.slice(), te = [0].concat(te), Se = tt[0], tt[1] >= d / 2 && Se++;
3425
3428
  do {
@@ -3434,8 +3437,8 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
3434
3437
  P++, h(V, xt < $ ? te : tt, $, d), $ = V.length;
3435
3438
  } else
3436
3439
  g === 0 && (P++, V = [0]);
3437
- et[A++] = P, V[0] ? V[$++] = at[oe] || 0 : (V = [at[oe]], $ = 1);
3438
- } while ((oe++ < Ee || V[0] != null) && ft--);
3440
+ et[A++] = P, V[0] ? V[$++] = at[ce] || 0 : (V = [at[ce]], $ = 1);
3441
+ } while ((ce++ < Ee || V[0] != null) && ft--);
3439
3442
  C = V[0] != null, et[0] || et.splice(0, 1);
3440
3443
  }
3441
3444
  if (d == p) {
@@ -3903,7 +3906,7 @@ var zt = { exports: {} }, Vr = { exports: {} }, $e = { exports: {} };
3903
3906
  });
3904
3907
  })();
3905
3908
  })(Vr);
3906
- var de = null;
3909
+ var fe = null;
3907
3910
  const js = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, Xs = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
3908
3911
  var Zs = function(s) {
3909
3912
  var e = {
@@ -3962,7 +3965,7 @@ var Zs = function(s) {
3962
3965
  if (k = +N, !isFinite(k))
3963
3966
  c("Bad number");
3964
3967
  else
3965
- return de == null && (de = $e.exports), N.length > 15 ? e.storeAsString ? N : e.useNativeBigInt ? BigInt(N) : new de(N) : e.alwaysParseAsBig ? e.useNativeBigInt ? BigInt(k) : new de(k) : k;
3968
+ return fe == null && (fe = $e.exports), N.length > 15 ? e.storeAsString ? N : e.useNativeBigInt ? BigInt(N) : new fe(N) : e.alwaysParseAsBig ? e.useNativeBigInt ? BigInt(k) : new fe(k) : k;
3966
3969
  }, y = function() {
3967
3970
  var k, N, T = "", Q;
3968
3971
  if (r === '"')
@@ -4053,7 +4056,7 @@ zt.exports.parse = Gr();
4053
4056
  zt.exports.stringify = Lr;
4054
4057
  class en {
4055
4058
  txHex = "";
4056
- txBuilder = Ae();
4059
+ txBuilder = pe();
4057
4060
  txEvaluationMultiplier = 1.1;
4058
4061
  _protocolParams = gt;
4059
4062
  txOutput;
@@ -4065,7 +4068,7 @@ class en {
4065
4068
  txInQueueItem;
4066
4069
  collateralQueueItem;
4067
4070
  refScriptTxInQueueItem;
4068
- reset = () => (this.txHex = "", this.txBuilder = Ae(), this.txEvaluationMultiplier = 1.1, this._protocolParams = gt, 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);
4071
+ reset = () => (this.txHex = "", this.txBuilder = pe(), this.txEvaluationMultiplier = 1.1, this._protocolParams = gt, 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);
4069
4072
  emptyTxBuilderBody = () => ({
4070
4073
  inputs: [],
4071
4074
  outputs: [],
@@ -4360,7 +4363,7 @@ class en {
4360
4363
  metadataValue = (e, t) => (this.meshTxBuilderBody.metadata.push({ tag: e, metadata: t }), this);
4361
4364
  protocolParams = (e) => {
4362
4365
  const t = { ...gt, ...e };
4363
- return this._protocolParams = t, this.txBuilder = Ae(t), this;
4366
+ return this._protocolParams = t, this.txBuilder = pe(t), this;
4364
4367
  };
4365
4368
  signingKey = (e) => (this.meshTxBuilderBody.signingKey.push(e), this);
4366
4369
  selectUtxosFrom = (e, t = 5e6) => (this.meshTxBuilderBody.extraInputs = e, this.meshTxBuilderBody.selectionThreshold = t, this);
@@ -4630,7 +4633,7 @@ class en {
4630
4633
  castRawDataToJsonString = (e) => typeof e == "object" ? zt.exports.stringify(e) : e;
4631
4634
  castDataToPlutusData = ({ type: e, content: t }) => e === "Mesh" ? Ot(t) : e === "CBOR" ? a.PlutusData.from_hex(t) : a.PlutusData.from_json(t, a.PlutusDatumSchema.DetailedSchema);
4632
4635
  }
4633
- class Dn extends en {
4636
+ class kn extends en {
4634
4637
  _fetcher;
4635
4638
  _submitter;
4636
4639
  _evaluator;
@@ -5090,7 +5093,7 @@ class Ke {
5090
5093
  return t == null ? void 0 : t.enable();
5091
5094
  }
5092
5095
  }
5093
- class kn {
5096
+ class Tn {
5094
5097
  _wallet;
5095
5098
  _network;
5096
5099
  constructor(e) {
@@ -5232,20 +5235,20 @@ class kn {
5232
5235
  }
5233
5236
  export {
5234
5237
  Qe as AppWallet,
5235
- wn as BlockfrostProvider,
5238
+ Cn as BlockfrostProvider,
5236
5239
  Ke as BrowserWallet,
5237
5240
  rt as EmbeddedWallet,
5238
- vn as ForgeScript,
5239
- Cn as InfuraProvider,
5240
- Bn as KoiosProvider,
5241
- Sn as MaestroProvider,
5242
- Dn as MeshTxBuilder,
5243
- kn as MeshWallet,
5244
- En as OgmiosProvider,
5241
+ Qn as ForgeScript,
5242
+ Bn as InfuraProvider,
5243
+ En as KoiosProvider,
5244
+ bn as MaestroProvider,
5245
+ kn as MeshTxBuilder,
5246
+ Tn as MeshWallet,
5247
+ Sn as OgmiosProvider,
5245
5248
  Bt as Transaction,
5246
- bn as YaciProvider,
5249
+ vn as YaciProvider,
5247
5250
  un as checkSignature,
5248
- _n as generateNonce,
5251
+ yn as generateNonce,
5249
5252
  Zr as isNetwork,
5250
5253
  ns as keepRelevant,
5251
5254
  cn as largestFirst,
@@ -5253,21 +5256,22 @@ export {
5253
5256
  on as mergeAssets,
5254
5257
  Kt as parseAssetUnit,
5255
5258
  E as parseHttpError,
5256
- yn as readPlutusData,
5257
- xn as readTransaction,
5259
+ xn as readPlutusData,
5260
+ wn as readTransaction,
5258
5261
  ln as resolveDataHash,
5259
5262
  hn as resolveEpochNo,
5260
5263
  Rr as resolveFingerprint,
5261
5264
  dn as resolveLanguageView,
5262
- fn as resolveNativeScriptHash,
5265
+ fn as resolveNativeScriptAddress,
5266
+ gn as resolveNativeScriptHash,
5263
5267
  Yt as resolvePaymentKeyHash,
5264
- gn as resolvePlutusScriptAddress,
5265
- mn as resolvePlutusScriptHash,
5266
- An as resolvePoolId,
5268
+ mn as resolvePlutusScriptAddress,
5269
+ An as resolvePlutusScriptHash,
5270
+ pn as resolvePoolId,
5267
5271
  Ys as resolvePrivateKey,
5268
5272
  ye as resolveRewardAddress,
5269
- pn as resolveScriptRef,
5270
- In as resolveSlotNo,
5273
+ In as resolveScriptRef,
5274
+ _n as resolveSlotNo,
5271
5275
  re as resolveStakeKeyHash,
5272
5276
  qr as resolveTxFees,
5273
5277
  $s as resolveTxHash
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Rapidly build Web3 apps on the Cardano Blockchain.",
4
4
  "homepage": "https://meshjs.dev",
5
5
  "author": "MeshJS",
6
- "version": "1.5.18",
6
+ "version": "1.5.19",
7
7
  "license": "Apache-2.0",
8
8
  "type": "module",
9
9
  "repository": {