@btc-vision/transaction 1.8.0-beta.4 → 1.8.0-beta.6

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 (59) hide show
  1. package/browser/btc-vision-bitcoin.js +178 -178
  2. package/browser/generators/AddressGenerator.d.ts.map +1 -1
  3. package/browser/index.js +615 -623
  4. package/browser/keypair/AddressVerificator.d.ts.map +1 -1
  5. package/browser/keypair/EcKeyPair.d.ts.map +1 -1
  6. package/browser/keypair/Wallet.d.ts.map +1 -1
  7. package/browser/mnemonic/Mnemonic.d.ts.map +1 -1
  8. package/browser/signer/ParallelSignerAdapter.d.ts +1 -1
  9. package/browser/signer/ParallelSignerAdapter.d.ts.map +1 -1
  10. package/browser/signer/TweakedSigner.d.ts.map +1 -1
  11. package/browser/transaction/builders/TransactionBuilder.d.ts.map +1 -1
  12. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts +1 -2
  13. package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -1
  14. package/browser/transaction/shared/TweakedTransaction.d.ts +1 -2
  15. package/browser/transaction/shared/TweakedTransaction.d.ts.map +1 -1
  16. package/build/generators/AddressGenerator.d.ts.map +1 -1
  17. package/build/generators/AddressGenerator.js +1 -3
  18. package/build/generators/AddressGenerator.js.map +1 -1
  19. package/build/keypair/AddressVerificator.d.ts.map +1 -1
  20. package/build/keypair/AddressVerificator.js +1 -3
  21. package/build/keypair/AddressVerificator.js.map +1 -1
  22. package/build/keypair/EcKeyPair.d.ts.map +1 -1
  23. package/build/keypair/EcKeyPair.js +2 -3
  24. package/build/keypair/EcKeyPair.js.map +1 -1
  25. package/build/keypair/Wallet.d.ts.map +1 -1
  26. package/build/keypair/Wallet.js +1 -3
  27. package/build/keypair/Wallet.js.map +1 -1
  28. package/build/mnemonic/Mnemonic.d.ts.map +1 -1
  29. package/build/mnemonic/Mnemonic.js +2 -3
  30. package/build/mnemonic/Mnemonic.js.map +1 -1
  31. package/build/signer/ParallelSignerAdapter.d.ts +1 -1
  32. package/build/signer/ParallelSignerAdapter.d.ts.map +1 -1
  33. package/build/signer/TweakedSigner.d.ts.map +1 -1
  34. package/build/signer/TweakedSigner.js +3 -4
  35. package/build/signer/TweakedSigner.js.map +1 -1
  36. package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -1
  37. package/build/transaction/builders/TransactionBuilder.js +1 -3
  38. package/build/transaction/builders/TransactionBuilder.js.map +1 -1
  39. package/build/transaction/interfaces/ITweakedTransactionData.d.ts +1 -1
  40. package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -1
  41. package/build/transaction/shared/TweakedTransaction.d.ts +1 -1
  42. package/build/transaction/shared/TweakedTransaction.d.ts.map +1 -1
  43. package/build/transaction/shared/TweakedTransaction.js +1 -1
  44. package/build/transaction/shared/TweakedTransaction.js.map +1 -1
  45. package/build/tsconfig.build.tsbuildinfo +1 -1
  46. package/build/utxo/OPNetLimitedProvider.js +2 -2
  47. package/build/utxo/OPNetLimitedProvider.js.map +1 -1
  48. package/package.json +2 -2
  49. package/src/generators/AddressGenerator.ts +1 -4
  50. package/src/keypair/AddressVerificator.ts +1 -4
  51. package/src/keypair/EcKeyPair.ts +1 -4
  52. package/src/keypair/Wallet.ts +0 -4
  53. package/src/mnemonic/Mnemonic.ts +2 -4
  54. package/src/signer/ParallelSignerAdapter.ts +1 -1
  55. package/src/signer/TweakedSigner.ts +2 -5
  56. package/src/transaction/builders/TransactionBuilder.ts +0 -4
  57. package/src/transaction/interfaces/ITweakedTransactionData.ts +1 -1
  58. package/src/transaction/shared/TweakedTransaction.ts +1 -1
  59. package/src/utxo/OPNetLimitedProvider.ts +2 -2
