@meshsdk/core 1.5.24 → 1.5.25

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.
Files changed (40) hide show
  1. package/dist/common/contracts/initiator.d.ts +1 -1
  2. package/dist/common/contracts/signer.d.ts +1 -1
  3. package/dist/common/decorators.d.ts +0 -3
  4. package/dist/common/types/Account.d.ts +1 -1
  5. package/dist/common/types/AccountInfo.d.ts +1 -1
  6. package/dist/common/types/Action.d.ts +2 -2
  7. package/dist/common/types/Asset.d.ts +3 -3
  8. package/dist/common/types/AssetExtended.d.ts +1 -1
  9. package/dist/common/types/AssetMetadata.d.ts +7 -7
  10. package/dist/common/types/BlockInfo.d.ts +1 -1
  11. package/dist/common/types/Data.d.ts +1 -1
  12. package/dist/common/types/DataSignature.d.ts +1 -1
  13. package/dist/common/types/Era.d.ts +1 -1
  14. package/dist/common/types/Mint.d.ts +1 -1
  15. package/dist/common/types/NativeScript.d.ts +1 -1
  16. package/dist/common/types/Network.d.ts +1 -1
  17. package/dist/common/types/PlutusScript.d.ts +2 -2
  18. package/dist/common/types/PoolParams.d.ts +2 -2
  19. package/dist/common/types/Protocol.d.ts +1 -1
  20. package/dist/common/types/Recipient.d.ts +1 -1
  21. package/dist/common/types/Relay.d.ts +1 -1
  22. package/dist/common/types/Token.d.ts +1 -1
  23. package/dist/common/types/TransactionInfo.d.ts +1 -1
  24. package/dist/common/types/UTxO.d.ts +1 -1
  25. package/dist/common/types/Wallet.d.ts +1 -1
  26. package/dist/core/CIP25.d.ts +2 -2
  27. package/dist/core/CIP27.d.ts +1 -1
  28. package/dist/core/CIP8.d.ts +2 -2
  29. package/dist/core/CSL.d.ts +145 -145
  30. package/dist/core.cjs +6 -6
  31. package/dist/core.js +1216 -554
  32. package/dist/providers/infura.provider.d.ts +1 -1
  33. package/dist/providers/maestro.provider.d.ts +1 -1
  34. package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +1 -1
  35. package/dist/transaction/meshTxBuilder/type.d.ts +19 -19
  36. package/dist/transaction/transaction.service.d.ts +1 -1
  37. package/dist/wallet/app.service.d.ts +11 -11
  38. package/dist/wallet/browser.service.d.ts +4 -4
  39. package/dist/wallet/mesh.service.d.ts +17 -12
  40. package/package.json +15 -26
package/dist/core.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { customAlphabet as xr } from "nanoid";
2
2
  import * as a from "@emurgo/cardano-serialization-lib-nodejs";
3
3
  import Mt from "axios";
