@gardenfi/core 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -750,7 +750,7 @@ class Lu {
750
750
  amount: c,
751
751
  secretHash: s
752
752
  }
753
- }), B = await Yt.post(
753
+ }), P = await Yt.post(
754
754
  this.url.endpoint("initiate"),
755
755
  {
756
756
  body: JSON.stringify({
@@ -764,7 +764,7 @@ class Lu {
764
764
  }
765
765
  }
766
766
  );
767
- return B.error ? j(B.error) : B.result ? re(B.result) : j("Init: No result found");
767
+ return P.error ? j(P.error) : P.result ? re(P.result) : j("Init: No result found");
768
768
  } catch (l) {
769
769
  return console.log("init error :", l), j(String(l));
770
770
  }
@@ -906,12 +906,12 @@ Ss.read = function(e, t, r, n, i) {
906
906
  return (y ? -1 : 1) * o * Math.pow(2, s - n);
907
907
  };
908
908
  Ss.write = function(e, t, r, n, i, s) {
909
- var o, a, c, l = s * 8 - i - 1, d = (1 << l) - 1, g = d >> 1, x = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : s - 1, O = n ? 1 : -1, B = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
909
+ var o, a, c, l = s * 8 - i - 1, d = (1 << l) - 1, g = d >> 1, x = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : s - 1, O = n ? 1 : -1, P = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
910
910
  for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, o = d) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = Math.pow(2, -o)) < 1 && (o--, c *= 2), o + g >= 1 ? t += x / c : t += x * Math.pow(2, 1 - g), t * c >= 2 && (o++, c /= 2), o + g >= d ? (a = 0, o = d) : o + g >= 1 ? (a = (t * c - 1) * Math.pow(2, i), o = o + g) : (a = t * Math.pow(2, g - 1) * Math.pow(2, i), o = 0)); i >= 8; e[r + y] = a & 255, y += O, a /= 256, i -= 8)
911
911
  ;
912
912
  for (o = o << i | a, l += i; l > 0; e[r + y] = o & 255, y += O, o /= 256, l -= 8)
913
913
  ;
914
- e[r + y - O] |= B * 128;
914
+ e[r + y - O] |= P * 128;
915
915
  };