@@ -351,9 +351,9 @@ function Ka(e) {
351
351
  function xs(e) {
352
352
  return typeof e == "string" && (e = Ka(e)), Jn(e), e;
353
353
  }
354
- let Da = class {
354
+ let Va = class {
355
355
  };
356
- function Va(e) {
356
+ function Da(e) {
357
357
  const t = (n) => e().update(xs(n)).digest(), r = e();
358
358
  return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t;
359
359
  }
@@ -369,7 +369,7 @@ function Fa(e, t, r) {
369
369
  function Wa(e, t, r) {
370
370
  return e & t ^ e & r ^ t & r;
371
371
  }
372
- let Ga = class extends Da {
372
+ let Ga = class extends Va {
373
373
  constructor(t, r, n, i) {
374
374
  super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = mn(this.buffer);
375
375
  }
@@ -495,7 +495,7 @@ const oe = /* @__PURE__ */ Uint32Array.from([
495
495
  3204031479,
496
496
  3329325298
497
497
  ]), ae = /* @__PURE__ */ new Uint32Array(64);
498
- class za extends Ga {
498
+ let za = class extends Ga {
499
499
  constructor(t = 32) {
500
500
  super(64, t, 8, !1), this.A = oe[0] | 0, this.B = oe[1] | 0, this.C = oe[2] | 0, this.D = oe[3] | 0, this.E = oe[4] | 0, this.F = oe[5] | 0, this.G = oe[6] | 0, this.H = oe[7] | 0;
501
501
  }
@@ -527,8 +527,8 @@ class za extends Ga {
527
527
  destroy() {
528
528
  this.set(0, 0, 0, 0, 0, 0, 0, 0), Cn(this.buffer);
529
529
  }
530
- }
531
- const qa = /* @__PURE__ */ Va(() => new za()), Oi = qa;
530
+ };
531
+ const qa = /* @__PURE__ */ Da(() => new za()), Oi = qa;
532
532
  function Ya(e) {
533
533
  if (e.length >= 255)
534
534
  throw new TypeError("Alphabet too long");
@@ -768,7 +768,7 @@ function Ge(e, t) {
768
768
  function Kt(e) {
769
769
  return Bs(e), e < 253 ? 1 : e <= 65535 ? 3 : e <= 4294967295 ? 5 : 9;
770
770
  }
771
- const gp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
771
+ const yp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
772
772
  __proto__: null,
773
773
  decode: Ge,
774
774
  encode: me,
@@ -1665,7 +1665,7 @@ function Et(e, t = 0) {
1665
1665
  const r = new Uint8Array(e);
1666
1666
  return t !== 0 && r.fill(t), r;
1667
1667
  }
1668
- function bp(e) {
1668
+ function mp(e) {
1669
1669
  return new TextEncoder().encode(e);
1670
1670
  }
1671
1671
  function uh(e) {
@@ -2202,7 +2202,7 @@ ri.write = function(e, t, r, n, i, o) {
2202
2202
  return L(this, h, c);
2203
2203
  case "latin1":
2204
2204
  case "binary":
2205
- return V(this, h, c);
2205
+ return D(this, h, c);
2206
2206
  case "base64":
2207
2207
  return x(this, h, c);
2208
2208
  case "ucs2":
@@ -2445,7 +2445,7 @@ ri.write = function(e, t, r, n, i, o) {
2445
2445
  g += String.fromCharCode(s[b] & 127);
2446
2446
  return g;
2447
2447
  }
2448
- function V(s, h, c) {
2448
+ function D(s, h, c) {
2449
2449
  let g = "";
2450
2450
  c = Math.min(s.length, c);
2451
2451
  for (let b = h; b < c; ++b)
@@ -2559,7 +2559,7 @@ ri.write = function(e, t, r, n, i, o) {
2559
2559
  }, f.prototype.readDoubleBE = function(s, h) {
2560
2560
  return s = s >>> 0, h || W(s, 8, this.length), r.read(this, s, !1, 52, 8);
2561
2561
  };
2562
- function D(s, h, c, g, b, I) {
2562
+ function V(s, h, c, g, b, I) {
2563
2563
  if (!f.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
2564
2564
  if (h > b || h < I) throw new RangeError('"value" argument is out of bounds');
2565
2565
  if (c + g > s.length) throw new RangeError("Index out of range");
@@ -2567,7 +2567,7 @@ ri.write = function(e, t, r, n, i, o) {
2567
2567
  f.prototype.writeUintLE = f.prototype.writeUIntLE = function(s, h, c, g) {
2568
2568
  if (s = +s, h = h >>> 0, c = c >>> 0, !g) {
2569
2569
  const T = Math.pow(2, 8 * c) - 1;
2570
- D(this, s, h, c, T, 0);
2570
+ V(this, s, h, c, T, 0);
2571
2571
  }
2572
2572
  let b = 1, I = 0;
2573
2573
  for (this[h] = s & 255; ++I < c && (b *= 256); )
@@ -2576,22 +2576,22 @@ ri.write = function(e, t, r, n, i, o) {
2576
2576
  }, f.prototype.writeUintBE = f.prototype.writeUIntBE = function(s, h, c, g) {
2577
2577
  if (s = +s, h = h >>> 0, c = c >>> 0, !g) {
2578
2578
  const T = Math.pow(2, 8 * c) - 1;
2579
- D(this, s, h, c, T, 0);
2579
+ V(this, s, h, c, T, 0);
2580
2580
  }
2581
2581
  let b = c - 1, I = 1;
2582
2582
  for (this[h + b] = s & 255; --b >= 0 && (I *= 256); )
2583
2583
  this[h + b] = s / I & 255;
2584
2584
  return h + c;
2585
2585
  }, f.prototype.writeUint8 = f.prototype.writeUInt8 = function(s, h, c) {
2586
- return s = +s, h = h >>> 0, c || D(this, s, h, 1, 255, 0), this[h] = s & 255, h + 1;
2586
+ return s = +s, h = h >>> 0, c || V(this, s, h, 1, 255, 0), this[h] = s & 255, h + 1;
2587
2587
  }, f.prototype.writeUint16LE = f.prototype.writeUInt16LE = function(s, h, c) {
2588
- return s = +s, h = h >>> 0, c || D(this, s, h, 2, 65535, 0), this[h] = s & 255, this[h + 1] = s >>> 8, h + 2;
2588
+ return s = +s, h = h >>> 0, c || V(this, s, h, 2, 65535, 0), this[h] = s & 255, this[h + 1] = s >>> 8, h + 2;
2589
2589
  }, f.prototype.writeUint16BE = f.prototype.writeUInt16BE = function(s, h, c) {
2590
- return s = +s, h = h >>> 0, c || D(this, s, h, 2, 65535, 0), this[h] = s >>> 8, this[h + 1] = s & 255, h + 2;
2590
+ return s = +s, h = h >>> 0, c || V(this, s, h, 2, 65535, 0), this[h] = s >>> 8, this[h + 1] = s & 255, h + 2;
2591
2591
  }, f.prototype.writeUint32LE = f.prototype.writeUInt32LE = function(s, h, c) {
2592
- return s = +s, h = h >>> 0, c || D(this, s, h, 4, 4294967295, 0), this[h + 3] = s >>> 24, this[h + 2] = s >>> 16, this[h + 1] = s >>> 8, this[h] = s & 255, h + 4;
2592
+ return s = +s, h = h >>> 0, c || V(this, s, h, 4, 4294967295, 0), this[h + 3] = s >>> 24, this[h + 2] = s >>> 16, this[h + 1] = s >>> 8, this[h] = s & 255, h + 4;
2593
2593
  }, f.prototype.writeUint32BE = f.prototype.writeUInt32BE = function(s, h, c) {
2594
- return s = +s, h = h >>> 0, c || D(this, s, h, 4, 4294967295, 0), this[h] = s >>> 24, this[h + 1] = s >>> 16, this[h + 2] = s >>> 8, this[h + 3] = s & 255, h + 4;
2594
+ return s = +s, h = h >>> 0, c || V(this, s, h, 4, 4294967295, 0), this[h] = s >>> 24, this[h + 1] = s >>> 16, this[h + 2] = s >>> 8, this[h + 3] = s & 255, h + 4;
2595
2595
  };
2596
2596
  function nt(s, h, c, g, b) {
2597
2597
  vi(h, g, b, s, c, 7);
@@ -2614,7 +2614,7 @@ ri.write = function(e, t, r, n, i, o) {
2614
2614
  }), f.prototype.writeIntLE = function(s, h, c, g) {
2615
2615
  if (s = +s, h = h >>> 0, !g) {
2616
2616
  const st = Math.pow(2, 8 * c - 1);
2617
- D(this, s, h, c, st - 1, -st);
2617
+ V(this, s, h, c, st - 1, -st);
2618
2618
  }
2619
2619
  let b = 0, I = 1, T = 0;
2620
2620
  for (this[h] = s & 255; ++b < c && (I *= 256); )
@@ -2623,22 +2623,22 @@ ri.write = function(e, t, r, n, i, o) {
2623
2623
  }, f.prototype.writeIntBE = function(s, h, c, g) {
2624
2624
  if (s = +s, h = h >>> 0, !g) {
2625
2625
  const st = Math.pow(2, 8 * c - 1);
2626
- D(this, s, h, c, st - 1, -st);
2626
+ V(this, s, h, c, st - 1, -st);
2627
2627
  }
2628
2628
  let b = c - 1, I = 1, T = 0;
2629
2629
  for (this[h + b] = s & 255; --b >= 0 && (I *= 256); )
2630
2630
  s < 0 && T === 0 && this[h + b + 1] !== 0 && (T = 1), this[h + b] = (s / I >> 0) - T & 255;
2631
2631
  return h + c;
2632
2632
  }, f.prototype.writeInt8 = function(s, h, c) {
2633
- return s = +s, h = h >>> 0, c || D(this, s, h, 1, 127, -128), s < 0 && (s = 255 + s + 1), this[h] = s & 255, h + 1;
2633
+ return s = +s, h = h >>> 0, c || V(this, s, h, 1, 127, -128), s < 0 && (s = 255 + s + 1), this[h] = s & 255, h + 1;
2634
2634
  }, f.prototype.writeInt16LE = function(s, h, c) {
2635
- return s = +s, h = h >>> 0, c || D(this, s, h, 2, 32767, -32768), this[h] = s & 255, this[h + 1] = s >>> 8, h + 2;
2635
+ return s = +s, h = h >>> 0, c || V(this, s, h, 2, 32767, -32768), this[h] = s & 255, this[h + 1] = s >>> 8, h + 2;
2636
2636
  }, f.prototype.writeInt16BE = function(s, h, c) {
2637
- return s = +s, h = h >>> 0, c || D(this, s, h, 2, 32767, -32768), this[h] = s >>> 8, this[h + 1] = s & 255, h + 2;
2637
+ return s = +s, h = h >>> 0, c || V(this, s, h, 2, 32767, -32768), this[h] = s >>> 8, this[h + 1] = s & 255, h + 2;
2638
2638
  }, f.prototype.writeInt32LE = function(s, h, c) {
2639
- return s = +s, h = h >>> 0, c || D(this, s, h, 4, 2147483647, -2147483648), this[h] = s & 255, this[h + 1] = s >>> 8, this[h + 2] = s >>> 16, this[h + 3] = s >>> 24, h + 4;
2639
+ return s = +s, h = h >>> 0, c || V(this, s, h, 4, 2147483647, -2147483648), this[h] = s & 255, this[h + 1] = s >>> 8, this[h + 2] = s >>> 16, this[h + 3] = s >>> 24, h + 4;
2640
2640
  }, f.prototype.writeInt32BE = function(s, h, c) {
2641
- return s = +s, h = h >>> 0, c || D(this, s, h, 4, 2147483647, -2147483648), s < 0 && (s = 4294967295 + s + 1), this[h] = s >>> 24, this[h + 1] = s >>> 16, this[h + 2] = s >>> 8, this[h + 3] = s & 255, h + 4;
2641
+ return s = +s, h = h >>> 0, c || V(this, s, h, 4, 2147483647, -2147483648), s < 0 && (s = 4294967295 + s + 1), this[h] = s >>> 24, this[h + 1] = s >>> 16, this[h + 2] = s >>> 8, this[h + 3] = s & 255, h + 4;
2642
2642
  }, f.prototype.writeBigInt64LE = se(function(s, h = 0) {
2643
2643
  return nt(this, s, h, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
2644
2644
  }), f.prototype.writeBigInt64BE = se(function(s, h = 0) {
@@ -2706,9 +2706,9 @@ ri.write = function(e, t, r, n, i, o) {
2706
2706
  }
2707
2707
  return this;
2708
2708
  };
2709
- const Dt = {};
2709
+ const Vt = {};
2710
2710
  function _e(s, h, c) {
2711
- Dt[s] = class extends c {
2711
+ Vt[s] = class extends c {
2712
2712
  constructor() {
2713
2713
  super(), Object.defineProperty(this, "message", {
2714
2714
  value: h.apply(this, arguments),
@@ -2766,16 +2766,16 @@ ri.write = function(e, t, r, n, i, o) {
2766
2766
  if (s > c || s < h) {
2767
2767
  const T = typeof h == "bigint" ? "n" : "";
2768
2768
  let st;
2769
- throw h === 0 || h === BigInt(0) ? st = `>= 0${T} and < 2${T} ** ${(I + 1) * 8}${T}` : st = `>= -(2${T} ** ${(I + 1) * 8 - 1}${T}) and < 2 ** ${(I + 1) * 8 - 1}${T}`, new Dt.ERR_OUT_OF_RANGE("value", st, s);
2769
+ throw h === 0 || h === BigInt(0) ? st = `>= 0${T} and < 2${T} ** ${(I + 1) * 8}${T}` : st = `>= -(2${T} ** ${(I + 1) * 8 - 1}${T}) and < 2 ** ${(I + 1) * 8 - 1}${T}`, new Vt.ERR_OUT_OF_RANGE("value", st, s);
2770
2770
  }
2771
2771
  ma(g, b, I);
2772
2772
  }
2773
2773
  function Re(s, h) {
2774
2774
  if (typeof s != "number")
2775
- throw new Dt.ERR_INVALID_ARG_TYPE(h, "number", s);
2775
+ throw new Vt.ERR_INVALID_ARG_TYPE(h, "number", s);
2776
2776
  }
2777
2777
  function ze(s, h, c) {
2778
- throw Math.floor(s) !== s ? (Re(s, c), new Dt.ERR_OUT_OF_RANGE("offset", "an integer", s)) : h < 0 ? new Dt.ERR_BUFFER_OUT_OF_BOUNDS() : new Dt.ERR_OUT_OF_RANGE(
2778
+ throw Math.floor(s) !== s ? (Re(s, c), new Vt.ERR_OUT_OF_RANGE("offset", "an integer", s)) : h < 0 ? new Vt.ERR_BUFFER_OUT_OF_BOUNDS() : new Vt.ERR_OUT_OF_RANGE(
2779
2779
  "offset",
2780
2780
  `>= 0 and <= ${h}`,
2781
2781
  s
@@ -2980,7 +2980,7 @@ function Rh(e) {
2980
2980
  throw new TypeError(`Expected 20-byte Uint8Array, got ${e.length} bytes`);
2981
2981
  return e;
2982
2982
  }
2983
- function mp(e) {
2983
+ function Ep(e) {
2984
2984
  if (e < 0n)
2985
2985
  throw new RangeError(`Satoshi cannot be negative, got ${e}`);
2986
2986
  if (e > Bi)
@@ -3024,23 +3024,23 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3024
3024
  decode: Nh,
3025
3025
  encode: Lh,
3026
3026
  isDefinedHashType: on
3027
- }, Symbol.toStringTag, { value: "Module" })), Ds = Y.OP_RESERVED;
3027
+ }, Symbol.toStringTag, { value: "Module" })), Vs = Y.OP_RESERVED;
3028
3028
  function Ch(e) {
3029
3029
  return kh(e) && (e === Y.OP_0 || e >= Y.OP_1 && e <= Y.OP_16 || e === Y.OP_1NEGATE);
3030
3030
  }
3031
- function Vs(e) {
3031
+ function Ds(e) {
3032
3032
  return e instanceof Uint8Array ? !0 : Ch(e);
3033
3033
  }
3034
3034
  function an(e) {
3035
- return ni(e) && e.every(Vs);
3035
+ return ni(e) && e.every(Ds);
3036
3036
  }
3037
3037
  function ii(e) {
3038
- return e.length - e.filter(Vs).length;
3038
+ return e.length - e.filter(Ds).length;
3039
3039
  }
3040
3040
  function Lr(e) {
3041
3041
  if (e.length === 0) return Y.OP_0;
3042
3042
  if (e.length === 1) {
3043
- if (e[0] >= 1 && e[0] <= 16) return Ds + e[0];
3043
+ if (e[0] >= 1 && e[0] <= 16) return Vs + e[0];
3044
3044
  if (e[0] === 129) return Y.OP_1NEGATE;
3045
3045
  }
3046
3046
  }
@@ -3127,7 +3127,7 @@ function Fs(e) {
3127
3127
  const t = si(e) ? et(e) : e;
3128
3128
  if (!t || !an(t))
3129
3129
  throw new TypeError("Expected push-only script");
3130
- return t.map((r) => Hr(r) ? r : r === Y.OP_0 ? Et(0) : Hs(r - Ds));
3130
+ return t.map((r) => Hr(r) ? r : r === Y.OP_0 ? Et(0) : Hs(r - Vs));
3131
3131
  }
3132
3132
  function Ws(e) {
3133
3133
  return Ue(e);
@@ -3135,7 +3135,7 @@ function Ws(e) {
3135
3135
  function Pe(e) {
3136
3136
  return !(e instanceof Uint8Array) || !on(e[e.length - 1]) ? !1 : uh(e.subarray(0, -1));
3137
3137
  }
3138
- const Dh = Th, Te = Hh, Vh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3138
+ const Vh = Th, Te = Hh, Dh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3139
3139
  __proto__: null,
3140
3140
  compile: yt,
3141
3141
  countNonPushOnlyOPs: ii,
@@ -3144,7 +3144,7 @@ const Dh = Th, Te = Hh, Vh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Objec
3144
3144
  isCanonicalPubKey: Ws,
3145
3145
  isCanonicalScriptSignature: Pe,
3146
3146
  isPushOnly: an,
3147
- number: Dh,
3147
+ number: Vh,
3148
3148
  opcodes: Y,
3149
3149
  signature: Te,
3150
3150
  toASM: Ms,
@@ -3650,7 +3650,7 @@ const jh = /* @__PURE__ */ oi(() => new Gh()), zh = /* @__PURE__ */ Uint8Array.f
3650
3650
  2053994217,
3651
3651
  0
3652
3652
  ]);
3653
- function Di(e, t, r, n) {
3653
+ function Vi(e, t, r, n) {
3654
3654
  return e === 0 ? t ^ r ^ n : e === 1 ? t & r | ~t & n : e === 2 ? (t | ~r) ^ n : e === 3 ? t & n | r & ~n : t ^ (r | ~n);
3655
3655
  }
3656
3656
  const Sr = /* @__PURE__ */ new Uint32Array(16);
@@ -3677,11 +3677,11 @@ class Jh extends ai {
3677
3677
  for (let y = 0; y < 5; y++) {
3678
3678
  const m = 4 - y, E = Zh[y], S = Qh[y], O = Qs[y], _ = Js[y], U = Yh[y], H = Xh[y];
3679
3679
  for (let j = 0; j < 16; j++) {
3680
- const rt = Se(n + Di(y, o, u, d) + Sr[O[j]] + E, U[j]) + p | 0;
3680
+ const rt = Se(n + Vi(y, o, u, d) + Sr[O[j]] + E, U[j]) + p | 0;
3681
3681
  n = p, p = d, d = Se(u, 10) | 0, u = o, o = rt;
3682
3682
  }
3683
3683
  for (let j = 0; j < 16; j++) {
3684
- const rt = Se(i + Di(m, a, l, f) + Sr[_[j]] + S, H[j]) + w | 0;
3684
+ const rt = Se(i + Vi(m, a, l, f) + Sr[_[j]] + S, H[j]) + w | 0;
3685
3685
  i = w, w = f, f = Se(l, 10) | 0, l = a, a = rt;
3686
3686
  }
3687
3687
  }
@@ -4454,8 +4454,8 @@ const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4454
4454
  b: 7n,
4455
4455
  Gx: 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,
4456
4456
  Gy: 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n
4457
- }, { p: ke, n: au, Gx: hu, Gy: uu, b: io } = no, Dn = 32, hi = 64, fu = {
4458
- publicKey: Dn + 1,
4457
+ }, { p: ke, n: au, Gx: hu, Gy: uu, b: io } = no, Vn = 32, hi = 64, fu = {
4458
+ publicKey: Vn + 1,
4459
4459
  publicKeyUncompressed: hi + 1
4460
4460
  }, cu = (...e) => {
4461
4461
  "captureStackTrace" in Error && typeof Error.captureStackTrace == "function" && Error.captureStackTrace(...e);
@@ -4469,7 +4469,7 @@ const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4469
4469
  xt(a + "expected Uint8Array" + u + ", got " + l);
4470
4470
  }
4471
4471
  return e;
4472
- }, so = (e) => new Uint8Array(e), oo = (e, t) => e.toString(16).padStart(t, "0"), ao = (e) => Array.from(ui(e)).map((t) => oo(t, 2)).join(""), ee = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }, Vi = (e) => {
4472
+ }, so = (e) => new Uint8Array(e), oo = (e, t) => e.toString(16).padStart(t, "0"), ao = (e) => Array.from(ui(e)).map((t) => oo(t, 2)).join(""), ee = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }, Di = (e) => {
4473
4473
  if (e >= ee._0 && e <= ee._9)
4474
4474
  return e - ee._0;
4475
4475
  if (e >= ee.A && e <= ee.F)
@@ -4485,7 +4485,7 @@ const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4485
4485
  return xt(t);
4486
4486
  const i = so(n);
4487
4487
  for (let o = 0, a = 0; o < n; o++, a += 2) {
4488
- const u = Vi(e.charCodeAt(a)), l = Vi(e.charCodeAt(a + 1));
4488
+ const u = Di(e.charCodeAt(a)), l = Di(e.charCodeAt(a + 1));
4489
4489
  if (u === void 0 || l === void 0)
4490
4490
  return xt(t);
4491
4491
  i[o] = u * 16 + l;
@@ -4508,7 +4508,7 @@ const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4508
4508
  n = r, r = u, i = o, o = l;
4509
4509
  }
4510
4510
  return n === 1n ? R(i, t) : xt("no inverse");
4511
- }, An = (e) => e instanceof Rt ? e : xt("Point expected"), uo = (e) => R(R(e * e) * e + io), Fi = (e) => hn(e, 0n, ke), _r = (e) => hn(e, 1n, ke), gu = (e) => hn(e, 1n, au), Vn = (e) => (e & 1n) === 0n, fo = (e) => Uint8Array.of(e), yu = (e) => fo(Vn(e) ? 2 : 3), bu = (e) => {
4511
+ }, An = (e) => e instanceof Rt ? e : xt("Point expected"), uo = (e) => R(R(e * e) * e + io), Fi = (e) => hn(e, 0n, ke), _r = (e) => hn(e, 1n, ke), gu = (e) => hn(e, 1n, au), Dn = (e) => (e & 1n) === 0n, fo = (e) => Uint8Array.of(e), yu = (e) => fo(Dn(e) ? 2 : 3), bu = (e) => {
4512
4512
  const t = uo(_r(e));
4513
4513
  let r = 1n;
4514
4514
  for (let n = t, i = (ke + 1n) / 4n; i > 0n; i >>= 1n)
@@ -4537,13 +4537,13 @@ class Rt {
4537
4537
  ui(t);
4538
4538
  const { publicKey: r, publicKeyUncompressed: n } = fu;
4539
4539
  let i;
4540
- const o = t.length, a = t[0], u = t.subarray(1), l = Wi(u, 0, Dn);
4540
+ const o = t.length, a = t[0], u = t.subarray(1), l = Wi(u, 0, Vn);
4541
4541
  if (o === r && (a === 2 || a === 3)) {
4542
4542
  let d = bu(l);
4543
- const f = Vn(d);
4544
- Vn($r(a)) !== f && (d = R(-d)), i = new Rt(l, d, 1n);
4543
+ const f = Dn(d);
4544
+ Dn($r(a)) !== f && (d = R(-d)), i = new Rt(l, d, 1n);
4545
4545
  }
4546
- return o === n && a === 4 && (i = new Rt(l, Wi(u, Dn, hi), 1n)), i ? i.assertValidity() : xt("bad point: not on curve");
4546
+ return o === n && a === 4 && (i = new Rt(l, Wi(u, Vn, hi), 1n)), i ? i.assertValidity() : xt("bad point: not on curve");
4547
4547
  }
4548
4548
  static fromHex(t) {
4549
4549
  return Rt.fromBytes(ho(t));
@@ -5460,7 +5460,7 @@ function wo(e) {
5460
5460
  throw new Error("Hash must wrapped by utils.createHasher");
5461
5461
  xe(e.outputLen), xe(e.blockLen);
5462
5462
  }
5463
- function Dr(e, t = !0) {
5463
+ function Vr(e, t = !0) {
5464
5464
  if (e.destroyed)
5465
5465
  throw new Error("Hash instance has been destroyed");
5466
5466
  if (t && e.finished)
@@ -5472,7 +5472,7 @@ function Tu(e, t) {
5472
5472
  if (e.length < r)
5473
5473
  throw new Error('"digestInto() output" expected to be of length >=' + r);
5474
5474
  }
5475
- function Vr(...e) {
5475
+ function Dr(...e) {
5476
5476
  for (let t = 0; t < e.length; t++)
5477
5477
  e[t].fill(0);
5478
5478
  }
@@ -5570,7 +5570,7 @@ class Bu {
5570
5570
  this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = vn(this.buffer);
5571
5571
  }
5572
5572
  update(t) {
5573
- Dr(this), ut(t);
5573
+ Vr(this), ut(t);
5574
5574
  const { view: r, buffer: n, blockLen: i } = this, o = t.length;
5575
5575
  for (let a = 0; a < o; ) {
5576
5576
  const u = Math.min(i - this.pos, o - a);
@@ -5585,10 +5585,10 @@ class Bu {
5585
5585
  return this.length += t.length, this.roundClean(), this;
5586
5586
  }
5587
5587
  digestInto(t) {
5588
- Dr(this), Tu(t, this), this.finished = !0;
5588
+ Vr(this), Tu(t, this), this.finished = !0;
5589
5589
  const { buffer: r, view: n, blockLen: i, isLE: o } = this;
5590
5590
  let { pos: a } = this;
5591
- r[a++] = 128, Vr(this.buffer.subarray(a)), this.padOffset > i - a && (this.process(n, 0), a = 0);
5591
+ r[a++] = 128, Dr(this.buffer.subarray(a)), this.padOffset > i - a && (this.process(n, 0), a = 0);
5592
5592
  for (let p = a; p < i; p++)
5593
5593
  r[p] = 0;
5594
5594
  n.setBigUint64(i - 8, BigInt(this.length * 8), o), this.process(n, 0);
@@ -5718,10 +5718,10 @@ class Ru extends Bu {
5718
5718
  n = n + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, a = a + this.D | 0, u = u + this.E | 0, l = l + this.F | 0, d = d + this.G | 0, f = f + this.H | 0, this.set(n, i, o, a, u, l, d, f);
5719
5719
  }
5720
5720
  roundClean() {
5721
- Vr(pe);
5721
+ Dr(pe);
5722
5722
  }
5723
5723
  destroy() {
5724
- this.set(0, 0, 0, 0, 0, 0, 0, 0), Vr(this.buffer);
5724
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), Dr(this.buffer);
5725
5725
  }
5726
5726
  }
5727
5727
  class Nu extends Ru {
@@ -5801,7 +5801,7 @@ function Ku(e) {
5801
5801
  return t;
5802
5802
  }
5803
5803
  const pi = (e) => (Wn << BigInt(e)) - Wn;
5804
- function Du(e, t, r) {
5804
+ function Vu(e, t, r) {
5805
5805
  if (xe(e, "hashLen"), xe(t, "qByteLen"), typeof r != "function")
5806
5806
  throw new Error("hmacFn must be a function");
5807
5807
  const n = (E) => new Uint8Array(E), i = Uint8Array.of(), o = Uint8Array.of(0), a = Uint8Array.of(1), u = 1e3;
@@ -5854,8 +5854,8 @@ function Zi(e) {
5854
5854
  return t.set(r, o), o;
5855
5855
  };
5856
5856
  }
5857
- const Ot = /* @__PURE__ */ BigInt(0), Tt = /* @__PURE__ */ BigInt(1), Ae = /* @__PURE__ */ BigInt(2), So = /* @__PURE__ */ BigInt(3), Ao = /* @__PURE__ */ BigInt(4), vo = /* @__PURE__ */ BigInt(5), Vu = /* @__PURE__ */ BigInt(7), To = /* @__PURE__ */ BigInt(8), Mu = /* @__PURE__ */ BigInt(9), ko = /* @__PURE__ */ BigInt(16);
5858
- function Vt(e, t) {
5857
+ const Ot = /* @__PURE__ */ BigInt(0), Tt = /* @__PURE__ */ BigInt(1), Ae = /* @__PURE__ */ BigInt(2), So = /* @__PURE__ */ BigInt(3), Ao = /* @__PURE__ */ BigInt(4), vo = /* @__PURE__ */ BigInt(5), Du = /* @__PURE__ */ BigInt(7), To = /* @__PURE__ */ BigInt(8), Mu = /* @__PURE__ */ BigInt(9), ko = /* @__PURE__ */ BigInt(16);
5858
+ function Dt(e, t) {
5859
5859
  const r = e % t;
5860
5860
  return r >= Ot ? r : t + r;
5861
5861
  }
@@ -5870,14 +5870,14 @@ function Qi(e, t) {
5870
5870
  throw new Error("invert: expected non-zero number");
5871
5871
  if (t <= Ot)
5872
5872
  throw new Error("invert: expected positive modulus, got " + t);
5873
- let r = Vt(e, t), n = t, i = Ot, o = Tt;
5873
+ let r = Dt(e, t), n = t, i = Ot, o = Tt;
5874
5874
  for (; r !== Ot; ) {
5875
5875
  const a = n / r, u = n % r, l = i - o * a;
5876
5876
  n = r, r = u, i = o, o = l;
5877
5877
  }
5878
5878
  if (n !== Tt)
5879
5879
  throw new Error("invert: does not exist");
5880
- return Vt(i, t);
5880
+ return Dt(i, t);
5881
5881
  }
5882
5882
  function wi(e, t, r) {
5883
5883
  if (!e.eql(e.sqr(t), r))
@@ -5892,7 +5892,7 @@ function Fu(e, t) {
5892
5892
  return wi(e, u, t), u;
5893
5893
  }
5894
5894
  function Wu(e) {
5895
- const t = cn(e), r = Oo(e), n = r(t, t.neg(t.ONE)), i = r(t, n), o = r(t, t.neg(n)), a = (e + Vu) / ko;
5895
+ const t = cn(e), r = Oo(e), n = r(t, t.neg(t.ONE)), i = r(t, n), o = r(t, t.neg(n)), a = (e + Du) / ko;
5896
5896
  return (u, l) => {
5897
5897
  let d = u.pow(l, a), f = u.mul(d, n);
5898
5898
  const p = u.mul(d, i), w = u.mul(d, o), y = u.eql(u.sqr(f), l), m = u.eql(u.sqr(p), l);
@@ -6014,7 +6014,7 @@ class Xu {
6014
6014
  this.ORDER = t, this.BITS = i, this.BYTES = o, this._sqrt = void 0, Object.preventExtensions(this);
6015
6015
  }
6016
6016
  create(t) {
6017
- return Vt(t, this.ORDER);
6017
+ return Dt(t, this.ORDER);
6018
6018
  }
6019
6019
  isValid(t) {
6020
6020
  if (typeof t != "bigint")
@@ -6032,28 +6032,28 @@ class Xu {
6032
6032
  return (t & Tt) === Tt;
6033
6033
  }
6034
6034
  neg(t) {
6035
- return Vt(-t, this.ORDER);
6035
+ return Dt(-t, this.ORDER);
6036
6036
  }
6037
6037
  eql(t, r) {
6038
6038
  return t === r;
6039
6039
  }
6040
6040
  sqr(t) {
6041
- return Vt(t * t, this.ORDER);
6041
+ return Dt(t * t, this.ORDER);
6042
6042
  }
6043
6043
  add(t, r) {
6044
- return Vt(t + r, this.ORDER);
6044
+ return Dt(t + r, this.ORDER);
6045
6045
  }
6046
6046
  sub(t, r) {
6047
- return Vt(t - r, this.ORDER);
6047
+ return Dt(t - r, this.ORDER);
6048
6048
  }
6049
6049
  mul(t, r) {
6050
- return Vt(t * r, this.ORDER);
6050
+ return Dt(t * r, this.ORDER);
6051
6051
  }
6052
6052
  pow(t, r) {
6053
6053
  return qu(this, t, r);
6054
6054
  }
6055
6055
  div(t, r) {
6056
- return Vt(t * Qi(r, this.ORDER), this.ORDER);
6056
+ return Dt(t * Qi(r, this.ORDER), this.ORDER);
6057
6057
  }
6058
6058
  // Same as above, but doesn't normalize
6059
6059
  sqrN(t) {
@@ -6089,7 +6089,7 @@ class Xu {
6089
6089
  if (t.length !== i)
6090
6090
  throw new Error("Field.fromBytes: expected " + i + " bytes, got " + t.length);
6091
6091
  let l = o ? Eo(t) : fn(t);
6092
- if (u && (l = Vt(l, a)), !r && !this.isValid(l))
6092
+ if (u && (l = Dt(l, a)), !r && !this.isValid(l))
6093
6093
  throw new Error("invalid field element: outside of range 0..ORDER");
6094
6094
  return l;
6095
6095
  }
@@ -6121,7 +6121,7 @@ function Zu(e, t, r = !1) {
6121
6121
  const n = e.length, i = Po(t), o = Bo(t);
6122
6122
  if (n < 16 || n < o || n > 1024)
6123
6123
  throw new Error("expected " + o + "-1024 bytes of input, got " + n);
6124
- const a = r ? Eo(e) : fn(e), u = Vt(a, t - Tt) + Tt;
6124
+ const a = r ? Eo(e) : fn(e), u = Dt(a, t - Tt) + Tt;
6125
6125
  return r ? Io(u, i) : li(u, i);
6126
6126
  }
6127
6127
  const We = /* @__PURE__ */ BigInt(0), ve = /* @__PURE__ */ BigInt(1);
@@ -6303,13 +6303,13 @@ let No = class {
6303
6303
  this.iHash.update(i), this.oHash = t.create();
6304
6304
  for (let o = 0; o < i.length; o++)
6305
6305
  i[o] ^= 106;
6306
- this.oHash.update(i), Vr(i);
6306
+ this.oHash.update(i), Dr(i);
6307
6307
  }
6308
6308
  update(t) {
6309
- return Dr(this), this.iHash.update(t), this;
6309
+ return Vr(this), this.iHash.update(t), this;
6310
6310
  }
6311
6311
  digestInto(t) {
6312
- Dr(this), ut(t, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
6312
+ Vr(this), ut(t, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
6313
6313
  }
6314
6314
  digest() {
6315
6315
  const t = new Uint8Array(this.oHash.outputLen);
@@ -6489,8 +6489,8 @@ function of(e, t = {}) {
6489
6489
  throw new Error("bad point: is not on curve, sqrt error" + ft);
6490
6490
  }
6491
6491
  f();
6492
- const V = n.isOdd(L);
6493
- return (x & 1) === 1 !== V && (L = n.neg(L)), { x: $, y: L };
6492
+ const D = n.isOdd(L);
6493
+ return (x & 1) === 1 !== D && (L = n.neg(L)), { x: $, y: L };
6494
6494
  } else if (A === v && x === 4) {
6495
6495
  const $ = n.BYTES, K = n.fromBytes(C.subarray(0, $)), L = n.fromBytes(C.subarray($, $ * 2));
6496
6496
  if (!S(K, L))
@@ -6622,8 +6622,8 @@ function of(e, t = {}) {
6622
6622
  /** Compare one point to another. */
6623
6623
  equals(k) {
6624
6624
  H(k);
6625
- const { X: v, Y: A, Z: x } = this, { X: C, Y: $, Z: K } = k, L = n.eql(n.mul(v, K), n.mul(C, x)), V = n.eql(n.mul(A, K), n.mul($, x));
6626
- return L && V;
6625
+ const { X: v, Y: A, Z: x } = this, { X: C, Y: $, Z: K } = k, L = n.eql(n.mul(v, K), n.mul(C, x)), D = n.eql(n.mul(A, K), n.mul($, x));
6626
+ return L && D;
6627
6627
  }
6628
6628
  /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
6629
6629
  negate() {
@@ -6635,8 +6635,8 @@ function of(e, t = {}) {
6635
6635
  // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
6636
6636
  double() {
6637
6637
  const { a: k, b: v } = o, A = n.mul(v, Tr), { X: x, Y: C, Z: $ } = this;
6638
- let K = n.ZERO, L = n.ZERO, V = n.ZERO, F = n.mul(x, x), ft = n.mul(C, C), W = n.mul($, $), D = n.mul(x, C);
6639
- return D = n.add(D, D), V = n.mul(x, $), V = n.add(V, V), K = n.mul(k, V), L = n.mul(A, W), L = n.add(K, L), K = n.sub(ft, L), L = n.add(ft, L), L = n.mul(K, L), K = n.mul(D, K), V = n.mul(A, V), W = n.mul(k, W), D = n.sub(F, W), D = n.mul(k, D), D = n.add(D, V), V = n.add(F, F), F = n.add(V, F), F = n.add(F, W), F = n.mul(F, D), L = n.add(L, F), W = n.mul(C, $), W = n.add(W, W), F = n.mul(W, D), K = n.sub(K, F), V = n.mul(W, ft), V = n.add(V, V), V = n.add(V, V), new M(K, L, V);
6638
+ let K = n.ZERO, L = n.ZERO, D = n.ZERO, F = n.mul(x, x), ft = n.mul(C, C), W = n.mul($, $), V = n.mul(x, C);
6639
+ return V = n.add(V, V), D = n.mul(x, $), D = n.add(D, D), K = n.mul(k, D), L = n.mul(A, W), L = n.add(K, L), K = n.sub(ft, L), L = n.add(ft, L), L = n.mul(K, L), K = n.mul(V, K), D = n.mul(A, D), W = n.mul(k, W), V = n.sub(F, W), V = n.mul(k, V), V = n.add(V, D), D = n.add(F, F), F = n.add(D, F), F = n.add(F, W), F = n.mul(F, V), L = n.add(L, F), W = n.mul(C, $), W = n.add(W, W), F = n.mul(W, V), K = n.sub(K, F), D = n.mul(W, ft), D = n.add(D, D), D = n.add(D, D), new M(K, L, D);
6640
6640
  }
6641
6641
  // Renes-Costello-Batina exception-free addition formula.
6642
6642
  // There is 30% faster Jacobian formula, but it is not complete.
@@ -6645,12 +6645,12 @@ function of(e, t = {}) {
6645
6645
  add(k) {
6646
6646
  H(k);
6647
6647
  const { X: v, Y: A, Z: x } = this, { X: C, Y: $, Z: K } = k;
6648
- let L = n.ZERO, V = n.ZERO, F = n.ZERO;
6648
+ let L = n.ZERO, D = n.ZERO, F = n.ZERO;
6649
6649
  const ft = o.a, W = n.mul(o.b, Tr);
6650
- let D = n.mul(v, C), nt = n.mul(A, $), ct = n.mul(x, K), _t = n.add(v, A), it = n.add(C, $);
6651
- _t = n.mul(_t, it), it = n.add(D, nt), _t = n.sub(_t, it), it = n.add(v, x);
6650
+ let V = n.mul(v, C), nt = n.mul(A, $), ct = n.mul(x, K), _t = n.add(v, A), it = n.add(C, $);
6651
+ _t = n.mul(_t, it), it = n.add(V, nt), _t = n.sub(_t, it), it = n.add(v, x);
6652
6652
  let gt = n.add(C, K);
6653
- return it = n.mul(it, gt), gt = n.add(D, ct), it = n.sub(it, gt), gt = n.add(A, x), L = n.add($, K), gt = n.mul(gt, L), L = n.add(nt, ct), gt = n.sub(gt, L), F = n.mul(ft, it), L = n.mul(W, ct), F = n.add(L, F), L = n.sub(nt, F), F = n.add(nt, F), V = n.mul(L, F), nt = n.add(D, D), nt = n.add(nt, D), ct = n.mul(ft, ct), it = n.mul(W, it), nt = n.add(nt, ct), ct = n.sub(D, ct), ct = n.mul(ft, ct), it = n.add(it, ct), D = n.mul(nt, it), V = n.add(V, D), D = n.mul(gt, it), L = n.mul(_t, L), L = n.sub(L, D), D = n.mul(_t, nt), F = n.mul(gt, F), F = n.add(F, D), new M(L, V, F);
6653
+ return it = n.mul(it, gt), gt = n.add(V, ct), it = n.sub(it, gt), gt = n.add(A, x), L = n.add($, K), gt = n.mul(gt, L), L = n.add(nt, ct), gt = n.sub(gt, L), F = n.mul(ft, it), L = n.mul(W, ct), F = n.add(L, F), L = n.sub(nt, F), F = n.add(nt, F), D = n.mul(L, F), nt = n.add(V, V), nt = n.add(nt, V), ct = n.mul(ft, ct), it = n.mul(W, it), nt = n.add(nt, ct), ct = n.sub(V, ct), ct = n.mul(ft, ct), it = n.add(it, ct), V = n.mul(nt, it), D = n.add(D, V), V = n.mul(gt, it), L = n.mul(_t, L), L = n.sub(L, V), V = n.mul(_t, nt), F = n.mul(gt, F), F = n.add(F, V), new M(L, D, F);
6654
6654
  }
6655
6655
  subtract(k) {
6656
6656
  return this.add(k.negate());
@@ -6674,8 +6674,8 @@ function of(e, t = {}) {
6674
6674
  let A, x;
6675
6675
  const C = ($) => te.cached(this, $, (K) => ts(M, K));
6676
6676
  if (v) {
6677
- const { k1neg: $, k1: K, k2neg: L, k2: V } = j(k), { p: F, f: ft } = C(K), { p: W, f: D } = C(V);
6678
- x = ft.add(D), A = q(v.beta, F, W, $, L);
6677
+ const { k1neg: $, k1: K, k2neg: L, k2: D } = j(k), { p: F, f: ft } = C(K), { p: W, f: V } = C(D);
6678
+ x = ft.add(V), A = q(v.beta, F, W, $, L);
6679
6679
  } else {
6680
6680
  const { p: $, f: K } = C(k);
6681
6681
  A = $, x = K;
@@ -6698,8 +6698,8 @@ function of(e, t = {}) {
6698
6698
  if (te.hasCache(this))
6699
6699
  return this.multiply(k);
6700
6700
  if (v) {
6701
- const { k1neg: x, k1: C, k2neg: $, k2: K } = j(k), { p1: L, p2: V } = Ju(M, A, C, K);
6702
- return q(v.beta, L, V, x, $);
6701
+ const { k1neg: x, k1: C, k2neg: $, k2: K } = j(k), { p1: L, p2: D } = Ju(M, A, C, K);
6702
+ return q(v.beta, L, D, x, $);
6703
6703
  } else
6704
6704
  return te.unsafe(A, k);
6705
6705
  }
@@ -6845,8 +6845,8 @@ function hf(e, t, r = {}) {
6845
6845
  U(A, x);
6846
6846
  let C;
6847
6847
  if (x === "der") {
6848
- const { r: V, s: F } = ye.toSig(ut(A));
6849
- return new H(V, F);
6848
+ const { r: D, s: F } = ye.toSig(ut(A));
6849
+ return new H(D, F);
6850
6850
  }
6851
6851
  x === "recovered" && (C = A[0], x = "compact", A = A.subarray(1));
6852
6852
  const $ = y.signature / 2, K = A.subarray(0, $), L = A.subarray($, $ * 2);
@@ -6868,7 +6868,7 @@ function hf(e, t, r = {}) {
6868
6868
  const { r: x, s: C } = this, $ = this.assertRecovery(), K = $ === 2 || $ === 3 ? x + u : x;
6869
6869
  if (!o.isValid(K))
6870
6870
  throw new Error("invalid recovery id: sig.r+curve.n != R.x");
6871
- const L = o.toBytes(K), V = e.fromBytes(be(Co(($ & 1) === 0), L)), F = a.inv(K), ft = rt(ut(A, void 0, "msgHash")), W = a.create(-ft * F), D = a.create(C * F), nt = e.BASE.multiplyUnsafe(W).add(V.multiplyUnsafe(D));
6871
+ const L = o.toBytes(K), D = e.fromBytes(be(Co(($ & 1) === 0), L)), F = a.inv(K), ft = rt(ut(A, void 0, "msgHash")), W = a.create(-ft * F), V = a.create(C * F), nt = e.BASE.multiplyUnsafe(W).add(D.multiplyUnsafe(V));
6872
6872
  if (nt.is0())
6873
6873
  throw new Error("invalid recovery: point at infinify");
6874
6874
  return nt.assertValidity(), nt;
@@ -6904,46 +6904,46 @@ function hf(e, t, r = {}) {
6904
6904
  function Bt(v, A, x) {
6905
6905
  const { lowS: C, prehash: $, extraEntropy: K } = On(x, m);
6906
6906
  v = M(v, $);
6907
- const L = rt(v), V = a.fromBytes(A);
6908
- if (!a.isValidNot0(V))
6907
+ const L = rt(v), D = a.fromBytes(A);
6908
+ if (!a.isValidNot0(D))
6909
6909
  throw new Error("invalid private key");
6910
- const F = [q(V), q(L)];
6910
+ const F = [q(D), q(L)];
6911
6911
  if (K != null && K !== !1) {
6912
6912
  const nt = K === !0 ? n(y.secretKey) : K;
6913
6913
  F.push(ut(nt, void 0, "extraEntropy"));
6914
6914
  }
6915
6915
  const ft = be(...F), W = L;
6916
- function D(nt) {
6916
+ function V(nt) {
6917
6917
  const ct = j(nt);
6918
6918
  if (!a.isValidNot0(ct))
6919
6919
  return;
6920
6920
  const _t = a.inv(ct), it = e.BASE.multiply(ct).toAffine(), gt = a.create(it.x);
6921
6921
  if (gt === ie)
6922
6922
  return;
6923
- const Dt = a.create(_t * a.create(W + gt * V));
6924
- if (Dt === ie)
6923
+ const Vt = a.create(_t * a.create(W + gt * D));
6924
+ if (Vt === ie)
6925
6925
  return;
6926
- let _e = (it.x === gt ? 0 : 2) | Number(it.y & Ke), je = Dt;
6927
- return C && S(Dt) && (je = a.neg(Dt), _e ^= 1), new H(gt, je, E ? void 0 : _e);
6926
+ let _e = (it.x === gt ? 0 : 2) | Number(it.y & Ke), je = Vt;
6927
+ return C && S(Vt) && (je = a.neg(Vt), _e ^= 1), new H(gt, je, E ? void 0 : _e);
6928
6928
  }
6929
- return { seed: ft, k2sig: D };
6929
+ return { seed: ft, k2sig: V };
6930
6930
  }
6931
6931
  function te(v, A, x = {}) {
6932
6932
  const { seed: C, k2sig: $ } = Bt(v, A, x);
6933
- return Du(t.outputLen, a.BYTES, i)(C, $).toBytes(x.format);
6933
+ return Vu(t.outputLen, a.BYTES, i)(C, $).toBytes(x.format);
6934
6934
  }
6935
6935
  function X(v, A, x, C = {}) {
6936
6936
  const { lowS: $, prehash: K, format: L } = On(C, m);
6937
6937
  if (x = ut(x, void 0, "publicKey"), A = M(A, K), !fi(v)) {
6938
- const V = v instanceof H ? ", use sig.toBytes()" : "";
6939
- throw new Error("verify expects Uint8Array signature" + V);
6938
+ const D = v instanceof H ? ", use sig.toBytes()" : "";
6939
+ throw new Error("verify expects Uint8Array signature" + D);
6940
6940
  }
6941
6941
  U(v, L);
6942
6942
  try {
6943
- const V = H.fromBytes(v, L), F = e.fromBytes(x);
6944
- if ($ && V.hasHighS())
6943
+ const D = H.fromBytes(v, L), F = e.fromBytes(x);
6944
+ if ($ && D.hasHighS())
6945
6945
  return !1;
6946
- const { r: ft, s: W } = V, D = rt(A), nt = a.inv(W), ct = a.create(D * nt), _t = a.create(ft * nt), it = e.BASE.multiplyUnsafe(ct).add(F.multiplyUnsafe(_t));
6946
+ const { r: ft, s: W } = D, V = rt(A), nt = a.inv(W), ct = a.create(V * nt), _t = a.create(ft * nt), it = e.BASE.multiplyUnsafe(ct).add(F.multiplyUnsafe(_t));
6947
6947
  return it.is0() ? !1 : a.create(it.x) === ft;
6948
6948
  } catch {
6949
6949
  return !1;
@@ -7311,7 +7311,7 @@ class Ut {
7311
7311
  return Ut.#t !== void 0;
7312
7312
  }
7313
7313
  }
7314
- function Ip(e) {
7314
+ function Sp(e) {
7315
7315
  if (e === void 0) {
7316
7316
  Ut.clear();
7317
7317
  return;
@@ -7381,7 +7381,7 @@ function bf(e) {
7381
7381
  return me(e.length, r), Nt([r, e]);
7382
7382
  }
7383
7383
  const os = Y, as = 1, mf = 80;
7384
- let Do = class rr {
7384
+ let Vo = class rr {
7385
7385
  // Static public fields
7386
7386
  static NAME = wt.P2TR;
7387
7387
  // Private instance fields
@@ -7477,14 +7477,14 @@ let Do = class rr {
7477
7477
  * This is the tweaked pubkey that appears in the output.
7478
7478
  */
7479
7479
  get pubkey() {
7480
- return this.#b || (this.#l = this.#D(), this.#b = !0), this.#l;
7480
+ return this.#b || (this.#l = this.#V(), this.#b = !0), this.#l;
7481
7481
  }
7482
7482
  /**
7483
7483
  * x-only internal pubkey (32 bytes).
7484
7484
  * This is the untweaked pubkey before adding the merkle root tweak.
7485
7485
  */
7486
7486
  get internalPubkey() {
7487
- return this.#v || (this.#d = this.#V(), this.#v = !0), this.#d;
7487
+ return this.#v || (this.#d = this.#D(), this.#v = !0), this.#d;
7488
7488
  }
7489
7489
  /**
7490
7490
  * Merkle root hash (32 bytes).
@@ -7628,7 +7628,7 @@ let Do = class rr {
7628
7628
  const r = at.bech32m.toWords(t);
7629
7629
  return r.unshift(as), at.bech32m.encode(this.#t.bech32, r);
7630
7630
  }
7631
- #D() {
7631
+ #V() {
7632
7632
  if (this.#s)
7633
7633
  return this.#s;
7634
7634
  if (this.#u)
@@ -7642,7 +7642,7 @@ let Do = class rr {
7642
7642
  return r.x;
7643
7643
  }
7644
7644
  }
7645
- #V() {
7645
+ #D() {
7646
7646
  if (this.#r)
7647
7647
  return this.#r;
7648
7648
  const t = this.#H();
@@ -7810,7 +7810,7 @@ let Do = class rr {
7810
7810
  function dr(e, t) {
7811
7811
  if (!e.address && !e.output && !e.pubkey && !e.internalPubkey && !(e.witness && e.witness.length > 1))
7812
7812
  throw new TypeError("Not enough data");
7813
- const r = new Do(
7813
+ const r = new Vo(
7814
7814
  {
7815
7815
  address: e.address,
7816
7816
  pubkey: e.pubkey,
@@ -7829,7 +7829,7 @@ function dr(e, t) {
7829
7829
  return Object.assign(r.toPayment(), e);
7830
7830
  }
7831
7831
  const hs = Y, Ef = new Uint8Array(0);
7832
- let Vo = class nr {
7832
+ let Do = class nr {
7833
7833
  // Static public fields
7834
7834
  static NAME = wt.P2WPKH;
7835
7835
  // Private instance fields
@@ -8127,7 +8127,7 @@ let Vo = class nr {
8127
8127
  function ln(e, t) {
8128
8128
  if (!e.address && !e.hash && !e.output && !e.pubkey && !e.witness)
8129
8129
  throw new TypeError("Not enough data");
8130
- const r = new Vo(
8130
+ const r = new Do(
8131
8131
  {
8132
8132
  address: e.address,
8133
8133
  hash: e.hash,
@@ -8702,7 +8702,7 @@ function yi(e, t) {
8702
8702
  return Object.assign(r.toPayment(), e);
8703
8703
  }
8704
8704
  const He = Y, Ur = He.OP_RESERVED;
8705
- class De {
8705
+ class Ve {
8706
8706
  // Static public fields
8707
8707
  static NAME = wt.P2MS;
8708
8708
  // Private instance fields
@@ -8829,7 +8829,7 @@ class De {
8829
8829
  * ```
8830
8830
  */
8831
8831
  static fromPubkeys(t, r, n) {
8832
- return new De({ m: t, pubkeys: r, network: n });
8832
+ return new Ve({ m: t, pubkeys: r, network: n });
8833
8833
  }
8834
8834
  /**
8835
8835
  * Creates a P2MS payment from a scriptPubKey.
@@ -8839,7 +8839,7 @@ class De {
8839
8839
  * @returns A new P2MS payment instance
8840
8840
  */
8841
8841
  static fromOutput(t, r) {
8842
- return new De({ output: t, network: r });
8842
+ return new Ve({ output: t, network: r });
8843
8843
  }
8844
8844
  /**
8845
8845
  * Creates a P2MS payment from signatures (for spending).
@@ -8851,7 +8851,7 @@ class De {
8851
8851
  * @returns A new P2MS payment instance
8852
8852
  */
8853
8853
  static fromSignatures(t, r, n, i) {
8854
- return new De({ signatures: t, m: r, pubkeys: n, network: i });
8854
+ return new Ve({ signatures: t, m: r, pubkeys: n, network: i });
8855
8855
  }
8856
8856
  // Private helper methods
8857
8857
  /**
@@ -8980,7 +8980,7 @@ class De {
8980
8980
  function gr(e, t) {
8981
8981
  if (!e.input && !e.output && !(e.pubkeys && e.m !== void 0) && !e.signatures)
8982
8982
  throw new TypeError("Not enough data");
8983
- const r = new De(
8983
+ const r = new Ve(
8984
8984
  {
8985
8985
  m: e.m,
8986
8986
  n: e.n,
@@ -9433,7 +9433,7 @@ function Be(e) {
9433
9433
  }
9434
9434
  };
9435
9435
  }
9436
- const Af = Be(gr), vf = Be(yi), Tf = Be(lr), pn = Be(ln), ps = Be(wr), Wo = Be(pr), Go = Be(dr), Sp = (e) => e.length === 4 && e[0] === 81 && // OP_1
9436
+ const Af = Be(gr), vf = Be(yi), Tf = Be(lr), pn = Be(ln), ps = Be(wr), Wo = Be(pr), Go = Be(dr), Ap = (e) => e.length === 4 && e[0] === 81 && // OP_1
9437
9437
  e[1] === 2 && // push 2 bytes
9438
9438
  e[2] === 78 && e[3] === 115;
9439
9439
  function sr(e) {
@@ -9494,7 +9494,7 @@ function Of(e) {
9494
9494
  function ds(e, t, r) {
9495
9495
  const n = Mf(t, e, r);
9496
9496
  try {
9497
- const i = Df(t, n).concat(new Uint8Array(n.script)).concat(new Uint8Array(n.controlBlock));
9497
+ const i = Vf(t, n).concat(new Uint8Array(n.script)).concat(new Uint8Array(n.controlBlock));
9498
9498
  return { finalScriptWitness: sr(i) };
9499
9499
  } catch (i) {
9500
9500
  throw new Error(`Can not finalize taproot input #${e}: ${i}`);
@@ -9583,14 +9583,14 @@ function qn(e, t, r = 0) {
9583
9583
  if (i) return [t && t[0], i];
9584
9584
  }
9585
9585
  function Cf(e, t, r) {
9586
- const n = $t(e) && Ve(t), i = Ve(e) && $t(t), o = e === t && $t(t) && Ve(t);
9586
+ const n = $t(e) && De(t), i = De(e) && $t(t), o = e === t && $t(t) && De(t);
9587
9587
  if (n || i || o)
9588
9588
  throw new Error(
9589
9589
  `Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`
9590
9590
  );
9591
9591
  }
9592
9592
  function $f(e, t, r) {
9593
- const n = Pn(e) && Ve(t), i = Ve(e) && Pn(t), o = e === t && Pn(t) && Ve(t);
9593
+ const n = Pn(e) && De(t), i = De(e) && Pn(t), o = e === t && Pn(t) && De(t);
9594
9594
  if (n || i || o)
9595
9595
  throw new Error(
9596
9596
  `Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`
@@ -9621,14 +9621,14 @@ function Bn(e, t) {
9621
9621
  }), n = jr(new Uint8Array(e.controlBlock), r);
9622
9622
  return P(n, t);
9623
9623
  }
9624
- function Df(e, t) {
9624
+ function Vf(e, t) {
9625
9625
  const r = new Uint8Array(t.script), n = Yt({
9626
9626
  output: r,
9627
9627
  version: t.leafVersion
9628
9628
  });
9629
- return (e.tapScriptSig || []).filter((i) => P(new Uint8Array(i.leafHash), n)).map((i) => Vf(r, i)).sort((i, o) => o.positionInScript - i.positionInScript).map((i) => new Uint8Array(i.signature));
9629
+ return (e.tapScriptSig || []).filter((i) => P(new Uint8Array(i.leafHash), n)).map((i) => Df(r, i)).sort((i, o) => o.positionInScript - i.positionInScript).map((i) => new Uint8Array(i.signature));
9630
9630
  }
9631
- function Vf(e, t) {
9631
+ function Df(e, t) {
9632
9632
  return Object.assign(
9633
9633
  {
9634
9634
  positionInScript: jo(new Uint8Array(t.pubkey), e)
@@ -9656,7 +9656,7 @@ function Ff(e, t, r) {
9656
9656
  });
9657
9657
  return (!r || P(r, n)) && t.find((i) => P(new Uint8Array(i.leafHash), n)) !== void 0;
9658
9658
  }
9659
- function Ve(e) {
9659
+ function De(e) {
9660
9660
  return e && !!(e.redeemScript || e.witnessScript || e.bip32Derivation && e.bip32Derivation.length);
9661
9661
  }
9662
9662
  const qo = {
@@ -10003,7 +10003,7 @@ const Xf = {
10003
10003
  verifySignatures: !0,
10004
10004
  preserveWorkers: !1
10005
10005
  };
10006
- class ge {
10006
+ let vp = class ge {
10007
10007
  /**
10008
10008
  * Singleton instance.
10009
10009
  */
@@ -10361,8 +10361,8 @@ class ge {
10361
10361
  const t = this.#e.filter((r) => r.state === At.Idle);
10362
10362
  await Promise.all(t.map((r) => this.#d(r)));
10363
10363
  }
10364
- }
10365
- function Ap(e, t, r = {}) {
10364
+ };
10365
+ function Tp(e, t, r = {}) {
10366
10366
  const n = [], i = e.data.inputs, o = t.publicKey;
10367
10367
  for (let a = 0; a < i.length; a++) {
10368
10368
  const u = i[a];
@@ -10408,7 +10408,7 @@ function Qf(e, t, r, n, i) {
10408
10408
  return null;
10409
10409
  }
10410
10410
  }
10411
- function vp(e, t, r) {
10411
+ function kp(e, t, r) {
10412
10412
  const n = r.publicKey;
10413
10413
  for (const [i, o] of t.signatures) {
10414
10414
  const a = e.data.inputs[i];
@@ -10580,7 +10580,7 @@ function ea(e, t) {
10580
10580
  }
10581
10581
  throw new TypeError(e + " has no matching Script");
10582
10582
  }
10583
- const Tp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10583
+ const Up = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10584
10584
  __proto__: null,
10585
10585
  FUTURE_MAX_VERSION: Yo,
10586
10586
  FUTURE_OPNET_VERSION: Yr,
@@ -10745,13 +10745,13 @@ const rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10745
10745
  Embed: ur,
10746
10746
  LEAF_VERSION_TAPSCRIPT: Gr,
10747
10747
  MAX_TAPTREE_DEPTH: Ko,
10748
- P2MS: De,
10748
+ P2MS: Ve,
10749
10749
  P2OP: Gs,
10750
10750
  P2PK: Fo,
10751
10751
  P2PKH: lo,
10752
10752
  P2SH: po,
10753
- P2TR: Do,
10754
- P2WPKH: Vo,
10753
+ P2TR: Vo,
10754
+ P2WPKH: Do,
10755
10755
  P2WSH: Mo,
10756
10756
  PaymentType: wt,
10757
10757
  findScriptPath: hr,
@@ -11047,14 +11047,14 @@ function Kc(e) {
11047
11047
  signature: e.value
11048
11048
  };
11049
11049
  }
11050
- function Dc(e) {
11050
+ function Vc(e) {
11051
11051
  const t = new Uint8Array([B.PARTIAL_SIG]);
11052
11052
  return {
11053
11053
  key: Qt([t, e.pubkey]),
11054
11054
  value: e.signature
11055
11055
  };
11056
11056
  }
11057
- const Vc = "{ pubkey: Uint8Array; signature: Uint8Array; }";
11057
+ const Dc = "{ pubkey: Uint8Array; signature: Uint8Array; }";
11058
11058
  function Mc(e) {
11059
11059
  return e.pubkey instanceof Uint8Array && e.signature instanceof Uint8Array && [33, 65].includes(e.pubkey.length) && [2, 3, 4].includes(e.pubkey[0]) && Fc(e.signature);
11060
11060
  }
@@ -11074,8 +11074,8 @@ const Gc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11074
11074
  canAddToArray: Wc,
11075
11075
  check: Mc,
11076
11076
  decode: Kc,
11077
- encode: Dc,
11078
- expected: Vc
11077
+ encode: Vc,
11078
+ expected: Dc
11079
11079
  }, Symbol.toStringTag, { value: "Module" }));
11080
11080
  function jc(e) {
11081
11081
  if (e.key[0] !== B.POR_COMMITMENT)
@@ -11462,9 +11462,9 @@ function oa(e) {
11462
11462
  canAdd: o
11463
11463
  };
11464
11464
  }
11465
- const Dl = (e) => e.length === 32;
11465
+ const Vl = (e) => e.length === 32;
11466
11466
  function aa(e) {
11467
- const t = mi(e, Dl);
11467
+ const t = mi(e, Vl);
11468
11468
  function r(a) {
11469
11469
  const { numberValue: u, bytes: l } = Ge(
11470
11470
  a.value
@@ -11593,7 +11593,7 @@ const Ii = {
11593
11593
  ),
11594
11594
  tapTree: Cl,
11595
11595
  tapInternalKey: ha(ht.TAP_INTERNAL_KEY)
11596
- }, Vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11596
+ }, Dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11597
11597
  __proto__: null,
11598
11598
  globals: Ii,
11599
11599
  inputs: dt,
@@ -11967,7 +11967,7 @@ function Si(e) {
11967
11967
  for (const n of Object.keys(t)) {
11968
11968
  const i = t[n], { canAdd: o, canAddToArray: a, check: u, expected: l } = (
11969
11969
  // @ts-ignore
11970
- Vl[e + "s"][n] || {}
11970
+ Dl[e + "s"][n] || {}
11971
11971
  ), d = !!a;
11972
11972
  if (u)
11973
11973
  if (d) {
@@ -13314,49 +13314,49 @@ class Qn {
13314
13314
  }
13315
13315
  }
13316
13316
  }
13317
- const kp = {
13317
+ const Op = {
13318
13318
  payments: rc,
13319
- script: Vh,
13319
+ script: Dh,
13320
13320
  crypto: ou
13321
13321
  };
13322
13322
  export {
13323
13323
  ta as A,
13324
- vp as B,
13324
+ Dh as B,
13325
13325
  Qn as C,
13326
- $e as D,
13327
- Xo as E,
13328
- ps as F,
13329
- ou as H,
13330
- Tp as I,
13331
- kp as J,
13332
- Sp as K,
13333
- Ip as L,
13334
- pn as M,
13335
- vf as N,
13336
- mp as O,
13337
- Vh as R,
13338
- Zt as T,
13326
+ yf as E,
13327
+ $e as F,
13328
+ pn as H,
13329
+ Up as I,
13330
+ Op as J,
13331
+ ps as L,
13332
+ vp as N,
13333
+ vf as P,
13334
+ Tf as R,
13335
+ Nt as S,
13336
+ Sp as T,
13337
+ ou as U,
13339
13338
  P as V,
13340
13339
  Fn as W,
13341
- Nt as a,
13342
- gp as b,
13343
- wt as c,
13344
- Et as d,
13345
- Ap as e,
13346
- ge as f,
13347
- nu as g,
13348
- Tf as h,
13340
+ Wo as _,
13341
+ Zt as a,
13342
+ nu as b,
13343
+ Go as c,
13344
+ mp as d,
13345
+ yp as e,
13346
+ wt as f,
13347
+ kp as g,
13348
+ Xo as h,
13349
13349
  or as i,
13350
- Wo as j,
13351
- yf as k,
13352
- pp as l,
13353
- bp as m,
13354
- Af as n,
13355
- lp as o,
13356
- Go as p,
13350
+ Ap as j,
13351
+ Af as k,
13352
+ Et as l,
13353
+ lp as m,
13354
+ pp as o,
13355
+ jo as p,
13357
13356
  tt as q,
13357
+ Tp as r,
13358
13358
  Mt as s,
13359
13359
  rc as v,
13360
- jo as w,
13360
+ Ep as x,
13361
13361
  Y as z
13362
13362
  };