4
- import { mnemonicToEntropy as wr, generateMnemonic as $r } from "bip39";
5
- import { COSEKey as Cr, COSESign1 as zr, Label as Pt, Int as ge, BigNum as ke, KeyType as Wr, AlgorithmId as Br, CBORValue as Te, HeaderMap as Je, Headers as Jr, ProtectedHeaderMap as jr, COSESign1Builder as Xr } from "@emurgo/cardano-message-signing-nodejs";
6
- const on = (s) => {
4
+ import { mnemonicToEntropy as wr, generateMnemonic as Wr } from "bip39";
5
+ import { COSEKey as Cr, COSESign1 as Jr, Label as Pt, Int as de, BigNum as Te, KeyType as jr, AlgorithmId as Br, CBORValue as Ne, HeaderMap as Je, Headers as Xr, ProtectedHeaderMap as Zr, COSESign1Builder as ts } from "@emurgo/cardano-message-signing-nodejs";
6
+ const mn = (s) => {
7
7
  const e = [];
8
8
  return s.forEach((t) => {
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
- }, Zr = ["testnet", "preview", "preprod", "mainnet"], ts = (s) => Zr.includes(s), Yt = {
12
+ }, es = ["testnet", "preview", "preprod", "mainnet"], rs = (s) => es.includes(s), Yt = {
13
13
  mem: 7e6,
14
14
  steps: 3e9
15
15
  }, At = {
@@ -36,12 +36,12 @@ const on = (s) => {
36
36
  }, ve = 2147483648, vt = {
37
37
  V1: a.Language.new_plutus_v1(),
38
38
  V2: a.Language.new_plutus_v2()
39
- }, ht = 56, es = {
39
+ }, ht = 56, ss = {
40
40
  CERT: a.RedeemerTag.new_cert(),
41
41
  MINT: a.RedeemerTag.new_mint(),
42
42
  REWARD: a.RedeemerTag.new_reward(),
43
43
  SPEND: a.RedeemerTag.new_spend()
44
- }, Ie = {
44
+ }, Ae = {
45
45
  testnet: ["74", "1598400", "1595967616", "432000"],
46
46
  preview: ["183", "15811222", "1682467200", "86400"],
47
47
  preprod: ["65", "26438400", "1682121600", "432000"],
@@ -397,7 +397,7 @@ const on = (s) => {
397
397
  "verifySchnorrSecp256k1Signature-memory-arguments": 10
398
398
  }).forEach((r, n) => t.set(n, a.Int.new_i32(r))), s.insert(a.Language.new_plutus_v1(), e), s.insert(a.Language.new_plutus_v2(), t), s;
399
399
  })()
400
- }, rs = {
400
+ }, ns = {
401
401
  ALONZO: {
402
402
  V1: "a141005901d59f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f704001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff"
403
403
  },
@@ -405,15 +405,15 @@ const on = (s) => {
405
405
  V1: "a141005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff",
406
406
  V2: "a20198af1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201b00000004a817c8001b00000004a817c8001a009063b91903fd0a1b00000004a817c800001b00000004a817c80041005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff"
407
407
  }
408
- }, Fe = {
408
+ }, Re = {
409
409
  [a.NetworkInfo.testnet().network_id()]: "8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3",
410
410
  [a.NetworkInfo.mainnet().network_id()]: "f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"
411
- }, ss = {
411
+ }, is = {
412
412
  mainnet: "wss://ogmios-api.mainnet.dandelion.link",
413
413
  preprod: "wss://ogmios-api.iohk-preprod.dandelion.link",
414
414
  preview: "__TBD_SOON_TM__",
415
415
  testnet: "wss://ogmios-api.testnet.dandelion.link"
416
- }, ns = {
416
+ }, as = {
417
417
  LQ: "da8c30857834c6ae7203935b89278c532b3995245295456f993e1d244c51",
418
418
  MIN: "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e",
419
419
  NTX: "edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458",
@@ -453,48 +453,48 @@ const on = (s) => {
453
453
  "typhoncip30",
454
454
  "vespr",
455
455
  "yoroi"
456
- ], is = (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((p) => p.unit !== "lovelace").some((p) => s.has(p.unit))), i = us(n);
456
+ ], os = (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((p) => p.unit !== "lovelace").some((p) => s.has(p.unit))), i = hs(n);
458
458
  return [
459
- ...i.less_than(r) ? ls(r.clamped_sub(i).to_str(), e.filter((l) => !n.some((p) => p.input.txHash === l.input.txHash && p.input.outputIndex === l.input.outputIndex))) : [],
459
+ ...i.less_than(r) ? ds(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 } = At) => {
463
- const c = e.filter((b) => Sr(b) === !1).sort(Re), l = a.BigNum.from_str(Vr(r, n, i)), p = t ? a.BigNum.from_str(s).checked_add(l).to_str() : s;
464
- return ie(c, /* @__PURE__ */ new Map([
462
+ }, pn = (s, e, t = !1, { maxTxSize: r, minFeeA: n, minFeeB: i } = At) => {
463
+ const c = e.filter((E) => Sr(E) === !1).sort(qe), l = a.BigNum.from_str(Vr(r, n, i)), p = t ? a.BigNum.from_str(s).checked_add(l).to_str() : s;
464
+ return se(c, /* @__PURE__ */ new Map([
465
465
  ["lovelace", p]
466
466
  ]));
467
- }, as = (s, e, t = !1, r = At) => {
468
- const n = e.filter(Sr).sort(Re), i = cs(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), ie(n, s);
470
- }, os = (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) => {
467
+ }, cs = (s, e, t = !1, r = At) => {
468
+ const n = e.filter(Sr).sort(qe), i = ls(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), se(n, s);
470
+ }, us = (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);
473
- }, a.BigNum.from_str("0")).less_than(t.quantity) === !1), Re = (s, e) => {
473
+ }, a.BigNum.from_str("0")).less_than(t.quantity) === !1), qe = (s, e) => {
474
474
  var n, i;
475
475
  const t = a.BigNum.from_str(((n = s.output.amount.find((c) => c.unit === "lovelace")) == null ? void 0 : n.quantity) ?? "0");
476
476
  return a.BigNum.from_str(((i = e.output.amount.find((c) => c.unit === "lovelace")) == null ? void 0 : i.quantity) ?? "0").compare(t);
477
- }, cs = (s) => {
477
+ }, ls = (s) => {
478
478
  const { maxTxSize: e, minFeeA: t, minFeeB: r } = s;
479
479
  return a.BigNum.from_str(Vr(e, t, r));
480
- }, Sr = (s) => s.output.amount.length > 1, us = (s) => s.reduce((e, t) => {
480
+ }, Sr = (s) => s.output.amount.length > 1, hs = (s) => s.reduce((e, t) => {
481
481
  var n;
482
482
  const r = ((n = t.output.amount.find((i) => i.unit === "lovelace")) == null ? void 0 : n.quantity) ?? "0";
483
483
  return e.checked_add(a.BigNum.from_str(r));
484
- }, a.BigNum.from_str("0")), ls = (s, e) => {
485
- const t = e.sort(Re);
486
- return ie(t, /* @__PURE__ */ new Map([
484
+ }, a.BigNum.from_str("0")), ds = (s, e) => {
485
+ const t = e.sort(qe);
486
+ return se(t, /* @__PURE__ */ new Map([
487
487
  ["lovelace", s]
488
488
  ]));
489
- }, ie = (s, e, t = []) => s.length === 0 || os(t, e) ? t : hs(s[0], e) ? ie(s.slice(1), e, [...t, s[0]]) : ie(s.slice(1), e, t), hs = (s, e) => Array.from(e.keys()).some((t) => s.output.amount.find((r) => r.unit === t) !== void 0), ds = (s, e) => {
490
- const t = gs(e), r = ms(s, e);
489
+ }, se = (s, e, t = []) => s.length === 0 || us(t, e) ? t : fs(s[0], e) ? se(s.slice(1), e, [...t, s[0]]) : se(s.slice(1), e, t), fs = (s, e) => Array.from(e.keys()).some((t) => s.output.amount.find((r) => r.unit === t) !== void 0), gs = (s, e) => {
490
+ const t = ps(e), r = As(s, e);
491
491
  return {
492
492
  coseKey: lt(t.to_bytes()),
493
493
  coseSign1: lt(r.to_bytes())
494
494
  };
495
- }, un = (s, e, { key: t, signature: r }) => {
495
+ }, An = (s, e, { key: t, signature: r }) => {
496
496
  var c, l;
497
- const n = Cr.from_bytes(G(t)), i = zr.from_bytes(G(r));
497
+ const n = Cr.from_bytes(G(t)), i = Jr.from_bytes(G(r));
498
498
  if ((s == null ? void 0 : s.length) > 0) {
499
499
  const p = lt(i.payload() ?? new Uint8Array());
500
500
  if (dt(s) !== p)
@@ -504,48 +504,52 @@ 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(ge.new_negative(ke.from_str("2"))))) == null ? void 0 : l.as_bytes();
508
- if (B === void 0)
507
+ const C = (l = n.header(Pt.new_int(de.new_negative(Te.from_str("2"))))) == null ? void 0 : l.as_bytes();
508
+ if (C === void 0)
509
509
  throw new Error("Couldn't find a signer key in signature");
510
- const b = Gt(lt(y)), w = Rs(lt(B));
511
- if (fs(e, b, w) === !1)
510
+ const E = Gt(lt(y)), w = $s(lt(C));
511
+ if (ms(e, E, w) === !1)
512
512
  throw new Error("Couldn't check signature because of address mismatch");
513
- const v = Fs(lt(i.signature())), U = i.signed_data().to_bytes();
513
+ const v = Ys(lt(i.signature())), U = i.signed_data().to_bytes();
514
514
  return w.verify(U, v);
515
515
  }
516
516
  return !1;
517
- }, fs = (s, e, t) => {
517
+ }, ms = (s, e, t) => {
518
518
  if (s !== e.to_bech32())
519
519
  return !1;
520
520
  try {
521
- return se(s) === t.hash().to_hex();
521
+ return re(s) === t.hash().to_hex();
522
522
  } catch {
523
523
  return !1;
524
524
  }
525
- }, gs = (s) => {
526
- const e = Cr.new(Pt.from_key_type(Wr.OKP));
527
- return e.set_algorithm_id(Pt.from_algorithm_id(Br.EdDSA)), e.set_header(Pt.new_int(ge.new_negative(ke.from_str("1"))), Te.new_int(ge.new_i32(6))), e.set_header(Pt.new_int(ge.new_negative(ke.from_str("2"))), Te.new_bytes(s.key.to_public().as_bytes())), e;
528
- }, ms = (s, e) => {
525
+ }, ps = (s) => {
526
+ const e = Cr.new(Pt.from_key_type(jr.OKP));
527
+ return e.set_algorithm_id(Pt.from_algorithm_id(Br.EdDSA)), e.set_header(Pt.new_int(de.new_negative(Te.from_str("1"))), Ne.new_int(de.new_i32(6))), e.set_header(Pt.new_int(de.new_negative(Te.from_str("2"))), Ne.new_bytes(s.key.to_public().as_bytes())), e;
528
+ }, As = (s, e) => {
529
529
  const t = Je.new(), r = Je.new();
530
- t.set_algorithm_id(Pt.from_algorithm_id(Br.EdDSA)), t.set_header(Pt.new_text("address"), Te.new_bytes(e.address.to_bytes()));
531
- const n = Jr.new(jr.new(t), r), i = Xr.new(n, G(s.payload), !1);
530
+ t.set_algorithm_id(Pt.from_algorithm_id(Br.EdDSA)), t.set_header(Pt.new_text("address"), Ne.new_bytes(e.address.to_bytes()));
531
+ const n = Xr.new(Zr.new(t), r), i = ts.new(n, G(s.payload), !1);
532
532
  s.externalAAD !== void 0 && i.set_external_aad(G(s.externalAAD));
533
533
  const c = i.make_data_to_sign(), l = e.key.sign(c.to_bytes());
534
534
  return i.build(l.to_bytes());
535
535
  };
536
- var Ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Er = {}, ot = { exports: {} };
537
- Dt.notEqual = As;
538
- Dt.notOk = Is;
539
- Dt.equal = ps;
536
+ var Ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
537
+ function Is(s) {
538
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
539
+ }
540
+ var Er = {}, ot = { exports: {} };
541
+ Dt.notEqual = ys;
542
+ Dt.notOk = xs;
543
+ Dt.equal = _s;
540
544
  Dt.ok = Dt;
541
545
  var br = Dt;
542
- function ps(s, e, t) {
546
+ function _s(s, e, t) {
543
547
  Dt(s == e, t);
544
548
  }
545
- function As(s, e, t) {
549
+ function ys(s, e, t) {
546
550
  Dt(s != e, t);
547
551
  }
548
- function Is(s, e) {
552
+ function xs(s, e) {
549
553
  Dt(!s, e);
550
554
  }
551
555
  function Dt(s, e) {
@@ -553,15 +557,15 @@ function Dt(s, e) {
553
557
  throw new Error(e || "AssertionError");
554
558
  }
555
559
  var Et = { exports: {} };
556
- function _s(s) {
560
+ function ws(s) {
557
561
  throw new Error('Could not dynamically require "' + s + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
558
562
  }
559
- var ys = qe;
560
- qe.supported = typeof WebAssembly < "u";
561
- function qe(s) {
562
- if (!qe.supported)
563
+ var Cs = Ve;
564
+ Ve.supported = typeof WebAssembly < "u";
565
+ function Ve(s) {
566
+ if (!Ve.supported)
563
567
  return null;
564
- var e = s && s.imports, t = xs("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCS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00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIR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ICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL"), r = null, n = {
565
569
  buffer: t,
566
570
  memory: null,
567
571
  exports: null,
@@ -593,13 +597,13 @@ function qe(s) {
593
597
  n.exports = p.instance.exports, n.memory = n.exports.memory && n.exports.memory.buffer && new Uint8Array(n.exports.memory.buffer);
594
598
  }
595
599
  }
596
- function xs(s) {
597
- return typeof atob == "function" ? new Uint8Array(atob(s).split("").map(ws)) : new (_s("buffer")).Buffer(s, "base64");
600
+ function Bs(s) {
601
+ return typeof atob == "function" ? new Uint8Array(atob(s).split("").map(Ss)) : new (ws("buffer")).Buffer(s, "base64");
598
602
  }
599
- function ws(s) {
603
+ function Ss(s) {
600
604
  return s.charCodeAt(0);
601
605
  }
602
- var wt = br, W = ys(), Qt = 64, me = [];
606
+ var wt = br, W = Cs(), Qt = 64, fe = [];
603
607
  Et.exports = It;
604
608
  var Ze = Et.exports.BYTES_MIN = 16, tr = Et.exports.BYTES_MAX = 64;
605
609
  Et.exports.BYTES = 32;
@@ -611,16 +615,16 @@ function It(s, e, t, r, n) {
611
615
  return new It(s, e, t, r, n);
612
616
  if (!(W && W.exports))
613
617
  throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");
614
- s || (s = 32), n !== !0 && (wt(s >= Ze, "digestLength must be at least " + Ze + ", was given " + s), wt(s <= tr, "digestLength must be at most " + tr + ", was given " + s), e != null && wt(e.length >= er, "key must be at least " + er + ", was given " + e.length), e != null && wt(e.length <= rr, "key must be at least " + rr + ", was given " + e.length), t != null && wt(t.length === sr, "salt must be exactly " + sr + ", was given " + t.length), r != null && wt(r.length === nr, "personal must be exactly " + nr + ", 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);
618
+ s || (s = 32), n !== !0 && (wt(s >= Ze, "digestLength must be at least " + Ze + ", was given " + s), wt(s <= tr, "digestLength must be at most " + tr + ", was given " + s), e != null && wt(e.length >= er, "key must be at least " + er + ", was given " + e.length), e != null && wt(e.length <= rr, "key must be at least " + rr + ", was given " + e.length), t != null && wt(t.length === sr, "salt must be exactly " + sr + ", was given " + t.length), r != null && wt(r.length === nr, "personal must be exactly " + nr + ", was given " + r.length)), fe.length || (fe.push(Qt), Qt += 216), this.digestLength = s, this.finalized = !1, this.pointer = fe.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
619
  }
616
620
  It.prototype.update = function(s) {
617
621
  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
622
  };
619
623
  It.prototype.digest = function(s) {
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")
624
+ if (wt(this.finalized === !1, "Hash instance finalized"), this.finalized = !0, fe.push(this.pointer), W.exports.blake2b_final(this.pointer), !s || s === "binary")
621
625
  return W.memory.slice(this.pointer + 128, this.pointer + 128 + this.digestLength);
622
626
  if (s === "hex")
623
- return Bs(W.memory, this.pointer + 128, this.digestLength);
627
+ return bs(W.memory, this.pointer + 128, this.digestLength);
624
628
  wt(s.length >= this.digestLength, "input must be TypedArray or Buffer");
625
629
  for (var e = 0; e < this.digestLength; e++)
626
630
  s[e] = W.memory[this.pointer + 128 + e];
@@ -630,7 +634,7 @@ It.prototype.final = It.prototype.digest;
630
634
  It.WASM = W && W.buffer;
631
635
  It.SUPPORTED = typeof WebAssembly < "u";
632
636
  It.ready = function(s) {
633
- if (s || (s = Cs), !W)
637
+ if (s || (s = Es), !W)
634
638
  return s(new Error("WebAssembly not supported"));
635
639
  var e = new Promise(function(t, r) {
636
640
  W.onload(function(n) {
@@ -640,18 +644,18 @@ It.ready = function(s) {
640
644
  return e;
641
645
  };
642
646
  It.prototype.ready = It.ready;
643
- function Cs() {
647
+ function Es() {
644
648
  }
645
- function Bs(s, e, t) {
649
+ function bs(s, e, t) {
646
650
  for (var r = "", n = 0; n < t; n++)
647
- r += Ss(s[e + n]);
651
+ r += vs(s[e + n]);
648
652
  return r;
649
653
  }
650
- function Ss(s) {
654
+ function vs(s) {
651
655
  return s < 16 ? "0" + s.toString(16) : s.toString(16);
652
656
  }
653
- var Ut = br, ae = Et.exports;
654
- function ue(s, e, t) {
657
+ var Qs = Et.exports, Ut = br, ne = Qs;
658
+ function oe(s, e, t) {
655
659
  var r = s[e] + s[t], n = s[e + 1] + s[t + 1];
656
660
  r >= 4294967296 && n++, s[e] = r, s[e + 1] = n;
657
661
  }
@@ -665,10 +669,10 @@ function vr(s, e) {
665
669
  return s[e] ^ s[e + 1] << 8 ^ s[e + 2] << 16 ^ s[e + 3] << 24;
666
670
  }
667
671
  function Tt(s, e, t, r, n, i) {
668
- var c = re[n], l = re[n + 1], p = re[i], y = re[i + 1];
669
- ue(H, s, e), ir(H, s, c, l);
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), ir(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
+ var c = ee[n], l = ee[n + 1], p = ee[i], y = ee[i + 1];
673
+ oe(H, s, e), ir(H, s, c, l);
674
+ var C = H[r] ^ H[s], E = H[r + 1] ^ H[s + 1];
675
+ H[r] = E, H[r + 1] = C, oe(H, t, r), C = H[e] ^ H[t], E = H[e + 1] ^ H[t + 1], H[e] = C >>> 24 ^ E << 8, H[e + 1] = E >>> 24 ^ C << 8, oe(H, s, e), ir(H, s, p, y), C = H[r] ^ H[s], E = H[r + 1] ^ H[s + 1], H[r] = C >>> 16 ^ E << 16, H[r + 1] = E >>> 16 ^ C << 16, oe(H, t, r), C = H[e] ^ H[t], E = H[e + 1] ^ H[t + 1], H[e] = E >>> 31 ^ C << 1, H[e + 1] = C >>> 31 ^ E << 1;
672
676
  }
673
677
  var Qr = new Uint32Array([
674
678
  4089235720,
@@ -687,7 +691,7 @@ var Qr = new Uint32Array([
687
691
  528734635,
688
692
  327033209,
689
693
  1541459225
690
- ]), Es = [
694
+ ]), Ds = [
691
695
  0,
692
696
  1,
693
697
  2,
@@ -880,15 +884,15 @@ var Qr = new Uint32Array([
880
884
  7,
881
885
  5,
882
886
  3
883
- ], it = new Uint8Array(Es.map(function(s) {
887
+ ], it = new Uint8Array(Ds.map(function(s) {
884
888
  return s * 2;
885
- })), H = new Uint32Array(32), re = new Uint32Array(32);
889
+ })), H = new Uint32Array(32), ee = new Uint32Array(32);
886
890
  function Dr(s, e) {
887
891
  var t = 0;
888
892
  for (t = 0; t < 16; t++)
889
893
  H[t] = s.h[t], H[t + 16] = Qr[t];
890
894
  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] = vr(s.b, 4 * t);
895
+ ee[t] = vr(s.b, 4 * t);
892
896
  for (t = 0; t < 12; t++)
893
897
  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
898
  for (t = 0; t < 16; t++)
@@ -899,83 +903,99 @@ var Nt = new Uint8Array([
899
903
  0,
900
904
  0,
901
905
  0,
906
+ // 0: outlen, keylen, fanout, depth
902
907
  0,
903
908
  0,
904
909
  0,
905
910
  0,
911
+ // 4: leaf length, sequential mode
906
912
  0,
907
913
  0,
908
914
  0,
909
915
  0,
916
+ // 8: node offset
910
917
  0,
911
918
  0,
912
919
  0,
913
920
  0,
921
+ // 12: node offset
914
922
  0,
915
923
  0,
916
924
  0,
917
925
  0,
926
+ // 16: node depth, inner length, rfu
918
927
  0,
919
928
  0,
920
929
  0,
921
930
  0,
931
+ // 20: rfu
922
932
  0,
923
933
  0,
924
934
  0,
925
935
  0,
936
+ // 24: rfu
926
937
  0,
927
938
  0,
928
939
  0,
929
940
  0,
941
+ // 28: rfu
930
942
  0,
931
943
  0,
932
944
  0,
933
945
  0,
946
+ // 32: salt
934
947
  0,
935
948
  0,
936
949
  0,
937
950
  0,
951
+ // 36: salt
938
952
  0,
939
953
  0,
940
954
  0,
941
955
  0,
956
+ // 40: salt
942
957
  0,
943
958
  0,
944
959
  0,
945
960
  0,
961
+ // 44: salt
946
962
  0,
947
963
  0,
948
964
  0,
949
965
  0,
966
+ // 48: personal
950
967
  0,
951
968
  0,
952
969
  0,
953
970
  0,
971
+ // 52: personal
954
972
  0,
955
973
  0,
956
974
  0,
957
975
  0,
976
+ // 56: personal
958
977
  0,
959
978
  0,
960
979
  0,
961
980
  0
981
+ // 60: personal
962
982
  ]);
963
- function Jt(s, e, t, r) {
983
+ function Wt(s, e, t, r) {
964
984
  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
985
  for (var n = 0; n < 16; n++)
966
986
  this.h[n] = Qr[n] ^ vr(Nt, n * 4);
967
987
  e && (kr(this, e), this.c = 128);
968
988
  }
969
- Jt.prototype.update = function(s) {
989
+ Wt.prototype.update = function(s) {
970
990
  return Ut(s != null, "input must be Uint8Array or Buffer"), kr(this, s), this;
971
991
  };
972
- Jt.prototype.digest = function(s) {
992
+ Wt.prototype.digest = function(s) {
973
993
  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"), bs(this, e), s === "hex" ? vs(e) : e;
994
+ return Ut(e.length >= this.outlen, "out must have at least outlen bytes of space"), ks(this, e), s === "hex" ? Ts(e) : e;
975
995
  };
976
- Jt.prototype.final = Jt.prototype.digest;
977
- Jt.ready = function(s) {
978
- ae.ready(function() {
996
+ Wt.prototype.final = Wt.prototype.digest;
997
+ Wt.ready = function(s) {
998
+ ne.ready(function() {
979
999
  s();
980
1000
  });
981
1001
  };
@@ -983,7 +1003,7 @@ function kr(s, e) {
983
1003
  for (var t = 0; t < e.length; t++)
984
1004
  s.c === 128 && (s.t += s.c, Dr(s, !1), s.c = 0), s.b[s.c++] = e[t];
985
1005
  }
986
- function bs(s, e) {
1006
+ function ks(s, e) {
987
1007
  for (s.t += s.c; s.c < 128; )
988
1008
  s.b[s.c++] = 0;
989
1009
  Dr(s, !0);
@@ -991,39 +1011,39 @@ function bs(s, e) {
991
1011
  e[t] = s.h[t >> 2] >> 8 * (t & 3);
992
1012
  return e;
993
1013
  }
994
- function vs(s) {
1014
+ function Ts(s) {
995
1015
  for (var e = "", t = 0; t < s.length; t++)
996
- e += Qs(s[t]);
1016
+ e += Ns(s[t]);
997
1017
  return e;
998
1018
  }
999
- function Qs(s) {
1019
+ function Ns(s) {
1000
1020
  return s < 16 ? "0" + s.toString(16) : s.toString(16);
1001
1021
  }
1002
- var Tr = Jt;
1022
+ var Tr = Wt;
1003
1023
  ot.exports = function(e, t, r, n, i) {
1004
1024
  return i !== !0 && (Ut(e >= ar, "outlen must be at least " + ar + ", was given " + e), Ut(e <= or, "outlen must be at most " + or + ", was given " + e), t != null && Ut(t.length >= cr, "key must be at least " + cr + ", was given " + t.length), t != null && Ut(t.length <= ur, "key must be at most " + ur + ", was given " + t.length), r != null && Ut(r.length === lr, "salt must be exactly " + lr + ", was given " + r.length), n != null && Ut(n.length === hr, "personal must be exactly " + hr + ", was given " + n.length)), new Tr(e, t, r, n);
1005
1025
  };
1006
1026
  ot.exports.ready = function(s) {
1007
- ae.ready(function() {
1027
+ ne.ready(function() {
1008
1028
  s();
1009
1029
  });
1010
1030
  };
1011
- ot.exports.WASM_SUPPORTED = ae.SUPPORTED;
1031
+ ot.exports.WASM_SUPPORTED = ne.SUPPORTED;
1012
1032
  ot.exports.WASM_LOADED = !1;
1013
1033
  var ar = ot.exports.BYTES_MIN = 16, or = ot.exports.BYTES_MAX = 64;
1014
1034
  ot.exports.BYTES = 32;
1015
1035
  var cr = ot.exports.KEYBYTES_MIN = 16, ur = ot.exports.KEYBYTES_MAX = 64;
1016
1036
  ot.exports.KEYBYTES = 32;
1017
1037
  var lr = ot.exports.SALTBYTES = 16, hr = ot.exports.PERSONALBYTES = 16;
1018
- ae.ready(function(s) {
1019
- s || (ot.exports.WASM_LOADED = !0, Tr = ae);
1038
+ ne.ready(function(s) {
1039
+ s || (ot.exports.WASM_LOADED = !0, Tr = ne);
1020
1040
  });
1021
- var jt = {};
1022
- Object.defineProperty(jt, "__esModule", { value: !0 });
1023
- jt.bech32m = jt.bech32 = void 0;
1024
- const _e = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", Nr = {};
1025
- for (let s = 0; s < _e.length; s++) {
1026
- const e = _e.charAt(s);
1041
+ var Us = ot.exports, Jt = {};
1042
+ Object.defineProperty(Jt, "__esModule", { value: !0 });
1043
+ Jt.bech32m = Jt.bech32 = void 0;
1044
+ const Ie = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", Nr = {};
1045
+ for (let s = 0; s < Ie.length; s++) {
1046
+ const e = Ie.charAt(s);
1027
1047
  Nr[e] = s;
1028
1048
  }
1029
1049
  function zt(s) {
@@ -1045,7 +1065,7 @@ function dr(s) {
1045
1065
  }
1046
1066
  return e;
1047
1067
  }
1048
- function Ve(s, e, t, r) {
1068
+ function Le(s, e, t, r) {
1049
1069
  let n = 0, i = 0;
1050
1070
  const c = (1 << t) - 1, l = [];
1051
1071
  for (let p = 0; p < s.length; ++p)
@@ -1061,16 +1081,16 @@ function Ve(s, e, t, r) {
1061
1081
  }
1062
1082
  return l;
1063
1083
  }
1064
- function Ds(s) {
1065
- return Ve(s, 8, 5, !0);
1084
+ function Ps(s) {
1085
+ return Le(s, 8, 5, !0);
1066
1086
  }
1067
- function ks(s) {
1068
- const e = Ve(s, 5, 8, !1);
1087
+ function Os(s) {
1088
+ const e = Le(s, 5, 8, !1);
1069
1089
  if (Array.isArray(e))
1070
1090
  return e;
1071
1091
  }
1072
- function Ts(s) {
1073
- const e = Ve(s, 5, 8, !1);
1092
+ function Ms(s) {
1093
+ const e = Le(s, 5, 8, !1);
1074
1094
  if (Array.isArray(e))
1075
1095
  return e;
1076
1096
  throw new Error(e);
@@ -1085,21 +1105,21 @@ function Ur(s) {
1085
1105
  let y = dr(c);
1086
1106
  if (typeof y == "string")
1087
1107
  throw new Error(y);
1088
- let B = c + "1";
1089
- for (let b = 0; b < l.length; ++b) {
1090
- const w = l[b];
1091
- if (w >> 5 !== 0)
1108
+ let C = c + "1";
1109
+ for (let E = 0; E < l.length; ++E) {
1110
+ const w = l[E];
1111
+ if (w >> 5)
1092
1112
  throw new Error("Non 5-bit word");
1093
- y = zt(y) ^ w, B += _e.charAt(w);
1113
+ y = zt(y) ^ w, C += Ie.charAt(w);
1094
1114
  }
1095
- for (let b = 0; b < 6; ++b)
1115
+ for (let E = 0; E < 6; ++E)
1096
1116
  y = zt(y);
1097
1117
  y ^= e;
1098
- for (let b = 0; b < 6; ++b) {
1099
- const w = y >> (5 - b) * 5 & 31;
1100
- B += _e.charAt(w);
1118
+ for (let E = 0; E < 6; ++E) {
1119
+ const w = y >> (5 - E) * 5 & 31;
1120
+ C += Ie.charAt(w);
1101
1121
  }
1102
- return B;
1122
+ return C;
1103
1123
  }
1104
1124
  function r(c, l) {
1105
1125
  if (l = l || 90, c.length < 8)
@@ -1110,15 +1130,15 @@ function Ur(s) {
1110
1130
  if (c !== p && c !== y)
1111
1131
  return "Mixed-case string " + c;
1112
1132
  c = p;
1113
- const B = c.lastIndexOf("1");
1114
- if (B === -1)
1133
+ const C = c.lastIndexOf("1");
1134
+ if (C === -1)
1115
1135
  return "No separator character for " + c;
1116
- if (B === 0)
1136
+ if (C === 0)
1117
1137
  return "Missing prefix for " + c;
1118
- const b = c.slice(0, B), w = c.slice(B + 1);
1138
+ const E = c.slice(0, C), w = c.slice(C + 1);
1119
1139
  if (w.length < 6)
1120
1140
  return "Data too short";
1121
- let v = dr(b);
1141
+ let v = dr(E);
1122
1142
  if (typeof v == "string")
1123
1143
  return v;
1124
1144
  const U = [];
@@ -1128,7 +1148,7 @@ function Ur(s) {
1128
1148
  return "Unknown character " + N;
1129
1149
  v = zt(v) ^ T, !(k + 6 >= w.length) && U.push(T);
1130
1150
  }
1131
- return v !== e ? "Invalid checksum for " + c : { prefix: b, words: U };
1151
+ return v !== e ? "Invalid checksum for " + c : { prefix: E, words: U };
1132
1152
  }
1133
1153
  function n(c, l) {
1134
1154
  const p = r(c, l);
@@ -1145,39 +1165,39 @@ function Ur(s) {
1145
1165
  decodeUnsafe: n,
1146
1166
  decode: i,
1147
1167
  encode: t,
1148
- toWords: Ds,
1149
- fromWordsUnsafe: ks,
1150
- fromWords: Ts
1168
+ toWords: Ps,
1169
+ fromWordsUnsafe: Os,
1170
+ fromWords: Ms
1151
1171
  };
1152
1172
  }
1153
- jt.bech32 = Ur("bech32");
1154
- jt.bech32m = Ur("bech32m");
1155
- var Ns = Ne && Ne.__importDefault || function(s) {
1173
+ Jt.bech32 = Ur("bech32");
1174
+ Jt.bech32m = Ur("bech32m");
1175
+ var Ks = Ue && Ue.__importDefault || function(s) {
1156
1176
  return s && s.__esModule ? s : { default: s };
1157
1177
  };
1158
1178
  Object.defineProperty(Er, "__esModule", { value: !0 });
1159
- const Us = Ns(ot.exports), le = jt, Qe = "asset";
1160
- class ne {
1179
+ const Hs = Ks(Us), ce = Jt, Qe = "asset";
1180
+ let Fs = class ge {
1161
1181
  constructor(e) {
1162
1182
  this.hashBuf = e;
1163
1183
  }
1164
1184
  static fromHash(e) {
1165
- return new ne(e);
1185
+ return new ge(e);
1166
1186
  }
1167
1187
  static fromParts(e, t) {
1168
- const r = (0, Us.default)(20).update(new Uint8Array([...e, ...t])).digest("binary");
1169
- return ne.fromHash(r);
1188
+ const r = (0, Hs.default)(20).update(new Uint8Array([...e, ...t])).digest("binary");
1189
+ return ge.fromHash(r);
1170
1190
  }
1171
1191
  static fromBech32(e) {
1172
- const { prefix: t, words: r } = le.bech32.decode(e);
1192
+ const { prefix: t, words: r } = ce.bech32.decode(e);
1173
1193
  if (t !== Qe)
1174
1194
  throw new Error("Invalid asset fingerprint");
1175
- const n = Buffer.from(le.bech32.fromWords(r));
1176
- return ne.fromHash(n);
1195
+ const n = Buffer.from(ce.bech32.fromWords(r));
1196
+ return ge.fromHash(n);
1177
1197
  }
1178
1198
  fingerprint() {
1179
- const e = le.bech32.toWords(this.hashBuf);
1180
- return le.bech32.encode(Qe, e);
1199
+ const e = ce.bech32.toWords(this.hashBuf);
1200
+ return ce.bech32.encode(Qe, e);
1181
1201
  }
1182
1202
  hash() {
1183
1203
  return Buffer.from(this.hashBuf).toString("hex");
@@ -1185,19 +1205,20 @@ class ne {
1185
1205
  prefix() {
1186
1206
  return Qe;
1187
1207
  }
1208
+ // The last six characters of the data part form a checksum and contain no information
1188
1209
  checksum() {
1189
1210
  return this.fingerprint().slice(-6);
1190
1211
  }
1191
- }
1192
- var Ps = Er.default = ne;
1193
- const Os = Ps, Ms = (s, e, t = 0) => {
1194
- const r = Ks(s), n = r.derive(ve + 1852).derive(ve + 1815).derive(ve + e), i = n.derive(0).derive(t).to_raw_key(), c = n.derive(2).derive(0).to_raw_key();
1212
+ };
1213
+ var Rs = Er.default = Fs;
1214
+ const qs = Rs, Vs = (s, e, t = 0) => {
1215
+ const r = Ls(s), n = r.derive(ve + 1852).derive(ve + 1815).derive(ve + e), i = n.derive(0).derive(t).to_raw_key(), c = n.derive(2).derive(0).to_raw_key();
1195
1216
  return n.free(), r.free(), { paymentKey: i, stakeKey: c };
1196
- }, Gt = (s) => a.Address.from_bytes(G(s)), Ks = (s) => a.Bip32PrivateKey.from_bytes(G(s)), Hs = (s) => a.DataHash.from_bytes(G(s)), Ct = (s) => a.Ed25519KeyHash.from_bytes(G(s)), Fs = (s) => a.Ed25519Signature.from_bytes(G(s)), Le = (s) => a.NativeScript.from_bytes(G(s)), Rs = (s) => a.PublicKey.from_bytes(G(s)), Pr = (s) => a.PlutusData.from_bytes(G(s)), Xt = (s, e) => a.PlutusScript.from_bytes_with_version(G(s), vt[e]), qs = (s) => a.ScriptRef.from_bytes(G(s)), Vs = (s) => a.ScriptHash.from_bytes(G(s)), pt = (s) => a.Transaction.from_bytes(G(s)), Ue = (s) => a.TransactionHash.from_bytes(G(s)), fr = (s) => a.TransactionUnspentOutput.from_bytes(G(s)), gr = (s) => a.TransactionWitnessSet.from_bytes(G(s)), Ls = (s) => a.Value.from_bytes(G(s)), yt = (s) => a.Address.from_bech32(s), Ge = (s) => a.BaseAddress.from_address(yt(s)), Or = (s) => a.EnterpriseAddress.from_address(yt(s)), Mr = (s) => a.RewardAddress.from_address(yt(s)), lt = (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"), Ye = (s) => {
1217
+ }, Gt = (s) => a.Address.from_bytes(G(s)), Ls = (s) => a.Bip32PrivateKey.from_bytes(G(s)), Gs = (s) => a.DataHash.from_bytes(G(s)), Ct = (s) => a.Ed25519KeyHash.from_bytes(G(s)), Ys = (s) => a.Ed25519Signature.from_bytes(G(s)), Ge = (s) => a.NativeScript.from_bytes(G(s)), $s = (s) => a.PublicKey.from_bytes(G(s)), Pr = (s) => a.PlutusData.from_bytes(G(s)), jt = (s, e) => a.PlutusScript.from_bytes_with_version(G(s), vt[e]), zs = (s) => a.ScriptRef.from_bytes(G(s)), Ws = (s) => a.ScriptHash.from_bytes(G(s)), pt = (s) => a.Transaction.from_bytes(G(s)), Pe = (s) => a.TransactionHash.from_bytes(G(s)), fr = (s) => a.TransactionUnspentOutput.from_bytes(G(s)), gr = (s) => a.TransactionWitnessSet.from_bytes(G(s)), Js = (s) => a.Value.from_bytes(G(s)), yt = (s) => a.Address.from_bech32(s), Ye = (s) => a.BaseAddress.from_address(yt(s)), Or = (s) => a.EnterpriseAddress.from_address(yt(s)), Mr = (s) => a.RewardAddress.from_address(yt(s)), lt = (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"), $e = (s) => {
1197
1218
  const e = (t) => {
1198
1219
  const r = new Array();
1199
1220
  for (let n = 0; n < t.len(); n += 1)
1200
- r.push(Ye(t.get(n)));
1221
+ r.push($e(t.get(n)));
1201
1222
  return r;
1202
1223
  };
1203
1224
  switch (s.kind()) {
@@ -1262,18 +1283,18 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1262
1283
  case "sig":
1263
1284
  return a.NativeScript.new_script_pubkey(a.ScriptPubkey.new(Ct(s.keyHash)));
1264
1285
  }
1265
- }, pe = (s) => {
1286
+ }, me = (s) => {
1266
1287
  var r, n, i;
1267
1288
  const e = (c) => {
1268
1289
  const l = [];
1269
1290
  for (let p = 0; p < c.len(); p += 1)
1270
- l.push(pe(c.get(p)));
1291
+ l.push(me(c.get(p)));
1271
1292
  return l;
1272
1293
  }, t = (c) => {
1273
1294
  const l = /* @__PURE__ */ new Map();
1274
1295
  for (let p = 0; p < c.len(); p += 1) {
1275
- const y = c.keys().get(p), B = c.get(y) ?? a.PlutusData.from_hex(dt("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));
1276
- l.set(pe(y), pe(B));
1296
+ const y = c.keys().get(p), C = c.get(y) ?? a.PlutusData.from_hex(dt("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));
1297
+ l.set(me(y), me(C));
1277
1298
  }
1278
1299
  return l;
1279
1300
  };
@@ -1320,13 +1341,13 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1320
1341
  } else
1321
1342
  return a.PlutusData.new_constr_plutus_data(a.ConstrPlutusData.new(a.BigNum.from_str(s.alternative.toString()), e(s.fields)));
1322
1343
  }
1323
- }, Gs = (s) => {
1344
+ }, js = (s) => {
1324
1345
  const e = a.Relays.new();
1325
1346
  throw s.relays.forEach((t) => {
1326
1347
  e.add(Kr(t));
1327
1348
  }), new Error("toPoolParams not implemented.");
1328
- }, Pe = (s) => {
1329
- const e = (t) => es[t];
1349
+ }, Oe = (s) => {
1350
+ const e = (t) => ss[t];
1330
1351
  return a.Redeemer.new(e(s.tag), a.BigNum.from_str(s.index.toString()), Ot(s.data), a.ExUnits.new(a.BigNum.from_str(s.budget.mem.toString()), a.BigNum.from_str(s.budget.steps.toString())));
1331
1352
  }, Kr = (s) => {
1332
1353
  switch (s.type) {
@@ -1348,14 +1369,14 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1348
1369
  };
1349
1370
  }
1350
1371
  const e = s.native_script();
1351
- return Ye(e);
1352
- }, Zt = (s) => {
1372
+ return $e(e);
1373
+ }, Xt = (s) => {
1353
1374
  if ("code" in s) {
1354
- const e = Xt(s.code, s.version);
1375
+ const e = jt(s.code, s.version);
1355
1376
  return a.ScriptRef.new_plutus_script(e);
1356
1377
  }
1357
1378
  return a.ScriptRef.new_native_script(Vt(s));
1358
- }, oe = (s) => {
1379
+ }, ie = (s) => {
1359
1380
  var n, i, c;
1360
1381
  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
1382
  return {
@@ -1372,12 +1393,12 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1372
1393
  }
1373
1394
  };
1374
1395
  }, mt = (s) => {
1375
- const e = a.TransactionInput.new(Ue(s.input.txHash), s.input.outputIndex), t = a.TransactionOutput.new(yt(s.output.address), Bt(s.output.amount));
1376
- return s.output.dataHash !== void 0 && t.set_data_hash(Hs(s.output.dataHash)), s.output.plutusData !== void 0 && t.set_plutus_data(Pr(s.output.plutusData)), s.output.scriptRef !== void 0 && t.set_script_ref(qs(s.output.scriptRef)), a.TransactionUnspentOutput.new(e, t);
1396
+ const e = a.TransactionInput.new(Pe(s.input.txHash), s.input.outputIndex), t = a.TransactionOutput.new(yt(s.output.address), Bt(s.output.amount));
1397
+ return s.output.dataHash !== void 0 && t.set_data_hash(Gs(s.output.dataHash)), s.output.plutusData !== void 0 && t.set_plutus_data(Pr(s.output.plutusData)), s.output.scriptRef !== void 0 && t.set_script_ref(zs(s.output.scriptRef)), a.TransactionUnspentOutput.new(e, t);
1377
1398
  }, mr = (s) => {
1378
1399
  const e = s.split(".")[1] ?? "0", t = `${parseInt(e, 10)}`, r = "1" + "0".repeat(e.length);
1379
1400
  return a.UnitInterval.new(a.BigNum.from_str(t), a.BigNum.from_str(r));
1380
- }, dt = (s) => s.length % 2 === 0 && /^[0-9A-F]*$/i.test(s) ? s : lt(Buffer.from(s, "utf-8")), $e = (s) => Buffer.from(s, "hex").toString("utf-8"), Fr = (s) => {
1401
+ }, dt = (s) => s.length % 2 === 0 && /^[0-9A-F]*$/i.test(s) ? s : lt(Buffer.from(s, "utf-8")), ze = (s) => Buffer.from(s, "hex").toString("utf-8"), Fr = (s) => {
1381
1402
  const e = [
1382
1403
  { unit: "lovelace", quantity: s.coin().to_str() }
1383
1404
  ], t = s.multiasset();
@@ -1388,8 +1409,8 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1388
1409
  if (c !== void 0) {
1389
1410
  const l = c.keys();
1390
1411
  for (let p = 0; p < l.len(); p += 1) {
1391
- const y = l.get(p), B = c.get(y) ?? a.BigNum.from_str("0"), b = i.to_hex() + lt(y.name());
1392
- e.push({ unit: b, quantity: B.to_str() });
1412
+ const y = l.get(p), C = c.get(y) ?? a.BigNum.from_str("0"), E = i.to_hex() + lt(y.name());
1413
+ e.push({ unit: E, quantity: C.to_str() });
1393
1414
  }
1394
1415
  }
1395
1416
  }
@@ -1401,11 +1422,11 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1401
1422
  const c = a.Assets.new();
1402
1423
  s.filter((l) => l.unit.slice(0, ht) === i).forEach((l) => {
1403
1424
  c.insert(a.AssetName.new(G(l.unit.slice(ht))), a.BigNum.from_str(l.quantity));
1404
- }), r.insert(Vs(i), c);
1425
+ }), r.insert(Ws(i), c);
1405
1426
  });
1406
1427
  const n = a.Value.new(a.BigNum.from_str(e ? e.quantity : "0"));
1407
1428
  return (s.length > 1 || !e) && n.set_multiasset(r), n;
1408
- }, pr = (s, e, t) => a.BaseAddress.new(s, a.StakeCredential.from_keyhash(e), a.StakeCredential.from_keyhash(t)), Rr = (s, e = "") => a.Bip32PrivateKey.from_bip39_entropy(G(s), G(dt(e))), Oe = (s) => a.DataCost.new_coins_per_byte(a.BigNum.from_str(s)), Ys = (s) => {
1429
+ }, pr = (s, e, t) => a.BaseAddress.new(s, a.StakeCredential.from_keyhash(e), a.StakeCredential.from_keyhash(t)), Rr = (s, e = "") => a.Bip32PrivateKey.from_bip39_entropy(G(s), G(dt(e))), Me = (s) => a.DataCost.new_coins_per_byte(a.BigNum.from_str(s)), Xs = (s) => {
1409
1430
  if (typeof s != "object" || !("input" in s))
1410
1431
  return a.DatumSource.new(Ot(s));
1411
1432
  const e = mt(s);
@@ -1414,12 +1435,12 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1414
1435
  throw new Error(`No inline datum found in UTxO: ${e.input().transaction_id().to_hex()}`);
1415
1436
  }, Ar = (s, e) => a.EnterpriseAddress.new(s, a.StakeCredential.from_keyhash(e)), Ir = (s, e) => {
1416
1437
  if (typeof s == "string")
1417
- return a.MintWitness.new_native_script(Le(s));
1438
+ return a.MintWitness.new_native_script(Ge(s));
1418
1439
  if (e === void 0)
1419
1440
  throw new Error("Minting with plutus requires a redeemer to be defined");
1420
1441
  if (e.tag !== "MINT")
1421
1442
  throw new Error("Minting redeemer's tag must be defined as 'MINT'");
1422
- return a.MintWitness.new_plutus_script(Ke(s), Pe({
1443
+ return a.MintWitness.new_plutus_script(He(s), Oe({
1423
1444
  tag: "MINT",
1424
1445
  index: 0,
1425
1446
  budget: Yt,
@@ -1429,22 +1450,22 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1429
1450
  },
1430
1451
  ...e
1431
1452
  }));
1432
- }, Me = (s, e) => a.RewardAddress.new(s, a.StakeCredential.from_keyhash(e)), Ke = (s) => {
1453
+ }, Ke = (s, e) => a.RewardAddress.new(s, a.StakeCredential.from_keyhash(e)), He = (s) => {
1433
1454
  if ("code" in s)
1434
- return a.PlutusScriptSource.new(Xt(s.code, s.version));
1455
+ return a.PlutusScriptSource.new(jt(s.code, s.version));
1435
1456
  const e = mt(s);
1436
1457
  if (e.output().has_script_ref()) {
1437
1458
  const t = e.output().script_ref();
1438
1459
  if (t.is_plutus_script()) {
1439
- const r = Hr(t), n = Xt(r.code, r.version).hash();
1460
+ const r = Hr(t), n = jt(r.code, r.version).hash();
1440
1461
  return a.PlutusScriptSource.new_ref_input_with_lang_ver(n, e.input(), vt[r.version]);
1441
1462
  }
1442
1463
  }
1443
1464
  throw new Error(`No plutus script reference found in UTxO: ${e.input().transaction_id().to_hex()}`);
1444
- }, he = (s) => {
1465
+ }, ue = (s) => {
1445
1466
  const e = a.ScriptPubkey.new(s);
1446
1467
  return a.NativeScript.new_script_pubkey(e);
1447
- }, Ae = (s = At) => {
1468
+ }, pe = (s = At) => {
1448
1469
  const e = a.TransactionBuilderConfigBuilder.new().coins_per_utxo_byte(a.BigNum.from_str(s.coinsPerUTxOSize)).ex_unit_prices(a.ExUnitPrices.new(mr(s.priceMem.toString()), mr(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
1470
  return a.TransactionBuilder.new(e);
1450
1471
  }, _r = (s) => {
@@ -1452,7 +1473,7 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1452
1473
  return s.map((t) => t instanceof a.TransactionUnspentOutput ? t : mt(t)).forEach((t) => {
1453
1474
  e.add_input(t.output().address(), t.input(), t.output().amount());
1454
1475
  }), e;
1455
- }, de = (s) => {
1476
+ }, le = (s) => {
1456
1477
  if (typeof s == "string")
1457
1478
  return a.TransactionOutputBuilder.new().with_address(yt(s));
1458
1479
  let e = a.TransactionOutputBuilder.new().with_address(yt(s.address));
@@ -1461,7 +1482,7 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1461
1482
  e = e.with_data_hash(a.hash_plutus_data(n)), r && (e = e.with_plutus_data(n));
1462
1483
  }
1463
1484
  if (s.script) {
1464
- const t = Zt(s.script);
1485
+ const t = Xt(s.script);
1465
1486
  e = e.with_script_ref(t);
1466
1487
  }
1467
1488
  return e;
@@ -1472,23 +1493,23 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1472
1493
  data: s.response.data,
1473
1494
  headers: s.response.headers,
1474
1495
  status: s.response.status
1475
- }) : s.request ? JSON.stringify(s.request) : s.message : JSON.stringify(s), ln = (s) => {
1496
+ }) : s.request ? JSON.stringify(s.request) : s.message : JSON.stringify(s), In = (s) => {
1476
1497
  const e = Ot(s);
1477
1498
  return a.hash_plutus_data(e).to_hex();
1478
- }, hn = (s, e = Date.now()) => {
1479
- if (Ie[s]) {
1480
- const [t, r, n, i] = Ie[s];
1499
+ }, _n = (s, e = Date.now()) => {
1500
+ if (Ae[s]) {
1501
+ const [t, r, n, i] = Ae[s];
1481
1502
  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
1503
  }
1483
1504
  throw new Error(`Couldn't resolve EpochNo for network: ${s}`);
1484
- }, qr = (s, e) => Os.fromParts(G(s), G(e)).fingerprint(), dn = (s, e) => rs[s][e], fn = (s, e = 0) => {
1505
+ }, qr = (s, e) => qs.fromParts(G(s), G(e)).fingerprint(), yn = (s, e) => ns[s][e], xn = (s, e = 0) => {
1485
1506
  const t = Vt(s);
1486
1507
  return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
1487
- }, gn = (s) => Vt(s).hash().to_hex(), mn = (s) => Vt(s).to_hex(), $t = (s) => {
1508
+ }, wn = (s) => Vt(s).hash().to_hex(), Cn = (s) => Vt(s).to_hex(), $t = (s) => {
1488
1509
  var e, t;
1489
1510
  try {
1490
1511
  const r = [
1491
- (e = Ge(s)) == null ? void 0 : e.payment_cred().to_keyhash(),
1512
+ (e = Ye(s)) == null ? void 0 : e.payment_cred().to_keyhash(),
1492
1513
  (t = Or(s)) == null ? void 0 : t.payment_cred().to_keyhash()
1493
1514
  ].find((n) => n !== void 0);
1494
1515
  if (r !== void 0)
@@ -1497,10 +1518,10 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1497
1518
  } catch (r) {
1498
1519
  throw new Error(`An error occurred during resolvePaymentKeyHash: ${r}.`);
1499
1520
  }
1500
- }, pn = (s, e = 0) => {
1501
- const t = Xt(s.code, s.version);
1521
+ }, Bn = (s, e = 0) => {
1522
+ const t = jt(s.code, s.version);
1502
1523
  return a.EnterpriseAddress.new(e, a.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32();
1503
- }, An = (s) => {
1524
+ }, Sn = (s) => {
1504
1525
  try {
1505
1526
  const e = Or(s), t = e == null ? void 0 : e.payment_cred().to_scripthash();
1506
1527
  if (t !== void 0)
@@ -1509,29 +1530,29 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1509
1530
  } catch (e) {
1510
1531
  throw new Error(`An error occurred during resolveScriptHash: ${e}.`);
1511
1532
  }
1512
- }, In = (s) => a.Ed25519KeyHash.from_hex(s).to_bech32("pool1"), $s = (s) => {
1533
+ }, En = (s) => a.Ed25519KeyHash.from_hex(s).to_bech32("pool1"), Zs = (s) => {
1513
1534
  const e = wr(s.join(" ")), t = Rr(e), r = t.to_bech32();
1514
1535
  return t.free(), r;
1515
- }, _n = (s) => Zt(s).to_hex(), yn = (s, e = Date.now()) => {
1516
- if (Ie[s]) {
1517
- const [t, r, n] = Ie[s];
1536
+ }, bn = (s) => Xt(s).to_hex(), vn = (s, e = Date.now()) => {
1537
+ if (Ae[s]) {
1538
+ const [t, r, n] = Ae[s];
1518
1539
  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();
1519
1540
  }
1520
1541
  throw new Error(`Couldn't resolve SlotNo for network: ${s}`);
1521
- }, xe = (s) => {
1542
+ }, ye = (s) => {
1522
1543
  try {
1523
- const e = yt(s), t = Ge(s), r = t == null ? void 0 : t.stake_cred().to_keyhash();
1544
+ const e = yt(s), t = Ye(s), r = t == null ? void 0 : t.stake_cred().to_keyhash();
1524
1545
  if (r !== void 0)
1525
- return Me(e.network_id(), r).to_address().to_bech32();
1546
+ return Ke(e.network_id(), r).to_address().to_bech32();
1526
1547
  throw new Error(`Couldn't resolve reward address from address: ${s}`);
1527
1548
  } catch (e) {
1528
1549
  throw new Error(`An error occurred during resolveRewardAddress: ${e}.`);
1529
1550
  }
1530
- }, se = (s) => {
1551
+ }, re = (s) => {
1531
1552
  var e, t;
1532
1553
  try {
1533
1554
  const r = [
1534
- (e = Ge(s)) == null ? void 0 : e.stake_cred().to_keyhash(),
1555
+ (e = Ye(s)) == null ? void 0 : e.stake_cred().to_keyhash(),
1535
1556
  (t = Mr(s)) == null ? void 0 : t.payment_cred().to_keyhash()
1536
1557
  ].find((n) => n !== void 0);
1537
1558
  if (r !== void 0)
@@ -1543,12 +1564,12 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1543
1564
  }, Vr = (s, e = At.minFeeA, t = At.minFeeB) => (BigInt(e) * BigInt(s) + BigInt(t)).toString(), yr = (s) => {
1544
1565
  const e = pt(s).body();
1545
1566
  return a.hash_transaction(e).to_hex();
1546
- }, xn = (s = "", e = 32) => {
1567
+ }, Qn = (s = "", e = 32) => {
1547
1568
  if (e <= 0 || e > 2048)
1548
1569
  throw new Error("Length must be bewteen 1 and 2048");
1549
1570
  const r = xr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(e);
1550
1571
  return dt(`${s}${r}`);
1551
- }, ye = (s, e) => {
1572
+ }, _e = (s, e) => {
1552
1573
  const t = s.vkeys();
1553
1574
  if (t !== void 0) {
1554
1575
  const r = /* @__PURE__ */ new Set();
@@ -1562,8 +1583,8 @@ const Os = Ps, Ms = (s, e, t = 0) => {
1562
1583
  }), n;
1563
1584
  }
1564
1585
  return e;
1565
- }, wn = (s) => pe(Pr(s)), Cn = (s) => pt(s).to_js_value();
1566
- class Bn {
1586
+ }, Dn = (s) => me(Pr(s)), kn = (s) => pt(s).to_js_value();
1587
+ class Tn {
1567
1588
  _axiosInstance;
1568
1589
  constructor(...e) {
1569
1590
  if (typeof e[0] == "string" && e[0].startsWith("http"))
@@ -1577,7 +1598,7 @@ class Bn {
1577
1598
  }
1578
1599
  }
1579
1600
  async fetchAccountInfo(e) {
1580
- const t = e.startsWith("addr") ? xe(e) : e;
1601
+ const t = e.startsWith("addr") ? ye(e) : e;
1581
1602
  try {
1582
1603
  const { data: r, status: n } = await this._axiosInstance.get(`accounts/${t}`);
1583
1604
  if (n === 200)
@@ -1601,7 +1622,7 @@ class Bn {
1601
1622
  code: await this.fetchPlutusScriptCBOR(e),
1602
1623
  version: t.type.replace("plutus", "")
1603
1624
  } : await this.fetchNativeScriptJSON(e);
1604
- return Zt(n).to_hex();
1625
+ return Xt(n).to_hex();
1605
1626
  }
1606
1627
  throw S(t);
1607
1628
  }
@@ -1626,7 +1647,7 @@ class Bn {
1626
1647
  if (y === 200)
1627
1648
  return p.length > 0 ? i(c + 1, [
1628
1649
  ...l,
1629
- ...await Promise.all(p.map((B) => this.toUTxO(B, B.tx_hash)))
1650
+ ...await Promise.all(p.map((C) => this.toUTxO(C, C.tx_hash)))
1630
1651
  ]) : l;
1631
1652
  throw S(p);
1632
1653
  };
@@ -1705,7 +1726,7 @@ class Bn {
1705
1726
  }
1706
1727
  async fetchHandleAddress(e) {
1707
1728
  try {
1708
- const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${Fe[1]}${t}/addresses`);
1729
+ const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${Re[1]}${t}/addresses`);
1709
1730
  if (n === 200)
1710
1731
  return r[0].address;
1711
1732
  throw S(r);
@@ -1815,7 +1836,7 @@ class Bn {
1815
1836
  throw S(t);
1816
1837
  }
1817
1838
  }
1818
- class Sn {
1839
+ class Nn {
1819
1840
  _axiosInstance;
1820
1841
  constructor(e, t, r) {
1821
1842
  const n = r.host ?? "ipfs.infura.io", i = r.port ?? 5001, c = r.version ?? 0;
@@ -1835,7 +1856,7 @@ class Sn {
1835
1856
  }
1836
1857
  }
1837
1858
  }
1838
- class En {
1859
+ class Un {
1839
1860
  _axiosInstance;
1840
1861
  constructor(...e) {
1841
1862
  if (typeof e[0] == "string" && e[0].startsWith("http"))
@@ -1858,7 +1879,7 @@ class En {
1858
1879
  }
1859
1880
  async fetchAccountInfo(e) {
1860
1881
  try {
1861
- const t = e.startsWith("addr") ? xe(e) : e, { data: r, status: n } = await this._axiosInstance.post("account_info", {
1882
+ const t = e.startsWith("addr") ? ye(e) : e, { data: r, status: n } = await this._axiosInstance.post("account_info", {
1862
1883
  _stake_addresses: [t]
1863
1884
  });
1864
1885
  if (n === 200)
@@ -1906,7 +1927,7 @@ class En {
1906
1927
  const { policyId: t, assetName: r } = Kt(e), { data: n, status: i } = await this._axiosInstance.get(`asset_info?_asset_policy=${t}&_asset_name=${r}`);
1907
1928
  if (i === 200)
1908
1929
  return {
1909
- ...n[0].minting_tx_metadata[721][t][$e(r)]
1930
+ ...n[0].minting_tx_metadata[721][t][ze(r)]
1910
1931
  };
1911
1932
  throw S(n);
1912
1933
  } catch (t) {
@@ -1959,7 +1980,7 @@ class En {
1959
1980
  }
1960
1981
  async fetchHandleAddress(e) {
1961
1982
  try {
1962
- const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`asset_address_list?_asset_policy=${Fe[1]}&_asset_name=${t}`);
1983
+ const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`asset_address_list?_asset_policy=${Re[1]}&_asset_name=${t}`);
1963
1984
  if (n === 200)
1964
1985
  return r[0].payment_address;
1965
1986
  throw S(r);
@@ -2085,15 +2106,15 @@ class En {
2085
2106
  const t = e.type.startsWith("plutus") ? {
2086
2107
  code: e.bytes,
2087
2108
  version: e.type.replace("plutus", "")
2088
- } : Ye(Le(e.bytes));
2089
- return Zt(t).to_hex();
2109
+ } : $e(Ge(e.bytes));
2110
+ return Xt(t).to_hex();
2090
2111
  }
2091
2112
  };
2092
2113
  }
2093
- class bn {
2114
+ class Pn {
2094
2115
  _baseUrl;
2095
2116
  constructor(...e) {
2096
- this._baseUrl = ts(e[0]) ? ss[e[0]] : e[0];
2117
+ this._baseUrl = rs(e[0]) ? is[e[0]] : e[0];
2097
2118
  }
2098
2119
  async evaluateTx(e) {
2099
2120
  const t = await this.open();
@@ -2157,7 +2178,7 @@ class bn {
2157
2178
  }));
2158
2179
  }
2159
2180
  }
2160
- class vn {
2181
+ class On {
2161
2182
  _axiosInstance;
2162
2183
  _amountsAsStrings = {
2163
2184
  headers: {
@@ -2192,7 +2213,7 @@ class vn {
2192
2213
  }
2193
2214
  }
2194
2215
  async fetchAccountInfo(e) {
2195
- const t = e.startsWith("addr") ? xe(e) : e;
2216
+ const t = e.startsWith("addr") ? ye(e) : e;
2196
2217
  try {
2197
2218
  const { data: r, status: n } = await this._axiosInstance.get(`accounts/${t}`, this._amountsAsStrings);
2198
2219
  if (n === 200) {
@@ -2211,9 +2232,9 @@ class vn {
2211
2232
  }
2212
2233
  }
2213
2234
  async fetchAddressUTxOs(e, t) {
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 p = c === null ? "" : `&cursor=${c}`, { data: y, status: B } = await this._axiosInstance.get(`${r}/utxos?count=100${n}${p}`, this._amountsAsStrings);
2216
- if (B === 200) {
2235
+ 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 = []) => {
2236
+ const p = c === null ? "" : `&cursor=${c}`, { data: y, status: C } = await this._axiosInstance.get(`${r}/utxos?count=100${n}${p}`, this._amountsAsStrings);
2237
+ if (C === 200) {
2217
2238
  const w = y.data.map(this.toUTxO), v = [...l, ...w], U = y.next_cursor;
2218
2239
  return U == null ? v : i(U, v);
2219
2240
  }
@@ -2229,9 +2250,9 @@ class vn {
2229
2250
  const { policyId: t, assetName: r } = Kt(e), n = async (i = null, c = []) => {
2230
2251
  const l = i === null ? "" : `&cursor=${i}`, { data: p, status: y } = await this._axiosInstance.get(`assets/${t}${r}/addresses?count=100${l}`, this._amountsAsStrings);
2231
2252
  if (y === 200) {
2232
- const b = p.data.map((U) => ({ address: U.address, quantity: U.amount })), w = p.next_cursor, v = [
2253
+ const E = p.data.map((U) => ({ address: U.address, quantity: U.amount })), w = p.next_cursor, v = [
2233
2254
  ...c,
2234
- ...b
2255
+ ...E
2235
2256
  ];
2236
2257
  return w == null ? v : n(w, v);
2237
2258
  }
@@ -2332,6 +2353,7 @@ class vn {
2332
2353
  coinsPerUTxOSize: i.coins_per_utxo_byte.toString(),
2333
2354
  collateralPercent: parseInt(i.collateral_percentage),
2334
2355
  decentralisation: 0,
2356
+ // Deprecated in Babbage era.
2335
2357
  epoch: parseInt(p.epoch_no),
2336
2358
  keyDeposit: i.stake_key_deposit.toString(),
2337
2359
  maxBlockExMem: i.max_execution_units_per_block.memory.toString(),
@@ -2443,20 +2465,24 @@ class vn {
2443
2465
  code: e.reference_script.bytes,
2444
2466
  version: e.reference_script.type.replace("plutusv", "V")
2445
2467
  };
2446
- return Zt(t).to_hex();
2468
+ return Xt(t).to_hex();
2447
2469
  } else
2448
2470
  return;
2449
2471
  };
2450
2472
  }
2451
- class Qn {
2473
+ class Mn {
2452
2474
  _axiosInstance;
2475
+ /**
2476
+ * Set the URL of the instance.
2477
+ * @param baseUrl The base URL of the instance.
2478
+ */
2453
2479
  constructor(e = "http://localhost:8080/api/v1") {
2454
2480
  this._axiosInstance = Mt.create({
2455
2481
  baseURL: e
2456
2482
  });
2457
2483
  }
2458
2484
  async fetchAccountInfo(e) {
2459
- const t = e.startsWith("addr") ? xe(e) : e;
2485
+ const t = e.startsWith("addr") ? ye(e) : e;
2460
2486
  try {
2461
2487
  const { data: r, status: n } = await this._axiosInstance.get(`accounts/${t}`);
2462
2488
  if (n === 200)
@@ -2480,7 +2506,7 @@ class Qn {
2480
2506
  code: await this.fetchPlutusScriptCBOR(e),
2481
2507
  version: t.type.replace("plutus", "")
2482
2508
  } : await this.fetchNativeScriptJSON(e);
2483
- return Zt(n).to_hex();
2509
+ return Xt(n).to_hex();
2484
2510
  }
2485
2511
  throw S(t);
2486
2512
  }
@@ -2505,7 +2531,7 @@ class Qn {
2505
2531
  if (y === 200)
2506
2532
  return p.length > 0 ? i(c + 1, [
2507
2533
  ...l,
2508
- ...await Promise.all(p.map((B) => this.toUTxO(B, B.tx_hash)))
2534
+ ...await Promise.all(p.map((C) => this.toUTxO(C, C.tx_hash)))
2509
2535
  ]) : l;
2510
2536
  throw S(p);
2511
2537
  };
@@ -2584,7 +2610,7 @@ class Qn {
2584
2610
  }
2585
2611
  async fetchHandleAddress(e) {
2586
2612
  try {
2587
- const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${Fe[1]}${t}/addresses`);
2613
+ const t = dt(e.replace("$", "")), { data: r, status: n } = await this._axiosInstance.get(`assets/${Re[1]}${t}/addresses`);
2588
2614
  if (n === 200)
2589
2615
  return r[0].address;
2590
2616
  throw S(r);
@@ -2671,6 +2697,7 @@ class Qn {
2671
2697
  });
2672
2698
  }, 5e3);
2673
2699
  }
2700
+ // diff bf
2674
2701
  async submitTx(e) {
2675
2702
  try {
2676
2703
  const t = { "Content-Type": "text/plain" }, { status: r, data: n } = await this._axiosInstance.post("/tx/submit", e, {
@@ -2696,16 +2723,16 @@ class Qn {
2696
2723
  throw S(t);
2697
2724
  }
2698
2725
  }
2699
- class Dn {
2726
+ class Kn {
2700
2727
  static withOneSignature(e) {
2701
2728
  const t = Ct($t(e));
2702
- return he(t).to_hex();
2729
+ return ue(t).to_hex();
2703
2730
  }
2704
2731
  static withAtLeastNSignatures(e, t) {
2705
2732
  const r = a.NativeScripts.new();
2706
2733
  e.forEach((i) => {
2707
2734
  const c = Ct($t(i));
2708
- r.add(he(c));
2735
+ r.add(ue(c));
2709
2736
  });
2710
2737
  const n = a.ScriptNOfK.new(t, r);
2711
2738
  return a.NativeScript.new_script_any(n).to_hex();
@@ -2714,7 +2741,7 @@ class Dn {
2714
2741
  const t = a.NativeScripts.new();
2715
2742
  e.forEach((n) => {
2716
2743
  const i = Ct($t(n));
2717
- t.add(he(i));
2744
+ t.add(ue(i));
2718
2745
  });
2719
2746
  const r = a.ScriptAny.new(t);
2720
2747
  return a.NativeScript.new_script_any(r).to_hex();
@@ -2723,7 +2750,7 @@ class Dn {
2723
2750
  const t = a.NativeScripts.new();
2724
2751
  e.forEach((n) => {
2725
2752
  const i = Ct($t(n));
2726
- t.add(he(i));
2753
+ t.add(ue(i));
2727
2754
  });
2728
2755
  const r = a.ScriptAll.new(t);
2729
2756
  return a.NativeScript.new_script_any(r).to_hex();
@@ -2741,7 +2768,7 @@ function Ht(s, e, t, r) {
2741
2768
  (c = s[l]) && (i = (n < 3 ? c(i) : n > 3 ? c(e, t, i) : c(e, t)) || i);
2742
2769
  return n > 3 && i && Object.defineProperty(e, t, i), i;
2743
2770
  }
2744
- const zs = (s) => class extends s {
2771
+ const tn = (s) => class extends s {
2745
2772
  __visits = [];
2746
2773
  }, Lt = () => function(s, e, t) {
2747
2774
  const r = t.value;
@@ -2765,7 +2792,7 @@ let St = class {
2765
2792
  _txInputsBuilder;
2766
2793
  _txWithdrawals;
2767
2794
  constructor(e = {}) {
2768
- this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? At, this._txBuilder = Ae(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
2795
+ this._era = e.era, this._initiator = e.initiator, this._mintBuilder = a.MintBuilder.new(), this._protocolParameters = e.parameters ?? At, this._txBuilder = pe(e.parameters), this._txCertificates = a.Certificates.new(), this._txInputsBuilder = a.TxInputsBuilder.new(), this._txWithdrawals = a.Withdrawals.new();
2769
2796
  }
2770
2797
  static attachMetadata(e, t, r = "BABBAGE") {
2771
2798
  var c;
@@ -2784,8 +2811,8 @@ let St = class {
2784
2811
  if (n !== void 0) {
2785
2812
  const c = a.GeneralTransactionMetadata.new();
2786
2813
  for (let p = 0; p < n.len(); p += 1) {
2787
- const y = n.keys().get(p), B = n.get(y);
2788
- c.insert(y, a.TransactionMetadatum.from_hex("0".repeat(((B == null ? void 0 : B.to_hex()) ?? "").length)));
2814
+ const y = n.keys().get(p), C = n.get(y);
2815
+ c.insert(y, a.TransactionMetadatum.from_hex("0".repeat(((C == null ? void 0 : C.to_hex()) ?? "").length)));
2789
2816
  }
2790
2817
  const l = r.auxiliary_data();
2791
2818
  return l !== void 0 && (l.set_metadata(c), l.set_prefer_alonzo_format(t === "ALONZO")), a.Transaction.new(r.body(), r.witness_set(), l).to_hex();
@@ -2815,35 +2842,35 @@ let St = class {
2815
2842
  return this._mintBuilder.add_asset(Ir(e, r), a.AssetName.new(G(t.unit.slice(ht))), a.Int.new_negative(a.BigNum.from_str(t.quantity))), this._totalBurns.set(t.unit, n), this;
2816
2843
  }
2817
2844
  delegateStake(e, t) {
2818
- const r = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(Ct(se(e))), a.Ed25519KeyHash.from_bech32(t)));
2845
+ const r = a.Certificate.new_stake_delegation(a.StakeDelegation.new(a.StakeCredential.from_keyhash(Ct(re(e))), a.Ed25519KeyHash.from_bech32(t)));
2819
2846
  return this._txCertificates.add(r), this;
2820
2847
  }
2821
2848
  deregisterStake(e) {
2822
- const t = a.Certificate.new_stake_deregistration(a.StakeDeregistration.new(a.StakeCredential.from_keyhash(Ct(se(e)))));
2849
+ const t = a.Certificate.new_stake_deregistration(a.StakeDeregistration.new(a.StakeCredential.from_keyhash(Ct(re(e)))));
2823
2850
  return this._txCertificates.add(t), this;
2824
2851
  }
2825
2852
  mintAsset(e, t, r) {
2826
- var y, B;
2827
- const n = (b, w) => {
2828
- const v = typeof b == "string" ? Le(b).hash().to_hex() : i(b).hash().to_hex(), U = dt(w.assetName);
2853
+ var y, C;
2854
+ const n = (E, w) => {
2855
+ const v = typeof E == "string" ? Ge(E).hash().to_hex() : i(E).hash().to_hex(), U = dt(w.assetName);
2829
2856
  return {
2830
2857
  unit: `${v}${U}`,
2831
2858
  quantity: w.assetQuantity
2832
2859
  };
2833
- }, i = (b) => {
2834
- if ("code" in b)
2835
- return Xt(b.code, b.version);
2836
- const w = mt(b);
2860
+ }, i = (E) => {
2861
+ if ("code" in E)
2862
+ return jt(E.code, E.version);
2863
+ const w = mt(E);
2837
2864
  if (w.output().has_script_ref()) {
2838
2865
  const v = w.output().script_ref();
2839
2866
  if (v.is_plutus_script()) {
2840
2867
  const U = Hr(v);
2841
- return Xt(U.code, U.version);
2868
+ return jt(U.code, U.version);
2842
2869
  }
2843
2870
  }
2844
2871
  throw new Error(`[Transaction] No plutus script reference found in UTxO: ${w.input().transaction_id().to_hex()}`);
2845
2872
  }, c = n(e, t), p = 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(Ir(e, r), a.AssetName.new(G(dt(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, {
2873
+ return this._mintBuilder.add_asset(Ir(e, r), a.AssetName.new(G(dt(t.assetName))), a.Int.new(a.BigNum.from_str(c.quantity))), this._recipients.has(t.recipient) ? (C = this._recipients.get(t.recipient)) == null || C.push(c) : this._recipients.set(t.recipient, [c]), this._totalMints.set(c.unit, {
2847
2874
  ...t,
2848
2875
  assetQuantity: p.to_str()
2849
2876
  }), this;
@@ -2858,81 +2885,170 @@ let St = class {
2858
2885
  fields: []
2859
2886
  },
2860
2887
  ...e.redeemer
2861
- }, r = mt(e.value), n = e.datum ? a.PlutusWitness.new_with_ref(Ke(e.script), Ys(e.datum), Pe(t)) : a.PlutusWitness.new_with_ref_without_datum(Ke(e.script), Pe(t));
2888
+ }, r = mt(e.value), n = e.datum ? a.PlutusWitness.new_with_ref(He(e.script), Xs(e.datum), Oe(t)) : a.PlutusWitness.new_with_ref_without_datum(He(e.script), Oe(t));
2862
2889
  return this._txInputsBuilder.add_plutus_script_input(n, r.input(), r.output().amount()), this;
2863
2890
  }
2864
2891
  registerStake(e) {
2865
- const t = a.Certificate.new_stake_registration(a.StakeRegistration.new(a.StakeCredential.from_keyhash(Ct(se(e)))));
2892
+ const t = a.Certificate.new_stake_registration(a.StakeRegistration.new(a.StakeCredential.from_keyhash(Ct(re(e)))));
2866
2893
  return this._txCertificates.add(t), this;
2867
2894
  }
2868
2895
  registerPool(e) {
2869
- const t = a.Certificate.new_pool_registration(a.PoolRegistration.new(Gs(e)));
2896
+ const t = a.Certificate.new_pool_registration(a.PoolRegistration.new(js(e)));
2870
2897
  return this._txCertificates.add(t), this;
2871
2898
  }
2872
2899
  retirePool(e, t) {
2873
2900
  const r = a.Certificate.new_pool_retirement(a.PoolRetirement.new(a.Ed25519KeyHash.from_bech32(e), t));
2874
2901
  return this._txCertificates.add(r), this;
2875
2902
  }
2903
+ /**
2904
+ * Adds an output to the transaction.
2905
+ *
2906
+ * @param recipient The recipient of the output.
2907
+ * @param assets The assets to send.
2908
+ * @returns The transaction builder.
2909
+ * @see {@link https://meshjs.dev/apis/transaction#sendAssets}
2910
+ */
2876
2911
  sendAssets(e, t) {
2877
2912
  const r = Bt(t), n = r.multiasset();
2878
2913
  if (r.is_zero() || n === void 0)
2879
2914
  return this;
2880
- const i = de(e).next(), c = r.coin().is_zero() ? i.with_asset_and_min_required_coin_by_utxo_cost(n, Oe(this._protocolParameters.coinsPerUTxOSize)).build() : i.with_coin_and_asset(r.coin(), n).build();
2915
+ const i = le(e).next(), c = r.coin().is_zero() ? i.with_asset_and_min_required_coin_by_utxo_cost(n, Me(this._protocolParameters.coinsPerUTxOSize)).build() : i.with_coin_and_asset(r.coin(), n).build();
2881
2916
  return t.forEach((l) => {
2882
2917
  this.setTxOutput(l);
2883
2918
  }), this._txBuilder.add_output(c), this;
2884
2919
  }
2920
+ /**
2921
+ * Adds a transaction output to the transaction.
2922
+ *
2923
+ * @param {Recipient} recipient The recipient of the transaction.
2924
+ * @param {string} lovelace The amount of lovelace to send.
2925
+ * @returns {Transaction} The Transaction object.
2926
+ * @see {@link https://meshjs.dev/apis/transaction#sendAda}
2927
+ */
2885
2928
  sendLovelace(e, t) {
2886
- const n = de(e).next().with_coin(a.BigNum.from_str(t)).build();
2929
+ const n = le(e).next().with_coin(a.BigNum.from_str(t)).build();
2887
2930
  return this.setTxOutput({
2888
2931
  unit: "lovelace",
2889
2932
  quantity: t
2890
2933
  }), this._txBuilder.add_output(n), this;
2891
2934
  }
2935
+ /**
2936
+ * Adds stable coins transaction output to the transaction.
2937
+ * @param {Recipient} recipient The recipient of the transaction.
2938
+ * @param {Token} ticker The ticker of the token to send.
2939
+ * @param {string} amount The amount of the token to send.
2940
+ * @returns {Transaction} The Transaction object.
2941
+ * @see {@link https://meshjs.dev/apis/transaction#sendToken}
2942
+ */
2892
2943
  sendToken(e, t, r) {
2893
2944
  return this.sendAssets(e, [
2894
2945
  {
2895
2946
  quantity: r,
2896
- unit: ns[t]
2947
+ unit: as[t]
2897
2948
  }
2898
2949
  ]), this;
2899
2950
  }
2951
+ /**
2952
+ * Adds an output to the transaction.
2953
+ *
2954
+ * @param {Recipient} recipient The recipient of the output.
2955
+ * @param {UTxO} value The UTxO value of the output.
2956
+ * @returns {Transaction} The Transaction object.
2957
+ */
2900
2958
  sendValue(e, t) {
2901
- const r = Bt(t.output.amount), i = de(e).next().with_value(r).build();
2959
+ const r = Bt(t.output.amount), i = le(e).next().with_value(r).build();
2902
2960
  return t.output.amount.forEach((c) => {
2903
2961
  this.setTxOutput(c);
2904
2962
  }), this._txBuilder.add_output(i), this;
2905
2963
  }
2964
+ /**
2965
+ * Sets the change address for the transaction.
2966
+ *
2967
+ * @param {string} changeAddress The change address.
2968
+ * @returns {Transaction} The Transaction object.
2969
+ */
2906
2970
  setChangeAddress(e) {
2907
2971
  return this._changeAddress = yt(e), this;
2908
2972
  }
2973
+ /**
2974
+ * Sets the collateral for the transaction.
2975
+ *
2976
+ * @param {UTxO[]} collateral - Set the UTxO for collateral.
2977
+ * @returns {Transaction} The Transaction object.
2978
+ */
2909
2979
  setCollateral(e) {
2910
2980
  const t = _r(e);
2911
2981
  return this._txBuilder.set_collateral(t), this;
2912
2982
  }
2983
+ /**
2984
+ * Add a JSON metadata entry to the transaction.
2985
+ *
2986
+ * @param {number} key The key to use for the metadata entry.
2987
+ * @param {unknown} value The value to use for the metadata entry.
2988
+ * @returns {Transaction} The Transaction object.
2989
+ * @see {@link https://meshjs.dev/apis/transaction#setMetadata}
2990
+ */
2913
2991
  setMetadata(e, t) {
2914
2992
  return this._txBuilder.add_json_metadatum_with_schema(a.BigNum.from_str(e.toString()), JSON.stringify(t), a.MetadataJsonSchema.NoConversions), this;
2915
2993
  }
2994
+ /**
2995
+ * Sets the required signers for the transaction.
2996
+ *
2997
+ * @param {string[]} addresses The addresses of the required signers.
2998
+ * @returns {Transaction} The Transaction object.
2999
+ */
2916
3000
  setRequiredSigners(e) {
2917
- return Array.from(new Set(e.map((r) => r.startsWith("addr") ? $t(r) : se(r)).map((r) => Ct(r)))).forEach((r) => {
3001
+ return Array.from(new Set(e.map((r) => r.startsWith("addr") ? $t(r) : re(r)).map((r) => Ct(r)))).forEach((r) => {
2918
3002
  this._txBuilder.add_required_signer(r);
2919
3003
  }), this;
2920
3004
  }
3005
+ /**
3006
+ * Sets the native script for the transaction.
3007
+ * @param {NativeScript} script The native script to spend from.
3008
+ * @param {UTxO} utxo The UTxO attached to the script.
3009
+ * @returns {Transaction} The Transaction object.
3010
+ */
2921
3011
  setNativeScriptInput(e, t) {
2922
3012
  const r = mt(t);
2923
3013
  return this._txBuilder.add_native_script_input(Vt(e), r.input(), r.output().amount()), this;
2924
3014
  }
3015
+ /**
3016
+ * Sets the start slot for the transaction.
3017
+ *
3018
+ * @param {string} slot The start slot for the transaction.
3019
+ * @returns {Transaction} The Transaction object.
3020
+ * @see {@link https://meshjs.dev/apis/transaction#setTimeLimit}
3021
+ */
2925
3022
  setTimeToStart(e) {
2926
3023
  return this._txBuilder.set_validity_start_interval_bignum(a.BigNum.from_str(e)), this;
2927
3024
  }
3025
+ /**
3026
+ * Set the time to live for the transaction.
3027
+ *
3028
+ * @param {string} slot The slot number to expire the transaction at.
3029
+ * @returns {Transaction} The Transaction object.
3030
+ * @see {@link https://meshjs.dev/apis/transaction#setTimeLimit}
3031
+ */
2928
3032
  setTimeToExpire(e) {
2929
3033
  return this._txBuilder.set_ttl_bignum(a.BigNum.from_str(e)), this;
2930
3034
  }
3035
+ /**
3036
+ * Sets the inputs for the transaction.
3037
+ *
3038
+ * @param {UTxO[]} inputs The inputs to set.
3039
+ * @returns {Transaction} The transaction.
3040
+ */
2931
3041
  setTxInputs(e) {
2932
3042
  return e.map((t) => mt(t)).forEach((t) => {
2933
3043
  this._txInputsBuilder.add_input(t.output().address(), t.input(), t.output().amount());
2934
3044
  }), this;
2935
3045
  }
3046
+ /**
3047
+ * Sets the reference inputs for the transaction.
3048
+ *
3049
+ * @param {UTxO[]} inputs The reference inputs to set.
3050
+ * @returns {Transaction} The transaction.
3051
+ */
2936
3052
  setTxRefInputs(e) {
2937
3053
  return e.map((t) => mt(t)).forEach((t) => {
2938
3054
  this._txBuilder.add_reference_input(t.input());
@@ -2945,7 +3061,7 @@ let St = class {
2945
3061
  async addBurnInputsIfNeeded() {
2946
3062
  if (this._initiator && this._totalBurns.size > 0 && this.notVisited("setTxInputs")) {
2947
3063
  const e = await this._initiator.getUsedUTxOs();
2948
- as(this._totalBurns, e.map((r) => oe(r))).map((r) => mt(r)).forEach((r) => {
3064
+ cs(this._totalBurns, e.map((r) => ie(r))).map((r) => mt(r)).forEach((r) => {
2949
3065
  this._txInputsBuilder.add_input(r.output().address(), r.input(), r.output().amount());
2950
3066
  });
2951
3067
  }
@@ -2972,7 +3088,7 @@ let St = class {
2972
3088
  async addTxInputsAsNeeded() {
2973
3089
  if (this.notVisited("setTxInputs")) {
2974
3090
  const e = await this.filterAvailableUTxOs();
2975
- is(this._txOutputs, e.map((r) => oe(r))).map((r) => mt(r)).forEach((r) => {
3091
+ os(this._txOutputs, e.map((r) => ie(r))).map((r) => mt(r)).forEach((r) => {
2976
3092
  this._txInputsBuilder.add_input(r.output().address(), r.input(), r.output().amount());
2977
3093
  });
2978
3094
  }
@@ -3021,7 +3137,7 @@ let St = class {
3021
3137
  this._recipients.forEach((e, t) => {
3022
3138
  const n = Bt(e).multiasset();
3023
3139
  if (n !== void 0) {
3024
- const c = de(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Oe(this._protocolParameters.coinsPerUTxOSize)).build();
3140
+ const c = le(t).next().with_asset_and_min_required_coin_by_utxo_cost(n, Me(this._protocolParameters.coinsPerUTxOSize)).build();
3025
3141
  this._txBuilder.add_output(c);
3026
3142
  }
3027
3143
  });
@@ -3056,9 +3172,9 @@ Ht([
3056
3172
  Lt()
3057
3173
  ], St.prototype, "setTxInputs", null);
3058
3174
  St = Ht([
3059
- zs
3175
+ tn
3060
3176
  ], St);
3061
- const Ws = (s, e, t) => {
3177
+ const en = (s, e, t) => {
3062
3178
  const r = new Map(e);
3063
3179
  r.set("lovelace", String(Number(r.get("lovelace")) + Number(t)));
3064
3180
  const n = /* @__PURE__ */ new Map();
@@ -3084,11 +3200,11 @@ const Ws = (s, e, t) => {
3084
3200
  break;
3085
3201
  }
3086
3202
  }
3087
- const B = (w, v, U) => {
3203
+ const C = (w, v, U) => {
3088
3204
  const k = n.get(w);
3089
3205
  if (!k)
3090
3206
  return;
3091
- const N = Js(k, v);
3207
+ const N = rn(k, v);
3092
3208
  if (Number(N) > 0) {
3093
3209
  i.add(w), U.delete(w);
3094
3210
  for (const T of k.output.amount)
@@ -3101,79 +3217,80 @@ const Ws = (s, e, t) => {
3101
3217
  const U = r.get(w);
3102
3218
  if (!U || Number(U) <= 0)
3103
3219
  break;
3104
- B(v, w, l);
3220
+ C(v, w, l);
3105
3221
  }
3106
3222
  for (const v of p) {
3107
3223
  const U = r.get(w);
3108
3224
  if (!U || Number(U) <= 0)
3109
3225
  break;
3110
- B(v, w, p);
3226
+ C(v, w, p);
3111
3227
  }
3112
3228
  for (const v of y) {
3113
3229
  const U = r.get(w);
3114
3230
  if (!U || Number(U) <= 0)
3115
3231
  break;
3116
- B(v, w, y);
3232
+ C(v, w, y);
3117
3233
  }
3118
3234
  }
3119
3235
  for (const w of c) {
3120
3236
  const v = r.get("lovelace");
3121
3237
  if (!v || Number(v) <= 0)
3122
3238
  break;
3123
- B(w, "lovelace", c);
3239
+ C(w, "lovelace", c);
3124
3240
  }
3125
3241
  for (const w of l) {
3126
3242
  const v = r.get("lovelace");
3127
3243
  if (!v || Number(v) <= 0)
3128
3244
  break;
3129
- B(w, "lovelace", l);
3245
+ C(w, "lovelace", l);
3130
3246
  }
3131
3247
  for (const w of p) {
3132
3248
  const v = r.get("lovelace");
3133
3249
  if (!v || Number(v) <= 0)
3134
3250
  break;
3135
- B(w, "lovelace", p);
3251
+ C(w, "lovelace", p);
3136
3252
  }
3137
3253
  for (const w of y) {
3138
3254
  const v = r.get("lovelace");
3139
3255
  if (!v || Number(v) <= 0)
3140
3256
  break;
3141
- B(w, "lovelace", y);
3257
+ C(w, "lovelace", y);
3142
3258
  }
3143
3259
  for (const w of r.keys())
3144
3260
  if (Number(r.get(w)) > 0)
3145
3261
  return [];
3146
- const b = [];
3262
+ const E = [];
3147
3263
  for (const w of i) {
3148
3264
  const v = n.get(w);
3149
- v && b.push(v);
3265
+ v && E.push(v);
3150
3266
  }
3151
- return b;
3152
- }, Js = (s, e) => {
3267
+ return E;
3268
+ }, rn = (s, e) => {
3153
3269
  for (const t of s.output.amount)
3154
3270
  if (t.unit == e)
3155
3271
  return t.quantity;
3156
3272
  return "0";
3157
3273
  };
3158
- var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3274
+ var xe = { exports: {} }, Lr = { exports: {} }, Gr = { exports: {} };
3159
3275
  (function(s) {
3160
3276
  (function(e) {
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: ", 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;
3277
+ 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, C = 9007199254740991, E = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], w = 1e7, v = 1e9;
3162
3278
  function U(O) {
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, _t = 1e7, Rt = !1, te = 1, kt = 0, we = {
3279
+ var M, z, X, D = b.prototype = { constructor: b, toString: null, valueOf: null }, F = new b(1), q = 20, J = 4, st = -7, ct = 21, Ft = -1e7, _t = 1e7, Rt = !1, Zt = 1, kt = 0, we = {
3164
3280
  prefix: "",
3165
3281
  groupSize: 3,
3166
3282
  secondaryGroupSize: 0,
3167
3283
  groupSeparator: ",",
3168
3284
  decimalSeparator: ".",
3169
3285
  fractionGroupSize: 0,
3170
- fractionGroupSeparator: "\xA0",
3286
+ fractionGroupSeparator: " ",
3287
+ // non-breaking space
3171
3288
  suffix: ""
3172
3289
  }, qt = "0123456789abcdefghijklmnopqrstuvwxyz", Ce = !0;
3173
- function E(o, u) {
3290
+ function b(o, u) {
3174
3291
  var h, I, f, m, x, d, g, _, A = this;
3175
- if (!(A instanceof E))
3176
- return new E(o, u);
3292
+ if (!(A instanceof b))
3293
+ return new b(o, u);
3177
3294
  if (u == null) {
3178
3295
  if (o && o._isBigNumber === !0) {
3179
3296
  A.s = o.s, !o.c || o.e > _t ? A.c = A.e = null : o.e < Ft ? A.c = [A.e = 0] : (A.e = o.e, A.c = o.c.slice());
@@ -3195,11 +3312,11 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3195
3312
  (m = _.indexOf(".")) > -1 && (_ = _.replace(".", "")), (x = _.search(/e/i)) > 0 ? (m < 0 && (m = x), m += +_.slice(x + 1), _ = _.substring(0, x)) : m < 0 && (m = _.length);
3196
3313
  } else {
3197
3314
  if (Q(u, 2, qt.length, "Base"), u == 10 && Ce)
3198
- return A = new E(o), ft(A, q + A.e + 1, J);
3315
+ return A = new b(o), ft(A, q + A.e + 1, J);
3199
3316
  if (_ = String(o), d = typeof o == "number") {
3200
3317
  if (o * 0 != 0)
3201
3318
  return X(A, _, d, u);
3202
- if (A.s = 1 / o < 0 ? (_ = _.slice(1), -1) : 1, E.DEBUG && _.replace(/^0\.0*|\./, "").length > 15)
3319
+ if (A.s = 1 / o < 0 ? (_ = _.slice(1), -1) : 1, b.DEBUG && _.replace(/^0\.0*|\./, "").length > 15)
3203
3320
  throw Error(l + o);
3204
3321
  } else
3205
3322
  A.s = _.charCodeAt(0) === 45 ? (_ = _.slice(1), -1) : 1;
@@ -3223,7 +3340,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3223
3340
  for (g = _.length; _.charCodeAt(--g) === 48; )
3224
3341
  ;
3225
3342
  if (_ = _.slice(x, ++g)) {
3226
- if (g -= x, d && E.DEBUG && g > 15 && (o > B || o !== i(o)))
3343
+ if (g -= x, d && b.DEBUG && g > 15 && (o > C || o !== i(o)))
3227
3344
  throw Error(l + A.s * o);
3228
3345
  if ((m = m - x - 1) > _t)
3229
3346
  A.c = A.e = null;
@@ -3243,7 +3360,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3243
3360
  } else
3244
3361
  A.c = [A.e = 0];
3245
3362
  }
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) {
3363
+ b.clone = U, b.ROUND_UP = 0, b.ROUND_DOWN = 1, b.ROUND_CEIL = 2, b.ROUND_FLOOR = 3, b.ROUND_HALF_UP = 4, b.ROUND_HALF_DOWN = 5, b.ROUND_HALF_EVEN = 6, b.ROUND_HALF_CEIL = 7, b.ROUND_HALF_FLOOR = 8, b.EUCLID = 9, b.config = b.set = function(o) {
3247
3364
  var u, h;
3248
3365
  if (o != null)
3249
3366
  if (typeof o == "object") {
@@ -3265,7 +3382,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3265
3382
  Rt = h;
3266
3383
  else
3267
3384
  throw Error(c + u + " not true or false: " + h);
3268
- 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"))
3385
+ if (o.hasOwnProperty(u = "MODULO_MODE") && (h = o[u], Q(h, 0, 9, u), Zt = h), o.hasOwnProperty(u = "POW_PRECISION") && (h = o[u], Q(h, 0, v, u), kt = h), o.hasOwnProperty(u = "FORMAT"))
3269
3386
  if (h = o[u], typeof h == "object")
3270
3387
  we = h;
3271
3388
  else
@@ -3283,15 +3400,15 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3283
3400
  EXPONENTIAL_AT: [st, ct],
3284
3401
  RANGE: [Ft, _t],
3285
3402
  CRYPTO: Rt,
3286
- MODULO_MODE: te,
3403
+ MODULO_MODE: Zt,
3287
3404
  POW_PRECISION: kt,
3288
3405
  FORMAT: we,
3289
3406
  ALPHABET: qt
3290
3407
  };
3291
- }, E.isBigNumber = function(o) {
3408
+ }, b.isBigNumber = function(o) {
3292
3409
  if (!o || o._isBigNumber !== !0)
3293
3410
  return !1;
3294
- if (!E.DEBUG)
3411
+ if (!b.DEBUG)
3295
3412
  return !0;
3296
3413
  var u, h, I = o.c, f = o.e, m = o.s;
3297
3414
  t:
@@ -3313,18 +3430,18 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3313
3430
  } else if (I === null && f === null && (m === null || m === 1 || m === -1))
3314
3431
  return !0;
3315
3432
  throw Error(c + "Invalid BigNumber: " + o);
3316
- }, E.maximum = E.max = function() {
3433
+ }, b.maximum = b.max = function() {
3317
3434
  return We(arguments, -1);
3318
- }, E.minimum = E.min = function() {
3435
+ }, b.minimum = b.min = function() {
3319
3436
  return We(arguments, 1);
3320
- }, E.random = function() {
3437
+ }, b.random = function() {
3321
3438
  var o = 9007199254740992, u = Math.random() * o & 2097151 ? function() {
3322
3439
  return i(Math.random() * o);
3323
3440
  } : function() {
3324
3441
  return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
3325
3442
  };
3326
3443
  return function(h) {
3327
- var I, f, m, x, d, g = 0, _ = [], A = new E(F);
3444
+ var I, f, m, x, d, g = 0, _ = [], A = new b(F);
3328
3445
  if (h == null ? h = q : Q(h, 0, v), x = n(h / y), Rt)
3329
3446
  if (crypto.getRandomValues) {
3330
3447
  for (I = crypto.getRandomValues(new Uint32Array(x *= 2)); g < x; )
@@ -3339,7 +3456,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3339
3456
  if (!Rt)
3340
3457
  for (; g < x; )
3341
3458
  d = u(), d < 9e15 && (_[g++] = d % 1e14);
3342
- for (x = _[--g], h %= y, x && h && (d = b[y - h], _[g] = i(x / d) * d); _[g] === 0; _.pop(), g--)
3459
+ for (x = _[--g], h %= y, x && h && (d = E[y - h], _[g] = i(x / d) * d); _[g] === 0; _.pop(), g--)
3343
3460
  ;
3344
3461
  if (g < 0)
3345
3462
  _ = [m = 0];
@@ -3352,11 +3469,11 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3352
3469
  }
3353
3470
  return A.e = m, A.c = _, A;
3354
3471
  };
3355
- }(), E.sum = function() {
3356
- for (var o = 1, u = arguments, h = new E(u[0]); o < u.length; )
3472
+ }(), b.sum = function() {
3473
+ for (var o = 1, u = arguments, h = new b(u[0]); o < u.length; )
3357
3474
  h = h.plus(u[o++]);
3358
3475
  return h;
3359
- }, z = function() {
3476
+ }, z = /* @__PURE__ */ function() {
3360
3477
  var o = "0123456789";
3361
3478
  function u(h, I, f, m) {
3362
3479
  for (var x, d = [0], g, _ = 0, A = h.length; _ < A; ) {
@@ -3368,8 +3485,8 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3368
3485
  return d.reverse();
3369
3486
  }
3370
3487
  return function(h, I, f, m, x) {
3371
- var d, g, _, A, C, P, K, L, Z = h.indexOf("."), et = q, V = J;
3372
- for (Z >= 0 && (A = kt, kt = 0, h = h.replace(".", ""), L = new E(I), P = L.pow(h.length - Z), kt = A, L.c = u(
3488
+ var d, g, _, A, B, P, K, L, Z = h.indexOf("."), et = q, V = J;
3489
+ for (Z >= 0 && (A = kt, kt = 0, h = h.replace(".", ""), L = new b(I), P = L.pow(h.length - Z), kt = A, L.c = u(
3373
3490
  Y(N(P.c), P.e, "0"),
3374
3491
  10,
3375
3492
  f,
@@ -3378,10 +3495,10 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3378
3495
  ;
3379
3496
  if (!K[0])
3380
3497
  return d.charAt(0);
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], A = 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 > A || Z == A && (V == 4 || C || V == 6 && K[g - 1] & 1 || V == (P.s < 0 ? 8 : 7)), g < 1 || !K[0])
3382
- h = C ? Y(d.charAt(1), -et, d.charAt(0)) : d.charAt(0);
3498
+ if (Z < 0 ? --_ : (P.c = K, P.e = _, P.s = m, P = M(P, L, et, V, f), K = P.c, B = P.r, _ = P.e), g = _ + et + 1, Z = K[g], A = f / 2, B = B || g < 0 || K[g + 1] != null, B = V < 4 ? (Z != null || B) && (V == 0 || V == (P.s < 0 ? 3 : 2)) : Z > A || Z == A && (V == 4 || B || V == 6 && K[g - 1] & 1 || V == (P.s < 0 ? 8 : 7)), g < 1 || !K[0])
3499
+ h = B ? Y(d.charAt(1), -et, d.charAt(0)) : d.charAt(0);
3383
3500
  else {
3384
- if (K.length = g, C)
3501
+ if (K.length = g, B)
3385
3502
  for (--f; ++K[--g] > f; )
3386
3503
  K[g] = 0, g || (++_, K = [1].concat(K));
3387
3504
  for (A = K.length; !K[--A]; )
@@ -3392,11 +3509,11 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3392
3509
  }
3393
3510
  return h;
3394
3511
  };
3395
- }(), M = function() {
3512
+ }(), M = /* @__PURE__ */ function() {
3396
3513
  function o(I, f, m) {
3397
- var x, d, g, _, A = 0, C = I.length, P = f % w, K = f / w | 0;
3398
- for (I = I.slice(); C--; )
3399
- g = I[C] % w, _ = I[C] / w | 0, x = K * g + _ * P, d = P * g + x % w * w + A, A = (d / m | 0) + (x / w | 0) + K * _, I[C] = d % m;
3514
+ var x, d, g, _, A = 0, B = I.length, P = f % w, K = f / w | 0;
3515
+ for (I = I.slice(); B--; )
3516
+ g = I[B] % w, _ = I[B] / w | 0, x = K * g + _ * P, d = P * g + x % w * w + A, A = (d / m | 0) + (x / w | 0) + K * _, I[B] = d % m;
3400
3517
  return A && (I = [A].concat(I)), I;
3401
3518
  }
3402
3519
  function u(I, f, m, x) {
@@ -3418,41 +3535,45 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3418
3535
  ;
3419
3536
  }
3420
3537
  return function(I, f, m, x, d) {
3421
- var g, _, A, C, P, K, L, Z, et, V, $, nt, ce, Ee, be, xt, ee, gt = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
3538
+ var g, _, A, B, P, K, L, Z, et, V, $, nt, ae, Ee, be, xt, te, gt = I.s == f.s ? 1 : -1, at = I.c, tt = f.c;
3422
3539
  if (!at || !at[0] || !tt || !tt[0])
3423
- return new E(
3424
- !I.s || !f.s || (at ? tt && at[0] == tt[0] : !tt) ? NaN : at && at[0] == 0 || !tt ? gt * 0 : gt / 0
3540
+ return new b(
3541
+ // Return NaN if either NaN, or both Infinity or 0.
3542
+ !I.s || !f.s || (at ? tt && at[0] == tt[0] : !tt) ? NaN : (
3543
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
3544
+ at && at[0] == 0 || !tt ? gt * 0 : gt / 0
3545
+ )
3425
3546
  );
3426
- for (Z = new E(gt), et = Z.c = [], _ = I.e - f.e, gt = m + _ + 1, d || (d = p, _ = k(I.e / y) - k(f.e / y), gt = gt / y | 0), A = 0; tt[A] == (at[A] || 0); A++)
3547
+ for (Z = new b(gt), et = Z.c = [], _ = I.e - f.e, gt = m + _ + 1, d || (d = p, _ = k(I.e / y) - k(f.e / y), gt = gt / y | 0), A = 0; tt[A] == (at[A] || 0); A++)
3427
3548
  ;
3428
3549
  if (tt[A] > (at[A] || 0) && _--, gt < 0)
3429
- et.push(1), C = !0;
3550
+ et.push(1), B = !0;
3430
3551
  else {
3431
- for (Ee = at.length, xt = tt.length, A = 0, gt += 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)
3552
+ for (Ee = at.length, xt = tt.length, A = 0, gt += 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), ae = xt, V = at.slice(0, xt), $ = V.length; $ < xt; V[$++] = 0)
3432
3553
  ;
3433
- ee = tt.slice(), ee = [0].concat(ee), be = tt[0], tt[1] >= d / 2 && be++;
3554
+ te = tt.slice(), te = [0].concat(te), be = tt[0], tt[1] >= d / 2 && be++;
3434
3555
  do {
3435
3556
  if (P = 0, g = u(tt, V, xt, $), g < 0) {
3436
3557
  if (nt = V[0], xt != $ && (nt = nt * d + (V[1] || 0)), P = i(nt / be), P > 1)
3437
3558
  for (P >= d && (P = d - 1), K = o(tt, P, d), L = K.length, $ = V.length; u(K, V, L, $) == 1; )
3438
- P--, h(K, xt < L ? ee : tt, L, d), L = K.length, g = 1;
3559
+ P--, h(K, xt < L ? te : tt, L, d), L = K.length, g = 1;
3439
3560
  else
3440
3561
  P == 0 && (g = P = 1), K = tt.slice(), L = K.length;
3441
3562
  if (L < $ && (K = [0].concat(K)), h(V, K, $, d), $ = V.length, g == -1)
3442
3563
  for (; u(tt, V, xt, $) < 1; )
3443
- P++, h(V, xt < $ ? ee : tt, $, d), $ = V.length;
3564
+ P++, h(V, xt < $ ? te : tt, $, d), $ = V.length;
3444
3565
  } else
3445
3566
  g === 0 && (P++, V = [0]);
3446
- et[A++] = P, V[0] ? V[$++] = at[ce] || 0 : (V = [at[ce]], $ = 1);
3447
- } while ((ce++ < Ee || V[0] != null) && gt--);
3448
- C = V[0] != null, et[0] || et.splice(0, 1);
3567
+ et[A++] = P, V[0] ? V[$++] = at[ae] || 0 : (V = [at[ae]], $ = 1);
3568
+ } while ((ae++ < Ee || V[0] != null) && gt--);
3569
+ B = V[0] != null, et[0] || et.splice(0, 1);
3449
3570
  }
3450
3571
  if (d == p) {
3451
3572
  for (A = 1, gt = et[0]; gt >= 10; gt /= 10, A++)
3452
3573
  ;
3453
- ft(Z, m + (Z.e = A + _ * y - 1) + 1, x, C);
3574
+ ft(Z, m + (Z.e = A + _ * y - 1) + 1, x, B);
3454
3575
  } else
3455
- Z.e = _, Z.r = +C;
3576
+ Z.e = _, Z.r = +B;
3456
3577
  return Z;
3457
3578
  };
3458
3579
  }();
@@ -3462,7 +3583,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3462
3583
  return o.toString();
3463
3584
  if (f = o.c[0], x = o.e, u == null)
3464
3585
  g = N(o.c), g = I == 1 || I == 2 && (x <= st || x >= ct) ? j(g, x) : Y(g, x, "0");
3465
- else if (o = ft(new E(o), u, h), m = o.e, g = N(o.c), d = g.length, I == 1 || I == 2 && (u <= m || m <= st)) {
3586
+ else if (o = ft(new b(o), u, h), m = o.e, g = N(o.c), d = g.length, I == 1 || I == 2 && (u <= m || m <= st)) {
3466
3587
  for (; d < u; g += "0", d++)
3467
3588
  ;
3468
3589
  g = j(g, m);
@@ -3476,8 +3597,8 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3476
3597
  return o.s < 0 && f ? "-" + g : g;
3477
3598
  }
3478
3599
  function We(o, u) {
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);
3600
+ for (var h, I, f = 1, m = new b(o[0]); f < o.length; f++)
3601
+ I = new b(o[f]), (!I.s || (h = T(m, I)) === u || h === 0 && m.s === u) && (m = I);
3481
3602
  return m;
3482
3603
  }
3483
3604
  function Se(o, u, h) {
@@ -3487,18 +3608,18 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3487
3608
  ;
3488
3609
  return (h = I + h * y - 1) > _t ? o.c = o.e = null : h < Ft ? o.c = [o.e = 0] : (o.e = h, o.c = u), o;
3489
3610
  }
3490
- X = function() {
3611
+ X = /* @__PURE__ */ function() {
3491
3612
  var o = /^(-?)0([xbo])(?=\w[\w.]*$)/i, u = /^([^.]+)\.$/, h = /^\.([^.]+)$/, I = /^-?(Infinity|NaN)$/, f = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
3492
3613
  return function(m, x, d, g) {
3493
3614
  var _, A = d ? x : x.replace(f, "");
3494
3615
  if (I.test(A))
3495
3616
  m.s = isNaN(A) ? null : A < 0 ? -1 : 1;
3496
3617
  else {
3497
- if (!d && (A = A.replace(o, function(C, P, K) {
3498
- return _ = (K = K.toLowerCase()) == "x" ? 16 : K == "b" ? 2 : 8, !g || g == _ ? P : C;
3618
+ if (!d && (A = A.replace(o, function(B, P, K) {
3619
+ return _ = (K = K.toLowerCase()) == "x" ? 16 : K == "b" ? 2 : 8, !g || g == _ ? P : B;
3499
3620
  }), g && (_ = g, A = A.replace(u, "$1").replace(h, "0.$1")), x != A))
3500
- return new E(A, _);
3501
- if (E.DEBUG)
3621
+ return new b(A, _);
3622
+ if (b.DEBUG)
3502
3623
  throw Error(c + "Not a" + (g ? " base " + g : "") + " number: " + x);
3503
3624
  m.s = null;
3504
3625
  }
@@ -3506,42 +3627,46 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3506
3627
  };
3507
3628
  }();
3508
3629
  function ft(o, u, h, I) {
3509
- var f, m, x, d, g, _, A, C = o.c, P = b;
3510
- if (C) {
3630
+ var f, m, x, d, g, _, A, B = o.c, P = E;
3631
+ if (B) {
3511
3632
  t: {
3512
- for (f = 1, d = C[0]; d >= 10; d /= 10, f++)
3633
+ for (f = 1, d = B[0]; d >= 10; d /= 10, f++)
3513
3634
  ;
3514
3635
  if (m = u - f, m < 0)
3515
- m += y, x = u, g = C[_ = 0], A = i(g / P[f - x - 1] % 10);
3516
- else if (_ = n((m + 1) / y), _ >= C.length)
3636
+ m += y, x = u, g = B[_ = 0], A = i(g / P[f - x - 1] % 10);
3637
+ else if (_ = n((m + 1) / y), _ >= B.length)
3517
3638
  if (I) {
3518
- for (; C.length <= _; C.push(0))
3639
+ for (; B.length <= _; B.push(0))
3519
3640
  ;
3520
3641
  g = A = 0, f = 1, m %= y, x = m - y + 1;
3521
3642
  } else
3522
3643
  break t;
3523
3644
  else {
3524
- for (g = d = C[_], f = 1; d >= 10; d /= 10, f++)
3645
+ for (g = d = B[_], f = 1; d >= 10; d /= 10, f++)
3525
3646
  ;
3526
3647
  m %= y, x = m - y + f, A = x < 0 ? 0 : i(g / P[f - x - 1] % 10);
3527
3648
  }
3528
- if (I = I || u < 0 || C[_ + 1] != null || (x < 0 ? g : g % P[f - x - 1]), I = h < 4 ? (A || I) && (h == 0 || h == (o.s < 0 ? 3 : 2)) : A > 5 || A == 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])
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;
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)
3649
+ if (I = I || u < 0 || // Are there any non-zero digits after the rounding digit?
3650
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
3651
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
3652
+ B[_ + 1] != null || (x < 0 ? g : g % P[f - x - 1]), I = h < 4 ? (A || I) && (h == 0 || h == (o.s < 0 ? 3 : 2)) : A > 5 || A == 5 && (h == 4 || I || h == 6 && // Check whether the digit to the left of the rounding digit is odd.
3653
+ (m > 0 ? x > 0 ? g / P[f - x] : 0 : B[_ - 1]) % 10 & 1 || h == (o.s < 0 ? 8 : 7)), u < 1 || !B[0])
3654
+ return B.length = 0, I ? (u -= o.e + 1, B[0] = P[(y - u % y) % y], o.e = -u || 0) : B[0] = o.e = 0, o;
3655
+ if (m == 0 ? (B.length = _, d = 1, _--) : (B.length = _ + 1, d = P[y - m], B[_] = x > 0 ? i(g / P[f - x] % P[x]) * d : 0), I)
3531
3656
  for (; ; )
3532
3657
  if (_ == 0) {
3533
- for (m = 1, x = C[0]; x >= 10; x /= 10, m++)
3658
+ for (m = 1, x = B[0]; x >= 10; x /= 10, m++)
3534
3659
  ;
3535
- for (x = C[0] += d, d = 1; x >= 10; x /= 10, d++)
3660
+ for (x = B[0] += d, d = 1; x >= 10; x /= 10, d++)
3536
3661
  ;
3537
- m != d && (o.e++, C[0] == p && (C[0] = 1));
3662
+ m != d && (o.e++, B[0] == p && (B[0] = 1));
3538
3663
  break;
3539
3664
  } else {
3540
- if (C[_] += d, C[_] != p)
3665
+ if (B[_] += d, B[_] != p)
3541
3666
  break;
3542
- C[_--] = 0, d = 1;
3667
+ B[_--] = 0, d = 1;
3543
3668
  }
3544
- for (m = C.length; C[--m] === 0; C.pop())
3669
+ for (m = B.length; B[--m] === 0; B.pop())
3545
3670
  ;
3546
3671
  }
3547
3672
  o.e > _t ? o.c = o.e = null : o.e < Ft && (o.c = [o.e = 0]);
@@ -3553,14 +3678,14 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3553
3678
  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);
3554
3679
  }
3555
3680
  return D.absoluteValue = D.abs = function() {
3556
- var o = new E(this);
3681
+ var o = new b(this);
3557
3682
  return o.s < 0 && (o.s = 1), o;
3558
3683
  }, D.comparedTo = function(o, u) {
3559
- return T(this, new E(o, u));
3684
+ return T(this, new b(o, u));
3560
3685
  }, D.decimalPlaces = D.dp = function(o, u) {
3561
3686
  var h, I, f, m = this;
3562
3687
  if (o != null)
3563
- return Q(o, 0, v), u == null ? u = J : Q(u, 0, 8), ft(new E(m), o + m.e + 1, u);
3688
+ return Q(o, 0, v), u == null ? u = J : Q(u, 0, 8), ft(new b(m), o + m.e + 1, u);
3564
3689
  if (!(h = m.c))
3565
3690
  return null;
3566
3691
  if (I = ((f = h.length - 1) - k(this.e / y)) * y, f = h[f])
@@ -3568,27 +3693,27 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3568
3693
  ;
3569
3694
  return I < 0 && (I = 0), I;
3570
3695
  }, D.dividedBy = D.div = function(o, u) {
3571
- return M(this, new E(o, u), q, J);
3696
+ return M(this, new b(o, u), q, J);
3572
3697
  }, D.dividedToIntegerBy = D.idiv = function(o, u) {
3573
- return M(this, new E(o, u), 0, 1);
3698
+ return M(this, new b(o, u), 0, 1);
3574
3699
  }, D.exponentiatedBy = D.pow = function(o, u) {
3575
- var h, I, f, m, x, d, g, _, A, C = this;
3576
- if (o = new E(o), o.c && !o.isInteger())
3700
+ var h, I, f, m, x, d, g, _, A, B = this;
3701
+ if (o = new b(o), o.c && !o.isInteger())
3577
3702
  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 A = new E(Math.pow(+bt(C), d ? o.s * (2 - R(o)) : +bt(o))), u ? A.mod(u) : A;
3703
+ if (u != null && (u = new b(u)), d = o.e > 14, !B.c || !B.c[0] || B.c[0] == 1 && !B.e && B.c.length == 1 || !o.c || !o.c[0])
3704
+ return A = new b(Math.pow(+bt(B), d ? o.s * (2 - R(o)) : +bt(o))), u ? A.mod(u) : A;
3580
3705
  if (g = o.s < 0, u) {
3581
3706
  if (u.c ? !u.c[0] : !u.s)
3582
- return new E(NaN);
3583
- I = !g && C.isInteger() && u.isInteger(), I && (C = C.mod(u));
3707
+ return new b(NaN);
3708
+ I = !g && B.isInteger() && u.isInteger(), I && (B = B.mod(u));
3584
3709
  } else {
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)))
3586
- return m = C.s < 0 && R(o) ? -0 : 0, C.e > -1 && (m = 1 / m), new E(g ? 1 / m : m);
3710
+ if (o.e > 9 && (B.e > 0 || B.e < -1 || (B.e == 0 ? B.c[0] > 1 || d && B.c[1] >= 24e7 : B.c[0] < 8e13 || d && B.c[0] <= 9999975e7)))
3711
+ return m = B.s < 0 && R(o) ? -0 : 0, B.e > -1 && (m = 1 / m), new b(g ? 1 / m : m);
3587
3712
  kt && (m = n(kt / y + 2));
3588
3713
  }
3589
- for (d ? (h = new E(0.5), g && (o.s = 1), _ = R(o)) : (f = Math.abs(+bt(o)), _ = f % 2), A = new E(F); ; ) {
3714
+ for (d ? (h = new b(0.5), g && (o.s = 1), _ = R(o)) : (f = Math.abs(+bt(o)), _ = f % 2), A = new b(F); ; ) {
3590
3715
  if (_) {
3591
- if (A = A.times(C), !A.c)
3716
+ if (A = A.times(B), !A.c)
3592
3717
  break;
3593
3718
  m ? A.c.length > m && (A.c.length = m) : I && (A = A.mod(u));
3594
3719
  }
@@ -3603,26 +3728,26 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3603
3728
  break;
3604
3729
  _ = f % 2;
3605
3730
  }
3606
- C = C.times(C), m ? C.c && C.c.length > m && (C.c.length = m) : I && (C = C.mod(u));
3731
+ B = B.times(B), m ? B.c && B.c.length > m && (B.c.length = m) : I && (B = B.mod(u));
3607
3732
  }
3608
3733
  return I ? A : (g && (A = F.div(A)), u ? A.mod(u) : m ? ft(A, kt, J, x) : A);
3609
3734
  }, D.integerValue = function(o) {
3610
- var u = new E(this);
3735
+ var u = new b(this);
3611
3736
  return o == null ? o = J : Q(o, 0, 8), ft(u, u.e + 1, o);
3612
3737
  }, D.isEqualTo = D.eq = function(o, u) {
3613
- return T(this, new E(o, u)) === 0;
3738
+ return T(this, new b(o, u)) === 0;
3614
3739
  }, D.isFinite = function() {
3615
3740
  return !!this.c;
3616
3741
  }, D.isGreaterThan = D.gt = function(o, u) {
3617
- return T(this, new E(o, u)) > 0;
3742
+ return T(this, new b(o, u)) > 0;
3618
3743
  }, D.isGreaterThanOrEqualTo = D.gte = function(o, u) {
3619
- return (u = T(this, new E(o, u))) === 1 || u === 0;
3744
+ return (u = T(this, new b(o, u))) === 1 || u === 0;
3620
3745
  }, D.isInteger = function() {
3621
3746
  return !!this.c && k(this.e / y) > this.c.length - 2;
3622
3747
  }, D.isLessThan = D.lt = function(o, u) {
3623
- return T(this, new E(o, u)) < 0;
3748
+ return T(this, new b(o, u)) < 0;
3624
3749
  }, D.isLessThanOrEqualTo = D.lte = function(o, u) {
3625
- return (u = T(this, new E(o, u))) === -1 || u === 0;
3750
+ return (u = T(this, new b(o, u))) === -1 || u === 0;
3626
3751
  }, D.isNaN = function() {
3627
3752
  return !this.s;
3628
3753
  }, D.isNegative = function() {
@@ -3633,71 +3758,74 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3633
3758
  return !!this.c && this.c[0] == 0;
3634
3759
  }, D.minus = function(o, u) {
3635
3760
  var h, I, f, m, x = this, d = x.s;
3636
- if (o = new E(o, u), u = o.s, !d || !u)
3637
- return new E(NaN);
3761
+ if (o = new b(o, u), u = o.s, !d || !u)
3762
+ return new b(NaN);
3638
3763
  if (d != u)
3639
3764
  return o.s = -u, x.plus(o);
3640
- var g = x.e / y, _ = o.e / y, A = x.c, C = o.c;
3765
+ var g = x.e / y, _ = o.e / y, A = x.c, B = o.c;
3641
3766
  if (!g || !_) {
3642
- if (!A || !C)
3643
- return A ? (o.s = -u, o) : new E(C ? x : NaN);
3644
- if (!A[0] || !C[0])
3645
- return C[0] ? (o.s = -u, o) : new E(A[0] ? x : J == 3 ? -0 : 0);
3767
+ if (!A || !B)
3768
+ return A ? (o.s = -u, o) : new b(B ? x : NaN);
3769
+ if (!A[0] || !B[0])
3770
+ return B[0] ? (o.s = -u, o) : new b(A[0] ? x : (
3771
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
3772
+ J == 3 ? -0 : 0
3773
+ ));
3646
3774
  }
3647
3775
  if (g = k(g), _ = k(_), A = A.slice(), d = g - _) {
3648
- for ((m = d < 0) ? (d = -d, f = A) : (_ = g, f = C), f.reverse(), u = d; u--; f.push(0))
3776
+ for ((m = d < 0) ? (d = -d, f = A) : (_ = g, f = B), f.reverse(), u = d; u--; f.push(0))
3649
3777
  ;
3650
3778
  f.reverse();
3651
3779
  } else
3652
- for (I = (m = (d = A.length) < (u = C.length)) ? d : u, d = u = 0; u < I; u++)
3653
- if (A[u] != C[u]) {
3654
- m = A[u] < C[u];
3780
+ for (I = (m = (d = A.length) < (u = B.length)) ? d : u, d = u = 0; u < I; u++)
3781
+ if (A[u] != B[u]) {
3782
+ m = A[u] < B[u];
3655
3783
  break;
3656
3784
  }
3657
- if (m && (f = A, A = C, C = f, o.s = -o.s), u = (I = C.length) - (h = A.length), u > 0)
3785
+ if (m && (f = A, A = B, B = f, o.s = -o.s), u = (I = B.length) - (h = A.length), u > 0)
3658
3786
  for (; u--; A[h++] = 0)
3659
3787
  ;
3660
3788
  for (u = p - 1; I > d; ) {
3661
- if (A[--I] < C[I]) {
3789
+ if (A[--I] < B[I]) {
3662
3790
  for (h = I; h && !A[--h]; A[h] = u)
3663
3791
  ;
3664
3792
  --A[h], A[I] += p;
3665
3793
  }
3666
- A[I] -= C[I];
3794
+ A[I] -= B[I];
3667
3795
  }
3668
3796
  for (; A[0] == 0; A.splice(0, 1), --_)
3669
3797
  ;
3670
3798
  return A[0] ? Se(o, A, _) : (o.s = J == 3 ? -1 : 1, o.c = [o.e = 0], o);
3671
3799
  }, D.modulo = D.mod = function(o, u) {
3672
3800
  var h, I, f = this;
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);
3801
+ return o = new b(o, u), !f.c || !o.s || o.c && !o.c[0] ? new b(NaN) : !o.c || f.c && !f.c[0] ? new b(f) : (Zt == 9 ? (I = o.s, o.s = 1, h = M(f, o, 0, 3), o.s = I, h.s *= I) : h = M(f, o, 0, Zt), o = f.minus(h.times(o)), !o.c[0] && Zt == 1 && (o.s = f.s), o);
3674
3802
  }, D.multipliedBy = D.times = function(o, u) {
3675
- var h, I, f, m, x, d, g, _, A, C, P, K, L, Z, et, V = this, $ = V.c, nt = (o = new E(o, u)).c;
3803
+ var h, I, f, m, x, d, g, _, A, B, P, K, L, Z, et, V = this, $ = V.c, nt = (o = new b(o, u)).c;
3676
3804
  if (!$ || !nt || !$[0] || !nt[0])
3677
3805
  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;
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))
3806
+ for (I = k(V.e / y) + k(o.e / y), o.s *= V.s, g = $.length, B = nt.length, g < B && (L = $, $ = nt, nt = L, f = g, g = B, B = f), f = g + B, L = []; f--; L.push(0))
3679
3807
  ;
3680
- for (Z = p, et = w, f = C; --f >= 0; ) {
3808
+ for (Z = p, et = w, f = B; --f >= 0; ) {
3681
3809
  for (h = 0, P = nt[f] % et, K = nt[f] / et | 0, x = g, m = f + x; m > f; )
3682
3810
  _ = $[--x] % et, A = $[x] / et | 0, d = K * _ + A * P, _ = P * _ + d % et * et + L[m] + h, h = (_ / Z | 0) + (d / et | 0) + K * A, L[m--] = _ % Z;
3683
3811
  L[m] = h;
3684
3812
  }
3685
3813
  return h ? ++I : L.splice(0, 1), Se(o, L, I);
3686
3814
  }, D.negated = function() {
3687
- var o = new E(this);
3815
+ var o = new b(this);
3688
3816
  return o.s = -o.s || null, o;
3689
3817
  }, D.plus = function(o, u) {
3690
3818
  var h, I = this, f = I.s;
3691
- if (o = new E(o, u), u = o.s, !f || !u)
3692
- return new E(NaN);
3819
+ if (o = new b(o, u), u = o.s, !f || !u)
3820
+ return new b(NaN);
3693
3821
  if (f != u)
3694
3822
  return o.s = -u, I.minus(o);
3695
3823
  var m = I.e / y, x = o.e / y, d = I.c, g = o.c;
3696
3824
  if (!m || !x) {
3697
3825
  if (!d || !g)
3698
- return new E(f / 0);
3826
+ return new b(f / 0);
3699
3827
  if (!d[0] || !g[0])
3700
- return g[0] ? o : new E(d[0] ? I : f * 0);
3828
+ return g[0] ? o : new b(d[0] ? I : f * 0);
3701
3829
  }
3702
3830
  if (m = k(m), x = k(x), d = d.slice(), f = m - x) {
3703
3831
  for (f > 0 ? (x = m, h = g) : (f = -f, h = d), h.reverse(); f--; h.push(0))
@@ -3710,7 +3838,7 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3710
3838
  }, D.precision = D.sd = function(o, u) {
3711
3839
  var h, I, f, m = this;
3712
3840
  if (o != null && o !== !!o)
3713
- return Q(o, 1, v), u == null ? u = J : Q(u, 0, 8), ft(new E(m), o, u);
3841
+ return Q(o, 1, v), u == null ? u = J : Q(u, 0, 8), ft(new b(m), o, u);
3714
3842
  if (!(h = m.c))
3715
3843
  return null;
3716
3844
  if (f = h.length - 1, I = f * y + 1, f = h[f]) {
@@ -3721,12 +3849,12 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3721
3849
  }
3722
3850
  return o && m.e + 1 > I && (I = m.e + 1), I;
3723
3851
  }, D.shiftedBy = function(o) {
3724
- return Q(o, -B, B), this.times("1e" + o);
3852
+ return Q(o, -C, C), this.times("1e" + o);
3725
3853
  }, D.squareRoot = D.sqrt = function() {
3726
- var o, u, h, I, f, m = this, x = m.c, d = m.s, g = m.e, _ = q + 4, A = new E("0.5");
3854
+ var o, u, h, I, f, m = this, x = m.c, d = m.s, g = m.e, _ = q + 4, A = new b("0.5");
3727
3855
  if (d !== 1 || !x || !x[0])
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]) {
3856
+ return new b(!d || d < 0 && (!x || x[0]) ? NaN : x ? m : 1 / 0);
3857
+ 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 b(u)) : h = new b(d + ""), h.c[0]) {
3730
3858
  for (g = h.e, d = g + _, d < 3 && (d = 0); ; )
3731
3859
  if (f = h, h = A.times(f.plus(M(m, f, _, 1))), N(f.c).slice(0, d) === (u = N(h.c)).slice(0, d))
3732
3860
  if (h.e < g && --d, u = u.slice(d - 3, d + 1), u == "9999" || !I && u == "4999") {
@@ -3752,39 +3880,39 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3752
3880
  else if (typeof h != "object")
3753
3881
  throw Error(c + "Argument not an object: " + h);
3754
3882
  if (I = f.toFixed(o, u), f.c) {
3755
- var m, x = I.split("."), d = +h.groupSize, g = +h.secondaryGroupSize, _ = h.groupSeparator || "", A = x[0], C = x[1], P = f.s < 0, K = P ? A.slice(1) : A, L = K.length;
3883
+ var m, x = I.split("."), d = +h.groupSize, g = +h.secondaryGroupSize, _ = h.groupSeparator || "", A = x[0], B = x[1], P = f.s < 0, K = P ? A.slice(1) : A, L = K.length;
3756
3884
  if (g && (m = d, d = g, g = m, L -= m), d > 0 && L > 0) {
3757
3885
  for (m = L % d || d, A = K.substr(0, m); m < L; m += d)
3758
3886
  A += _ + K.substr(m, d);
3759
3887
  g > 0 && (A += _ + K.slice(m)), P && (A = "-" + A);
3760
3888
  }
3761
- I = C ? A + (h.decimalSeparator || "") + ((g = +h.fractionGroupSize) ? C.replace(
3889
+ I = B ? A + (h.decimalSeparator || "") + ((g = +h.fractionGroupSize) ? B.replace(
3762
3890
  new RegExp("\\d{" + g + "}\\B", "g"),
3763
3891
  "$&" + (h.fractionGroupSeparator || "")
3764
- ) : C) : A;
3892
+ ) : B) : A;
3765
3893
  }
3766
3894
  return (h.prefix || "") + I + (h.suffix || "");
3767
3895
  }, D.toFraction = function(o) {
3768
- var u, h, I, f, m, x, d, g, _, A, 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)))
3896
+ var u, h, I, f, m, x, d, g, _, A, B, P, K = this, L = K.c;
3897
+ if (o != null && (d = new b(o), !d.isInteger() && (d.c || d.s !== 1) || d.lt(F)))
3770
3898
  throw Error(c + "Argument " + (d.isInteger() ? "out of range: " : "not an integer: ") + bt(d));
3771
3899
  if (!L)
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 = _t, _t = 1 / 0, d = new E(P), g.c[0] = 0; A = M(d, u, 0, 1), f = h.plus(A.times(I)), f.comparedTo(o) != 1; )
3900
+ return new b(K);
3901
+ for (u = new b(F), _ = h = new b(F), I = g = new b(F), P = N(L), m = u.e = P.length - K.e - 1, u.c[0] = E[(x = m % y) < 0 ? y + x : x], o = !o || d.comparedTo(u) > 0 ? m > 0 ? u : _ : d, x = _t, _t = 1 / 0, d = new b(P), g.c[0] = 0; A = M(d, u, 0, 1), f = h.plus(A.times(I)), f.comparedTo(o) != 1; )
3774
3902
  h = I, I = f, _ = g.plus(A.times(f = _)), g = f, u = d.minus(A.times(f = u)), d = f;
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(
3903
+ 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, B = M(_, I, m, J).minus(K).abs().comparedTo(
3776
3904
  M(g, h, m, J).minus(K).abs()
3777
- ) < 1 ? [_, I] : [g, h], _t = x, C;
3905
+ ) < 1 ? [_, I] : [g, h], _t = x, B;
3778
3906
  }, D.toNumber = function() {
3779
3907
  return +bt(this);
3780
3908
  }, D.toPrecision = function(o, u) {
3781
3909
  return o != null && Q(o, 1, v), Be(this, o, u, 2);
3782
3910
  }, D.toString = function(o) {
3783
3911
  var u, h = this, I = h.s, f = h.e;
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 && Ce ? (h = ft(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;
3912
+ 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 && Ce ? (h = ft(new b(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;
3785
3913
  }, D.valueOf = D.toJSON = function() {
3786
3914
  return bt(this);
3787
- }, D._isBigNumber = !0, O != null && E.set(O), E;
3915
+ }, D._isBigNumber = !0, O != null && b.set(O), b;
3788
3916
  }
3789
3917
  function k(O) {
3790
3918
  var M = O | 0;
@@ -3843,12 +3971,14 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3843
3971
  return O;
3844
3972
  }
3845
3973
  t = U(), t.default = t.BigNumber = t, s.exports ? s.exports = t : (e || (e = typeof self < "u" && self ? self : window), e.BigNumber = t);
3846
- })(Ne);
3847
- })(ze);
3974
+ })(Ue);
3975
+ })(Gr);
3976
+ var Yr = Gr.exports;
3848
3977
  (function(s) {
3849
- var e = ze.exports, t = s.exports;
3978
+ var e = Yr, t = s.exports;
3850
3979
  (function() {
3851
3980
  var r = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, n, i, c = {
3981
+ // table of character substitutions
3852
3982
  "\b": "\\b",
3853
3983
  " ": "\\t",
3854
3984
  "\n": "\\n",
@@ -3857,15 +3987,15 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3857
3987
  '"': '\\"',
3858
3988
  "\\": "\\\\"
3859
3989
  }, l;
3860
- function p(B) {
3861
- return r.lastIndex = 0, r.test(B) ? '"' + B.replace(r, function(b) {
3862
- var w = c[b];
3863
- return typeof w == "string" ? w : "\\u" + ("0000" + b.charCodeAt(0).toString(16)).slice(-4);
3864
- }) + '"' : '"' + B + '"';
3990
+ function p(C) {
3991
+ return r.lastIndex = 0, r.test(C) ? '"' + C.replace(r, function(E) {
3992
+ var w = c[E];
3993
+ return typeof w == "string" ? w : "\\u" + ("0000" + E.charCodeAt(0).toString(16)).slice(-4);
3994
+ }) + '"' : '"' + C + '"';
3865
3995
  }
3866
- function y(B, b) {
3867
- var w, v, U, k, N = n, T, Q = b[B], R = Q != null && (Q instanceof e || e.isBigNumber(Q));
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) {
3996
+ function y(C, E) {
3997
+ var w, v, U, k, N = n, T, Q = E[C], R = Q != null && (Q instanceof e || e.isBigNumber(Q));
3998
+ switch (Q && typeof Q == "object" && typeof Q.toJSON == "function" && (Q = Q.toJSON(C)), typeof l == "function" && (Q = l.call(E, C, Q)), typeof Q) {
3869
3999
  case "string":
3870
4000
  return R ? Q : p(Q);
3871
4001
  case "number":
@@ -3899,27 +4029,31 @@ var Wt = { exports: {} }, Lr = { exports: {} }, ze = { exports: {} };
3899
4029
  ` + N + "}" : "{" + T.join(",") + "}", n = N, U;
3900
4030
  }
3901
4031
  }
3902
- typeof t.stringify != "function" && (t.stringify = function(B, b, w) {
4032
+ typeof t.stringify != "function" && (t.stringify = function(C, E, w) {
3903
4033
  var v;
3904
4034
  if (n = "", i = "", typeof w == "number")
3905
4035
  for (v = 0; v < w; v += 1)
3906
4036
  i += " ";
3907
4037
  else
3908
4038
  typeof w == "string" && (i = w);
3909
- if (l = b, b && typeof b != "function" && (typeof b != "object" || typeof b.length != "number"))
4039
+ if (l = E, E && typeof E != "function" && (typeof E != "object" || typeof E.length != "number"))
3910
4040
  throw new Error("JSON.stringify");
3911
- return y("", { "": B });
4041
+ return y("", { "": C });
3912
4042
  });
3913
4043
  })();
3914
4044
  })(Lr);
3915
- var fe = null;
3916
- 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)/;
3917
- var Zs = function(s) {
4045
+ var sn = Lr.exports, he = null;
4046
+ const nn = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, an = /(?: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)/;
4047
+ var on = function(s) {
3918
4048
  var e = {
3919
4049
  strict: !1,
4050
+ // not being strict means do not generate syntax errors for "duplicate key"
3920
4051
  storeAsString: !1,
4052
+ // toggles whether the values should be stored as BigNumber (default) or a string
3921
4053
  alwaysParseAsBig: !1,
4054
+ // toggles whether all numbers should be Big
3922
4055
  useNativeBigInt: !1,
4056
+ // toggles whether to use native BigInt instead of bignumber.js
3923
4057
  protoAction: "error",
3924
4058
  constructorAction: "error"
3925
4059
  };
@@ -3971,7 +4105,7 @@ var Zs = function(s) {
3971
4105
  if (k = +N, !isFinite(k))
3972
4106
  c("Bad number");
3973
4107
  else
3974
- return fe == null && (fe = ze.exports), N.length > 15 ? e.storeAsString ? N : e.useNativeBigInt ? BigInt(N) : new fe(N) : e.alwaysParseAsBig ? e.useNativeBigInt ? BigInt(k) : new fe(k) : k;
4108
+ return he == null && (he = Yr), N.length > 15 ? e.storeAsString ? N : e.useNativeBigInt ? BigInt(N) : new he(N) : e.alwaysParseAsBig ? e.useNativeBigInt ? BigInt(k) : new he(k) : k;
3975
4109
  }, y = function() {
3976
4110
  var k, N, T = "", Q;
3977
4111
  if (r === '"')
@@ -3991,10 +4125,10 @@ var Zs = function(s) {
3991
4125
  }
3992
4126
  }
3993
4127
  c("Bad string");
3994
- }, B = function() {
4128
+ }, C = function() {
3995
4129
  for (; r && r <= " "; )
3996
4130
  l();
3997
- }, b = function() {
4131
+ }, E = function() {
3998
4132
  switch (r) {
3999
4133
  case "t":
4000
4134
  return l("t"), l("r"), l("u"), l("e"), !0;
@@ -4007,30 +4141,30 @@ var Zs = function(s) {
4007
4141
  }, w, v = function() {
4008
4142
  var k = [];
4009
4143
  if (r === "[") {
4010
- if (l("["), B(), r === "]")
4144
+ if (l("["), C(), r === "]")
4011
4145
  return l("]"), k;
4012
4146
  for (; r; ) {
4013
- if (k.push(w()), B(), r === "]")
4147
+ if (k.push(w()), C(), r === "]")
4014
4148
  return l("]"), k;
4015
- l(","), B();
4149
+ l(","), C();
4016
4150
  }
4017
4151
  }
4018
4152
  c("Bad array");
4019
4153
  }, U = function() {
4020
4154
  var k, N = /* @__PURE__ */ Object.create(null);
4021
4155
  if (r === "{") {
4022
- if (l("{"), B(), r === "}")
4156
+ if (l("{"), C(), r === "}")
4023
4157
  return l("}"), N;
4024
4158
  for (; r; ) {
4025
- if (k = y(), B(), l(":"), e.strict === !0 && Object.hasOwnProperty.call(N, k) && c('Duplicate key "' + k + '"'), js.test(k) === !0 ? e.protoAction === "error" ? c("Object contains forbidden prototype property") : e.protoAction === "ignore" ? w() : N[k] = w() : Xs.test(k) === !0 ? e.constructorAction === "error" ? c("Object contains forbidden constructor property") : e.constructorAction === "ignore" ? w() : N[k] = w() : N[k] = w(), B(), r === "}")
4159
+ if (k = y(), C(), l(":"), e.strict === !0 && Object.hasOwnProperty.call(N, k) && c('Duplicate key "' + k + '"'), nn.test(k) === !0 ? e.protoAction === "error" ? c("Object contains forbidden prototype property") : e.protoAction === "ignore" ? w() : N[k] = w() : an.test(k) === !0 ? e.constructorAction === "error" ? c("Object contains forbidden constructor property") : e.constructorAction === "ignore" ? w() : N[k] = w() : N[k] = w(), C(), r === "}")
4026
4160
  return l("}"), N;
4027
- l(","), B();
4161
+ l(","), C();
4028
4162
  }
4029
4163
  }
4030
4164
  c("Bad object");
4031
4165
  };
4032
4166
  return w = function() {
4033
- switch (B(), r) {
4167
+ switch (C(), r) {
4034
4168
  case "{":
4035
4169
  return U();
4036
4170
  case "[":
@@ -4040,29 +4174,31 @@ var Zs = function(s) {
4040
4174
  case "-":
4041
4175
  return p();
4042
4176
  default:
4043
- return r >= "0" && r <= "9" ? p() : b();
4177
+ return r >= "0" && r <= "9" ? p() : E();
4044
4178
  }
4045
4179
  }, function(k, N) {
4046
4180
  var T;
4047
- return i = k + "", t = 0, r = " ", T = w(), B(), r && c("Syntax error"), typeof N == "function" ? function Q(R, j) {
4181
+ return i = k + "", t = 0, r = " ", T = w(), C(), r && c("Syntax error"), typeof N == "function" ? function Q(R, j) {
4048
4182
  var Y, O = R[j];
4049
4183
  return O && typeof O == "object" && Object.keys(O).forEach(function(M) {
4050
4184
  Y = Q(O, M), Y !== void 0 ? O[M] = Y : delete O[M];
4051
4185
  }), N.call(R, j, O);
4052
4186
  }({ "": T }, "") : T;
4053
4187
  };
4054
- }, tn = Zs, Gr = Lr.exports.stringify, Yr = tn;
4055
- Wt.exports = function(s) {
4188
+ }, cn = on, $r = sn.stringify, zr = cn;
4189
+ xe.exports = function(s) {
4056
4190
  return {
4057
- parse: Yr(s),
4058
- stringify: Gr
4191
+ parse: zr(s),
4192
+ stringify: $r
4059
4193
  };
4060
4194
  };
4061
- Wt.exports.parse = Yr();
4062
- Wt.exports.stringify = Gr;
4063
- class en {
4195
+ xe.exports.parse = zr();
4196
+ xe.exports.stringify = $r;
4197
+ var un = xe.exports;
4198
+ const De = /* @__PURE__ */ Is(un);
4199
+ class ln {
4064
4200
  txHex = "";
4065
- txBuilder = Ae();
4201
+ txBuilder = pe();
4066
4202
  txEvaluationMultiplier = 1.1;
4067
4203
  _protocolParams = At;
4068
4204
  txOutput;
@@ -4074,7 +4210,15 @@ class en {
4074
4210
  txInQueueItem;
4075
4211
  collateralQueueItem;
4076
4212
  refScriptTxInQueueItem;
4077
- reset = () => (this.txHex = "", this.txBuilder = Ae(), this.txEvaluationMultiplier = 1.1, this._protocolParams = At, 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);
4213
+ /**
4214
+ * Reset everything in the MeshTxBuilder instance
4215
+ * @returns The MeshTxBuilder instance
4216
+ */
4217
+ reset = () => (this.txHex = "", this.txBuilder = pe(), this.txEvaluationMultiplier = 1.1, this._protocolParams = At, 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);
4218
+ /**
4219
+ * Make an empty transaction body for building transaction in object
4220
+ * @returns An empty transaction body
4221
+ */
4078
4222
  emptyTxBuilderBody = () => ({
4079
4223
  inputs: [],
4080
4224
  outputs: [],
@@ -4093,13 +4237,25 @@ class en {
4093
4237
  constructor() {
4094
4238
  this.meshTxBuilderBody = this.emptyTxBuilderBody();
4095
4239
  }
4240
+ /**
4241
+ * Synchronous functions here
4242
+ */
4243
+ /**
4244
+ * It builds the transaction without dependencies
4245
+ * @param customizedTx The optional customized transaction body
4246
+ * @returns The signed transaction in hex ready to submit / signed by client
4247
+ */
4096
4248
  completeSync = (e) => (e ? this.meshTxBuilderBody = e : this.queueAllLastItem(), this.serializeTxBody(this.meshTxBuilderBody));
4249
+ /**
4250
+ * Complete the signing process
4251
+ * @returns The signed transaction in hex
4252
+ */
4097
4253
  completeSigning = () => {
4098
4254
  const { signingKey: e } = this.meshTxBuilderBody;
4099
4255
  return e.length > 0 && this.addAllSigningKeys(e), this.txHex;
4100
4256
  };
4101
4257
  serializeTxBody = (e) => {
4102
- const { inputs: t, outputs: r, extraInputs: n, selectionThreshold: i, collaterals: c, referenceInputs: l, mints: p, changeAddress: y, certificates: B, validityRange: b, requiredSignatures: w, metadata: v } = e;
4258
+ const { inputs: t, outputs: r, extraInputs: n, selectionThreshold: i, collaterals: c, referenceInputs: l, mints: p, changeAddress: y, certificates: C, validityRange: E, requiredSignatures: w, metadata: v } = e;
4103
4259
  if (this.isHydra ? this.protocolParams({
4104
4260
  minFeeA: 0,
4105
4261
  minFeeB: 0,
@@ -4107,7 +4263,7 @@ class en {
4107
4263
  priceStep: 0,
4108
4264
  collateralPercent: 0,
4109
4265
  coinsPerUTxOSize: "0"
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(p), this.addAllCertificates(B), this.addValidityRange(b), this.addAllRequiredSignatures(w), this.addAllMetadata(v), this.addCostModels(), y) {
4266
+ }) : 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(p), this.addAllCertificates(C), this.addValidityRange(E), this.addAllRequiredSignatures(w), this.addAllMetadata(v), this.addCostModels(), y) {
4111
4267
  const U = this.meshTxBuilderBody.collaterals.map((T) => {
4112
4268
  var Q, R;
4113
4269
  return ((R = (Q = T.txIn.amount) == null ? void 0 : Q.find((j) => j.unit === "lovelace")) == null ? void 0 : R.quantity) || "0";
@@ -4121,6 +4277,14 @@ class en {
4121
4277
  }
4122
4278
  return this.buildTx(), this;
4123
4279
  };
4280
+ /**
4281
+ * Set the input for transaction
4282
+ * @param txHash The transaction hash of the input UTxO
4283
+ * @param txIndex The transaction index of the input UTxO
4284
+ * @param amount The asset amount of index of the input UTxO
4285
+ * @param address The address of the input UTxO
4286
+ * @returns The MeshTxBuilder instance
4287
+ */
4124
4288
  txIn = (e, t, r, n) => (this.txInQueueItem && this.queueInput(), this.addingScriptInput ? this.txInQueueItem = {
4125
4289
  type: "Script",
4126
4290
  txIn: {
@@ -4139,6 +4303,12 @@ class en {
4139
4303
  address: n
4140
4304
  }
4141
4305
  }, this.addingScriptInput = !1, this);
4306
+ /**
4307
+ * Set the script for transaction input
4308
+ * @param {string} scriptCbor The CborHex of the script
4309
+ * @param version Optional - The Plutus script version
4310
+ * @returns The MeshTxBuilder instance
4311
+ */
4142
4312
  txInScript = (e, t) => {
4143
4313
  if (!this.txInQueueItem)
4144
4314
  throw Error("Undefined input");
@@ -4163,6 +4333,12 @@ class en {
4163
4333
  }
4164
4334
  return this;
4165
4335
  };
4336
+ /**
4337
+ * Set the input datum for transaction input
4338
+ * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4339
+ * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4340
+ * @returns The MeshTxBuilder instance
4341
+ */
4166
4342
  txInDatumValue = (e, t = "Mesh") => {
4167
4343
  if (!this.txInQueueItem)
4168
4344
  throw Error("Undefined input");
@@ -4185,6 +4361,10 @@ class en {
4185
4361
  }
4186
4362
  }, this);
4187
4363
  };
4364
+ /**
4365
+ * Tell the transaction builder that the input UTxO has inlined datum
4366
+ * @returns The MeshTxBuilder instance
4367
+ */
4188
4368
  txInInlineDatumPresent = () => {
4189
4369
  if (!this.txInQueueItem)
4190
4370
  throw Error("Undefined input");
@@ -4199,6 +4379,40 @@ class en {
4199
4379
  txIndex: t
4200
4380
  }), this;
4201
4381
  };
4382
+ // /**
4383
+ // * Native script - Set the reference input where it would also be spent in the transaction
4384
+ // * @param txHash The transaction hash of the reference UTxO
4385
+ // * @param txIndex The transaction index of the reference UTxO
4386
+ // * @param spendingScriptHash The script hash of the spending script
4387
+ // * @returns The MeshTxBuilder instance
4388
+ // */
4389
+ // simpleScriptTxInReference = (
4390
+ // txHash: string,
4391
+ // txIndex: number,
4392
+ // spendingScriptHash?: string
4393
+ // ) => {
4394
+ // if (!this.txInQueueItem) throw Error('Undefined input');
4395
+ // if (this.txInQueueItem.type === 'PubKey')
4396
+ // throw Error(
4397
+ // 'Spending tx in reference attempted to be called a non script input'
4398
+ // );
4399
+ // this.txInQueueItem.scriptTxIn.scriptSource = {
4400
+ // type: 'Inline',
4401
+ // txInInfo: {
4402
+ // txHash,
4403
+ // txIndex,
4404
+ // spendingScriptHash,
4405
+ // },
4406
+ // };
4407
+ // return this;
4408
+ // };
4409
+ /**
4410
+ * Set the redeemer for the reference input to be spent in same transaction
4411
+ * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4412
+ * @param exUnits The execution units budget for the redeemer
4413
+ * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4414
+ * @returns The MeshTxBuilder instance
4415
+ */
4202
4416
  txInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => {
4203
4417
  if (!this.txInQueueItem)
4204
4418
  throw Error("Undefined input");
@@ -4221,10 +4435,22 @@ class en {
4221
4435
  exUnits: t
4222
4436
  }, this);
4223
4437
  };
4438
+ /**
4439
+ * Set the output for transaction
4440
+ * @param {string} address The recipient of the output
4441
+ * @param {Asset[]} amount The amount of other native assets attached with UTxO
4442
+ * @returns The MeshTxBuilder instance
4443
+ */
4224
4444
  txOut = (e, t) => (this.txOutput && (this.meshTxBuilderBody.outputs.push(this.txOutput), this.txOutput = void 0), this.txOutput = {
4225
4445
  address: e,
4226
4446
  amount: t
4227
4447
  }, this);
4448
+ /**
4449
+ * Set the output datum hash for transaction
4450
+ * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4451
+ * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4452
+ * @returns The MeshTxBuilder instance
4453
+ */
4228
4454
  txOutDatumHashValue = (e, t = "Mesh") => {
4229
4455
  let r = e;
4230
4456
  if (this.txOutput) {
@@ -4246,6 +4472,12 @@ class en {
4246
4472
  }
4247
4473
  return this;
4248
4474
  };
4475
+ /**
4476
+ * Set the output inline datum for transaction
4477
+ * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4478
+ * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4479
+ * @returns The MeshTxBuilder instance
4480
+ */
4249
4481
  txOutInlineDatumValue = (e, t = "Mesh") => {
4250
4482
  let r = e;
4251
4483
  if (this.txOutput) {
@@ -4267,8 +4499,25 @@ class en {
4267
4499
  }
4268
4500
  return this;
4269
4501
  };
4502
+ /**
4503
+ * Set the reference script to be attached with the output
4504
+ * @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
4505
+ * @param version Optional - The Plutus script version
4506
+ * @returns The MeshTxBuilder instance
4507
+ */
4270
4508
  txOutReferenceScript = (e, t = "V2") => (this.txOutput && (this.txOutput.referenceScript = { code: e, version: t }), this);
4509
+ /**
4510
+ * Set the instruction that it is currently using V2 Plutus spending scripts
4511
+ * @returns The MeshTxBuilder instance
4512
+ */
4271
4513
  spendingPlutusScriptV2 = () => (this.addingScriptInput = !0, this);
4514
+ /**
4515
+ * Set the reference input where it would also be spent in the transaction
4516
+ * @param txHash The transaction hash of the reference UTxO
4517
+ * @param txIndex The transaction index of the reference UTxO
4518
+ * @param spendingScriptHash The script hash of the spending script
4519
+ * @returns The MeshTxBuilder instance
4520
+ */
4272
4521
  spendingTxInReference = (e, t, r, n = "V2") => {
4273
4522
  if (!this.txInQueueItem)
4274
4523
  throw Error("Undefined input");
@@ -4286,16 +4535,52 @@ class en {
4286
4535
  }
4287
4536
  }, this;
4288
4537
  };
4538
+ /**
4539
+ * [Alias of txInInlineDatumPresent] Set the instruction that the reference input has inline datum
4540
+ * @returns The MeshTxBuilder instance
4541
+ */
4542
+ // Unsure how this is different from the --tx-in-inline-datum-present flag
4543
+ // It seems to just be different based on if the script is a reference input
4289
4544
  spendingReferenceTxInInlineDatumPresent = () => (this.txInInlineDatumPresent(), this);
4545
+ /**
4546
+ * [Alias of txInRedeemerValue] Set the redeemer for the reference input to be spent in same transaction
4547
+ * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4548
+ * @param exUnits The execution units budget for the redeemer
4549
+ * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4550
+ * @returns The MeshTxBuilder instance
4551
+ */
4290
4552
  spendingReferenceTxInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => (this.txInRedeemerValue(e, t, r), this);
4553
+ /**
4554
+ * Specify a read only reference input. This reference input is not witnessing anything it is simply provided in the plutus script context.
4555
+ * @param txHash The transaction hash of the reference UTxO
4556
+ * @param txIndex The transaction index of the reference UTxO
4557
+ * @returns The MeshTxBuilder instance
4558
+ */
4291
4559
  readOnlyTxInReference = (e, t) => (this.meshTxBuilderBody.referenceInputs.push({ txHash: e, txIndex: t }), this);
4560
+ /**
4561
+ * Set the instruction that it is currently using V2 Plutus minting scripts
4562
+ * @returns The MeshTxBuilder instance
4563
+ */
4292
4564
  mintPlutusScriptV2 = () => (this.addingPlutusMint = !0, this);
4565
+ /**
4566
+ * Set the minting value of transaction
4567
+ * @param quantity The quantity of asset to be minted
4568
+ * @param policy The policy id of the asset to be minted
4569
+ * @param name The hex of token name of the asset to be minted
4570
+ * @returns The MeshTxBuilder instance
4571
+ */
4293
4572
  mint = (e, t, r) => (this.mintItem && this.queueMint(), this.mintItem = {
4294
4573
  type: this.addingPlutusMint ? "Plutus" : "Native",
4295
4574
  policyId: t,
4296
4575
  assetName: r,
4297
4576
  amount: e
4298
4577
  }, this.addingPlutusMint = !1, this);
4578
+ /**
4579
+ * Set the minting script of current mint
4580
+ * @param scriptCBOR The CBOR hex of the minting policy script
4581
+ * @param version Optional - The Plutus script version
4582
+ * @returns The MeshTxBuilder instance
4583
+ */
4299
4584
  mintingScript = (e, t = "V2") => {
4300
4585
  if (!this.mintItem)
4301
4586
  throw Error("Undefined mint");
@@ -4306,6 +4591,12 @@ class en {
4306
4591
  script: { code: e, version: t }
4307
4592
  }, this;
4308
4593
  };
4594
+ /**
4595
+ * Use reference script for minting
4596
+ * @param txHash The transaction hash of the UTxO
4597
+ * @param txIndex The transaction index of the UTxO
4598
+ * @returns The MeshTxBuilder instance
4599
+ */
4309
4600
  mintTxInReference = (e, t, r = "V2") => {
4310
4601
  if (!this.mintItem)
4311
4602
  throw Error("Undefined mint");
@@ -4322,6 +4613,13 @@ class en {
4322
4613
  version: r
4323
4614
  }, this;
4324
4615
  };
4616
+ /**
4617
+ * Set the redeemer for minting
4618
+ * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4619
+ * @param exUnits The execution units budget for the redeemer
4620
+ * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4621
+ * @returns The MeshTxBuilder instance
4622
+ */
4325
4623
  mintReferenceTxInRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => {
4326
4624
  if (!this.mintItem)
4327
4625
  throw Error("Undefined mint");
@@ -4349,8 +4647,28 @@ class en {
4349
4647
  }
4350
4648
  return this;
4351
4649
  };
4650
+ /**
4651
+ * Set the redeemer for the reference input to be spent in same transaction
4652
+ * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4653
+ * @param exUnits The execution units budget for the redeemer
4654
+ * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
4655
+ * @returns The MeshTxBuilder instance
4656
+ */
4352
4657
  mintRedeemerValue = (e, t = { ...Yt }, r = "Mesh") => (this.mintReferenceTxInRedeemerValue(e, t, r), this);
4658
+ /**
4659
+ * Set the required signer of the transaction
4660
+ * @param pubKeyHash The PubKeyHash of the required signer
4661
+ * @returns The MeshTxBuilder instance
4662
+ */
4353
4663
  requiredSignerHash = (e) => (this.meshTxBuilderBody.requiredSignatures.push(e), this);
4664
+ /**
4665
+ * Set the collateral UTxO for the transaction
4666
+ * @param txHash The transaction hash of the collateral UTxO
4667
+ * @param txIndex The transaction index of the collateral UTxO
4668
+ * @param amount The asset amount of index of the collateral UTxO
4669
+ * @param address The address of the collateral UTxO
4670
+ * @returns The MeshTxBuilder instance
4671
+ */
4354
4672
  txInCollateral = (e, t, r, n) => (this.collateralQueueItem && this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem), this.collateralQueueItem = {
4355
4673
  type: "PubKey",
4356
4674
  txIn: {
@@ -4360,48 +4678,112 @@ class en {
4360
4678
  address: n
4361
4679
  }
4362
4680
  }, this);
4681
+ /**
4682
+ * Creates a pool registration certificate, and adds it to the transaction
4683
+ * @param poolParams Parameters for pool registration
4684
+ * @returns The MeshTxBuilder instance
4685
+ */
4363
4686
  registerPoolCertificate = (e) => (this.meshTxBuilderBody.certificates.push({
4364
4687
  type: "RegisterPool",
4365
4688
  poolParams: e
4366
4689
  }), this);
4690
+ /**
4691
+ * Creates a stake registration certificate, and adds it to the transaction
4692
+ * @param stakeKeyHash The keyHash of the stake key
4693
+ * @returns The MeshTxBuilder instance
4694
+ */
4367
4695
  registerStakeCertificate = (e) => (this.meshTxBuilderBody.certificates.push({
4368
4696
  type: "RegisterStake",
4369
4697
  stakeKeyHash: e
4370
4698
  }), this);
4699
+ /**
4700
+ * Creates a stake delegation certificate, and adds it to the transaction
4701
+ * This will delegate stake from the corresponding stake address to the pool
4702
+ * @param stakeKeyHash The keyHash of the stake key
4703
+ * @param poolId poolId can be in either bech32 or hex form
4704
+ * @returns The MeshTxBuilder instance
4705
+ */
4371
4706
  delegateStakeCertificate = (e, t) => (this.meshTxBuilderBody.certificates.push({
4372
4707
  type: "DelegateStake",
4373
4708
  stakeKeyHash: e,
4374
4709
  poolId: t
4375
4710
  }), this);
4711
+ /**
4712
+ * Creates a stake deregister certificate, and adds it to the transaction
4713
+ * @param stakeKeyHash The keyHash of the stake key
4714
+ * @returns The MeshTxBuilder instance
4715
+ */
4376
4716
  deregisterStakeCertificate = (e) => (this.meshTxBuilderBody.certificates.push({
4377
4717
  type: "DeregisterStake",
4378
4718
  stakeKeyHash: e
4379
4719
  }), this);
4720
+ /**
4721
+ * Creates a pool retire certificate, and adds it to the transaction
4722
+ * @param poolId poolId can be in either bech32 or hex form
4723
+ * @param epoch The intended epoch to retire the pool
4724
+ * @returns The MeshTxBuilder instance
4725
+ */
4380
4726
  retirePoolCertificate = (e, t) => (this.meshTxBuilderBody.certificates.push({
4381
4727
  type: "RetirePool",
4382
4728
  poolId: e,
4383
4729
  epoch: t
4384
4730
  }), this);
4731
+ /**
4732
+ * Configure the address to accept change UTxO
4733
+ * @param addr The address to accept change UTxO
4734
+ * @returns The MeshTxBuilder instance
4735
+ */
4385
4736
  changeAddress = (e) => (this.meshTxBuilderBody.changeAddress = e, this);
4737
+ /**
4738
+ * Set the transaction valid interval to be valid only after the slot
4739
+ * @param slot The transaction is valid only after this slot
4740
+ * @returns The MeshTxBuilder instance
4741
+ */
4386
4742
  invalidBefore = (e) => (this.meshTxBuilderBody.validityRange.invalidBefore = e, this);
4743
+ /**
4744
+ * Set the transaction valid interval to be valid only before the slot
4745
+ * @param slot The transaction is valid only before this slot
4746
+ * @returns The MeshTxBuilder instance
4747
+ */
4387
4748
  invalidHereafter = (e) => (this.meshTxBuilderBody.validityRange.invalidHereafter = e, this);
4749
+ /**
4750
+ * Add metadata to the transaction
4751
+ * @param tag The tag of the metadata
4752
+ * @param metadata The metadata in object format
4753
+ * @returns The MeshTxBuilder instance
4754
+ */
4388
4755
  metadataValue = (e, t) => (this.meshTxBuilderBody.metadata.push({ tag: e, metadata: t }), this);
4756
+ /**
4757
+ * Set the protocol parameters to be used for the transaction other than the default one
4758
+ * @param params (Part of) the protocol parameters to be used for the transaction
4759
+ * @returns The MeshTxBuilder instance
4760
+ */
4389
4761
  protocolParams = (e) => {
4390
4762
  const t = { ...At, ...e };
4391
- return this._protocolParams = t, this.txBuilder = Ae(t), this;
4763
+ return this._protocolParams = t, this.txBuilder = pe(t), this;
4392
4764
  };
4765
+ /**
4766
+ * Sign the transaction with the private key
4767
+ * @param skeyHex The private key in cborHex (with or without 5820 prefix, i.e. the format when generated from cardano-cli)
4768
+ * @returns
4769
+ */
4393
4770
  signingKey = (e) => (this.meshTxBuilderBody.signingKey.push(e), this);
4771
+ /**
4772
+ * EXPERIMENTAL - Selects utxos to fill output value and puts them into inputs
4773
+ * @param extraInputs The inputs already placed into the object will remain, these extra inputs will be used to fill the remaining value needed
4774
+ * @param threshold Extra value needed to be selected for, usually for paying fees and min UTxO value of change output
4775
+ */
4394
4776
  selectUtxosFrom = (e, t = 5e6) => (this.meshTxBuilderBody.extraInputs = e, this.meshTxBuilderBody.selectionThreshold = t, this);
4395
4777
  addUtxosFrom = (e, t) => {
4396
4778
  const r = this.meshTxBuilderBody.outputs.reduce((i, c) => (c.amount.forEach((p) => {
4397
- const { unit: y, quantity: B } = p, b = Number(i.get(y)) || 0;
4398
- i.set(y, String(b + Number(B)));
4779
+ const { unit: y, quantity: C } = p, E = Number(i.get(y)) || 0;
4780
+ i.set(y, String(E + Number(C)));
4399
4781
  }), i), /* @__PURE__ */ new Map());
4400
4782
  this.meshTxBuilderBody.inputs.reduce((i, c) => {
4401
4783
  const l = c.txIn.amount;
4402
4784
  return l == null || l.forEach((p) => {
4403
- const { unit: y, quantity: B } = p, b = Number(i.get(y)) || 0;
4404
- i.set(y, String(b - Number(B)));
4785
+ const { unit: y, quantity: C } = p, E = Number(i.get(y)) || 0;
4786
+ i.set(y, String(E - Number(C)));
4405
4787
  }), i;
4406
4788
  }, r), this.meshTxBuilderBody.mints.reduce((i, c) => {
4407
4789
  const l = {
@@ -4409,7 +4791,7 @@ class en {
4409
4791
  quantity: String(c.amount)
4410
4792
  }, p = Number(i.get(l.unit)) || 0;
4411
4793
  return i.set(l.unit, String(p - Number(l.quantity))), i;
4412
- }, r), Ws(e, r, t).forEach((i) => {
4794
+ }, r), en(e, r, t).forEach((i) => {
4413
4795
  const c = {
4414
4796
  type: "PubKey",
4415
4797
  txIn: {
@@ -4426,8 +4808,8 @@ class en {
4426
4808
  if (e.length > 0) {
4427
4809
  const t = a.Vkeywitnesses.new(), r = a.Transaction.from_hex(this.txHex), n = r.body();
4428
4810
  e.forEach((l) => {
4429
- const p = l.slice(0, 4) === "5820" ? l.slice(4) : l, y = a.PrivateKey.from_hex(p), B = a.make_vkey_witness(a.hash_transaction(n), y);
4430
- t.add(B);
4811
+ const p = l.slice(0, 4) === "5820" ? l.slice(4) : l, y = a.PrivateKey.from_hex(p), C = a.make_vkey_witness(a.hash_transaction(n), y);
4812
+ t.add(C);
4431
4813
  });
4432
4814
  const i = r.witness_set();
4433
4815
  i.set_vkeys(t);
@@ -4465,6 +4847,7 @@ class en {
4465
4847
  const t = a.ScriptHash.from_hex(e.spendingScriptHash), r = a.TransactionInput.new(a.TransactionHash.from_hex(e.txHash), e.txIndex);
4466
4848
  return a.PlutusScriptSource.new_ref_input_with_lang_ver(t, r, vt[e.version]);
4467
4849
  };
4850
+ // Below protected functions for completing tx building
4468
4851
  removeDuplicateInputs = () => {
4469
4852
  const e = this.meshTxBuilderBody.inputs, t = (n) => `${n.txHash}#${n.txIndex}`, r = [];
4470
4853
  for (let n = 0; n < e.length; n++) {
@@ -4522,7 +4905,7 @@ class en {
4522
4905
  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
4906
  const p = l.next();
4524
4907
  if (c) {
4525
- const y = i.coin().is_zero() ? p.with_asset_and_min_required_coin_by_utxo_cost(c, Oe(this._protocolParams.coinsPerUTxOSize)).build() : p.with_coin_and_asset(i.coin(), c).build();
4908
+ const y = i.coin().is_zero() ? p.with_asset_and_min_required_coin_by_utxo_cost(c, Me(this._protocolParams.coinsPerUTxOSize)).build() : p.with_coin_and_asset(i.coin(), c).build();
4526
4909
  this.txBuilder.add_output(y);
4527
4910
  } else {
4528
4911
  const y = p.with_coin(i.coin()).build();
@@ -4597,7 +4980,7 @@ class en {
4597
4980
  const i = a.Ed25519KeyHashes.new();
4598
4981
  return e.owners.forEach((c) => {
4599
4982
  i.add(a.Ed25519KeyHash.from_hex(c));
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);
4983
+ }), 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(De.stringify(e.metadata)) : void 0);
4601
4984
  };
4602
4985
  addCertificate = (e, t) => {
4603
4986
  switch (t.type) {
@@ -4642,7 +5025,7 @@ class en {
4642
5025
  };
4643
5026
  addAllMetadata = (e) => {
4644
5027
  e.forEach(({ tag: t, metadata: r }) => {
4645
- this.txBuilder.add_json_metadatum(a.BigNum.from_str(t), Wt.exports.stringify(r));
5028
+ this.txBuilder.add_json_metadatum(a.BigNum.from_str(t), De.stringify(r));
4646
5029
  });
4647
5030
  };
4648
5031
  updateRedeemer = (e, t) => {
@@ -4661,10 +5044,10 @@ class en {
4661
5044
  }
4662
5045
  });
4663
5046
  };
4664
- castRawDataToJsonString = (e) => typeof e == "object" ? Wt.exports.stringify(e) : e;
5047
+ castRawDataToJsonString = (e) => typeof e == "object" ? De.stringify(e) : e;
4665
5048
  castDataToPlutusData = ({ type: e, content: t }) => e === "Mesh" ? Ot(t) : e === "CBOR" ? a.PlutusData.from_hex(t) : a.PlutusData.from_json(t, a.PlutusDatumSchema.DetailedSchema);
4666
5049
  }
4667
- class Tn extends en {
5050
+ class Fn extends ln {
4668
5051
  _fetcher;
4669
5052
  _submitter;
4670
5053
  _evaluator;
@@ -4673,6 +5056,11 @@ class Tn extends en {
4673
5056
  constructor({ fetcher: e, submitter: t, evaluator: r, isHydra: n = !1 }) {
4674
5057
  super(), e && (this._fetcher = e), t && (this._submitter = t), r && (this._evaluator = r), n && (this.isHydra = !0);
4675
5058
  }
5059
+ /**
5060
+ * It builds the transaction and query the blockchain for missing information
5061
+ * @param customizedTx The optional customized transaction body
5062
+ * @returns The signed transaction in hex ready to submit / signed by client
5063
+ */
4676
5064
  complete = async (e) => {
4677
5065
  e ? this.meshTxBuilderBody = e : this.queueAllLastItem();
4678
5066
  const { inputs: t, collaterals: r } = this.meshTxBuilderBody, n = [...t, ...r].filter((i) => !this.isInputComplete(i));
@@ -4684,10 +5072,19 @@ class Tn extends en {
4684
5072
  }
4685
5073
  return this;
4686
5074
  };
5075
+ /**
5076
+ * Submit transactions to the blockchain using the fetcher instance
5077
+ * @param txHex The signed transaction in hex
5078
+ * @returns
5079
+ */
4687
5080
  submitTx = async (e) => {
4688
5081
  var r;
4689
5082
  return await ((r = this._submitter) == null ? void 0 : r.submitTx(e));
4690
5083
  };
5084
+ /**
5085
+ * Get the UTxO information from the blockchain
5086
+ * @param TxHash The TxIn object that contains the txHash and txIndex, while missing amount and address information
5087
+ */
4691
5088
  getUTxOInfo = async (e) => {
4692
5089
  var r;
4693
5090
  let t = [];
@@ -4742,7 +5139,7 @@ class rt {
4742
5139
  }
4743
5140
  getAccount(e, t, r = 0) {
4744
5141
  return this.accountContext(e, r, t, (n, i) => {
4745
- const c = pr(this._networkId, n.to_public().hash(), i.to_public().hash()).to_address().to_bech32(), l = Ar(this._networkId, n.to_public().hash()).to_address().to_bech32(), p = Me(this._networkId, i.to_public().hash()).to_address().to_bech32();
5142
+ const c = pr(this._networkId, n.to_public().hash(), i.to_public().hash()).to_address().to_bech32(), l = Ar(this._networkId, n.to_public().hash()).to_address().to_bech32(), p = Ke(this._networkId, i.to_public().hash()).to_address().to_bech32();
4746
5143
  return {
4747
5144
  baseAddress: c,
4748
5145
  enterpriseAddress: l,
@@ -4756,8 +5153,8 @@ class rt {
4756
5153
  const p = { payload: n }, y = {
4757
5154
  address: rt.resolveAddress(this._networkId, r, c, l),
4758
5155
  key: r.startsWith("stake") ? l : c
4759
- }, { coseSign1: B, coseKey: b } = ds(p, y);
4760
- return { signature: B, key: b };
5156
+ }, { coseSign1: C, coseKey: E } = gs(p, y);
5157
+ return { signature: C, key: E };
4761
5158
  });
4762
5159
  } catch (c) {
4763
5160
  throw new Error(`An error occurred during signData: ${c}.`);
@@ -4765,24 +5162,24 @@ class rt {
4765
5162
  }
4766
5163
  signTx(e, t, r, n, i, c = 0) {
4767
5164
  try {
4768
- const l = Ue(yr(n));
5165
+ const l = Pe(yr(n));
4769
5166
  return this.accountContext(e, c, t, (p, y) => {
4770
- const B = a.Vkeywitnesses.new();
5167
+ const C = a.Vkeywitnesses.new();
4771
5168
  return rt.resolveSigners(n, r, p.to_public().hash().to_hex()).forEach((w) => {
4772
5169
  if (w === p.to_public().hash().to_hex())
4773
- B.add(a.make_vkey_witness(l, p));
5170
+ C.add(a.make_vkey_witness(l, p));
4774
5171
  else if (w === y.to_public().hash().to_hex())
4775
- B.add(a.make_vkey_witness(l, y));
5172
+ C.add(a.make_vkey_witness(l, y));
4776
5173
  else if (i === !1)
4777
5174
  throw new Error(`Missing key witness for: ${w}`);
4778
- }), B;
5175
+ }), C;
4779
5176
  });
4780
5177
  } catch (l) {
4781
5178
  throw new Error(`An error occurred during signTx: ${l}.`);
4782
5179
  }
4783
5180
  }
4784
5181
  addPaymentKey(e, t, r, n, i = 0) {
4785
- const c = Ue(yr(r));
5182
+ const c = Pe(yr(r));
4786
5183
  return this.accountContext(e, i, t, (l, p) => {
4787
5184
  n.add(a.make_vkey_witness(c, l));
4788
5185
  }), n;
@@ -4800,7 +5197,7 @@ class rt {
4800
5197
  return [n, i];
4801
5198
  }
4802
5199
  static generateMnemonic(e = 256) {
4803
- return $r(e).split(" ");
5200
+ return Wr(e).split(" ");
4804
5201
  }
4805
5202
  accountContext(e, t, r, n) {
4806
5203
  const { paymentKey: i, stakeKey: c } = rt.resolveKeys(e, t, r, this._encryptedSecret), l = n(i, c);
@@ -4821,7 +5218,7 @@ class rt {
4821
5218
  const i = [
4822
5219
  pr(e, r.to_public().hash(), n.to_public().hash()),
4823
5220
  Ar(e, r.to_public().hash()),
4824
- Me(e, n.to_public().hash())
5221
+ Ke(e, n.to_public().hash())
4825
5222
  ].find((c) => c.to_address().to_bech32() === t);
4826
5223
  if (i !== void 0)
4827
5224
  return i.to_address();
@@ -4830,7 +5227,7 @@ class rt {
4830
5227
  static resolveKeys(e, t, r, n) {
4831
5228
  if (typeof n == "string") {
4832
5229
  const l = rt.decrypt(n, r);
4833
- return Ms(l, e, t);
5230
+ return Vs(l, e, t);
4834
5231
  }
4835
5232
  const i = rt.decrypt(n[0], r), c = rt.decrypt(n[1], r);
4836
5233
  return {
@@ -4858,7 +5255,7 @@ class rt {
4858
5255
  }
4859
5256
  case a.CertificateKind.PoolRegistration: {
4860
5257
  const F = (z = j.as_pool_registration()) == null ? void 0 : z.pool_params().pool_owners();
4861
- Y.push(...B(F));
5258
+ Y.push(...C(F));
4862
5259
  break;
4863
5260
  }
4864
5261
  case a.CertificateKind.PoolRetirement: {
@@ -4882,39 +5279,39 @@ class rt {
4882
5279
  return Q;
4883
5280
  const j = T.get(R).index(), Y = T.get(R).transaction_id(), O = t.find((M) => M.input.outputIndex === j && M.input.txHash === Y.to_hex()) !== void 0 ? r : "OUR_PRINCESS_IS_IN_ANOTHER_CASTLE";
4884
5281
  return y(T, [...Q, O], R + 1);
4885
- }, B = (T, Q = [], R = 0) => T === void 0 || R >= T.len() ? Q : B(T, [...Q, T.get(R).to_hex()], R + 1), b = (T, Q = [], R = 0) => {
5282
+ }, C = (T, Q = [], R = 0) => T === void 0 || R >= T.len() ? Q : C(T, [...Q, T.get(R).to_hex()], R + 1), E = (T, Q = [], R = 0) => {
4886
5283
  if (T === void 0 || R >= T.len())
4887
5284
  return Q;
4888
5285
  const j = T.keys().get(R).payment_cred(), Y = j.kind() === a.StakeCredKind.Key ? j.to_keyhash() : void 0;
4889
- return b(T, Y ? [...Q, Y.to_hex()] : Q, R + 1);
5286
+ return E(T, Y ? [...Q, Y.to_hex()] : Q, R + 1);
4890
5287
  }, w = l.certs(), v = l.collateral(), U = l.inputs(), k = l.required_signers(), N = l.withdrawals();
4891
5288
  return [
4892
5289
  ...p(w),
4893
5290
  ...y(v),
4894
5291
  ...y(U),
4895
- ...B(k),
4896
- ...b(N)
5292
+ ...C(k),
5293
+ ...E(N)
4897
5294
  ];
4898
5295
  }, i = (l) => {
4899
- const p = (B, b = []) => {
5296
+ const p = (C, E = []) => {
4900
5297
  var w, v, U, k;
4901
- if (B)
4902
- for (let N = 0; N < B.len(); N += 1) {
4903
- const T = B.get(N);
5298
+ if (C)
5299
+ for (let N = 0; N < C.len(); N += 1) {
5300
+ const T = C.get(N);
4904
5301
  switch (T.kind()) {
4905
5302
  case a.NativeScriptKind.ScriptPubkey: {
4906
5303
  const Q = (w = T.as_script_pubkey()) == null ? void 0 : w.addr_keyhash().to_hex();
4907
- return Q ? [...b, Q] : b;
5304
+ return Q ? [...E, Q] : E;
4908
5305
  }
4909
5306
  case a.NativeScriptKind.ScriptAll:
4910
- return p((v = T.as_script_all()) == null ? void 0 : v.native_scripts(), b);
5307
+ return p((v = T.as_script_all()) == null ? void 0 : v.native_scripts(), E);
4911
5308
  case a.NativeScriptKind.ScriptAny:
4912
- return p((U = T.as_script_any()) == null ? void 0 : U.native_scripts(), b);
5309
+ return p((U = T.as_script_any()) == null ? void 0 : U.native_scripts(), E);
4913
5310
  case a.NativeScriptKind.ScriptNOfK:
4914
- return p((k = T.as_script_n_of_k()) == null ? void 0 : k.native_scripts(), b);
5311
+ return p((k = T.as_script_n_of_k()) == null ? void 0 : k.native_scripts(), E);
4915
5312
  }
4916
5313
  }
4917
- return b;
5314
+ return E;
4918
5315
  }, y = l.native_scripts();
4919
5316
  return [...p(y)];
4920
5317
  }, c = pt(e);
@@ -4925,7 +5322,7 @@ class rt {
4925
5322
  }
4926
5323
  }
4927
5324
  const ut = "MARI0TIME";
4928
- class De {
5325
+ class ke {
4929
5326
  _fetcher;
4930
5327
  _submitter;
4931
5328
  _wallet;
@@ -4957,11 +5354,11 @@ class De {
4957
5354
  getUsedCollateral(e = At.maxCollateralInputs) {
4958
5355
  throw new Error("getUsedCollateral not implemented.");
4959
5356
  }
4960
- async getUsedUTxOs(e = 0) {
5357
+ async getUsedUTxOs(e = 0, t = "base") {
4961
5358
  if (!this._fetcher)
4962
5359
  throw new Error("[AppWallet] Fetcher is required to fetch UTxOs. Please provide a fetcher.");
4963
- const t = this._wallet.getAccount(e, ut);
4964
- return (await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map((n) => mt(n));
5360
+ const r = this._wallet.getAccount(e, ut);
5361
+ return (await this._fetcher.fetchAddressUTxOs(t == "enterprise" ? r.enterpriseAddress : r.baseAddress)).map((i) => mt(i));
4965
5362
  }
4966
5363
  signData(e, t, r = 0, n = 0) {
4967
5364
  try {
@@ -4970,21 +5367,21 @@ class De {
4970
5367
  throw new Error(`[AppWallet] An error occurred during signData: ${i}.`);
4971
5368
  }
4972
5369
  }
4973
- async signTx(e, t = !1, r = 0, n = 0) {
5370
+ async signTx(e, t = !1, r = 0, n = 0, i = "base") {
4974
5371
  try {
4975
5372
  if (!this._fetcher)
4976
5373
  throw new Error("[AppWallet] Fetcher is required to fetch UTxOs. Please provide a fetcher.");
4977
- const i = this._wallet.getAccount(r, ut), c = await this._fetcher.fetchAddressUTxOs(i.enterpriseAddress), l = this._wallet.signTx(r, ut, c, e, t, n), p = pt(e), y = p.witness_set(), B = ye(y, l);
4978
- return y.set_vkeys(B), a.Transaction.new(p.body(), y, p.auxiliary_data()).to_hex();
4979
- } catch (i) {
4980
- throw new Error(`[AppWallet] An error occurred during signTx: ${i}.`);
5374
+ const c = this._wallet.getAccount(r, ut), l = await this._fetcher.fetchAddressUTxOs(i == "enterprise" ? c.enterpriseAddress : c.baseAddress), p = this._wallet.signTx(r, ut, l, e, t, n), y = pt(e), C = y.witness_set(), E = _e(C, p);
5375
+ return C.set_vkeys(E), a.Transaction.new(y.body(), C, y.auxiliary_data()).to_hex();
5376
+ } catch (c) {
5377
+ throw new Error(`[AppWallet] An error occurred during signTx: ${c}.`);
4981
5378
  }
4982
5379
  }
4983
5380
  signTxSync(e, t = !1, r = 0, n = 0) {
4984
5381
  try {
4985
5382
  const i = this._wallet.signTx(r, ut, [], e, t, n);
4986
5383
  this._wallet.addPaymentKey(r, ut, e, i, n);
4987
- const c = pt(e), l = c.witness_set(), p = ye(l, i);
5384
+ const c = pt(e), l = c.witness_set(), p = _e(l, i);
4988
5385
  return l.set_vkeys(p), a.Transaction.new(c.body(), l, c.auxiliary_data()).to_hex();
4989
5386
  } catch (i) {
4990
5387
  throw new Error(`[AppWallet] An error occurred during signTx: ${i}.`);
@@ -5001,6 +5398,9 @@ class De {
5001
5398
  static brew(e = 256) {
5002
5399
  return rt.generateMnemonic(e);
5003
5400
  }
5401
+ /**
5402
+ * development: browser wallets apis
5403
+ */
5004
5404
  async getUtxos() {
5005
5405
  return await this.getUsedUTxOs();
5006
5406
  }
@@ -5011,13 +5411,21 @@ class De {
5011
5411
  return console.log(1, await this.getPaymentAddress()), [await this.getPaymentAddress()];
5012
5412
  }
5013
5413
  }
5014
- class He {
5414
+ class Fe {
5015
5415
  _walletInstance;
5016
5416
  _walletName;
5017
5417
  walletInstance;
5018
5418
  constructor(e, t) {
5019
5419
  this._walletInstance = e, this._walletName = t, this.walletInstance = { ...e };
5020
5420
  }
5421
+ /**
5422
+ * Returns a list of wallets installed on user's device. Each wallet is an object with the following properties:
5423
+ * - A name is provided to display wallet's name on the user interface.
5424
+ * - A version is provided to display wallet's version on the user interface.
5425
+ * - An icon is provided to display wallet's icon on the user interface.
5426
+ *
5427
+ * @returns a list of wallet names
5428
+ */
5021
5429
  static getInstalledWallets() {
5022
5430
  return window.cardano === void 0 ? [] : Xe.filter((e) => window.cardano[e] !== void 0).map((e) => ({
5023
5431
  name: window.cardano[e].name,
@@ -5025,54 +5433,131 @@ class He {
5025
5433
  version: window.cardano[e].apiVersion
5026
5434
  }));
5027
5435
  }
5436
+ /**
5437
+ * This is the entrypoint to start communication with the user's wallet. The wallet should request the user's permission to connect the web page to the user's wallet, and if permission has been granted, the wallet will be returned and exposing the full API for the dApp to use.
5438
+ *
5439
+ * Query BrowserWallet.getInstalledWallets() to get a list of available wallets, then provide the wallet name for which wallet the user would like to connect with.
5440
+ *
5441
+ * @param walletName
5442
+ * @returns WalletInstance
5443
+ */
5028
5444
  static async enable(e) {
5029
5445
  try {
5030
- const t = await He.resolveInstance(e);
5446
+ const t = await Fe.resolveInstance(e);
5031
5447
  if (t !== void 0)
5032
- return new He(t, e);
5448
+ return new Fe(t, e);
5033
5449
  throw new Error(`Couldn't create an instance of wallet: ${e}`);
5034
5450
  } catch (t) {
5035
5451
  throw new Error(`[BrowserWallet] An error occurred during enable: ${JSON.stringify(t)}.`);
5036
5452
  }
5037
5453
  }
5454
+ /**
5455
+ * Returns a list of assets in the wallet. This API will return every assets in the wallet. Each asset is an object with the following properties:
5456
+ * - A unit is provided to display asset's name on the user interface.
5457
+ * - A quantity is provided to display asset's quantity on the user interface.
5458
+ *
5459
+ * @returns a list of assets and their quantities
5460
+ */
5038
5461
  async getBalance() {
5039
5462
  const e = await this._walletInstance.getBalance();
5040
- return Fr(Ls(e));
5463
+ return Fr(Js(e));
5041
5464
  }
5465
+ /**
5466
+ * Returns an address owned by the wallet that should be used as a change address to return leftover assets during transaction creation back to the connected wallet.
5467
+ *
5468
+ * @returns an address
5469
+ */
5042
5470
  async getChangeAddress() {
5043
5471
  const e = await this._walletInstance.getChangeAddress();
5044
5472
  return Gt(e).to_bech32();
5045
5473
  }
5474
+ /**
5475
+ * This function shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only UTXOs).
5476
+ *
5477
+ * If this cannot be attained, an error message with an explanation of the blocking problem shall be returned. NOTE: wallets are free to return UTXOs that add up to a greater total ADA value than requested in the amount parameter, but wallets must never return any result where UTXOs would sum up to a smaller total ADA value, instead in a case like that an error message must be returned.
5478
+ *
5479
+ * @param limit
5480
+ * @returns a list of UTXOs
5481
+ */
5046
5482
  async getCollateral(e = At.maxCollateralInputs) {
5047
- return (await this.getUsedCollateral(e)).map((r) => oe(r));
5483
+ return (await this.getUsedCollateral(e)).map((r) => ie(r));
5048
5484
  }
5485
+ /**
5486
+ * Returns the network ID of the currently connected account. 0 is testnet and 1 is mainnet but other networks can possibly be returned by wallets. Those other network ID values are not governed by CIP-30. This result will stay the same unless the connected account has changed.
5487
+ *
5488
+ * @returns network ID
5489
+ */
5049
5490
  getNetworkId() {
5050
5491
  return this._walletInstance.getNetworkId();
5051
5492
  }
5493
+ /**
5494
+ * Returns a list of reward addresses owned by the wallet. A reward address is a stake address that is used to receive rewards from staking, generally starts from `stake` prefix.
5495
+ *
5496
+ * @returns a list of reward addresses
5497
+ */
5052
5498
  async getRewardAddresses() {
5053
5499
  return (await this._walletInstance.getRewardAddresses()).map((t) => Gt(t).to_bech32());
5054
5500
  }
5501
+ /**
5502
+ * Returns a list of unused addresses controlled by the wallet.
5503
+ *
5504
+ * @returns a list of unused addresses
5505
+ */
5055
5506
  async getUnusedAddresses() {
5056
5507
  return (await this._walletInstance.getUnusedAddresses()).map((t) => Gt(t).to_bech32());
5057
5508
  }
5509
+ /**
5510
+ * Returns a list of used addresses controlled by the wallet.
5511
+ *
5512
+ * @returns a list of used addresses
5513
+ */
5058
5514
  async getUsedAddresses() {
5059
5515
  return (await this._walletInstance.getUsedAddresses()).map((t) => Gt(t).to_bech32());
5060
5516
  }
5517
+ /**
5518
+ * Return a list of all UTXOs (unspent transaction outputs) controlled by the wallet.
5519
+ *
5520
+ * @param amount
5521
+ * @returns a list of UTXOs
5522
+ */
5061
5523
  async getUtxos(e = void 0) {
5062
- return (await this.getUsedUTxOs(e)).map((r) => oe(r));
5063
- }
5524
+ return (await this.getUsedUTxOs(e)).map((r) => ie(r));
5525
+ }
5526
+ /**
5527
+ * This endpoint utilizes the [CIP-8 - Message Signing](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030) to sign arbitrary data, to verify the data was signed by the owner of the private key.
5528
+ *
5529
+ * Here, we get the first wallet's address with wallet.getUsedAddresses(), alternativelly you can use reward addresses (getRewardAddresses()) too. It's really up to you as the developer which address you want to use in your application.
5530
+ *
5531
+ * @param address
5532
+ * @param payload
5533
+ * @returns a signature
5534
+ */
5064
5535
  signData(e, t) {
5065
5536
  const r = yt(e).to_hex();
5066
5537
  return this._walletInstance.signData(r, dt(t));
5067
5538
  }
5539
+ /**
5540
+ * Requests user to sign the provided transaction (tx). The wallet should ask the user for permission, and if given, try to sign the supplied body and return a signed transaction. partialSign should be true if the transaction provided requires multiple signatures.
5541
+ *
5542
+ * @param unsignedTx
5543
+ * @param partialSign
5544
+ * @returns a signed transaction in CBOR
5545
+ */
5068
5546
  async signTx(e, t = !1) {
5069
5547
  try {
5070
- const r = pt(e), n = r.witness_set(), i = await this._walletInstance.signTx(e, t), c = gr(i).vkeys() ?? a.Vkeywitnesses.new(), l = ye(n, c);
5548
+ const r = pt(e), n = r.witness_set(), i = await this._walletInstance.signTx(e, t), c = gr(i).vkeys() ?? a.Vkeywitnesses.new(), l = _e(n, c);
5071
5549
  return n.set_vkeys(l), lt(a.Transaction.new(r.body(), n, r.auxiliary_data()).to_bytes());
5072
5550
  } catch (r) {
5073
5551
  throw new Error(`[BrowserWallet] An error occurred during signTx: ${JSON.stringify(r)}.`);
5074
5552
  }
5075
5553
  }
5554
+ /**
5555
+ * Experimental feature - sign multiple transactions at once (Supported wallet(s): Typhon)
5556
+ *
5557
+ * @param unsignedTxs - array of unsigned transactions in CborHex string
5558
+ * @param partialSign - if the transactions are signed partially
5559
+ * @returns array of signed transactions CborHex string
5560
+ */
5076
5561
  async signTxs(e, t = !1) {
5077
5562
  let r;
5078
5563
  switch (this._walletName) {
@@ -5096,46 +5581,96 @@ class He {
5096
5581
  if (!r[i])
5097
5582
  n.push(e[i]);
5098
5583
  else {
5099
- const c = pt(e[i]), l = c.witness_set(), p = gr(r[i]).vkeys() ?? a.Vkeywitnesses.new(), y = ye(l, p);
5584
+ const c = pt(e[i]), l = c.witness_set(), p = gr(r[i]).vkeys() ?? a.Vkeywitnesses.new(), y = _e(l, p);
5100
5585
  l.set_vkeys(y);
5101
- const B = lt(a.Transaction.new(c.body(), l, c.auxiliary_data()).to_bytes());
5102
- n.push(B);
5586
+ const C = lt(a.Transaction.new(c.body(), l, c.auxiliary_data()).to_bytes());
5587
+ n.push(C);
5103
5588
  }
5104
5589
  return n;
5105
5590
  }
5591
+ /**
5592
+ * Submits the signed transaction to the blockchain network.
5593
+ *
5594
+ * As wallets should already have this ability to submit transaction, we allow dApps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the dApp to track. The wallet can return error messages or failure if there was an error in sending it.
5595
+ *
5596
+ * @param tx
5597
+ * @returns a transaction hash
5598
+ */
5106
5599
  submitTx(e) {
5107
5600
  return this._walletInstance.submitTx(e);
5108
5601
  }
5602
+ /**
5603
+ * Get a used address of type Address from the wallet.
5604
+ *
5605
+ * This is used in transaction building.
5606
+ *
5607
+ * @returns an Address object
5608
+ */
5109
5609
  async getUsedAddress() {
5110
5610
  const e = await this._walletInstance.getUsedAddresses();
5111
5611
  return Gt(e[0]);
5112
5612
  }
5613
+ /**
5614
+ * Get a list of UTXOs to be used as collateral inputs for transactions with plutus script inputs.
5615
+ *
5616
+ * This is used in transaction building.
5617
+ *
5618
+ * @returns a list of UTXOs
5619
+ */
5113
5620
  async getUsedCollateral(e = At.maxCollateralInputs) {
5114
5621
  return (await this._walletInstance.experimental.getCollateral() ?? []).map((r) => fr(r)).slice(0, e);
5115
5622
  }
5623
+ /**
5624
+ * Get a list of UTXOs to be used for transaction building.
5625
+ *
5626
+ * This is used in transaction building.
5627
+ *
5628
+ * @returns a list of UTXOs
5629
+ */
5116
5630
  async getUsedUTxOs(e = void 0) {
5117
5631
  const t = e ? Bt(e).to_hex() : void 0;
5118
5632
  return (await this._walletInstance.getUtxos(t) ?? []).map((n) => fr(n));
5119
5633
  }
5634
+ /**
5635
+ * A helper function to get the assets in the wallet.
5636
+ *
5637
+ * @returns a list of assets
5638
+ */
5120
5639
  async getAssets() {
5121
5640
  return (await this.getBalance()).filter((t) => t.unit !== "lovelace").map((t) => {
5122
5641
  const r = t.unit.slice(0, ht), n = t.unit.slice(ht), i = qr(r, n);
5123
5642
  return {
5124
5643
  unit: t.unit,
5125
5644
  policyId: r,
5126
- assetName: $e(n),
5645
+ assetName: ze(n),
5127
5646
  fingerprint: i,
5128
5647
  quantity: t.quantity
5129
5648
  };
5130
5649
  });
5131
5650
  }
5651
+ /**
5652
+ * A helper function to get the lovelace balance in the wallet.
5653
+ *
5654
+ * @returns lovelace balance
5655
+ */
5132
5656
  async getLovelace() {
5133
5657
  const t = (await this.getBalance()).find((r) => r.unit === "lovelace");
5134
5658
  return t !== void 0 ? t.quantity : "0";
5135
5659
  }
5660
+ /**
5661
+ * A helper function to get the assets of a specific policy ID in the wallet.
5662
+ *
5663
+ * @param policyId
5664
+ * @returns a list of assets
5665
+ */
5136
5666
  async getPolicyIdAssets(e) {
5137
5667
  return (await this.getAssets()).filter((r) => r.policyId === e);
5138
5668
  }
5669
+ /**
5670
+ * A helper function to get the policy IDs of all the assets in the wallet.
5671
+ *
5672
+ * @returns a list of policy IDs
5673
+ */
5139
5674
  async getPolicyIds() {
5140
5675
  const e = await this.getBalance();
5141
5676
  return Array.from(new Set(e.map((t) => t.unit.slice(0, ht)))).filter((t) => t !== "lovelace");
@@ -5147,13 +5682,13 @@ class He {
5147
5682
  return t == null ? void 0 : t.enable();
5148
5683
  }
5149
5684
  }
5150
- class Nn {
5685
+ class Rn {
5151
5686
  _wallet;
5152
5687
  _network;
5153
5688
  constructor(e) {
5154
5689
  switch (this._network = e.networkId, e.key.type) {
5155
5690
  case "root":
5156
- this._wallet = new De({
5691
+ this._wallet = new ke({
5157
5692
  networkId: e.networkId,
5158
5693
  fetcher: e.fetcher,
5159
5694
  submitter: e.submitter,
@@ -5164,7 +5699,7 @@ class Nn {
5164
5699
  });
5165
5700
  break;
5166
5701
  case "cli":
5167
- this._wallet = new De({
5702
+ this._wallet = new ke({
5168
5703
  networkId: e.networkId,
5169
5704
  fetcher: e.fetcher,
5170
5705
  submitter: e.submitter,
@@ -5175,7 +5710,7 @@ class Nn {
5175
5710
  });
5176
5711
  break;
5177
5712
  case "mnemonic":
5178
- this._wallet = new De({
5713
+ this._wallet = new ke({
5179
5714
  networkId: e.networkId,
5180
5715
  fetcher: e.fetcher,
5181
5716
  submitter: e.submitter,
@@ -5187,6 +5722,13 @@ class Nn {
5187
5722
  break;
5188
5723
  }
5189
5724
  }
5725
+ /**
5726
+ * Returns a list of assets in the wallet. This API will return every assets in the wallet. Each asset is an object with the following properties:
5727
+ * - A unit is provided to display asset's name on the user interface.
5728
+ * - A quantity is provided to display asset's quantity on the user interface.
5729
+ *
5730
+ * @returns a list of assets and their quantities
5731
+ */
5190
5732
  async getBalance() {
5191
5733
  const e = await this.getUtxos(), t = /* @__PURE__ */ new Map();
5192
5734
  return e.map((n) => {
@@ -5203,9 +5745,22 @@ class Nn {
5203
5745
  quantity: i.toString()
5204
5746
  }));
5205
5747
  }
5206
- getChangeAddress() {
5207
- return this._wallet.getPaymentAddress();
5208
- }
5748
+ /**
5749
+ * Returns an address owned by the wallet that should be used as a change address to return leftover assets during transaction creation back to the connected wallet.
5750
+ *
5751
+ * @param addressType - `enterprise` or `base` address
5752
+ * @returns an address
5753
+ */
5754
+ getChangeAddress(e = "base") {
5755
+ return e === "base" ? this._wallet.getBaseAddress() : this._wallet.getPaymentAddress();
5756
+ }
5757
+ /**
5758
+ * This function shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only UTXOs).
5759
+ *
5760
+ * If this cannot be attained, an error message with an explanation of the blocking problem shall be returned. NOTE: wallets are free to return UTXOs that add up to a greater total ADA value than requested in the amount parameter, but wallets must never return any result where UTXOs would sum up to a smaller total ADA value, instead in a case like that an error message must be returned.
5761
+ *
5762
+ * @returns a list of UTXOs
5763
+ */
5209
5764
  async getCollateral() {
5210
5765
  const t = (await this.getUtxos()).filter((r) => r.output.amount.length === 1 && r.output.amount[0].unit === "lovelace");
5211
5766
  t.sort((r, n) => Number(r.output.amount[0].quantity) - Number(n.output.amount[0].quantity));
@@ -5214,27 +5769,78 @@ class Nn {
5214
5769
  return [r];
5215
5770
  return [];
5216
5771
  }
5772
+ /**
5773
+ * Returns the network ID of the currently connected account. 0 is testnet and 1 is mainnet but other networks can possibly be returned by wallets. Those other network ID values are not governed by CIP-30. This result will stay the same unless the connected account has changed.
5774
+ *
5775
+ * @returns network ID
5776
+ */
5217
5777
  getNetworkId() {
5218
5778
  return this._network;
5219
5779
  }
5780
+ /**
5781
+ * Returns a list of reward addresses owned by the wallet. A reward address is a stake address that is used to receive rewards from staking, generally starts from `stake` prefix.
5782
+ *
5783
+ * @returns a list of reward addresses
5784
+ */
5220
5785
  async getRewardAddresses() {
5221
5786
  return [await this._wallet.getRewardAddress()];
5222
5787
  }
5223
- getUnusedAddresses() {
5224
- return [this.getChangeAddress()];
5225
- }
5226
- async getUsedAddresses() {
5227
- return [this.getChangeAddress()];
5228
- }
5229
- async getUtxos() {
5230
- return (await this.getUsedUTxOs()).map((t) => oe(t));
5231
- }
5788
+ /**
5789
+ * Returns a list of unused addresses controlled by the wallet.
5790
+ *
5791
+ * @param addressType - `enterprise` or `base` address
5792
+ * @returns a list of unused addresses
5793
+ */
5794
+ getUnusedAddresses(e = "base") {
5795
+ return e === "base" ? [this._wallet.getBaseAddress()] : [this._wallet.getPaymentAddress()];
5796
+ }
5797
+ /**
5798
+ * Returns a list of used addresses controlled by the wallet.
5799
+ *
5800
+ * @param addressType - `enterprise` or `base` address
5801
+ * @returns a list of used addresses
5802
+ */
5803
+ async getUsedAddresses(e = "base") {
5804
+ return e === "base" ? [this._wallet.getBaseAddress()] : [this._wallet.getPaymentAddress()];
5805
+ }
5806
+ /**
5807
+ * Return a list of all UTXOs (unspent transaction outputs) controlled by the wallet.
5808
+ *
5809
+ * @param addressType - `enterprise` or `base` address
5810
+ * @returns a list of UTXOs
5811
+ */
5812
+ async getUtxos(e = "base") {
5813
+ return (await this.getUsedUTxOs(e)).map((r) => ie(r));
5814
+ }
5815
+ /**
5816
+ * This endpoint utilizes the [CIP-8 - Message Signing](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030) to sign arbitrary data, to verify the data was signed by the owner of the private key.
5817
+ *
5818
+ * Here, we get the first wallet's address with wallet.getUsedAddresses(), alternativelly you can use reward addresses (getRewardAddresses()) too. It's really up to you as the developer which address you want to use in your application.
5819
+ *
5820
+ * @param address
5821
+ * @param payload
5822
+ * @returns a signature
5823
+ */
5232
5824
  signData(e) {
5233
5825
  return this._wallet.signData(this.getChangeAddress(), e);
5234
5826
  }
5827
+ /**
5828
+ * Requests user to sign the provided transaction (tx). The wallet should ask the user for permission, and if given, try to sign the supplied body and return a signed transaction. partialSign should be true if the transaction provided requires multiple signatures.
5829
+ *
5830
+ * @param unsignedTx
5831
+ * @param partialSign
5832
+ * @returns a signed transaction in CBOR
5833
+ */
5235
5834
  async signTx(e, t = !1) {
5236
5835
  return await this._wallet.signTx(e, t);
5237
5836
  }
5837
+ /**
5838
+ * Experimental feature - sign multiple transactions at once.
5839
+ *
5840
+ * @param unsignedTxs - array of unsigned transactions in CborHex string
5841
+ * @param partialSign - if the transactions are signed partially
5842
+ * @returns array of signed transactions CborHex string
5843
+ */
5238
5844
  async signTxs(e, t = !1) {
5239
5845
  const r = [];
5240
5846
  for (const n of e) {
@@ -5243,91 +5849,147 @@ class Nn {
5243
5849
  }
5244
5850
  return r;
5245
5851
  }
5852
+ /**
5853
+ * Submits the signed transaction to the blockchain network.
5854
+ *
5855
+ * As wallets should already have this ability to submit transaction, we allow dApps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the dApp to track. The wallet can return error messages or failure if there was an error in sending it.
5856
+ *
5857
+ * @param tx
5858
+ * @returns a transaction hash
5859
+ */
5246
5860
  async submitTx(e) {
5247
5861
  return await this._wallet.submitTx(e);
5248
5862
  }
5863
+ /**
5864
+ * Get a used address of type Address from the wallet.
5865
+ *
5866
+ * This is used in transaction building.
5867
+ *
5868
+ * @returns an Address object
5869
+ */
5249
5870
  getUsedAddress() {
5250
5871
  return this._wallet.getUsedAddress();
5251
5872
  }
5873
+ /**
5874
+ * Get a list of UTXOs to be used as collateral inputs for transactions with plutus script inputs.
5875
+ *
5876
+ * This is used in transaction building.
5877
+ *
5878
+ * @returns a list of UTXOs
5879
+ */
5252
5880
  async getUsedCollateral() {
5253
5881
  return (await this.getCollateral()).map((r) => mt(r));
5254
5882
  }
5255
- async getUsedUTxOs() {
5256
- return await this._wallet.getUtxos();
5257
- }
5883
+ /**
5884
+ * Get a list of UTXOs to be used for transaction building.
5885
+ *
5886
+ * This is used in transaction building.
5887
+ *
5888
+ * @param addressType - `enterprise` or `base` address
5889
+ * @returns a list of UTXOs
5890
+ */
5891
+ async getUsedUTxOs(e = "base") {
5892
+ return await this._wallet.getUsedUTxOs(0, e);
5893
+ }
5894
+ /**
5895
+ * A helper function to get the assets in the wallet.
5896
+ *
5897
+ * @returns a list of assets
5898
+ */
5258
5899
  async getAssets() {
5259
5900
  return (await this.getBalance()).filter((t) => t.unit !== "lovelace").map((t) => {
5260
5901
  const r = t.unit.slice(0, ht), n = t.unit.slice(ht), i = qr(r, n);
5261
5902
  return {
5262
5903
  unit: t.unit,
5263
5904
  policyId: r,
5264
- assetName: $e(n),
5905
+ assetName: ze(n),
5265
5906
  fingerprint: i,
5266
5907
  quantity: t.quantity
5267
5908
  };
5268
5909
  });
5269
5910
  }
5911
+ /**
5912
+ * A helper function to get the lovelace balance in the wallet.
5913
+ *
5914
+ * @returns lovelace balance
5915
+ */
5270
5916
  async getLovelace() {
5271
5917
  const t = (await this.getBalance()).find((r) => r.unit === "lovelace");
5272
5918
  return t !== void 0 ? t.quantity : "0";
5273
5919
  }
5920
+ /**
5921
+ * A helper function to get the assets of a specific policy ID in the wallet.
5922
+ *
5923
+ * @param policyId
5924
+ * @returns a list of assets
5925
+ */
5274
5926
  async getPolicyIdAssets(e) {
5275
5927
  return (await this.getAssets()).filter((r) => r.policyId === e);
5276
5928
  }
5929
+ /**
5930
+ * A helper function to get the policy IDs of all the assets in the wallet.
5931
+ *
5932
+ * @returns a list of policy IDs
5933
+ */
5277
5934
  async getPolicyIds() {
5278
5935
  const e = await this.getBalance();
5279
5936
  return Array.from(new Set(e.map((t) => t.unit.slice(0, ht)))).filter((t) => t !== "lovelace");
5280
5937
  }
5938
+ /**
5939
+ * A helper function to create a collateral input for a transaction.
5940
+ *
5941
+ * @returns a transaction hash
5942
+ */
5281
5943
  async createCollateral() {
5282
5944
  const t = await new St({ initiator: this._wallet }).sendLovelace(this.getChangeAddress(), "5000000").build(), r = await this.signTx(t);
5283
5945
  return await this.submitTx(r);
5284
5946
  }
5285
5947
  static brew(e = !1, t = 256) {
5286
5948
  const r = rt.generateMnemonic(t);
5287
- return e ? $s(r) : r;
5949
+ return e ? Zs(r) : r;
5288
5950
  }
5289
5951
  }
5290
5952
  export {
5291
- De as AppWallet,
5292
- Bn as BlockfrostProvider,
5293
- He as BrowserWallet,
5953
+ ke as AppWallet,
5954
+ Tn as BlockfrostProvider,
5955
+ Fe as BrowserWallet,
5294
5956
  rt as EmbeddedWallet,
5295
- Dn as ForgeScript,
5296
- Sn as InfuraProvider,
5297
- En as KoiosProvider,
5298
- vn as MaestroProvider,
5299
- Tn as MeshTxBuilder,
5300
- Nn as MeshWallet,
5301
- bn as OgmiosProvider,
5957
+ Kn as ForgeScript,
5958
+ Nn as InfuraProvider,
5959
+ Un as KoiosProvider,
5960
+ On as MaestroProvider,
5961
+ Fn as MeshTxBuilder,
5962
+ Rn as MeshWallet,
5963
+ Pn as OgmiosProvider,
5302
5964
  St as Transaction,
5303
- Qn as YaciProvider,
5304
- un as checkSignature,
5305
- xn as generateNonce,
5306
- ts as isNetwork,
5307
- is as keepRelevant,
5308
- cn as largestFirst,
5309
- as as largestFirstMultiAsset,
5310
- on as mergeAssets,
5965
+ Mn as YaciProvider,
5966
+ An as checkSignature,
5967
+ Qn as generateNonce,
5968
+ rs as isNetwork,
5969
+ os as keepRelevant,
5970
+ pn as largestFirst,
5971
+ cs as largestFirstMultiAsset,
5972
+ mn as mergeAssets,
5311
5973
  Kt as parseAssetUnit,
5312
5974
  S as parseHttpError,
5313
- wn as readPlutusData,
5314
- Cn as readTransaction,
5315
- ln as resolveDataHash,
5316
- hn as resolveEpochNo,
5975
+ Dn as readPlutusData,
5976
+ kn as readTransaction,
5977
+ In as resolveDataHash,
5978
+ _n as resolveEpochNo,
5317
5979
  qr as resolveFingerprint,
5318
- dn as resolveLanguageView,
5319
- fn as resolveNativeScriptAddress,
5320
- gn as resolveNativeScriptHash,
5321
- mn as resolveNativeScriptHex,
5980
+ yn as resolveLanguageView,
5981
+ xn as resolveNativeScriptAddress,
5982
+ wn as resolveNativeScriptHash,
5983
+ Cn as resolveNativeScriptHex,
5322
5984
  $t as resolvePaymentKeyHash,
5323
- pn as resolvePlutusScriptAddress,
5324
- An as resolvePlutusScriptHash,
5325
- In as resolvePoolId,
5326
- $s as resolvePrivateKey,
5327
- xe as resolveRewardAddress,
5328
- _n as resolveScriptRef,
5329
- yn as resolveSlotNo,
5330
- se as resolveStakeKeyHash,
5985
+ Bn as resolvePlutusScriptAddress,
5986
+ Sn as resolvePlutusScriptHash,
5987
+ En as resolvePoolId,
5988
+ Zs as resolvePrivateKey,
5989
+ ye as resolveRewardAddress,
5990
+ bn as resolveScriptRef,
5991
+ vn as resolveSlotNo,
5992
+ re as resolveStakeKeyHash,
5331
5993
  Vr as resolveTxFees,
5332
5994
  yr as resolveTxHash
5333
5995
  };