916
916
  /*!
917
917
  * The buffer module from node.js, for the browser.
@@ -976,7 +976,7 @@ Ss.write = function(e, t, r, n, i, s) {
976
976
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof h
977
977
  );
978
978
  if (Ve(h, ArrayBuffer) || h && Ve(h.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Ve(h, SharedArrayBuffer) || h && Ve(h.buffer, SharedArrayBuffer)))
979
- return B(h, f, u);
979
+ return P(h, f, u);
980
980
  if (typeof h == "number")
981
981
  throw new TypeError(
982
982
  'The "value" argument must not be of type number. Received type number'
@@ -1032,11 +1032,11 @@ Ss.write = function(e, t, r, n, i, s) {
1032
1032
  function O(h) {
1033
1033
  if (Ve(h, Uint8Array)) {
1034
1034
  const f = new Uint8Array(h);
1035
- return B(f.buffer, f.byteOffset, f.byteLength);
1035
+ return P(f.buffer, f.byteOffset, f.byteLength);
1036
1036
  }
1037
1037
  return y(h);
1038
1038
  }
1039
- function B(h, f, u) {
1039
+ function P(h, f, u) {
1040
1040
  if (f < 0 || h.byteLength < f)
1041
1041
  throw new RangeError('"offset" is outside of buffer bounds');
1042
1042
  if (h.byteLength < f + (u || 0))
@@ -1627,13 +1627,13 @@ Ss.write = function(e, t, r, n, i, s) {
1627
1627
  }, a.prototype.writeFloatBE = function(f, u, p) {
1628
1628
  return T(this, f, u, !1, p);
1629
1629
  };
1630
- function P(h, f, u, p, v) {
1630
+ function B(h, f, u, p, v) {
1631
1631
  return f = +f, u = u >>> 0, v || ht(h, f, u, 8), r.write(h, f, u, p, 52, 8), u + 8;
1632
1632
  }
1633
1633
  a.prototype.writeDoubleLE = function(f, u, p) {
1634
- return P(this, f, u, !0, p);
1634
+ return B(this, f, u, !0, p);
1635
1635
  }, a.prototype.writeDoubleBE = function(f, u, p) {
1636
- return P(this, f, u, !1, p);
1636
+ return B(this, f, u, !1, p);
1637
1637
  }, a.prototype.copy = function(f, u, p, v) {
1638
1638
  if (!a.isBuffer(f)) throw new TypeError("argument should be a Buffer");
1639
1639
  if (p || (p = 0), !v && v !== 0 && (v = this.length), u >= f.length && (u = f.length), u || (u = 0), v > 0 && v < p && (v = p), v === p || f.length === 0 || this.length === 0) return 0;
@@ -1992,7 +1992,7 @@ function ec() {
1992
1992
  function O(E) {
1993
1993
  return (E | 0) === E;
1994
1994
  }
1995
- function B(E) {
1995
+ function P(E) {
1996
1996
  return typeof E == "number" && E >= -d && E <= d && Math.floor(E) === E;
1997
1997
  }
1998
1998
  function A(E) {
@@ -2017,7 +2017,7 @@ function ec() {
2017
2017
  Int8: x,
2018
2018
  Int16: y,
2019
2019
  Int32: O,
2020
- Int53: B,
2020
+ Int53: P,
2021
2021
  Range: l,
2022
2022
  StringN: c,
2023
2023
  UInt8: A,
@@ -2406,7 +2406,7 @@ ci.crypto = void 0;
2406
2406
  ci.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
2407
2407
  (function(e) {
2408
2408
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2409
- Object.defineProperty(e, "__esModule", { value: !0 }), e.Hash = e.nextTick = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = void 0, e.isBytes = n, e.byteSwap32 = d, e.bytesToHex = x, e.hexToBytes = B, e.asyncLoop = k, e.utf8ToBytes = U, e.toBytes = _, e.concatBytes = m, e.checkOpts = H, e.wrapConstructor = D, e.wrapConstructorWithOpts = R, e.wrapXOFConstructorWithOpts = z, e.randomBytes = Z;
2409
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.Hash = e.nextTick = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = void 0, e.isBytes = n, e.byteSwap32 = d, e.bytesToHex = x, e.hexToBytes = P, e.asyncLoop = k, e.utf8ToBytes = U, e.toBytes = _, e.concatBytes = m, e.checkOpts = H, e.wrapConstructor = D, e.wrapConstructorWithOpts = R, e.wrapXOFConstructorWithOpts = z, e.randomBytes = Z;
2410
2410
  const t = ci, r = et;
2411
2411
  function n(C) {
2412
2412
  return C instanceof Uint8Array || C != null && typeof C == "object" && C.constructor.name === "Uint8Array";
@@ -2444,7 +2444,7 @@ ci.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
2444
2444
  if (C >= y._a && C <= y._f)
2445
2445
  return C - (y._a - 10);
2446
2446
  }
2447
- function B(C) {
2447
+ function P(C) {
2448
2448
  if (typeof C != "string")
2449
2449
  throw new Error("hex string expected, got " + typeof C);
2450
2450
  const M = C.length, W = M / 2;
@@ -2636,9 +2636,9 @@ let ja = class extends cc.HashMD {
2636
2636
  An[y] = t.getUint32(r, !0);
2637
2637
  let n = this.h0 | 0, i = n, s = this.h1 | 0, o = s, a = this.h2 | 0, c = a, l = this.h3 | 0, d = l, g = this.h4 | 0, x = g;
2638
2638
  for (let y = 0; y < 5; y++) {
2639
- const O = 4 - y, B = yc[y], A = bc[y], k = Os[y], U = ks[y], _ = dc[y], m = pc[y];
2639
+ const O = 4 - y, P = yc[y], A = bc[y], k = Os[y], U = ks[y], _ = dc[y], m = pc[y];
2640
2640
  for (let S = 0; S < 16; S++) {
2641
- const E = (0, rn.rotl)(n + lo(y, s, a, l) + An[k[S]] + B, _[S]) + g | 0;
2641
+ const E = (0, rn.rotl)(n + lo(y, s, a, l) + An[k[S]] + P, _[S]) + g | 0;
2642
2642
  n = g, g = l, l = (0, rn.rotl)(a, 10) | 0, a = s, s = E;
2643
2643
  }
2644
2644
  for (let S = 0; S < 16; S++) {
@@ -2898,13 +2898,13 @@ class Ls extends Sc {
2898
2898
  for (let g = 0; g < 16; g++, r += 4)
2899
2899
  Ot[g] = t.getUint32(r, !1);
2900
2900
  for (let g = 16; g < 64; g++) {
2901
- const x = Ot[g - 15], y = Ot[g - 2], O = nt(x, 7) ^ nt(x, 18) ^ x >>> 3, B = nt(y, 17) ^ nt(y, 19) ^ y >>> 10;
2902
- Ot[g] = B + Ot[g - 7] + O + Ot[g - 16] | 0;
2901
+ const x = Ot[g - 15], y = Ot[g - 2], O = nt(x, 7) ^ nt(x, 18) ^ x >>> 3, P = nt(y, 17) ^ nt(y, 19) ^ y >>> 10;
2902
+ Ot[g] = P + Ot[g - 7] + O + Ot[g - 16] | 0;
2903
2903
  }
2904
2904
  let { A: n, B: i, C: s, D: o, E: a, F: c, G: l, H: d } = this;
2905
2905
  for (let g = 0; g < 64; g++) {
2906
- const x = nt(a, 6) ^ nt(a, 11) ^ nt(a, 25), y = d + x + Ec(a, c, l) + Bc[g] + Ot[g] | 0, B = (nt(n, 2) ^ nt(n, 13) ^ nt(n, 22)) + xc(n, i, s) | 0;
2907
- d = l, l = c, c = a, a = o + y | 0, o = s, s = i, i = n, n = y + B | 0;
2906
+ const x = nt(a, 6) ^ nt(a, 11) ^ nt(a, 25), y = d + x + Ec(a, c, l) + Bc[g] + Ot[g] | 0, P = (nt(n, 2) ^ nt(n, 13) ^ nt(n, 22)) + xc(n, i, s) | 0;
2907
+ d = l, l = c, c = a, a = o + y | 0, o = s, s = i, i = n, n = y + P | 0;
2908
2908
  }
2909
2909
  n = n + this.A | 0, i = i + this.B | 0, s = s + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, d = d + this.H | 0, this.set(n, i, s, o, a, c, l, d);
2910
2910
  }
@@ -3889,7 +3889,7 @@ function qe() {
3889
3889
  function O(R) {
3890
3890
  return Buffer.isBuffer(R);
3891
3891
  }
3892
- function B(R) {
3892
+ function P(R) {
3893
3893
  return o.Array(R);
3894
3894
  }
3895
3895
  function A(R) {
@@ -3915,7 +3915,7 @@ function qe() {
3915
3915
  }
3916
3916
  e.compile = k;
3917
3917
  function U(R) {
3918
- if (B(R)) return R;
3918
+ if (P(R)) return R;
3919
3919
  a(o.Buffer, R);
3920
3920
  const z = [];
3921
3921
  let Z = 0;
@@ -4146,7 +4146,7 @@ class X {
4146
4146
  ), n.length !== this.ins.length || r.length !== this.ins.length)
4147
4147
  throw new Error("Must supply prevout script and value for all inputs");
4148
4148
  const a = i === X.SIGHASH_DEFAULT ? X.SIGHASH_ALL : i & X.SIGHASH_OUTPUT_MASK, l = (i & X.SIGHASH_INPUT_MASK) === X.SIGHASH_ANYONECANPAY, d = a === X.SIGHASH_NONE, g = a === X.SIGHASH_SINGLE;
4149
- let x = Ct, y = Ct, O = Ct, B = Ct, A = Ct;
4149
+ let x = Ct, y = Ct, O = Ct, P = Ct, A = Ct;
4150
4150
  if (!l) {
4151
4151
  let m = xe.BufferWriter.withCapacity(
4152
4152
  36 * this.ins.length
@@ -4161,7 +4161,7 @@ class X {
4161
4161
  (S) => m.writeVarSlice(S)
4162
4162
  ), O = Ne.sha256(m.end()), m = xe.BufferWriter.withCapacity(
4163
4163
  4 * this.ins.length
4164
- ), this.ins.forEach((S) => m.writeUInt32(S.sequence)), B = Ne.sha256(m.end());
4164
+ ), this.ins.forEach((S) => m.writeUInt32(S.sequence)), P = Ne.sha256(m.end());
4165
4165
  }
4166
4166
  if (d || g) {
4167
4167
  if (g && t < this.outs.length) {
@@ -4177,7 +4177,7 @@ class X {
4177
4177
  }), A = Ne.sha256(S.end());
4178
4178
  }
4179
4179
  const k = (s ? 2 : 0) + (o ? 1 : 0), U = 174 - (l ? 49 : 0) - (d ? 32 : 0) + (o ? 32 : 0) + (s ? 37 : 0), _ = xe.BufferWriter.withCapacity(U);
4180
- if (_.writeUInt8(i), _.writeInt32(this.version), _.writeUInt32(this.locktime), _.writeSlice(x), _.writeSlice(y), _.writeSlice(O), _.writeSlice(B), d || g || _.writeSlice(A), _.writeUInt8(k), l) {
4180
+ if (_.writeUInt8(i), _.writeInt32(this.version), _.writeUInt32(this.locktime), _.writeSlice(x), _.writeSlice(y), _.writeSlice(O), _.writeSlice(P), d || g || _.writeSlice(A), _.writeUInt8(k), l) {
4181
4181
  const m = this.ins[t];
4182
4182
  _.writeSlice(m.hash), _.writeUInt32(m.index), _.writeUInt64(n[t]), _.writeVarSlice(r[t]), _.writeUInt32(m.sequence);
4183
4183
  } else
@@ -4597,16 +4597,16 @@ function Qc(e) {
4597
4597
  throw new TypeError("Expected Uint8Array");
4598
4598
  if (y.length === 0)
4599
4599
  return "";
4600
- for (var O = 0, B = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
4600
+ for (var O = 0, P = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
4601
4601
  A++, O++;
4602
4602
  for (var U = (k - A) * l + 1 >>> 0, _ = new Uint8Array(U); A !== k; ) {
4603
- for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < B) && E !== -1; E--, S++)
4603
+ for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < P) && E !== -1; E--, S++)
4604
4604
  m += 256 * _[E] >>> 0, _[E] = m % o >>> 0, m = m / o >>> 0;
4605
4605
  if (m !== 0)
4606
4606
  throw new Error("Non-zero carry");
4607
- B = S, A++;
4607
+ P = S, A++;
4608
4608
  }
4609
- for (var H = U - B; H !== U && _[H] === 0; )
4609
+ for (var H = U - P; H !== U && _[H] === 0; )
4610
4610
  H++;
4611
4611
  for (var D = a.repeat(O); H < U; ++H)
4612
4612
  D += e.charAt(_[H]);
@@ -4617,8 +4617,8 @@ function Qc(e) {
4617
4617
  throw new TypeError("Expected String");
4618
4618
  if (y.length === 0)
4619
4619
  return new Uint8Array();
4620
- for (var O = 0, B = 0, A = 0; y[O] === a; )
4621
- B++, O++;
4620
+ for (var O = 0, P = 0, A = 0; y[O] === a; )
4621
+ P++, O++;
4622
4622
  for (var k = (y.length - O) * c + 1 >>> 0, U = new Uint8Array(k); y[O]; ) {
4623
4623
  var _ = t[y.charCodeAt(O)];
4624
4624
  if (_ === 255)
@@ -4631,7 +4631,7 @@ function Qc(e) {
4631
4631
  }
4632
4632
  for (var E = k - A; E !== k && U[E] === 0; )
4633
4633
  E++;
4634
- for (var H = new Uint8Array(B + (k - E)), D = B; E !== k; )
4634
+ for (var H = new Uint8Array(P + (k - E)), D = P; E !== k; )
4635
4635
  H[D++] = U[E++];
4636
4636
  return H;
4637
4637
  }
@@ -5023,11 +5023,11 @@ function Qa(e) {
5023
5023
  if (typeof y == "string")
5024
5024
  return y;
5025
5025
  const O = [];
5026
- for (let B = 0; B < x.length; ++B) {
5027
- const A = x.charAt(B), k = Ja[A];
5026
+ for (let P = 0; P < x.length; ++P) {
5027
+ const A = x.charAt(P), k = Ja[A];
5028
5028
  if (k === void 0)
5029
5029
  return "Unknown character " + A;
5030
- y = xr(y) ^ k, !(B + 6 >= x.length) && O.push(k);
5030
+ y = xr(y) ^ k, !(P + 6 >= x.length) && O.push(k);
5031
5031
  }
5032
5032
  return y !== t ? "Invalid checksum for " + o : { prefix: g, words: O };
5033
5033
  }
@@ -5370,25 +5370,25 @@ var Hs = {};
5370
5370
  Object.defineProperty(e, "__esModule", { value: !0 }), e.tweakKey = e.tapTweakHash = e.tapleafHash = e.findScriptPath = e.toHashTree = e.rootHashFromPath = e.MAX_TAPTREE_DEPTH = e.LEAF_VERSION_TAPSCRIPT = void 0;
5371
5371
  const t = St, r = er, n = $t, i = Ae, s = Le;
5372
5372
  e.LEAF_VERSION_TAPSCRIPT = 192, e.MAX_TAPTREE_DEPTH = 128;
5373
- const o = (B) => "left" in B && "right" in B;
5374
- function a(B, A) {
5375
- if (B.length < 33)
5373
+ const o = (P) => "left" in P && "right" in P;
5374
+ function a(P, A) {
5375
+ if (P.length < 33)
5376
5376
  throw new TypeError(
5377
- `The control-block length is too small. Got ${B.length}, expected min 33.`
5377
+ `The control-block length is too small. Got ${P.length}, expected min 33.`
5378
5378
  );
5379
- const k = (B.length - 33) / 32;
5379
+ const k = (P.length - 33) / 32;
5380
5380
  let U = A;
5381
5381
  for (let _ = 0; _ < k; _++) {
5382
- const m = B.slice(33 + 32 * _, 65 + 32 * _);
5382
+ const m = P.slice(33 + 32 * _, 65 + 32 * _);
5383
5383
  U.compare(m) < 0 ? U = y(U, m) : U = y(m, U);
5384
5384
  }
5385
5385
  return U;
5386
5386
  }
5387
5387
  e.rootHashFromPath = a;
5388
- function c(B) {
5389
- if ((0, s.isTapleaf)(B))
5390
- return { hash: d(B) };
5391
- const A = [c(B[0]), c(B[1])];
5388
+ function c(P) {
5389
+ if ((0, s.isTapleaf)(P))
5390
+ return { hash: d(P) };
5391
+ const A = [c(P[0]), c(P[1])];
5392
5392
  A.sort((_, m) => _.hash.compare(m.hash));
5393
5393
  const [k, U] = A;
5394
5394
  return {
@@ -5398,49 +5398,49 @@ var Hs = {};
5398
5398
  };
5399
5399
  }
5400
5400
  e.toHashTree = c;
5401
- function l(B, A) {
5402
- if (o(B)) {
5403
- const k = l(B.left, A);
5404
- if (k !== void 0) return [...k, B.right.hash];
5405
- const U = l(B.right, A);
5406
- if (U !== void 0) return [...U, B.left.hash];
5407
- } else if (B.hash.equals(A))
5401
+ function l(P, A) {
5402
+ if (o(P)) {
5403
+ const k = l(P.left, A);
5404
+ if (k !== void 0) return [...k, P.right.hash];
5405
+ const U = l(P.right, A);
5406
+ if (U !== void 0) return [...U, P.left.hash];
5407
+ } else if (P.hash.equals(A))
5408
5408
  return [];
5409
5409
  }
5410
5410
  e.findScriptPath = l;
5411
- function d(B) {
5412
- const A = B.version || e.LEAF_VERSION_TAPSCRIPT;
5411
+ function d(P) {
5412
+ const A = P.version || e.LEAF_VERSION_TAPSCRIPT;
5413
5413
  return n.taggedHash(
5414
5414
  "TapLeaf",
5415
5415
  t.Buffer.concat([
5416
5416
  t.Buffer.from([A]),
5417
- O(B.output)
5417
+ O(P.output)
5418
5418
  ])
5419
5419
  );
5420
5420
  }
5421
5421
  e.tapleafHash = d;
5422
- function g(B, A) {
5422
+ function g(P, A) {
5423
5423
  return n.taggedHash(
5424
5424
  "TapTweak",
5425
- t.Buffer.concat(A ? [B, A] : [B])
5425
+ t.Buffer.concat(A ? [P, A] : [P])
5426
5426
  );
5427
5427
  }
5428
5428
  e.tapTweakHash = g;
5429
- function x(B, A) {
5430
- if (!t.Buffer.isBuffer(B) || B.length !== 32 || A && A.length !== 32) return null;
5431
- const k = g(B, A), U = (0, r.getEccLib)().xOnlyPointAddTweak(B, k);
5429
+ function x(P, A) {
5430
+ if (!t.Buffer.isBuffer(P) || P.length !== 32 || A && A.length !== 32) return null;
5431
+ const k = g(P, A), U = (0, r.getEccLib)().xOnlyPointAddTweak(P, k);
5432
5432
  return !U || U.xOnlyPubkey === null ? null : {
5433
5433
  parity: U.parity,
5434
5434
  x: t.Buffer.from(U.xOnlyPubkey)
5435
5435
  };
5436
5436
  }
5437
5437
  e.tweakKey = x;
5438
- function y(B, A) {
5439
- return n.taggedHash("TapBranch", t.Buffer.concat([B, A]));
5438
+ function y(P, A) {
5439
+ return n.taggedHash("TapBranch", t.Buffer.concat([P, A]));
5440
5440
  }
5441
- function O(B) {
5442
- const A = i.varuint.encodingLength(B.length), k = t.Buffer.allocUnsafe(A);
5443
- return i.varuint.encode(B.length, k), t.Buffer.concat([k, B]);
5441
+ function O(P) {
5442
+ const A = i.varuint.encodingLength(P.length), k = t.Buffer.allocUnsafe(A);
5443
+ return i.varuint.encode(P.length, k), t.Buffer.concat([k, P]);
5444
5444
  }
5445
5445
  })(Hs);
5446
5446
  var Me = {}, Uo;
@@ -5484,7 +5484,7 @@ function Eh() {
5484
5484
  };
5485
5485
  }
5486
5486
  Me.fromBech32 = O;
5487
- function B(_, m) {
5487
+ function P(_, m) {
5488
5488
  (0, n.typeforce)(
5489
5489
  (0, n.tuple)(n.Hash160bit, n.UInt8),
5490
5490
  arguments
@@ -5492,7 +5492,7 @@ function Eh() {
5492
5492
  const S = Buffer.allocUnsafe(21);
5493
5493
  return S.writeUInt8(m, 0), _.copy(S, 1), s.encode(S);
5494
5494
  }
5495
- Me.toBase58Check = B;
5495
+ Me.toBase58Check = P;
5496
5496
  function A(_, m, S) {
5497
5497
  const E = i.bech32.toWords(_);
5498
5498
  return E.unshift(m), m === 0 ? i.bech32.encode(S, E) : i.bech32m.encode(S, E);
@@ -5604,7 +5604,7 @@ function xh() {
5604
5604
  },
5605
5605
  y
5606
5606
  );
5607
- const B = o.value(() => (0, c.fromBech32)(y.address)), A = o.value(() => {
5607
+ const P = o.value(() => (0, c.fromBech32)(y.address)), A = o.value(() => {
5608
5608
  if (!(!y.witness || !y.witness.length))
5609
5609
  return y.witness.length >= 2 && y.witness[y.witness.length - 1][0] === g ? y.witness.slice(0, -1) : y.witness.slice();
5610
5610
  }), k = o.value(() => {
@@ -5641,7 +5641,7 @@ function xh() {
5641
5641
  }), o.prop(_, "pubkey", () => {
5642
5642
  if (y.pubkey) return y.pubkey;
5643
5643
  if (y.output) return y.output.slice(2);
5644
- if (y.address) return B().data;
5644
+ if (y.address) return P().data;
5645
5645
  if (_.internalPubkey) {
5646
5646
  const m = (0, s.tweakKey)(_.internalPubkey, _.hash);
5647
5647
  if (m) return m.x;
@@ -5679,13 +5679,13 @@ function xh() {
5679
5679
  }), O.validate) {
5680
5680
  let m = e.Buffer.from([]);
5681
5681
  if (y.address) {
5682
- if (U && U.bech32 !== B().prefix)
5682
+ if (U && U.bech32 !== P().prefix)
5683
5683
  throw new TypeError("Invalid prefix or Network mismatch");
5684
- if (B().version !== d)
5684
+ if (P().version !== d)
5685
5685
  throw new TypeError("Invalid address version");
5686
- if (B().data.length !== 32)
5686
+ if (P().data.length !== 32)
5687
5687
  throw new TypeError("Invalid address data");
5688
- m = B().data;
5688
+ m = P().data;
5689
5689
  }
5690
5690
  if (y.pubkey) {
5691
5691
  if (m.length > 0 && !m.equals(y.pubkey))
@@ -6338,11 +6338,11 @@ class fn {
6338
6338
  throw new Error(
6339
6339
  He.invalidCounterpartySigForUTXO(t[g].utxo)
6340
6340
  );
6341
- const y = await this.signer.signSchnorr(x), O = Buffer.from(n.ins[g].hash).reverse().toString("hex"), B = t.find((A) => A.utxo === O);
6342
- if (!B)
6341
+ const y = await this.signer.signSchnorr(x), O = Buffer.from(n.ins[g].hash).reverse().toString("hex"), P = t.find((A) => A.utxo === O);
6342
+ if (!P)
6343
6343
  throw new Error(He.counterPartySigNotFound(O));
6344
6344
  n.setWitness(g, [
6345
- Buffer.from(B.sig, "hex"),
6345
+ Buffer.from(P.sig, "hex"),
6346
6346
  y,
6347
6347
  this.instantRefundLeaf(),
6348
6348
  this.generateControlBlockFor(
@@ -7023,20 +7023,20 @@ var Xi, $o;
7023
7023
  function bl() {
7024
7024
  if ($o) return Xi;
7025
7025
  $o = 1;
7026
- function e(O, B) {
7026
+ function e(O, P) {
7027
7027
  var A = Object.keys(O);
7028
7028
  if (Object.getOwnPropertySymbols) {
7029
7029
  var k = Object.getOwnPropertySymbols(O);
7030
- B && (k = k.filter(function(U) {
7030
+ P && (k = k.filter(function(U) {
7031
7031
  return Object.getOwnPropertyDescriptor(O, U).enumerable;
7032
7032
  })), A.push.apply(A, k);
7033
7033
  }
7034
7034
  return A;
7035
7035
  }
7036
7036
  function t(O) {
7037
- for (var B = 1; B < arguments.length; B++) {
7038
- var A = arguments[B] != null ? arguments[B] : {};
7039
- B % 2 ? e(Object(A), !0).forEach(function(k) {
7037
+ for (var P = 1; P < arguments.length; P++) {
7038
+ var A = arguments[P] != null ? arguments[P] : {};
7039
+ P % 2 ? e(Object(A), !0).forEach(function(k) {
7040
7040
  r(O, k, A[k]);
7041
7041
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(O, Object.getOwnPropertyDescriptors(A)) : e(Object(A)).forEach(function(k) {
7042
7042
  Object.defineProperty(O, k, Object.getOwnPropertyDescriptor(A, k));
@@ -7044,39 +7044,39 @@ function bl() {
7044
7044
  }
7045
7045
  return O;
7046
7046
  }
7047
- function r(O, B, A) {
7048
- return B = o(B), B in O ? Object.defineProperty(O, B, { value: A, enumerable: !0, configurable: !0, writable: !0 }) : O[B] = A, O;
7047
+ function r(O, P, A) {
7048
+ return P = o(P), P in O ? Object.defineProperty(O, P, { value: A, enumerable: !0, configurable: !0, writable: !0 }) : O[P] = A, O;
7049
7049
  }
7050
- function n(O, B) {
7051
- if (!(O instanceof B))
7050
+ function n(O, P) {
7051
+ if (!(O instanceof P))
7052
7052
  throw new TypeError("Cannot call a class as a function");
7053
7053
  }
7054
- function i(O, B) {
7055
- for (var A = 0; A < B.length; A++) {
7056
- var k = B[A];
7054
+ function i(O, P) {
7055
+ for (var A = 0; A < P.length; A++) {
7056
+ var k = P[A];
7057
7057
  k.enumerable = k.enumerable || !1, k.configurable = !0, "value" in k && (k.writable = !0), Object.defineProperty(O, o(k.key), k);
7058
7058
  }
7059
7059
  }
7060
- function s(O, B, A) {
7061
- return B && i(O.prototype, B), Object.defineProperty(O, "prototype", { writable: !1 }), O;
7060
+ function s(O, P, A) {
7061
+ return P && i(O.prototype, P), Object.defineProperty(O, "prototype", { writable: !1 }), O;
7062
7062
  }
7063
7063
  function o(O) {
7064
- var B = a(O, "string");
7065
- return typeof B == "symbol" ? B : String(B);
7064
+ var P = a(O, "string");
7065
+ return typeof P == "symbol" ? P : String(P);
7066
7066
  }
7067
- function a(O, B) {
7067
+ function a(O, P) {
7068
7068
  if (typeof O != "object" || O === null) return O;
7069
7069
  var A = O[Symbol.toPrimitive];
7070
7070
  if (A !== void 0) {
7071
- var k = A.call(O, B || "default");
7071
+ var k = A.call(O, P || "default");
7072
7072
  if (typeof k != "object") return k;
7073
7073
  throw new TypeError("@@toPrimitive must return a primitive value.");
7074
7074
  }
7075
- return (B === "string" ? String : Number)(O);
7075
+ return (P === "string" ? String : Number)(O);
7076
7076
  }
7077
7077
  var c = St, l = c.Buffer, d = Gs, g = d.inspect, x = g && g.custom || "inspect";
7078
- function y(O, B, A) {
7079
- l.prototype.copy.call(O, B, A);
7078
+ function y(O, P, A) {
7079
+ l.prototype.copy.call(O, P, A);
7080
7080
  }
7081
7081
  return Xi = /* @__PURE__ */ function() {
7082
7082
  function O() {
@@ -7325,9 +7325,9 @@ function gf() {
7325
7325
  if (Go) return Qi;
7326
7326
  Go = 1, Qi = D;
7327
7327
  function e(T) {
7328
- var P = this;
7328
+ var B = this;
7329
7329
  this.next = null, this.entry = null, this.finish = function() {
7330
- ht(P, T);
7330
+ ht(B, T);
7331
7331
  };
7332
7332
  }
7333
7333
  var t;
@@ -7342,20 +7342,20 @@ function gf() {
7342
7342
  function a(T) {
7343
7343
  return i.isBuffer(T) || T instanceof s;
7344
7344
  }
7345
- var c = yf, l = wf, d = l.getHighWaterMark, g = fr.codes, x = g.ERR_INVALID_ARG_TYPE, y = g.ERR_METHOD_NOT_IMPLEMENTED, O = g.ERR_MULTIPLE_CALLBACK, B = g.ERR_STREAM_CANNOT_PIPE, A = g.ERR_STREAM_DESTROYED, k = g.ERR_STREAM_NULL_VALUES, U = g.ERR_STREAM_WRITE_AFTER_END, _ = g.ERR_UNKNOWN_ENCODING, m = c.errorOrDestroy;
7345
+ var c = yf, l = wf, d = l.getHighWaterMark, g = fr.codes, x = g.ERR_INVALID_ARG_TYPE, y = g.ERR_METHOD_NOT_IMPLEMENTED, O = g.ERR_MULTIPLE_CALLBACK, P = g.ERR_STREAM_CANNOT_PIPE, A = g.ERR_STREAM_DESTROYED, k = g.ERR_STREAM_NULL_VALUES, U = g.ERR_STREAM_WRITE_AFTER_END, _ = g.ERR_UNKNOWN_ENCODING, m = c.errorOrDestroy;
7346
7346
  Ie(D, n);
7347
7347
  function S() {
7348
7348
  }
7349
- function E(T, P, F) {
7350
- t = t || Rr(), T = T || {}, typeof F != "boolean" && (F = P instanceof t), this.objectMode = !!T.objectMode, F && (this.objectMode = this.objectMode || !!T.writableObjectMode), this.highWaterMark = d(this, T, "writableHighWaterMark", F), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
7349
+ function E(T, B, F) {
7350
+ t = t || Rr(), T = T || {}, typeof F != "boolean" && (F = B instanceof t), this.objectMode = !!T.objectMode, F && (this.objectMode = this.objectMode || !!T.writableObjectMode), this.highWaterMark = d(this, T, "writableHighWaterMark", F), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
7351
7351
  var G = T.decodeStrings === !1;
7352
7352
  this.decodeStrings = !G, this.defaultEncoding = T.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(K) {
7353
- ae(P, K);
7353
+ ae(B, K);
7354
7354
  }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = T.emitClose !== !1, this.autoDestroy = !!T.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
7355
7355
  }
7356
7356
  E.prototype.getBuffer = function() {
7357
- for (var P = this.bufferedRequest, F = []; P; )
7358
- F.push(P), P = P.next;
7357
+ for (var B = this.bufferedRequest, F = []; B; )
7358
+ F.push(B), B = B.next;
7359
7359
  return F;
7360
7360
  }, function() {
7361
7361
  try {
@@ -7369,40 +7369,40 @@ function gf() {
7369
7369
  }();
7370
7370
  var H;
7371
7371
  typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (H = Function.prototype[Symbol.hasInstance], Object.defineProperty(D, Symbol.hasInstance, {
7372
- value: function(P) {
7373
- return H.call(this, P) ? !0 : this !== D ? !1 : P && P._writableState instanceof E;
7372
+ value: function(B) {
7373
+ return H.call(this, B) ? !0 : this !== D ? !1 : B && B._writableState instanceof E;
7374
7374
  }
7375
- })) : H = function(P) {
7376
- return P instanceof this;
7375
+ })) : H = function(B) {
7376
+ return B instanceof this;
7377
7377
  };
7378
7378
  function D(T) {
7379
7379
  t = t || Rr();
7380
- var P = this instanceof t;
7381
- if (!P && !H.call(D, this)) return new D(T);
7382
- this._writableState = new E(T, this, P), this.writable = !0, T && (typeof T.write == "function" && (this._write = T.write), typeof T.writev == "function" && (this._writev = T.writev), typeof T.destroy == "function" && (this._destroy = T.destroy), typeof T.final == "function" && (this._final = T.final)), n.call(this);
7380
+ var B = this instanceof t;
7381
+ if (!B && !H.call(D, this)) return new D(T);
7382
+ this._writableState = new E(T, this, B), this.writable = !0, T && (typeof T.write == "function" && (this._write = T.write), typeof T.writev == "function" && (this._writev = T.writev), typeof T.destroy == "function" && (this._destroy = T.destroy), typeof T.final == "function" && (this._final = T.final)), n.call(this);
7383
7383
  }
7384
7384
  D.prototype.pipe = function() {
7385
- m(this, new B());
7385
+ m(this, new P());
7386
7386
  };
7387
- function R(T, P) {
7387
+ function R(T, B) {
7388
7388
  var F = new U();
7389
- m(T, F), process.nextTick(P, F);
7389
+ m(T, F), process.nextTick(B, F);
7390
7390
  }
7391
- function z(T, P, F, G) {
7391
+ function z(T, B, F, G) {
7392
7392
  var K;
7393
- return F === null ? K = new k() : typeof F != "string" && !P.objectMode && (K = new x("chunk", ["string", "Buffer"], F)), K ? (m(T, K), process.nextTick(G, K), !1) : !0;
7393
+ return F === null ? K = new k() : typeof F != "string" && !B.objectMode && (K = new x("chunk", ["string", "Buffer"], F)), K ? (m(T, K), process.nextTick(G, K), !1) : !0;
7394
7394
  }
7395
- D.prototype.write = function(T, P, F) {
7395
+ D.prototype.write = function(T, B, F) {
7396
7396
  var G = this._writableState, K = !1, b = !G.objectMode && a(T);
7397
- return b && !i.isBuffer(T) && (T = o(T)), typeof P == "function" && (F = P, P = null), b ? P = "buffer" : P || (P = G.defaultEncoding), typeof F != "function" && (F = S), G.ending ? R(this, F) : (b || z(this, G, T, F)) && (G.pendingcb++, K = C(this, G, b, T, P, F)), K;
7397
+ return b && !i.isBuffer(T) && (T = o(T)), typeof B == "function" && (F = B, B = null), b ? B = "buffer" : B || (B = G.defaultEncoding), typeof F != "function" && (F = S), G.ending ? R(this, F) : (b || z(this, G, T, F)) && (G.pendingcb++, K = C(this, G, b, T, B, F)), K;
7398
7398
  }, D.prototype.cork = function() {
7399
7399
  this._writableState.corked++;
7400
7400
  }, D.prototype.uncork = function() {
7401
7401
  var T = this._writableState;
7402
7402
  T.corked && (T.corked--, !T.writing && !T.corked && !T.bufferProcessing && T.bufferedRequest && Ge(this, T));
7403
- }, D.prototype.setDefaultEncoding = function(P) {
7404
- if (typeof P == "string" && (P = P.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((P + "").toLowerCase()) > -1)) throw new _(P);
7405
- return this._writableState.defaultEncoding = P, this;
7403
+ }, D.prototype.setDefaultEncoding = function(B) {
7404
+ if (typeof B == "string" && (B = B.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((B + "").toLowerCase()) > -1)) throw new _(B);
7405
+ return this._writableState.defaultEncoding = B, this;
7406
7406
  }, Object.defineProperty(D.prototype, "writableBuffer", {
7407
7407
  // making it explicit this property is not enumerable
7408
7408
  // because otherwise some prototype manipulation in
@@ -7412,8 +7412,8 @@ function gf() {
7412
7412
  return this._writableState && this._writableState.getBuffer();
7413
7413
  }
7414
7414
  });
7415
- function Z(T, P, F) {
7416
- return !T.objectMode && T.decodeStrings !== !1 && typeof P == "string" && (P = i.from(P, F)), P;
7415
+ function Z(T, B, F) {
7416
+ return !T.objectMode && T.decodeStrings !== !1 && typeof B == "string" && (B = i.from(B, F)), B;
7417
7417
  }
7418
7418
  Object.defineProperty(D.prototype, "writableHighWaterMark", {
7419
7419
  // making it explicit this property is not enumerable
@@ -7424,75 +7424,75 @@ function gf() {
7424
7424
  return this._writableState.highWaterMark;
7425
7425
  }
7426
7426
  });
7427
- function C(T, P, F, G, K, b) {
7427
+ function C(T, B, F, G, K, b) {
7428
7428
  if (!F) {
7429
- var w = Z(P, G, K);
7429
+ var w = Z(B, G, K);
7430
7430
  G !== w && (F = !0, K = "buffer", G = w);
7431
7431
  }
7432
- var N = P.objectMode ? 1 : G.length;
7433
- P.length += N;
7434
- var $ = P.length < P.highWaterMark;
7435
- if ($ || (P.needDrain = !0), P.writing || P.corked) {
7436
- var pe = P.lastBufferedRequest;
7437
- P.lastBufferedRequest = {
7432
+ var N = B.objectMode ? 1 : G.length;
7433
+ B.length += N;
7434
+ var $ = B.length < B.highWaterMark;
7435
+ if ($ || (B.needDrain = !0), B.writing || B.corked) {
7436
+ var pe = B.lastBufferedRequest;
7437
+ B.lastBufferedRequest = {
7438
7438
  chunk: G,
7439
7439
  encoding: K,
7440
7440
  isBuf: F,
7441
7441
  callback: b,
7442
7442
  next: null
7443
- }, pe ? pe.next = P.lastBufferedRequest : P.bufferedRequest = P.lastBufferedRequest, P.bufferedRequestCount += 1;
7443
+ }, pe ? pe.next = B.lastBufferedRequest : B.bufferedRequest = B.lastBufferedRequest, B.bufferedRequestCount += 1;
7444
7444
  } else
7445
- M(T, P, !1, N, G, K, b);
7445
+ M(T, B, !1, N, G, K, b);
7446
7446
  return $;
7447
7447
  }
7448
- function M(T, P, F, G, K, b, w) {
7449
- P.writelen = G, P.writecb = w, P.writing = !0, P.sync = !0, P.destroyed ? P.onwrite(new A("write")) : F ? T._writev(K, P.onwrite) : T._write(K, b, P.onwrite), P.sync = !1;
7448
+ function M(T, B, F, G, K, b, w) {
7449
+ B.writelen = G, B.writecb = w, B.writing = !0, B.sync = !0, B.destroyed ? B.onwrite(new A("write")) : F ? T._writev(K, B.onwrite) : T._write(K, b, B.onwrite), B.sync = !1;
7450
7450
  }
7451
- function W(T, P, F, G, K) {
7452
- --P.pendingcb, F ? (process.nextTick(K, G), process.nextTick(We, T, P), T._writableState.errorEmitted = !0, m(T, G)) : (K(G), T._writableState.errorEmitted = !0, m(T, G), We(T, P));
7451
+ function W(T, B, F, G, K) {
7452
+ --B.pendingcb, F ? (process.nextTick(K, G), process.nextTick(We, T, B), T._writableState.errorEmitted = !0, m(T, G)) : (K(G), T._writableState.errorEmitted = !0, m(T, G), We(T, B));
7453
7453
  }
7454
7454
  function q(T) {
7455
7455
  T.writing = !1, T.writecb = null, T.length -= T.writelen, T.writelen = 0;
7456
7456
  }
7457
- function ae(T, P) {
7457
+ function ae(T, B) {
7458
7458
  var F = T._writableState, G = F.sync, K = F.writecb;
7459
7459
  if (typeof K != "function") throw new O();
7460
- if (q(F), P) W(T, F, G, P, K);
7460
+ if (q(F), B) W(T, F, G, B, K);
7461
7461
  else {
7462
7462
  var b = rt(F) || T.destroyed;
7463
7463
  !b && !F.corked && !F.bufferProcessing && F.bufferedRequest && Ge(T, F), G ? process.nextTick(fe, T, F, b, K) : fe(T, F, b, K);
7464
7464
  }
7465
7465
  }
7466
- function fe(T, P, F, G) {
7467
- F || Qe(T, P), P.pendingcb--, G(), We(T, P);
7466
+ function fe(T, B, F, G) {
7467
+ F || Qe(T, B), B.pendingcb--, G(), We(T, B);
7468
7468
  }
7469
- function Qe(T, P) {
7470
- P.length === 0 && P.needDrain && (P.needDrain = !1, T.emit("drain"));
7469
+ function Qe(T, B) {
7470
+ B.length === 0 && B.needDrain && (B.needDrain = !1, T.emit("drain"));
7471
7471
  }
7472
- function Ge(T, P) {
7473
- P.bufferProcessing = !0;
7474
- var F = P.bufferedRequest;
7472
+ function Ge(T, B) {
7473
+ B.bufferProcessing = !0;
7474
+ var F = B.bufferedRequest;
7475
7475
  if (T._writev && F && F.next) {
7476
- var G = P.bufferedRequestCount, K = new Array(G), b = P.corkedRequestsFree;
7476
+ var G = B.bufferedRequestCount, K = new Array(G), b = B.corkedRequestsFree;
7477
7477
  b.entry = F;
7478
7478
  for (var w = 0, N = !0; F; )
7479
7479
  K[w] = F, F.isBuf || (N = !1), F = F.next, w += 1;
7480
- K.allBuffers = N, M(T, P, !0, P.length, K, "", b.finish), P.pendingcb++, P.lastBufferedRequest = null, b.next ? (P.corkedRequestsFree = b.next, b.next = null) : P.corkedRequestsFree = new e(P), P.bufferedRequestCount = 0;
7480
+ K.allBuffers = N, M(T, B, !0, B.length, K, "", b.finish), B.pendingcb++, B.lastBufferedRequest = null, b.next ? (B.corkedRequestsFree = b.next, b.next = null) : B.corkedRequestsFree = new e(B), B.bufferedRequestCount = 0;
7481
7481
  } else {
7482
7482
  for (; F; ) {
7483
- var $ = F.chunk, pe = F.encoding, Y = F.callback, te = P.objectMode ? 1 : $.length;
7484
- if (M(T, P, !1, te, $, pe, Y), F = F.next, P.bufferedRequestCount--, P.writing)
7483
+ var $ = F.chunk, pe = F.encoding, Y = F.callback, te = B.objectMode ? 1 : $.length;
7484
+ if (M(T, B, !1, te, $, pe, Y), F = F.next, B.bufferedRequestCount--, B.writing)
7485
7485
  break;
7486
7486
  }
7487
- F === null && (P.lastBufferedRequest = null);
7487
+ F === null && (B.lastBufferedRequest = null);
7488
7488
  }
7489
- P.bufferedRequest = F, P.bufferProcessing = !1;
7489
+ B.bufferedRequest = F, B.bufferProcessing = !1;
7490
7490
  }
7491
- D.prototype._write = function(T, P, F) {
7491
+ D.prototype._write = function(T, B, F) {
7492
7492
  F(new y("_write()"));
7493
- }, D.prototype._writev = null, D.prototype.end = function(T, P, F) {
7493
+ }, D.prototype._writev = null, D.prototype.end = function(T, B, F) {
7494
7494
  var G = this._writableState;
7495
- return typeof T == "function" ? (F = T, T = null, P = null) : typeof P == "function" && (F = P, P = null), T != null && this.write(T, P), G.corked && (G.corked = 1, this.uncork()), G.ending || Bt(this, G, F), this;
7495
+ return typeof T == "function" ? (F = T, T = null, B = null) : typeof B == "function" && (F = B, B = null), T != null && this.write(T, B), G.corked && (G.corked = 1, this.uncork()), G.ending || Bt(this, G, F), this;
7496
7496
  }, Object.defineProperty(D.prototype, "writableLength", {
7497
7497
  // making it explicit this property is not enumerable
7498
7498
  // because otherwise some prototype manipulation in
@@ -7505,32 +7505,32 @@ function gf() {
7505
7505
  function rt(T) {
7506
7506
  return T.ending && T.length === 0 && T.bufferedRequest === null && !T.finished && !T.writing;
7507
7507
  }
7508
- function de(T, P) {
7508
+ function de(T, B) {
7509
7509
  T._final(function(F) {
7510
- P.pendingcb--, F && m(T, F), P.prefinished = !0, T.emit("prefinish"), We(T, P);
7510
+ B.pendingcb--, F && m(T, F), B.prefinished = !0, T.emit("prefinish"), We(T, B);
7511
7511
  });
7512
7512
  }
7513
- function ve(T, P) {
7514
- !P.prefinished && !P.finalCalled && (typeof T._final == "function" && !P.destroyed ? (P.pendingcb++, P.finalCalled = !0, process.nextTick(de, T, P)) : (P.prefinished = !0, T.emit("prefinish")));
7513
+ function ve(T, B) {
7514
+ !B.prefinished && !B.finalCalled && (typeof T._final == "function" && !B.destroyed ? (B.pendingcb++, B.finalCalled = !0, process.nextTick(de, T, B)) : (B.prefinished = !0, T.emit("prefinish")));
7515
7515
  }
7516
- function We(T, P) {
7517
- var F = rt(P);
7518
- if (F && (ve(T, P), P.pendingcb === 0 && (P.finished = !0, T.emit("finish"), P.autoDestroy))) {
7516
+ function We(T, B) {
7517
+ var F = rt(B);
7518
+ if (F && (ve(T, B), B.pendingcb === 0 && (B.finished = !0, T.emit("finish"), B.autoDestroy))) {
7519
7519
  var G = T._readableState;
7520
7520
  (!G || G.autoDestroy && G.endEmitted) && T.destroy();
7521
7521
  }
7522
7522
  return F;
7523
7523
  }
7524
- function Bt(T, P, F) {
7525
- P.ending = !0, We(T, P), F && (P.finished ? process.nextTick(F) : T.once("finish", F)), P.ended = !0, T.writable = !1;
7524
+ function Bt(T, B, F) {
7525
+ B.ending = !0, We(T, B), F && (B.finished ? process.nextTick(F) : T.once("finish", F)), B.ended = !0, T.writable = !1;
7526
7526
  }
7527
- function ht(T, P, F) {
7527
+ function ht(T, B, F) {
7528
7528
  var G = T.entry;
7529
7529
  for (T.entry = null; G; ) {
7530
7530
  var K = G.callback;
7531
- P.pendingcb--, K(F), G = G.next;
7531
+ B.pendingcb--, K(F), G = G.next;
7532
7532
  }
7533
- P.corkedRequestsFree.next = T;
7533
+ B.corkedRequestsFree.next = T;
7534
7534
  }
7535
7535
  return Object.defineProperty(D.prototype, "destroyed", {
7536
7536
  // making it explicit this property is not enumerable
@@ -7540,11 +7540,11 @@ function gf() {
7540
7540
  get: function() {
7541
7541
  return this._writableState === void 0 ? !1 : this._writableState.destroyed;
7542
7542
  },
7543
- set: function(P) {
7544
- this._writableState && (this._writableState.destroyed = P);
7543
+ set: function(B) {
7544
+ this._writableState && (this._writableState.destroyed = B);
7545
7545
  }
7546
- }), D.prototype.destroy = c.destroy, D.prototype._undestroy = c.undestroy, D.prototype._destroy = function(T, P) {
7547
- P(T);
7546
+ }), D.prototype.destroy = c.destroy, D.prototype._undestroy = c.undestroy, D.prototype._destroy = function(T, B) {
7547
+ B(T);
7548
7548
  }, Qi;
7549
7549
  }
7550
7550
  var Zi, Wo;
@@ -7846,7 +7846,7 @@ function Vl() {
7846
7846
  function O(_) {
7847
7847
  process.nextTick(y, _);
7848
7848
  }
7849
- function B(_, m) {
7849
+ function P(_, m) {
7850
7850
  return function(S, E) {
7851
7851
  _.then(function() {
7852
7852
  if (m[c]) {
@@ -7876,7 +7876,7 @@ function Vl() {
7876
7876
  });
7877
7877
  var E = this[l], H;
7878
7878
  if (E)
7879
- H = new Promise(B(E, this));
7879
+ H = new Promise(P(E, this));
7880
7880
  else {
7881
7881
  var D = this[g].read();
7882
7882
  if (D !== null)
@@ -7958,7 +7958,7 @@ function _f() {
7958
7958
  var a = Gs, c;
7959
7959
  a && a.debuglog ? c = a.debuglog("stream") : c = function() {
7960
7960
  };
7961
- var l = bl(), d = yf, g = wf, x = g.getHighWaterMark, y = fr.codes, O = y.ERR_INVALID_ARG_TYPE, B = y.ERR_STREAM_PUSH_AFTER_EOF, A = y.ERR_METHOD_NOT_IMPLEMENTED, k = y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, U, _, m;
7961
+ var l = bl(), d = yf, g = wf, x = g.getHighWaterMark, y = fr.codes, O = y.ERR_INVALID_ARG_TYPE, P = y.ERR_STREAM_PUSH_AFTER_EOF, A = y.ERR_METHOD_NOT_IMPLEMENTED, k = y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, U, _, m;
7962
7962
  Ie(R, r);
7963
7963
  var S = d.errorOrDestroy, E = ["error", "close", "destroy", "pause", "resume"];
7964
7964
  function H(b, w, N) {
@@ -8005,7 +8005,7 @@ function _f() {
8005
8005
  if (typeof w != "string" && !Y.objectMode && Object.getPrototypeOf(w) !== n.prototype && (w = s(w)), $)
8006
8006
  Y.endEmitted ? S(b, new k()) : Z(b, Y, w, !0);
8007
8007
  else if (Y.ended)
8008
- S(b, new B());
8008
+ S(b, new P());
8009
8009
  else {
8010
8010
  if (Y.destroyed)
8011
8011
  return !1;
@@ -8049,7 +8049,7 @@ function _f() {
8049
8049
  var $ = w.needReadable;
8050
8050
  c("need readable", $), (w.length === 0 || w.length - b < w.highWaterMark) && ($ = !0, c("length less than watermark", $)), w.ended || w.reading ? ($ = !1, c("reading or ended", $)) : $ && (c("do read"), w.reading = !0, w.sync = !0, w.length === 0 && (w.needReadable = !0), this._read(w.highWaterMark), w.sync = !1, w.reading || (b = q(N, w)));
8051
8051
  var pe;
8052
- return b > 0 ? pe = P(b, w) : pe = null, pe === null ? (w.needReadable = w.length <= w.highWaterMark, b = 0) : (w.length -= b, w.awaitDrain = 0), w.length === 0 && (w.ended || (w.needReadable = !0), N !== b && w.ended && F(this)), pe !== null && this.emit("data", pe), pe;
8052
+ return b > 0 ? pe = B(b, w) : pe = null, pe === null ? (w.needReadable = w.length <= w.highWaterMark, b = 0) : (w.length -= b, w.awaitDrain = 0), w.length === 0 && (w.ended || (w.needReadable = !0), N !== b && w.ended && F(this)), pe !== null && this.emit("data", pe), pe;
8053
8053
  };
8054
8054
  function ae(b, w) {
8055
8055
  if (c("onEofChunk"), !w.ended) {
@@ -8243,7 +8243,7 @@ function _f() {
8243
8243
  set: function(w) {
8244
8244
  this._readableState && (this._readableState.flowing = w);
8245
8245
  }
8246
- }), R._fromList = P, Object.defineProperty(R.prototype, "readableLength", {
8246
+ }), R._fromList = B, Object.defineProperty(R.prototype, "readableLength", {
8247
8247
  // making it explicit this property is not enumerable
8248
8248
  // because otherwise some prototype manipulation in
8249
8249
  // userland will fail
@@ -8252,7 +8252,7 @@ function _f() {
8252
8252
  return this._readableState.length;
8253
8253
  }
8254
8254
  });
8255
- function P(b, w) {
8255
+ function B(b, w) {
8256
8256
  if (w.length === 0) return null;
8257
8257
  var N;
8258
8258
  return w.objectMode ? N = w.buffer.shift() : !b || b >= w.length ? (w.decoder ? N = w.buffer.join("") : w.buffer.length === 1 ? N = w.buffer.first() : N = w.buffer.concat(w.length), w.buffer.clear()) : N = w.buffer.consume(b, w.decoder), N;
@@ -8876,8 +8876,8 @@ Si.prototype._update = function() {
8876
8876
  var y, O;
8877
8877
  x < 16 ? (y = Zo(r, n, i, s, o, e[zr[x]], Xr[0], Kr[x]), O = na(a, c, l, d, g, e[qr[x]], Jr[0], Yr[x])) : x < 32 ? (y = ea(r, n, i, s, o, e[zr[x]], Xr[1], Kr[x]), O = ra(a, c, l, d, g, e[qr[x]], Jr[1], Yr[x])) : x < 48 ? (y = ta(r, n, i, s, o, e[zr[x]], Xr[2], Kr[x]), O = ta(a, c, l, d, g, e[qr[x]], Jr[2], Yr[x])) : x < 64 ? (y = ra(r, n, i, s, o, e[zr[x]], Xr[3], Kr[x]), O = ea(a, c, l, d, g, e[qr[x]], Jr[3], Yr[x])) : (y = na(r, n, i, s, o, e[zr[x]], Xr[4], Kr[x]), O = Zo(a, c, l, d, g, e[qr[x]], Jr[4], Yr[x])), r = o, o = s, s = tr(i, 10), i = n, n = y, a = g, g = d, d = tr(l, 10), l = c, c = O;
8878
8878
  }
8879
- var B = this._b + i + d | 0;
8880
- this._b = this._c + s + g | 0, this._c = this._d + o + a | 0, this._d = this._e + r + c | 0, this._e = this._a + n + l | 0, this._a = B;
8879
+ var P = this._b + i + d | 0;
8880
+ this._b = this._c + s + g | 0, this._c = this._d + o + a | 0, this._d = this._e + r + c | 0, this._e = this._a + n + l | 0, this._a = P;
8881
8881
  };
8882
8882
  Si.prototype._digest = function() {
8883
8883
  this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
@@ -9318,7 +9318,7 @@ function Be(e, t) {
9318
9318
  return e >>> 0 < t >>> 0 ? 1 : 0;
9319
9319
  }
9320
9320
  _n.prototype._update = function(e) {
9321
- for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, s = this._dh | 0, o = this._eh | 0, a = this._fh | 0, c = this._gh | 0, l = this._hh | 0, d = this._al | 0, g = this._bl | 0, x = this._cl | 0, y = this._dl | 0, O = this._el | 0, B = this._fl | 0, A = this._gl | 0, k = this._hl | 0, U = 0; U < 32; U += 2)
9321
+ for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, s = this._dh | 0, o = this._eh | 0, a = this._fh | 0, c = this._gh | 0, l = this._hh | 0, d = this._al | 0, g = this._bl | 0, x = this._cl | 0, y = this._dl | 0, O = this._el | 0, P = this._fl | 0, A = this._gl | 0, k = this._hl | 0, U = 0; U < 32; U += 2)
9322
9322
  t[U] = e.readInt32BE(U * 4), t[U + 1] = e.readInt32BE(U * 4 + 4);
9323
9323
  for (; U < 160; U += 2) {
9324
9324
  var _ = t[U - 30], m = t[U - 15 * 2 + 1], S = id(_, m), E = sd(m, _);
@@ -9328,12 +9328,12 @@ _n.prototype._update = function(e) {
9328
9328
  }
9329
9329
  for (var q = 0; q < 160; q += 2) {
9330
9330
  W = t[q], M = t[q + 1];
9331
- var ae = oa(r, n, i), fe = oa(d, g, x), Qe = aa(r, d), Ge = aa(d, r), rt = fa(o, O), de = fa(O, o), ve = ia[q], We = ia[q + 1], Bt = sa(o, a, c), ht = sa(O, B, A), T = k + de | 0, P = l + rt + Be(T, k) | 0;
9332
- T = T + ht | 0, P = P + Bt + Be(T, ht) | 0, T = T + We | 0, P = P + ve + Be(T, We) | 0, T = T + M | 0, P = P + W + Be(T, M) | 0;
9331
+ var ae = oa(r, n, i), fe = oa(d, g, x), Qe = aa(r, d), Ge = aa(d, r), rt = fa(o, O), de = fa(O, o), ve = ia[q], We = ia[q + 1], Bt = sa(o, a, c), ht = sa(O, P, A), T = k + de | 0, B = l + rt + Be(T, k) | 0;
9332
+ T = T + ht | 0, B = B + Bt + Be(T, ht) | 0, T = T + We | 0, B = B + ve + Be(T, We) | 0, T = T + M | 0, B = B + W + Be(T, M) | 0;
9333
9333
  var F = Ge + fe | 0, G = Qe + ae + Be(F, Ge) | 0;
9334
- l = c, k = A, c = a, A = B, a = o, B = O, O = y + T | 0, o = s + P + Be(O, y) | 0, s = i, y = x, i = n, x = g, n = r, g = d, d = T + F | 0, r = P + G + Be(d, T) | 0;
9334
+ l = c, k = A, c = a, A = P, a = o, P = O, O = y + T | 0, o = s + B + Be(O, y) | 0, s = i, y = x, i = n, x = g, n = r, g = d, d = T + F | 0, r = B + G + Be(d, T) | 0;
9335
9335
  }
9336
- this._al = this._al + d | 0, this._bl = this._bl + g | 0, this._cl = this._cl + x | 0, this._dl = this._dl + y | 0, this._el = this._el + O | 0, this._fl = this._fl + B | 0, this._gl = this._gl + A | 0, this._hl = this._hl + k | 0, this._ah = this._ah + r + Be(this._al, d) | 0, this._bh = this._bh + n + Be(this._bl, g) | 0, this._ch = this._ch + i + Be(this._cl, x) | 0, this._dh = this._dh + s + Be(this._dl, y) | 0, this._eh = this._eh + o + Be(this._el, O) | 0, this._fh = this._fh + a + Be(this._fl, B) | 0, this._gh = this._gh + c + Be(this._gl, A) | 0, this._hh = this._hh + l + Be(this._hl, k) | 0;
9336
+ this._al = this._al + d | 0, this._bl = this._bl + g | 0, this._cl = this._cl + x | 0, this._dl = this._dl + y | 0, this._el = this._el + O | 0, this._fl = this._fl + P | 0, this._gl = this._gl + A | 0, this._hl = this._hl + k | 0, this._ah = this._ah + r + Be(this._al, d) | 0, this._bh = this._bh + n + Be(this._bl, g) | 0, this._ch = this._ch + i + Be(this._cl, x) | 0, this._dh = this._dh + s + Be(this._dl, y) | 0, this._eh = this._eh + o + Be(this._el, O) | 0, this._fh = this._fh + a + Be(this._fl, P) | 0, this._gh = this._gh + c + Be(this._gl, A) | 0, this._hh = this._hh + l + Be(this._hl, k) | 0;
9337
9337
  };
9338
9338
  _n.prototype._hash = function() {
9339
9339
  var e = rd.allocUnsafe(64);
@@ -9449,16 +9449,16 @@ function xd(e) {
9449
9449
  throw new TypeError("Expected Buffer");
9450
9450
  if (y.length === 0)
9451
9451
  return "";
9452
- for (var O = 0, B = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
9452
+ for (var O = 0, P = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
9453
9453
  A++, O++;
9454
9454
  for (var U = (k - A) * l + 1 >>> 0, _ = new Uint8Array(U); A !== k; ) {
9455
- for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < B) && E !== -1; E--, S++)
9455
+ for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < P) && E !== -1; E--, S++)
9456
9456
  m += 256 * _[E] >>> 0, _[E] = m % o >>> 0, m = m / o >>> 0;
9457
9457
  if (m !== 0)
9458
9458
  throw new Error("Non-zero carry");
9459
- B = S, A++;
9459
+ P = S, A++;
9460
9460
  }
9461
- for (var H = U - B; H !== U && _[H] === 0; )
9461
+ for (var H = U - P; H !== U && _[H] === 0; )
9462
9462
  H++;
9463
9463
  for (var D = a.repeat(O); H < U; ++H)
9464
9464
  D += e.charAt(_[H]);
@@ -9469,8 +9469,8 @@ function xd(e) {
9469
9469
  throw new TypeError("Expected String");
9470
9470
  if (y.length === 0)
9471
9471
  return Ln.alloc(0);
9472
- for (var O = 0, B = 0, A = 0; y[O] === a; )
9473
- B++, O++;
9472
+ for (var O = 0, P = 0, A = 0; y[O] === a; )
9473
+ P++, O++;
9474
9474
  for (var k = (y.length - O) * c + 1 >>> 0, U = new Uint8Array(k); O < y.length; ) {
9475
9475
  var _ = t[y.charCodeAt(O)];
9476
9476
  if (_ === 255)
@@ -9483,9 +9483,9 @@ function xd(e) {
9483
9483
  }
9484
9484
  for (var E = k - A; E !== k && U[E] === 0; )
9485
9485
  E++;
9486
- var H = Ln.allocUnsafe(B + (k - E));
9487
- H.fill(0, 0, B);
9488
- for (var D = B; E !== k; )
9486
+ var H = Ln.allocUnsafe(P + (k - E));
9487
+ H.fill(0, 0, P);
9488
+ for (var D = P; E !== k; )
9489
9489
  H[D++] = U[E++];
9490
9490
  return H;
9491
9491
  }
@@ -10048,17 +10048,7 @@ class Dy extends ga {
10048
10048
  async swap(t) {
10049
10049
  const r = await this.validateAndFillParams(t);
10050
10050
  if (r.error) return j(r.error);
10051
- const { sendAddress: n, receiveAddress: i, timelock: s } = r.val;
10052
- let o = t.nonce;
10053
- if (!o) {
10054
- if (!this._evmWallet.account) return j("EVM Wallet not found");
10055
- const B = await this._orderBook.getOrdersCount(
10056
- this._evmWallet.account.address
10057
- );
10058
- if (B.error) return j(B.error);
10059
- o = B.val + 1;
10060
- }
10061
- const a = await this._secretManager.generateSecret(o);
10051
+ const { sendAddress: n, receiveAddress: i, timelock: s } = r.val, o = Date.now().toString(), a = await this._secretManager.generateSecret(o);
10062
10052
  if (a.error) return j(a.error);
10063
10053
  const { strategyId: c, btcAddress: l } = t.additionalData, d = {
10064
10054
  strategy_id: c,
@@ -10075,7 +10065,7 @@ class Dy extends ga {
10075
10065
  source_amount: t.sendAmount,
10076
10066
  destination_amount: t.receiveAmount,
10077
10067
  fee: "1",
10078
- nonce: o.toString(),
10068
+ nonce: o,
10079
10069
  timelock: s,
10080
10070
  secret_hash: Kt(a.val.secretHash),
10081
10071
  min_destination_confirmations: t.minDestinationConfirmations ?? 0,
@@ -10180,7 +10170,7 @@ class Dy extends ga {
10180
10170
  switch (o) {
10181
10171
  case Pe.Redeem: {
10182
10172
  const a = await this._secretManager.generateSecret(
10183
- Number(s.create_order.nonce)
10173
+ s.create_order.nonce
10184
10174
  );
10185
10175
  if (a.error) {
10186
10176
  this.emit("error", s, a.error);
@@ -11518,7 +11508,7 @@ function ny(e, t) {
11518
11508
  y = Pp({ blobs: _, commitments: S, proofs: E });
11519
11509
  }
11520
11510
  }
11521
- const O = Ri(d), B = [
11511
+ const O = Ri(d), P = [
11522
11512
  J(r),
11523
11513
  i ? J(i) : "0x",
11524
11514
  l ? J(l) : "0x",
@@ -11540,7 +11530,7 @@ function ny(e, t) {
11540
11530
  return En([
11541
11531
  "0x03",
11542
11532
  // If sidecars are enabled, envelope turns into a "wrapper":
11543
- nr(y ? [B, A, k, U] : B)
11533
+ nr(y ? [P, A, k, U] : P)
11544
11534
  ]);
11545
11535
  }
11546
11536
  function iy(e, t) {