@strkfarm/sdk 1.0.62 → 1.0.63

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.
@@ -60,7 +60,7 @@ var strkfarm_risk_engine = (() => {
60
60
  fractionGroupSize: 0
61
61
  };
62
62
  function BigNumber3(n, b) {
63
- var c, e, i, num4, len, str, x = this;
63
+ var c, e, i, num2, len, str, x = this;
64
64
  if (!(x instanceof BigNumber3)) {
65
65
  if (ERRORS) raise(26, "constructor call without new", n);
66
66
  return new BigNumber3(n, b);
@@ -73,7 +73,7 @@ var strkfarm_risk_engine = (() => {
73
73
  id = 0;
74
74
  return;
75
75
  }
76
- if ((num4 = typeof n == "number") && n * 0 == 0) {
76
+ if ((num2 = typeof n == "number") && n * 0 == 0) {
77
77
  x.s = 1 / n < 0 ? (n = -n, -1) : 1;
78
78
  if (n === ~~n) {
79
79
  for (e = 0, i = n; i >= 10; i /= 10, e++) ;
@@ -84,7 +84,7 @@ var strkfarm_risk_engine = (() => {
84
84
  }
85
85
  str = n + "";
86
86
  } else {
87
- if (!isNumeric.test(str = n + "")) return parseNumeric(x, str, num4);
87
+ if (!isNumeric.test(str = n + "")) return parseNumeric(x, str, num2);
88
88
  x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
89
89
  }
90
90
  } else {
@@ -94,15 +94,15 @@ var strkfarm_risk_engine = (() => {
94
94
  x = new BigNumber3(n instanceof BigNumber3 ? n : str);
95
95
  return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
96
96
  }
97
- if ((num4 = typeof n == "number") && n * 0 != 0 || !new RegExp("^-?" + (c = "[" + ALPHABET.slice(0, b) + "]+") + "(?:\\." + c + ")?$", b < 37 ? "i" : "").test(str)) {
98
- return parseNumeric(x, str, num4, b);
97
+ if ((num2 = typeof n == "number") && n * 0 != 0 || !new RegExp("^-?" + (c = "[" + ALPHABET.slice(0, b) + "]+") + "(?:\\." + c + ")?$", b < 37 ? "i" : "").test(str)) {
98
+ return parseNumeric(x, str, num2, b);
99
99
  }
100
- if (num4) {
100
+ if (num2) {
101
101
  x.s = 1 / n < 0 ? (str = str.slice(1), -1) : 1;
102
102
  if (ERRORS && str.replace(/^0\.0*|\./, "").length > 15) {
103
103
  raise(id, tooManyDigits, n);
104
104
  }
105
- num4 = false;
105
+ num2 = false;
106
106
  } else {
107
107
  x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
108
108
  }
@@ -121,7 +121,7 @@ var strkfarm_risk_engine = (() => {
121
121
  str = str.slice(i, len + 1);
122
122
  if (str) {
123
123
  len = str.length;
124
- if (num4 && ERRORS && len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) {
124
+ if (num2 && ERRORS && len > 15 && (n > MAX_SAFE_INTEGER || n !== mathfloor(n))) {
125
125
  raise(id, tooManyDigits, x.s * n);
126
126
  }
127
127
  e = e - i - 1;
@@ -584,12 +584,12 @@ var strkfarm_risk_engine = (() => {
584
584
  }
585
585
  parseNumeric = /* @__PURE__ */ (function() {
586
586
  var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
587
- return function(x, str, num4, b) {
588
- var base2, s = num4 ? str : str.replace(whitespaceOrPlus, "");
587
+ return function(x, str, num2, b) {
588
+ var base2, s = num2 ? str : str.replace(whitespaceOrPlus, "");
589
589
  if (isInfinityOrNaN.test(s)) {
590
590
  x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
591
591
  } else {
592
- if (!num4) {
592
+ if (!num2) {
593
593
  s = s.replace(basePrefix, function(m, p1, p2) {
594
594
  base2 = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
595
595
  return !b || b == base2 ? p1 : m;
@@ -2694,18 +2694,18 @@ var strkfarm_risk_engine = (() => {
2694
2694
  }
2695
2695
  for (let i = 0; i < 3; i++) {
2696
2696
  const trailingOK = i == 2;
2697
- const num4 = parseDigits(parts[i], 1, 2, trailingOK);
2698
- if (num4 === null) {
2697
+ const num2 = parseDigits(parts[i], 1, 2, trailingOK);
2698
+ if (num2 === null) {
2699
2699
  return null;
2700
2700
  }
2701
- result[i] = num4;
2701
+ result[i] = num2;
2702
2702
  }
2703
2703
  return result;
2704
2704
  }
2705
2705
  function parseMonth(token) {
2706
2706
  token = String(token).substr(0, 3).toLowerCase();
2707
- const num4 = MONTH_TO_NUM[token];
2708
- return num4 >= 0 ? num4 : null;
2707
+ const num2 = MONTH_TO_NUM[token];
2708
+ return num2 >= 0 ? num2 : null;
2709
2709
  }
2710
2710
  function parseDate(str) {
2711
2711
  if (!str) {
@@ -4919,14 +4919,14 @@ var strkfarm_risk_engine = (() => {
4919
4919
  var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
4920
4920
  return O.__proto__;
4921
4921
  } : null);
4922
- function addNumericSeparator(num4, str) {
4923
- if (num4 === Infinity || num4 === -Infinity || num4 !== num4 || num4 && num4 > -1e3 && num4 < 1e3 || $test.call(/e/, str)) {
4922
+ function addNumericSeparator(num2, str) {
4923
+ if (num2 === Infinity || num2 === -Infinity || num2 !== num2 || num2 && num2 > -1e3 && num2 < 1e3 || $test.call(/e/, str)) {
4924
4924
  return str;
4925
4925
  }
4926
4926
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4927
- if (typeof num4 === "number") {
4928
- var int = num4 < 0 ? -$floor(-num4) : $floor(num4);
4929
- if (int !== num4) {
4927
+ if (typeof num2 === "number") {
4928
+ var int = num2 < 0 ? -$floor(-num2) : $floor(num2);
4929
+ if (int !== num2) {
4930
4930
  var intStr = String(int);
4931
4931
  var dec = $slice.call(str, intStr.length + 1);
4932
4932
  return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
@@ -8439,18 +8439,18 @@ var strkfarm_risk_engine = (() => {
8439
8439
  return res;
8440
8440
  }
8441
8441
  // @__NO_SIDE_EFFECTS__
8442
- function radix(num4) {
8443
- /* @__PURE__ */ assertNumber2(num4);
8442
+ function radix(num2) {
8443
+ /* @__PURE__ */ assertNumber2(num2);
8444
8444
  return {
8445
8445
  encode: (bytes3) => {
8446
8446
  if (!isBytes10(bytes3))
8447
8447
  throw new Error("radix.encode input should be Uint8Array");
8448
- return /* @__PURE__ */ convertRadix(Array.from(bytes3), 2 ** 8, num4);
8448
+ return /* @__PURE__ */ convertRadix(Array.from(bytes3), 2 ** 8, num2);
8449
8449
  },
8450
8450
  decode: (digits) => {
8451
8451
  if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number")
8452
8452
  throw new Error("radix.decode input should be array of numbers");
8453
- return Uint8Array.from(/* @__PURE__ */ convertRadix(digits, num4, 2 ** 8));
8453
+ return Uint8Array.from(/* @__PURE__ */ convertRadix(digits, num2, 2 ** 8));
8454
8454
  }
8455
8455
  };
8456
8456
  }
@@ -8749,8 +8749,8 @@ var strkfarm_risk_engine = (() => {
8749
8749
  }
8750
8750
  return hex;
8751
8751
  }
8752
- function numberToHexUnpadded4(num4) {
8753
- const hex = num4.toString(16);
8752
+ function numberToHexUnpadded4(num2) {
8753
+ const hex = num2.toString(16);
8754
8754
  return hex.length & 1 ? `0${hex}` : hex;
8755
8755
  }
8756
8756
  function hexToNumber4(hex) {
@@ -10293,8 +10293,8 @@ var strkfarm_risk_engine = (() => {
10293
10293
  return hex;
10294
10294
  }
10295
10295
  exports.bytesToHex = bytesToHex4;
10296
- function numberToHexUnpadded4(num4) {
10297
- const hex = num4.toString(16);
10296
+ function numberToHexUnpadded4(num2) {
10297
+ const hex = num2.toString(16);
10298
10298
  return hex.length & 1 ? `0${hex}` : hex;
10299
10299
  }
10300
10300
  exports.numberToHexUnpadded = numberToHexUnpadded4;
@@ -10530,7 +10530,7 @@ var strkfarm_risk_engine = (() => {
10530
10530
  return result >= _0n16 ? result : b + result;
10531
10531
  }
10532
10532
  exports.mod = mod4;
10533
- function pow3(num4, power, modulo) {
10533
+ function pow3(num2, power, modulo) {
10534
10534
  if (modulo <= _0n16 || power < _0n16)
10535
10535
  throw new Error("Expected power/modulo > 0");
10536
10536
  if (modulo === _1n16)
@@ -10538,8 +10538,8 @@ var strkfarm_risk_engine = (() => {
10538
10538
  let res = _1n16;
10539
10539
  while (power > _0n16) {
10540
10540
  if (power & _1n16)
10541
- res = res * num4 % modulo;
10542
- num4 = num4 * num4 % modulo;
10541
+ res = res * num2 % modulo;
10542
+ num2 = num2 * num2 % modulo;
10543
10543
  power >>= _1n16;
10544
10544
  }
10545
10545
  return res;
@@ -10645,7 +10645,7 @@ var strkfarm_risk_engine = (() => {
10645
10645
  return tonelliShanks4(P);
10646
10646
  }
10647
10647
  exports.FpSqrt = FpSqrt4;
10648
- var isNegativeLE = (num4, modulo) => (mod4(num4, modulo) & _1n16) === _1n16;
10648
+ var isNegativeLE = (num2, modulo) => (mod4(num2, modulo) & _1n16) === _1n16;
10649
10649
  exports.isNegativeLE = isNegativeLE;
10650
10650
  var FIELD_FIELDS4 = [
10651
10651
  "create",
@@ -10680,15 +10680,15 @@ var strkfarm_risk_engine = (() => {
10680
10680
  return (0, utils_js_1.validateObject)(field, opts);
10681
10681
  }
10682
10682
  exports.validateField = validateField4;
10683
- function FpPow4(f, num4, power) {
10683
+ function FpPow4(f, num2, power) {
10684
10684
  if (power < _0n16)
10685
10685
  throw new Error("Expected power > 0");
10686
10686
  if (power === _0n16)
10687
10687
  return f.ONE;
10688
10688
  if (power === _1n16)
10689
- return num4;
10689
+ return num2;
10690
10690
  let p = f.ONE;
10691
- let d = num4;
10691
+ let d = num2;
10692
10692
  while (power > _0n16) {
10693
10693
  if (power & _1n16)
10694
10694
  p = f.mul(p, d);
@@ -10700,18 +10700,18 @@ var strkfarm_risk_engine = (() => {
10700
10700
  exports.FpPow = FpPow4;
10701
10701
  function FpInvertBatch4(f, nums) {
10702
10702
  const tmp = new Array(nums.length);
10703
- const lastMultiplied = nums.reduce((acc, num4, i) => {
10704
- if (f.is0(num4))
10703
+ const lastMultiplied = nums.reduce((acc, num2, i) => {
10704
+ if (f.is0(num2))
10705
10705
  return acc;
10706
10706
  tmp[i] = acc;
10707
- return f.mul(acc, num4);
10707
+ return f.mul(acc, num2);
10708
10708
  }, f.ONE);
10709
10709
  const inverted = f.inv(lastMultiplied);
10710
- nums.reduceRight((acc, num4, i) => {
10711
- if (f.is0(num4))
10710
+ nums.reduceRight((acc, num2, i) => {
10711
+ if (f.is0(num2))
10712
10712
  return acc;
10713
10713
  tmp[i] = f.mul(acc, tmp[i]);
10714
- return f.mul(acc, num4);
10714
+ return f.mul(acc, num2);
10715
10715
  }, inverted);
10716
10716
  return tmp;
10717
10717
  }
@@ -10748,34 +10748,34 @@ var strkfarm_risk_engine = (() => {
10748
10748
  MASK: (0, utils_js_1.bitMask)(BITS),
10749
10749
  ZERO: _0n16,
10750
10750
  ONE: _1n16,
10751
- create: (num4) => mod4(num4, ORDER),
10752
- isValid: (num4) => {
10753
- if (typeof num4 !== "bigint")
10754
- throw new Error(`Invalid field element: expected bigint, got ${typeof num4}`);
10755
- return _0n16 <= num4 && num4 < ORDER;
10751
+ create: (num2) => mod4(num2, ORDER),
10752
+ isValid: (num2) => {
10753
+ if (typeof num2 !== "bigint")
10754
+ throw new Error(`Invalid field element: expected bigint, got ${typeof num2}`);
10755
+ return _0n16 <= num2 && num2 < ORDER;
10756
10756
  },
10757
- is0: (num4) => num4 === _0n16,
10758
- isOdd: (num4) => (num4 & _1n16) === _1n16,
10759
- neg: (num4) => mod4(-num4, ORDER),
10757
+ is0: (num2) => num2 === _0n16,
10758
+ isOdd: (num2) => (num2 & _1n16) === _1n16,
10759
+ neg: (num2) => mod4(-num2, ORDER),
10760
10760
  eql: (lhs, rhs) => lhs === rhs,
10761
- sqr: (num4) => mod4(num4 * num4, ORDER),
10761
+ sqr: (num2) => mod4(num2 * num2, ORDER),
10762
10762
  add: (lhs, rhs) => mod4(lhs + rhs, ORDER),
10763
10763
  sub: (lhs, rhs) => mod4(lhs - rhs, ORDER),
10764
10764
  mul: (lhs, rhs) => mod4(lhs * rhs, ORDER),
10765
- pow: (num4, power) => FpPow4(f, num4, power),
10765
+ pow: (num2, power) => FpPow4(f, num2, power),
10766
10766
  div: (lhs, rhs) => mod4(lhs * invert4(rhs, ORDER), ORDER),
10767
10767
  // Same as above, but doesn't normalize
10768
- sqrN: (num4) => num4 * num4,
10768
+ sqrN: (num2) => num2 * num2,
10769
10769
  addN: (lhs, rhs) => lhs + rhs,
10770
10770
  subN: (lhs, rhs) => lhs - rhs,
10771
10771
  mulN: (lhs, rhs) => lhs * rhs,
10772
- inv: (num4) => invert4(num4, ORDER),
10772
+ inv: (num2) => invert4(num2, ORDER),
10773
10773
  sqrt: redef.sqrt || ((n) => sqrtP(f, n)),
10774
10774
  invertBatch: (lst) => FpInvertBatch4(f, lst),
10775
10775
  // TODO: do we really need constant cmov?
10776
10776
  // We don't have const-time bigints anyway, so probably will be not very useful
10777
10777
  cmov: (a, b, c) => c ? b : a,
10778
- toBytes: (num4) => isLE4 ? (0, utils_js_1.numberToBytesLE)(num4, BYTES) : (0, utils_js_1.numberToBytesBE)(num4, BYTES),
10778
+ toBytes: (num2) => isLE4 ? (0, utils_js_1.numberToBytesLE)(num2, BYTES) : (0, utils_js_1.numberToBytesBE)(num2, BYTES),
10779
10779
  fromBytes: (bytes3) => {
10780
10780
  if (bytes3.length !== BYTES)
10781
10781
  throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
@@ -10805,8 +10805,8 @@ var strkfarm_risk_engine = (() => {
10805
10805
  const minLen = nLength4(groupOrder).nByteLength + 8;
10806
10806
  if (minLen < 24 || hashLen < minLen || hashLen > 1024)
10807
10807
  throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);
10808
- const num4 = isLE4 ? (0, utils_js_1.bytesToNumberLE)(hash4) : (0, utils_js_1.bytesToNumberBE)(hash4);
10809
- return mod4(num4, groupOrder - _1n16) + _1n16;
10808
+ const num2 = isLE4 ? (0, utils_js_1.bytesToNumberLE)(hash4) : (0, utils_js_1.bytesToNumberBE)(hash4);
10809
+ return mod4(num2, groupOrder - _1n16) + _1n16;
10810
10810
  }
10811
10811
  exports.hashToPrivateScalar = hashToPrivateScalar;
10812
10812
  function getFieldBytesLength4(fieldOrder) {
@@ -10827,8 +10827,8 @@ var strkfarm_risk_engine = (() => {
10827
10827
  const minLen = getMinHashLength4(fieldOrder);
10828
10828
  if (len < 16 || len < minLen || len > 1024)
10829
10829
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
10830
- const num4 = isLE4 ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key);
10831
- const reduced = mod4(num4, fieldOrder - _1n16) + _1n16;
10830
+ const num2 = isLE4 ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key);
10831
+ const reduced = mod4(num2, fieldOrder - _1n16) + _1n16;
10832
10832
  return isLE4 ? (0, utils_js_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_js_1.numberToBytesBE)(reduced, fieldLen);
10833
10833
  }
10834
10834
  exports.mapHashToField = mapHashToField4;
@@ -11149,8 +11149,8 @@ var strkfarm_risk_engine = (() => {
11149
11149
  },
11150
11150
  hexFromSig(sig) {
11151
11151
  const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2;
11152
- const h = (num4) => {
11153
- const hex = num4.toString(16);
11152
+ const h = (num2) => {
11153
+ const hex = num2.toString(16);
11154
11154
  return hex.length & 1 ? `0${hex}` : hex;
11155
11155
  };
11156
11156
  const s = slice(h(sig.s));
@@ -11188,11 +11188,11 @@ var strkfarm_risk_engine = (() => {
11188
11188
  }
11189
11189
  if (!Fp2.eql(Fp2.sqr(CURVE2.Gy), weierstrassEquation(CURVE2.Gx)))
11190
11190
  throw new Error("bad generator point: equation left != right");
11191
- function isWithinCurveOrder(num4) {
11192
- return typeof num4 === "bigint" && _0n16 < num4 && num4 < CURVE2.n;
11191
+ function isWithinCurveOrder(num2) {
11192
+ return typeof num2 === "bigint" && _0n16 < num2 && num2 < CURVE2.n;
11193
11193
  }
11194
- function assertGE(num4) {
11195
- if (!isWithinCurveOrder(num4))
11194
+ function assertGE(num2) {
11195
+ if (!isWithinCurveOrder(num2))
11196
11196
  throw new Error("Expected valid bigint: 0 < bigint < curve.n");
11197
11197
  }
11198
11198
  function normPrivateKeyToScalar(key) {
@@ -11204,16 +11204,16 @@ var strkfarm_risk_engine = (() => {
11204
11204
  throw new Error("Invalid key");
11205
11205
  key = key.padStart(nByteLength * 2, "0");
11206
11206
  }
11207
- let num4;
11207
+ let num2;
11208
11208
  try {
11209
- num4 = typeof key === "bigint" ? key : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)("private key", key, nByteLength));
11209
+ num2 = typeof key === "bigint" ? key : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)("private key", key, nByteLength));
11210
11210
  } catch (error2) {
11211
11211
  throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);
11212
11212
  }
11213
11213
  if (wrapPrivateKey)
11214
- num4 = mod4.mod(num4, n);
11215
- assertGE(num4);
11216
- return num4;
11214
+ num2 = mod4.mod(num2, n);
11215
+ assertGE(num2);
11216
+ return num2;
11217
11217
  }
11218
11218
  const pointPrecomputes2 = /* @__PURE__ */ new Map();
11219
11219
  function assertPrjPoint(other) {
@@ -11575,8 +11575,8 @@ var strkfarm_risk_engine = (() => {
11575
11575
  const { Fp: Fp2, n: CURVE_ORDER3 } = CURVE2;
11576
11576
  const compressedLen = Fp2.BYTES + 1;
11577
11577
  const uncompressedLen = 2 * Fp2.BYTES + 1;
11578
- function isValidFieldElement(num4) {
11579
- return _0n16 < num4 && num4 < Fp2.ORDER;
11578
+ function isValidFieldElement(num2) {
11579
+ return _0n16 < num2 && num2 < Fp2.ORDER;
11580
11580
  }
11581
11581
  function modN(a) {
11582
11582
  return mod4.mod(a, CURVE_ORDER3);
@@ -11620,7 +11620,7 @@ var strkfarm_risk_engine = (() => {
11620
11620
  }
11621
11621
  }
11622
11622
  });
11623
- const numToNByteStr = (num4) => ut.bytesToHex(ut.numberToBytesBE(num4, CURVE2.nByteLength));
11623
+ const numToNByteStr = (num2) => ut.bytesToHex(ut.numberToBytesBE(num2, CURVE2.nByteLength));
11624
11624
  function isBiggerThanHalfOrder(number3) {
11625
11625
  const HALF = CURVE_ORDER3 >> _1n16;
11626
11626
  return number3 > HALF;
@@ -11754,20 +11754,20 @@ var strkfarm_risk_engine = (() => {
11754
11754
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
11755
11755
  }
11756
11756
  const bits2int3 = CURVE2.bits2int || function(bytes3) {
11757
- const num4 = ut.bytesToNumberBE(bytes3);
11757
+ const num2 = ut.bytesToNumberBE(bytes3);
11758
11758
  const delta = bytes3.length * 8 - CURVE2.nBitLength;
11759
- return delta > 0 ? num4 >> BigInt(delta) : num4;
11759
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
11760
11760
  };
11761
11761
  const bits2int_modN = CURVE2.bits2int_modN || function(bytes3) {
11762
11762
  return modN(bits2int3(bytes3));
11763
11763
  };
11764
11764
  const ORDER_MASK = ut.bitMask(CURVE2.nBitLength);
11765
- function int2octets(num4) {
11766
- if (typeof num4 !== "bigint")
11765
+ function int2octets(num2) {
11766
+ if (typeof num2 !== "bigint")
11767
11767
  throw new Error("bigint expected");
11768
- if (!(_0n16 <= num4 && num4 < ORDER_MASK))
11768
+ if (!(_0n16 <= num2 && num2 < ORDER_MASK))
11769
11769
  throw new Error(`bigint expected < 2^${CURVE2.nBitLength}`);
11770
- return ut.numberToBytesBE(num4, CURVE2.nByteLength);
11770
+ return ut.numberToBytesBE(num2, CURVE2.nByteLength);
11771
11771
  }
11772
11772
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
11773
11773
  if (["recovered", "canonical"].some((k) => k in opts))
@@ -12102,8 +12102,8 @@ var strkfarm_risk_engine = (() => {
12102
12102
  while (bytes3[0] === 0)
12103
12103
  bytes3 = bytes3.subarray(1);
12104
12104
  const delta = bytes3.length * 8 - nBitLength3;
12105
- const num4 = u.bytesToNumberBE(bytes3);
12106
- return delta > 0 ? num4 >> BigInt(delta) : num4;
12105
+ const num2 = u.bytesToNumberBE(bytes3);
12106
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
12107
12107
  }
12108
12108
  function hex0xToBytes3(hex) {
12109
12109
  if (typeof hex === "string") {
@@ -12157,8 +12157,8 @@ var strkfarm_risk_engine = (() => {
12157
12157
  }
12158
12158
  function checkMessage2(msgHash) {
12159
12159
  const bytes3 = ensureBytes5(msgHash);
12160
- const num4 = u.bytesToNumberBE(bytes3);
12161
- if (num4 >= exports.MAX_VALUE)
12160
+ const num2 = u.bytesToNumberBE(bytes3);
12161
+ if (num2 >= exports.MAX_VALUE)
12162
12162
  throw new Error(`msgHash should be [0, ${exports.MAX_VALUE})`);
12163
12163
  return bytes3;
12164
12164
  }
@@ -12420,7 +12420,7 @@ var strkfarm_risk_engine = (() => {
12420
12420
  const result = a % b;
12421
12421
  return result >= _0n16 ? result : b + result;
12422
12422
  }
12423
- function pow3(num4, power, modulo) {
12423
+ function pow3(num2, power, modulo) {
12424
12424
  if (modulo <= _0n16 || power < _0n16)
12425
12425
  throw new Error("Expected power/modulo > 0");
12426
12426
  if (modulo === _1n16)
@@ -12428,8 +12428,8 @@ var strkfarm_risk_engine = (() => {
12428
12428
  let res = _1n16;
12429
12429
  while (power > _0n16) {
12430
12430
  if (power & _1n16)
12431
- res = res * num4 % modulo;
12432
- num4 = num4 * num4 % modulo;
12431
+ res = res * num2 % modulo;
12432
+ num2 = num2 * num2 % modulo;
12433
12433
  power >>= _1n16;
12434
12434
  }
12435
12435
  return res;
@@ -12530,7 +12530,7 @@ var strkfarm_risk_engine = (() => {
12530
12530
  }
12531
12531
  return tonelliShanks4(P);
12532
12532
  }
12533
- var isNegativeLE = (num4, modulo) => (mod4(num4, modulo) & _1n16) === _1n16;
12533
+ var isNegativeLE = (num2, modulo) => (mod4(num2, modulo) & _1n16) === _1n16;
12534
12534
  exports.isNegativeLE = isNegativeLE;
12535
12535
  var FIELD_FIELDS4 = [
12536
12536
  "create",
@@ -12564,15 +12564,15 @@ var strkfarm_risk_engine = (() => {
12564
12564
  }, initial);
12565
12565
  return (0, utils_js_1.validateObject)(field, opts);
12566
12566
  }
12567
- function FpPow4(f, num4, power) {
12567
+ function FpPow4(f, num2, power) {
12568
12568
  if (power < _0n16)
12569
12569
  throw new Error("Expected power > 0");
12570
12570
  if (power === _0n16)
12571
12571
  return f.ONE;
12572
12572
  if (power === _1n16)
12573
- return num4;
12573
+ return num2;
12574
12574
  let p = f.ONE;
12575
- let d = num4;
12575
+ let d = num2;
12576
12576
  while (power > _0n16) {
12577
12577
  if (power & _1n16)
12578
12578
  p = f.mul(p, d);
@@ -12583,18 +12583,18 @@ var strkfarm_risk_engine = (() => {
12583
12583
  }
12584
12584
  function FpInvertBatch4(f, nums) {
12585
12585
  const tmp = new Array(nums.length);
12586
- const lastMultiplied = nums.reduce((acc, num4, i) => {
12587
- if (f.is0(num4))
12586
+ const lastMultiplied = nums.reduce((acc, num2, i) => {
12587
+ if (f.is0(num2))
12588
12588
  return acc;
12589
12589
  tmp[i] = acc;
12590
- return f.mul(acc, num4);
12590
+ return f.mul(acc, num2);
12591
12591
  }, f.ONE);
12592
12592
  const inverted = f.inv(lastMultiplied);
12593
- nums.reduceRight((acc, num4, i) => {
12594
- if (f.is0(num4))
12593
+ nums.reduceRight((acc, num2, i) => {
12594
+ if (f.is0(num2))
12595
12595
  return acc;
12596
12596
  tmp[i] = f.mul(acc, tmp[i]);
12597
- return f.mul(acc, num4);
12597
+ return f.mul(acc, num2);
12598
12598
  }, inverted);
12599
12599
  return tmp;
12600
12600
  }
@@ -12627,34 +12627,34 @@ var strkfarm_risk_engine = (() => {
12627
12627
  MASK: (0, utils_js_1.bitMask)(BITS),
12628
12628
  ZERO: _0n16,
12629
12629
  ONE: _1n16,
12630
- create: (num4) => mod4(num4, ORDER),
12631
- isValid: (num4) => {
12632
- if (typeof num4 !== "bigint")
12633
- throw new Error(`Invalid field element: expected bigint, got ${typeof num4}`);
12634
- return _0n16 <= num4 && num4 < ORDER;
12630
+ create: (num2) => mod4(num2, ORDER),
12631
+ isValid: (num2) => {
12632
+ if (typeof num2 !== "bigint")
12633
+ throw new Error(`Invalid field element: expected bigint, got ${typeof num2}`);
12634
+ return _0n16 <= num2 && num2 < ORDER;
12635
12635
  },
12636
- is0: (num4) => num4 === _0n16,
12637
- isOdd: (num4) => (num4 & _1n16) === _1n16,
12638
- neg: (num4) => mod4(-num4, ORDER),
12636
+ is0: (num2) => num2 === _0n16,
12637
+ isOdd: (num2) => (num2 & _1n16) === _1n16,
12638
+ neg: (num2) => mod4(-num2, ORDER),
12639
12639
  eql: (lhs, rhs) => lhs === rhs,
12640
- sqr: (num4) => mod4(num4 * num4, ORDER),
12640
+ sqr: (num2) => mod4(num2 * num2, ORDER),
12641
12641
  add: (lhs, rhs) => mod4(lhs + rhs, ORDER),
12642
12642
  sub: (lhs, rhs) => mod4(lhs - rhs, ORDER),
12643
12643
  mul: (lhs, rhs) => mod4(lhs * rhs, ORDER),
12644
- pow: (num4, power) => FpPow4(f, num4, power),
12644
+ pow: (num2, power) => FpPow4(f, num2, power),
12645
12645
  div: (lhs, rhs) => mod4(lhs * invert4(rhs, ORDER), ORDER),
12646
12646
  // Same as above, but doesn't normalize
12647
- sqrN: (num4) => num4 * num4,
12647
+ sqrN: (num2) => num2 * num2,
12648
12648
  addN: (lhs, rhs) => lhs + rhs,
12649
12649
  subN: (lhs, rhs) => lhs - rhs,
12650
12650
  mulN: (lhs, rhs) => lhs * rhs,
12651
- inv: (num4) => invert4(num4, ORDER),
12651
+ inv: (num2) => invert4(num2, ORDER),
12652
12652
  sqrt: redef.sqrt || ((n) => sqrtP(f, n)),
12653
12653
  invertBatch: (lst) => FpInvertBatch4(f, lst),
12654
12654
  // TODO: do we really need constant cmov?
12655
12655
  // We don't have const-time bigints anyway, so probably will be not very useful
12656
12656
  cmov: (a, b, c) => c ? b : a,
12657
- toBytes: (num4) => isLE4 ? (0, utils_js_1.numberToBytesLE)(num4, BYTES) : (0, utils_js_1.numberToBytesBE)(num4, BYTES),
12657
+ toBytes: (num2) => isLE4 ? (0, utils_js_1.numberToBytesLE)(num2, BYTES) : (0, utils_js_1.numberToBytesBE)(num2, BYTES),
12658
12658
  fromBytes: (bytes3) => {
12659
12659
  if (bytes3.length !== BYTES)
12660
12660
  throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
@@ -12681,8 +12681,8 @@ var strkfarm_risk_engine = (() => {
12681
12681
  const minLen = nLength4(groupOrder).nByteLength + 8;
12682
12682
  if (minLen < 24 || hashLen < minLen || hashLen > 1024)
12683
12683
  throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);
12684
- const num4 = isLE4 ? (0, utils_js_1.bytesToNumberLE)(hash4) : (0, utils_js_1.bytesToNumberBE)(hash4);
12685
- return mod4(num4, groupOrder - _1n16) + _1n16;
12684
+ const num2 = isLE4 ? (0, utils_js_1.bytesToNumberLE)(hash4) : (0, utils_js_1.bytesToNumberBE)(hash4);
12685
+ return mod4(num2, groupOrder - _1n16) + _1n16;
12686
12686
  }
12687
12687
  function getFieldBytesLength4(fieldOrder) {
12688
12688
  if (typeof fieldOrder !== "bigint")
@@ -12700,8 +12700,8 @@ var strkfarm_risk_engine = (() => {
12700
12700
  const minLen = getMinHashLength4(fieldOrder);
12701
12701
  if (len < 16 || len < minLen || len > 1024)
12702
12702
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
12703
- const num4 = isLE4 ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key);
12704
- const reduced = mod4(num4, fieldOrder - _1n16) + _1n16;
12703
+ const num2 = isLE4 ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key);
12704
+ const reduced = mod4(num2, fieldOrder - _1n16) + _1n16;
12705
12705
  return isLE4 ? (0, utils_js_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_js_1.numberToBytesBE)(reduced, fieldLen);
12706
12706
  }
12707
12707
  }
@@ -13022,8 +13022,8 @@ var strkfarm_risk_engine = (() => {
13022
13022
  },
13023
13023
  hexFromSig(sig) {
13024
13024
  const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2;
13025
- const h = (num4) => {
13026
- const hex = num4.toString(16);
13025
+ const h = (num2) => {
13026
+ const hex = num2.toString(16);
13027
13027
  return hex.length & 1 ? `0${hex}` : hex;
13028
13028
  };
13029
13029
  const s = slice(h(sig.s));
@@ -13061,11 +13061,11 @@ var strkfarm_risk_engine = (() => {
13061
13061
  }
13062
13062
  if (!Fp2.eql(Fp2.sqr(CURVE2.Gy), weierstrassEquation(CURVE2.Gx)))
13063
13063
  throw new Error("bad generator point: equation left != right");
13064
- function isWithinCurveOrder(num4) {
13065
- return typeof num4 === "bigint" && _0n16 < num4 && num4 < CURVE2.n;
13064
+ function isWithinCurveOrder(num2) {
13065
+ return typeof num2 === "bigint" && _0n16 < num2 && num2 < CURVE2.n;
13066
13066
  }
13067
- function assertGE(num4) {
13068
- if (!isWithinCurveOrder(num4))
13067
+ function assertGE(num2) {
13068
+ if (!isWithinCurveOrder(num2))
13069
13069
  throw new Error("Expected valid bigint: 0 < bigint < curve.n");
13070
13070
  }
13071
13071
  function normPrivateKeyToScalar(key) {
@@ -13077,16 +13077,16 @@ var strkfarm_risk_engine = (() => {
13077
13077
  throw new Error("Invalid key");
13078
13078
  key = key.padStart(nByteLength * 2, "0");
13079
13079
  }
13080
- let num4;
13080
+ let num2;
13081
13081
  try {
13082
- num4 = typeof key === "bigint" ? key : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)("private key", key, nByteLength));
13082
+ num2 = typeof key === "bigint" ? key : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)("private key", key, nByteLength));
13083
13083
  } catch (error2) {
13084
13084
  throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);
13085
13085
  }
13086
13086
  if (wrapPrivateKey)
13087
- num4 = mod4.mod(num4, n);
13088
- assertGE(num4);
13089
- return num4;
13087
+ num2 = mod4.mod(num2, n);
13088
+ assertGE(num2);
13089
+ return num2;
13090
13090
  }
13091
13091
  const pointPrecomputes2 = /* @__PURE__ */ new Map();
13092
13092
  function assertPrjPoint(other) {
@@ -13447,8 +13447,8 @@ var strkfarm_risk_engine = (() => {
13447
13447
  const { Fp: Fp2, n: CURVE_ORDER3 } = CURVE2;
13448
13448
  const compressedLen = Fp2.BYTES + 1;
13449
13449
  const uncompressedLen = 2 * Fp2.BYTES + 1;
13450
- function isValidFieldElement(num4) {
13451
- return _0n16 < num4 && num4 < Fp2.ORDER;
13450
+ function isValidFieldElement(num2) {
13451
+ return _0n16 < num2 && num2 < Fp2.ORDER;
13452
13452
  }
13453
13453
  function modN(a) {
13454
13454
  return mod4.mod(a, CURVE_ORDER3);
@@ -13498,7 +13498,7 @@ var strkfarm_risk_engine = (() => {
13498
13498
  }
13499
13499
  }
13500
13500
  });
13501
- const numToNByteStr = (num4) => ut.bytesToHex(ut.numberToBytesBE(num4, CURVE2.nByteLength));
13501
+ const numToNByteStr = (num2) => ut.bytesToHex(ut.numberToBytesBE(num2, CURVE2.nByteLength));
13502
13502
  function isBiggerThanHalfOrder(number3) {
13503
13503
  const HALF = CURVE_ORDER3 >> _1n16;
13504
13504
  return number3 > HALF;
@@ -13632,20 +13632,20 @@ var strkfarm_risk_engine = (() => {
13632
13632
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
13633
13633
  }
13634
13634
  const bits2int3 = CURVE2.bits2int || function(bytes3) {
13635
- const num4 = ut.bytesToNumberBE(bytes3);
13635
+ const num2 = ut.bytesToNumberBE(bytes3);
13636
13636
  const delta = bytes3.length * 8 - CURVE2.nBitLength;
13637
- return delta > 0 ? num4 >> BigInt(delta) : num4;
13637
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
13638
13638
  };
13639
13639
  const bits2int_modN = CURVE2.bits2int_modN || function(bytes3) {
13640
13640
  return modN(bits2int3(bytes3));
13641
13641
  };
13642
13642
  const ORDER_MASK = ut.bitMask(CURVE2.nBitLength);
13643
- function int2octets(num4) {
13644
- if (typeof num4 !== "bigint")
13643
+ function int2octets(num2) {
13644
+ if (typeof num2 !== "bigint")
13645
13645
  throw new Error("bigint expected");
13646
- if (!(_0n16 <= num4 && num4 < ORDER_MASK))
13646
+ if (!(_0n16 <= num2 && num2 < ORDER_MASK))
13647
13647
  throw new Error(`bigint expected < 2^${CURVE2.nBitLength}`);
13648
- return ut.numberToBytesBE(num4, CURVE2.nByteLength);
13648
+ return ut.numberToBytesBE(num2, CURVE2.nByteLength);
13649
13649
  }
13650
13650
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
13651
13651
  if (["recovered", "canonical"].some((k) => k in opts))
@@ -21543,8 +21543,8 @@ ${r2}}` : "}", l2;
21543
21543
  }
21544
21544
  if (enums && element.type in enums && enums[element.type]) {
21545
21545
  const variantNum = Number(responseIterator.next().value);
21546
- const rawEnum = enums[element.type].variants.reduce((acc, variant, num4) => {
21547
- if (num4 === variantNum) {
21546
+ const rawEnum = enums[element.type].variants.reduce((acc, variant, num2) => {
21547
+ if (num2 === variantNum) {
21548
21548
  acc[variant.name] = parseResponseValue2(
21549
21549
  responseIterator,
21550
21550
  { name: "", type: variant.type },
@@ -22458,8 +22458,8 @@ ${r2}}` : "}", l2;
22458
22458
  var parseIntAsNumberOrBigInt2 = (str) => {
22459
22459
  if (!json.isInteger(str))
22460
22460
  return parseFloat(str);
22461
- const num4 = parseInt(str, 10);
22462
- return Number.isSafeInteger(num4) ? num4 : BigInt(str);
22461
+ const num2 = parseInt(str, 10);
22462
+ return Number.isSafeInteger(num2) ? num2 : BigInt(str);
22463
22463
  };
22464
22464
  var parse22 = (str) => json.parse(String(str), void 0, parseIntAsNumberOrBigInt2);
22465
22465
  var parseAlwaysAsBig2 = (str) => json.parse(String(str), void 0, json.parseNumberAndBigInt);
@@ -31580,8 +31580,8 @@ ${r2}}` : "}", l2;
31580
31580
  }
31581
31581
  return hex;
31582
31582
  }
31583
- function numberToHexUnpadded(num4) {
31584
- const hex = num4.toString(16);
31583
+ function numberToHexUnpadded(num2) {
31584
+ const hex = num2.toString(16);
31585
31585
  return hex.length & 1 ? `0${hex}` : hex;
31586
31586
  }
31587
31587
  function hexToNumber(hex) {
@@ -32682,8 +32682,8 @@ ${r2}}` : "}", l2;
32682
32682
  }
32683
32683
  return hex;
32684
32684
  }
32685
- function numberToHexUnpadded2(num4) {
32686
- const hex = num4.toString(16);
32685
+ function numberToHexUnpadded2(num2) {
32686
+ const hex = num2.toString(16);
32687
32687
  return hex.length & 1 ? `0${hex}` : hex;
32688
32688
  }
32689
32689
  function hexToNumber2(hex) {
@@ -32892,7 +32892,7 @@ ${r2}}` : "}", l2;
32892
32892
  const result = a % b;
32893
32893
  return result >= _0n5 ? result : b + result;
32894
32894
  }
32895
- function pow(num4, power, modulo) {
32895
+ function pow(num2, power, modulo) {
32896
32896
  if (modulo <= _0n5 || power < _0n5)
32897
32897
  throw new Error("Expected power/modulo > 0");
32898
32898
  if (modulo === _1n5)
@@ -32900,8 +32900,8 @@ ${r2}}` : "}", l2;
32900
32900
  let res = _1n5;
32901
32901
  while (power > _0n5) {
32902
32902
  if (power & _1n5)
32903
- res = res * num4 % modulo;
32904
- num4 = num4 * num4 % modulo;
32903
+ res = res * num2 % modulo;
32904
+ num2 = num2 * num2 % modulo;
32905
32905
  power >>= _1n5;
32906
32906
  }
32907
32907
  return res;
@@ -33026,15 +33026,15 @@ ${r2}}` : "}", l2;
33026
33026
  }, initial);
33027
33027
  return validateObject2(field, opts);
33028
33028
  }
33029
- function FpPow(f, num4, power) {
33029
+ function FpPow(f, num2, power) {
33030
33030
  if (power < _0n5)
33031
33031
  throw new Error("Expected power > 0");
33032
33032
  if (power === _0n5)
33033
33033
  return f.ONE;
33034
33034
  if (power === _1n5)
33035
- return num4;
33035
+ return num2;
33036
33036
  let p = f.ONE;
33037
- let d = num4;
33037
+ let d = num2;
33038
33038
  while (power > _0n5) {
33039
33039
  if (power & _1n5)
33040
33040
  p = f.mul(p, d);
@@ -33045,18 +33045,18 @@ ${r2}}` : "}", l2;
33045
33045
  }
33046
33046
  function FpInvertBatch(f, nums) {
33047
33047
  const tmp = new Array(nums.length);
33048
- const lastMultiplied = nums.reduce((acc, num4, i) => {
33049
- if (f.is0(num4))
33048
+ const lastMultiplied = nums.reduce((acc, num2, i) => {
33049
+ if (f.is0(num2))
33050
33050
  return acc;
33051
33051
  tmp[i] = acc;
33052
- return f.mul(acc, num4);
33052
+ return f.mul(acc, num2);
33053
33053
  }, f.ONE);
33054
33054
  const inverted = f.inv(lastMultiplied);
33055
- nums.reduceRight((acc, num4, i) => {
33056
- if (f.is0(num4))
33055
+ nums.reduceRight((acc, num2, i) => {
33056
+ if (f.is0(num2))
33057
33057
  return acc;
33058
33058
  tmp[i] = f.mul(acc, tmp[i]);
33059
- return f.mul(acc, num4);
33059
+ return f.mul(acc, num2);
33060
33060
  }, inverted);
33061
33061
  return tmp;
33062
33062
  }
@@ -33079,34 +33079,34 @@ ${r2}}` : "}", l2;
33079
33079
  MASK: bitMask2(BITS),
33080
33080
  ZERO: _0n5,
33081
33081
  ONE: _1n5,
33082
- create: (num4) => mod(num4, ORDER),
33083
- isValid: (num4) => {
33084
- if (typeof num4 !== "bigint")
33085
- throw new Error(`Invalid field element: expected bigint, got ${typeof num4}`);
33086
- return _0n5 <= num4 && num4 < ORDER;
33082
+ create: (num2) => mod(num2, ORDER),
33083
+ isValid: (num2) => {
33084
+ if (typeof num2 !== "bigint")
33085
+ throw new Error(`Invalid field element: expected bigint, got ${typeof num2}`);
33086
+ return _0n5 <= num2 && num2 < ORDER;
33087
33087
  },
33088
- is0: (num4) => num4 === _0n5,
33089
- isOdd: (num4) => (num4 & _1n5) === _1n5,
33090
- neg: (num4) => mod(-num4, ORDER),
33088
+ is0: (num2) => num2 === _0n5,
33089
+ isOdd: (num2) => (num2 & _1n5) === _1n5,
33090
+ neg: (num2) => mod(-num2, ORDER),
33091
33091
  eql: (lhs, rhs) => lhs === rhs,
33092
- sqr: (num4) => mod(num4 * num4, ORDER),
33092
+ sqr: (num2) => mod(num2 * num2, ORDER),
33093
33093
  add: (lhs, rhs) => mod(lhs + rhs, ORDER),
33094
33094
  sub: (lhs, rhs) => mod(lhs - rhs, ORDER),
33095
33095
  mul: (lhs, rhs) => mod(lhs * rhs, ORDER),
33096
- pow: (num4, power) => FpPow(f, num4, power),
33096
+ pow: (num2, power) => FpPow(f, num2, power),
33097
33097
  div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),
33098
33098
  // Same as above, but doesn't normalize
33099
- sqrN: (num4) => num4 * num4,
33099
+ sqrN: (num2) => num2 * num2,
33100
33100
  addN: (lhs, rhs) => lhs + rhs,
33101
33101
  subN: (lhs, rhs) => lhs - rhs,
33102
33102
  mulN: (lhs, rhs) => lhs * rhs,
33103
- inv: (num4) => invert(num4, ORDER),
33103
+ inv: (num2) => invert(num2, ORDER),
33104
33104
  sqrt: redef.sqrt || ((n) => sqrtP(f, n)),
33105
33105
  invertBatch: (lst) => FpInvertBatch(f, lst),
33106
33106
  // TODO: do we really need constant cmov?
33107
33107
  // We don't have const-time bigints anyway, so probably will be not very useful
33108
33108
  cmov: (a, b, c) => c ? b : a,
33109
- toBytes: (num4) => isLE4 ? numberToBytesLE2(num4, BYTES) : numberToBytesBE2(num4, BYTES),
33109
+ toBytes: (num2) => isLE4 ? numberToBytesLE2(num2, BYTES) : numberToBytesBE2(num2, BYTES),
33110
33110
  fromBytes: (bytes3) => {
33111
33111
  if (bytes3.length !== BYTES)
33112
33112
  throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
@@ -33131,8 +33131,8 @@ ${r2}}` : "}", l2;
33131
33131
  const minLen = getMinHashLength(fieldOrder);
33132
33132
  if (len < 16 || len < minLen || len > 1024)
33133
33133
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
33134
- const num4 = isLE4 ? bytesToNumberBE2(key) : bytesToNumberLE2(key);
33135
- const reduced = mod(num4, fieldOrder - _1n5) + _1n5;
33134
+ const num2 = isLE4 ? bytesToNumberBE2(key) : bytesToNumberLE2(key);
33135
+ const reduced = mod(num2, fieldOrder - _1n5) + _1n5;
33136
33136
  return isLE4 ? numberToBytesLE2(reduced, fieldLen) : numberToBytesBE2(reduced, fieldLen);
33137
33137
  }
33138
33138
 
@@ -33403,8 +33403,8 @@ ${r2}}` : "}", l2;
33403
33403
  },
33404
33404
  hexFromSig(sig) {
33405
33405
  const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2;
33406
- const h = (num4) => {
33407
- const hex = num4.toString(16);
33406
+ const h = (num2) => {
33407
+ const hex = num2.toString(16);
33408
33408
  return hex.length & 1 ? `0${hex}` : hex;
33409
33409
  };
33410
33410
  const s = slice(h(sig.s));
@@ -33442,11 +33442,11 @@ ${r2}}` : "}", l2;
33442
33442
  }
33443
33443
  if (!Fp2.eql(Fp2.sqr(CURVE2.Gy), weierstrassEquation(CURVE2.Gx)))
33444
33444
  throw new Error("bad generator point: equation left != right");
33445
- function isWithinCurveOrder(num4) {
33446
- return typeof num4 === "bigint" && _0n7 < num4 && num4 < CURVE2.n;
33445
+ function isWithinCurveOrder(num2) {
33446
+ return typeof num2 === "bigint" && _0n7 < num2 && num2 < CURVE2.n;
33447
33447
  }
33448
- function assertGE(num4) {
33449
- if (!isWithinCurveOrder(num4))
33448
+ function assertGE(num2) {
33449
+ if (!isWithinCurveOrder(num2))
33450
33450
  throw new Error("Expected valid bigint: 0 < bigint < curve.n");
33451
33451
  }
33452
33452
  function normPrivateKeyToScalar(key) {
@@ -33458,16 +33458,16 @@ ${r2}}` : "}", l2;
33458
33458
  throw new Error("Invalid key");
33459
33459
  key = key.padStart(nByteLength * 2, "0");
33460
33460
  }
33461
- let num4;
33461
+ let num2;
33462
33462
  try {
33463
- num4 = typeof key === "bigint" ? key : bytesToNumberBE2(ensureBytes2("private key", key, nByteLength));
33463
+ num2 = typeof key === "bigint" ? key : bytesToNumberBE2(ensureBytes2("private key", key, nByteLength));
33464
33464
  } catch (error2) {
33465
33465
  throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);
33466
33466
  }
33467
33467
  if (wrapPrivateKey)
33468
- num4 = mod(num4, n);
33469
- assertGE(num4);
33470
- return num4;
33468
+ num2 = mod(num2, n);
33469
+ assertGE(num2);
33470
+ return num2;
33471
33471
  }
33472
33472
  const pointPrecomputes2 = /* @__PURE__ */ new Map();
33473
33473
  function assertPrjPoint(other) {
@@ -33828,8 +33828,8 @@ ${r2}}` : "}", l2;
33828
33828
  const { Fp: Fp2, n: CURVE_ORDER3 } = CURVE2;
33829
33829
  const compressedLen = Fp2.BYTES + 1;
33830
33830
  const uncompressedLen = 2 * Fp2.BYTES + 1;
33831
- function isValidFieldElement(num4) {
33832
- return _0n7 < num4 && num4 < Fp2.ORDER;
33831
+ function isValidFieldElement(num2) {
33832
+ return _0n7 < num2 && num2 < Fp2.ORDER;
33833
33833
  }
33834
33834
  function modN(a) {
33835
33835
  return mod(a, CURVE_ORDER3);
@@ -33873,7 +33873,7 @@ ${r2}}` : "}", l2;
33873
33873
  }
33874
33874
  }
33875
33875
  });
33876
- const numToNByteStr = (num4) => bytesToHex2(numberToBytesBE2(num4, CURVE2.nByteLength));
33876
+ const numToNByteStr = (num2) => bytesToHex2(numberToBytesBE2(num2, CURVE2.nByteLength));
33877
33877
  function isBiggerThanHalfOrder(number3) {
33878
33878
  const HALF = CURVE_ORDER3 >> _1n7;
33879
33879
  return number3 > HALF;
@@ -34007,20 +34007,20 @@ ${r2}}` : "}", l2;
34007
34007
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
34008
34008
  }
34009
34009
  const bits2int3 = CURVE2.bits2int || function(bytes3) {
34010
- const num4 = bytesToNumberBE2(bytes3);
34010
+ const num2 = bytesToNumberBE2(bytes3);
34011
34011
  const delta = bytes3.length * 8 - CURVE2.nBitLength;
34012
- return delta > 0 ? num4 >> BigInt(delta) : num4;
34012
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
34013
34013
  };
34014
34014
  const bits2int_modN = CURVE2.bits2int_modN || function(bytes3) {
34015
34015
  return modN(bits2int3(bytes3));
34016
34016
  };
34017
34017
  const ORDER_MASK = bitMask2(CURVE2.nBitLength);
34018
- function int2octets(num4) {
34019
- if (typeof num4 !== "bigint")
34018
+ function int2octets(num2) {
34019
+ if (typeof num2 !== "bigint")
34020
34020
  throw new Error("bigint expected");
34021
- if (!(_0n7 <= num4 && num4 < ORDER_MASK))
34021
+ if (!(_0n7 <= num2 && num2 < ORDER_MASK))
34022
34022
  throw new Error(`bigint expected < 2^${CURVE2.nBitLength}`);
34023
- return numberToBytesBE2(num4, CURVE2.nByteLength);
34023
+ return numberToBytesBE2(num2, CURVE2.nByteLength);
34024
34024
  }
34025
34025
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
34026
34026
  if (["recovered", "canonical"].some((k) => k in opts))
@@ -34211,8 +34211,8 @@ ${r2}}` : "}", l2;
34211
34211
  while (bytes3[0] === 0)
34212
34212
  bytes3 = bytes3.subarray(1);
34213
34213
  const delta = bytes3.length * 8 - nBitLength;
34214
- const num4 = bytesToNumberBE2(bytes3);
34215
- return delta > 0 ? num4 >> BigInt(delta) : num4;
34214
+ const num2 = bytesToNumberBE2(bytes3);
34215
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
34216
34216
  }
34217
34217
  function hex0xToBytes(hex) {
34218
34218
  if (typeof hex === "string") {
@@ -34264,8 +34264,8 @@ ${r2}}` : "}", l2;
34264
34264
  }
34265
34265
  function checkMessage(msgHash) {
34266
34266
  const bytes3 = ensureBytes3(msgHash);
34267
- const num4 = bytesToNumberBE2(bytes3);
34268
- if (num4 >= MAX_VALUE)
34267
+ const num2 = bytesToNumberBE2(bytes3);
34268
+ if (num2 >= MAX_VALUE)
34269
34269
  throw new Error(`msgHash should be [0, ${MAX_VALUE})`);
34270
34270
  return bytes3;
34271
34271
  }
@@ -34488,7 +34488,7 @@ ${r2}}` : "}", l2;
34488
34488
  const result = a % b;
34489
34489
  return result >= _0n8 ? result : b + result;
34490
34490
  }
34491
- function pow2(num4, power, modulo) {
34491
+ function pow2(num2, power, modulo) {
34492
34492
  if (modulo <= _0n8 || power < _0n8)
34493
34493
  throw new Error("Expected power/modulo > 0");
34494
34494
  if (modulo === _1n8)
@@ -34496,8 +34496,8 @@ ${r2}}` : "}", l2;
34496
34496
  let res = _1n8;
34497
34497
  while (power > _0n8) {
34498
34498
  if (power & _1n8)
34499
- res = res * num4 % modulo;
34500
- num4 = num4 * num4 % modulo;
34499
+ res = res * num2 % modulo;
34500
+ num2 = num2 * num2 % modulo;
34501
34501
  power >>= _1n8;
34502
34502
  }
34503
34503
  return res;
@@ -34630,15 +34630,15 @@ ${r2}}` : "}", l2;
34630
34630
  }, initial);
34631
34631
  return validateObject(field, opts);
34632
34632
  }
34633
- function FpPow2(f, num4, power) {
34633
+ function FpPow2(f, num2, power) {
34634
34634
  if (power < _0n8)
34635
34635
  throw new Error("Expected power > 0");
34636
34636
  if (power === _0n8)
34637
34637
  return f.ONE;
34638
34638
  if (power === _1n8)
34639
- return num4;
34639
+ return num2;
34640
34640
  let p = f.ONE;
34641
- let d = num4;
34641
+ let d = num2;
34642
34642
  while (power > _0n8) {
34643
34643
  if (power & _1n8)
34644
34644
  p = f.mul(p, d);
@@ -34649,18 +34649,18 @@ ${r2}}` : "}", l2;
34649
34649
  }
34650
34650
  function FpInvertBatch2(f, nums) {
34651
34651
  const tmp = new Array(nums.length);
34652
- const lastMultiplied = nums.reduce((acc, num4, i) => {
34653
- if (f.is0(num4))
34652
+ const lastMultiplied = nums.reduce((acc, num2, i) => {
34653
+ if (f.is0(num2))
34654
34654
  return acc;
34655
34655
  tmp[i] = acc;
34656
- return f.mul(acc, num4);
34656
+ return f.mul(acc, num2);
34657
34657
  }, f.ONE);
34658
34658
  const inverted = f.inv(lastMultiplied);
34659
- nums.reduceRight((acc, num4, i) => {
34660
- if (f.is0(num4))
34659
+ nums.reduceRight((acc, num2, i) => {
34660
+ if (f.is0(num2))
34661
34661
  return acc;
34662
34662
  tmp[i] = f.mul(acc, tmp[i]);
34663
- return f.mul(acc, num4);
34663
+ return f.mul(acc, num2);
34664
34664
  }, inverted);
34665
34665
  return tmp;
34666
34666
  }
@@ -34683,34 +34683,34 @@ ${r2}}` : "}", l2;
34683
34683
  MASK: bitMask(BITS),
34684
34684
  ZERO: _0n8,
34685
34685
  ONE: _1n8,
34686
- create: (num4) => mod2(num4, ORDER),
34687
- isValid: (num4) => {
34688
- if (typeof num4 !== "bigint")
34689
- throw new Error(`Invalid field element: expected bigint, got ${typeof num4}`);
34690
- return _0n8 <= num4 && num4 < ORDER;
34686
+ create: (num2) => mod2(num2, ORDER),
34687
+ isValid: (num2) => {
34688
+ if (typeof num2 !== "bigint")
34689
+ throw new Error(`Invalid field element: expected bigint, got ${typeof num2}`);
34690
+ return _0n8 <= num2 && num2 < ORDER;
34691
34691
  },
34692
- is0: (num4) => num4 === _0n8,
34693
- isOdd: (num4) => (num4 & _1n8) === _1n8,
34694
- neg: (num4) => mod2(-num4, ORDER),
34692
+ is0: (num2) => num2 === _0n8,
34693
+ isOdd: (num2) => (num2 & _1n8) === _1n8,
34694
+ neg: (num2) => mod2(-num2, ORDER),
34695
34695
  eql: (lhs, rhs) => lhs === rhs,
34696
- sqr: (num4) => mod2(num4 * num4, ORDER),
34696
+ sqr: (num2) => mod2(num2 * num2, ORDER),
34697
34697
  add: (lhs, rhs) => mod2(lhs + rhs, ORDER),
34698
34698
  sub: (lhs, rhs) => mod2(lhs - rhs, ORDER),
34699
34699
  mul: (lhs, rhs) => mod2(lhs * rhs, ORDER),
34700
- pow: (num4, power) => FpPow2(f, num4, power),
34700
+ pow: (num2, power) => FpPow2(f, num2, power),
34701
34701
  div: (lhs, rhs) => mod2(lhs * invert2(rhs, ORDER), ORDER),
34702
34702
  // Same as above, but doesn't normalize
34703
- sqrN: (num4) => num4 * num4,
34703
+ sqrN: (num2) => num2 * num2,
34704
34704
  addN: (lhs, rhs) => lhs + rhs,
34705
34705
  subN: (lhs, rhs) => lhs - rhs,
34706
34706
  mulN: (lhs, rhs) => lhs * rhs,
34707
- inv: (num4) => invert2(num4, ORDER),
34707
+ inv: (num2) => invert2(num2, ORDER),
34708
34708
  sqrt: redef.sqrt || ((n) => sqrtP(f, n)),
34709
34709
  invertBatch: (lst) => FpInvertBatch2(f, lst),
34710
34710
  // TODO: do we really need constant cmov?
34711
34711
  // We don't have const-time bigints anyway, so probably will be not very useful
34712
34712
  cmov: (a, b, c) => c ? b : a,
34713
- toBytes: (num4) => isLE4 ? numberToBytesLE(num4, BYTES) : numberToBytesBE(num4, BYTES),
34713
+ toBytes: (num2) => isLE4 ? numberToBytesLE(num2, BYTES) : numberToBytesBE(num2, BYTES),
34714
34714
  fromBytes: (bytes3) => {
34715
34715
  if (bytes3.length !== BYTES)
34716
34716
  throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
@@ -34735,8 +34735,8 @@ ${r2}}` : "}", l2;
34735
34735
  const minLen = getMinHashLength2(fieldOrder);
34736
34736
  if (len < 16 || len < minLen || len > 1024)
34737
34737
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
34738
- const num4 = isLE4 ? bytesToNumberBE(key) : bytesToNumberLE(key);
34739
- const reduced = mod2(num4, fieldOrder - _1n8) + _1n8;
34738
+ const num2 = isLE4 ? bytesToNumberBE(key) : bytesToNumberLE(key);
34739
+ const reduced = mod2(num2, fieldOrder - _1n8) + _1n8;
34740
34740
  return isLE4 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
34741
34741
  }
34742
34742
 
@@ -35032,8 +35032,8 @@ ${r2}}` : "}", l2;
35032
35032
  },
35033
35033
  hexFromSig(sig) {
35034
35034
  const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2;
35035
- const h = (num4) => {
35036
- const hex = num4.toString(16);
35035
+ const h = (num2) => {
35036
+ const hex = num2.toString(16);
35037
35037
  return hex.length & 1 ? `0${hex}` : hex;
35038
35038
  };
35039
35039
  const s = slice(h(sig.s));
@@ -35071,11 +35071,11 @@ ${r2}}` : "}", l2;
35071
35071
  }
35072
35072
  if (!Fp2.eql(Fp2.sqr(CURVE2.Gy), weierstrassEquation(CURVE2.Gx)))
35073
35073
  throw new Error("bad generator point: equation left != right");
35074
- function isWithinCurveOrder(num4) {
35075
- return typeof num4 === "bigint" && _0n10 < num4 && num4 < CURVE2.n;
35074
+ function isWithinCurveOrder(num2) {
35075
+ return typeof num2 === "bigint" && _0n10 < num2 && num2 < CURVE2.n;
35076
35076
  }
35077
- function assertGE(num4) {
35078
- if (!isWithinCurveOrder(num4))
35077
+ function assertGE(num2) {
35078
+ if (!isWithinCurveOrder(num2))
35079
35079
  throw new Error("Expected valid bigint: 0 < bigint < curve.n");
35080
35080
  }
35081
35081
  function normPrivateKeyToScalar(key) {
@@ -35087,16 +35087,16 @@ ${r2}}` : "}", l2;
35087
35087
  throw new Error("Invalid key");
35088
35088
  key = key.padStart(nByteLength * 2, "0");
35089
35089
  }
35090
- let num4;
35090
+ let num2;
35091
35091
  try {
35092
- num4 = typeof key === "bigint" ? key : bytesToNumberBE(ensureBytes("private key", key, nByteLength));
35092
+ num2 = typeof key === "bigint" ? key : bytesToNumberBE(ensureBytes("private key", key, nByteLength));
35093
35093
  } catch (error2) {
35094
35094
  throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);
35095
35095
  }
35096
35096
  if (wrapPrivateKey)
35097
- num4 = mod2(num4, n);
35098
- assertGE(num4);
35099
- return num4;
35097
+ num2 = mod2(num2, n);
35098
+ assertGE(num2);
35099
+ return num2;
35100
35100
  }
35101
35101
  const pointPrecomputes2 = /* @__PURE__ */ new Map();
35102
35102
  function assertPrjPoint(other) {
@@ -35457,8 +35457,8 @@ ${r2}}` : "}", l2;
35457
35457
  const { Fp: Fp2, n: CURVE_ORDER3 } = CURVE2;
35458
35458
  const compressedLen = Fp2.BYTES + 1;
35459
35459
  const uncompressedLen = 2 * Fp2.BYTES + 1;
35460
- function isValidFieldElement(num4) {
35461
- return _0n10 < num4 && num4 < Fp2.ORDER;
35460
+ function isValidFieldElement(num2) {
35461
+ return _0n10 < num2 && num2 < Fp2.ORDER;
35462
35462
  }
35463
35463
  function modN(a) {
35464
35464
  return mod2(a, CURVE_ORDER3);
@@ -35508,7 +35508,7 @@ ${r2}}` : "}", l2;
35508
35508
  }
35509
35509
  }
35510
35510
  });
35511
- const numToNByteStr = (num4) => bytesToHex(numberToBytesBE(num4, CURVE2.nByteLength));
35511
+ const numToNByteStr = (num2) => bytesToHex(numberToBytesBE(num2, CURVE2.nByteLength));
35512
35512
  function isBiggerThanHalfOrder(number3) {
35513
35513
  const HALF = CURVE_ORDER3 >> _1n10;
35514
35514
  return number3 > HALF;
@@ -35642,20 +35642,20 @@ ${r2}}` : "}", l2;
35642
35642
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
35643
35643
  }
35644
35644
  const bits2int3 = CURVE2.bits2int || function(bytes3) {
35645
- const num4 = bytesToNumberBE(bytes3);
35645
+ const num2 = bytesToNumberBE(bytes3);
35646
35646
  const delta = bytes3.length * 8 - CURVE2.nBitLength;
35647
- return delta > 0 ? num4 >> BigInt(delta) : num4;
35647
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
35648
35648
  };
35649
35649
  const bits2int_modN = CURVE2.bits2int_modN || function(bytes3) {
35650
35650
  return modN(bits2int3(bytes3));
35651
35651
  };
35652
35652
  const ORDER_MASK = bitMask(CURVE2.nBitLength);
35653
- function int2octets(num4) {
35654
- if (typeof num4 !== "bigint")
35653
+ function int2octets(num2) {
35654
+ if (typeof num2 !== "bigint")
35655
35655
  throw new Error("bigint expected");
35656
- if (!(_0n10 <= num4 && num4 < ORDER_MASK))
35656
+ if (!(_0n10 <= num2 && num2 < ORDER_MASK))
35657
35657
  throw new Error(`bigint expected < 2^${CURVE2.nBitLength}`);
35658
- return numberToBytesBE(num4, CURVE2.nByteLength);
35658
+ return numberToBytesBE(num2, CURVE2.nByteLength);
35659
35659
  }
35660
35660
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
35661
35661
  if (["recovered", "canonical"].some((k) => k in opts))
@@ -35873,8 +35873,8 @@ ${r2}}` : "}", l2;
35873
35873
  }
35874
35874
  var NUMBER_REGEX = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
35875
35875
  function isSafeNumber(value, config2) {
35876
- const num4 = Number.parseFloat(value);
35877
- const parsed = String(num4);
35876
+ const num2 = Number.parseFloat(value);
35877
+ const parsed = String(num2);
35878
35878
  if (value === parsed) {
35879
35879
  return true;
35880
35880
  }
@@ -35907,11 +35907,11 @@ ${r2}}` : "}", l2;
35907
35907
  if (isInteger(value)) {
35908
35908
  return UnsafeNumberReason.truncate_integer;
35909
35909
  }
35910
- const num4 = Number.parseFloat(value);
35911
- if (!Number.isFinite(num4)) {
35910
+ const num2 = Number.parseFloat(value);
35911
+ if (!Number.isFinite(num2)) {
35912
35912
  return UnsafeNumberReason.overflow;
35913
35913
  }
35914
- if (num4 === 0) {
35914
+ if (num2 === 0) {
35915
35915
  return UnsafeNumberReason.underflow;
35916
35916
  }
35917
35917
  return UnsafeNumberReason.truncate_float;
@@ -43049,8 +43049,8 @@ ${indent}}` : "}";
43049
43049
  }
43050
43050
  if (enums && element.type in enums && enums[element.type]) {
43051
43051
  const variantNum = Number(responseIterator.next().value);
43052
- const rawEnum = enums[element.type].variants.reduce((acc, variant, num4) => {
43053
- if (num4 === variantNum) {
43052
+ const rawEnum = enums[element.type].variants.reduce((acc, variant, num2) => {
43053
+ if (num2 === variantNum) {
43054
43054
  acc[variant.name] = parseResponseValue(
43055
43055
  responseIterator,
43056
43056
  { name: "", type: variant.type },
@@ -43958,8 +43958,8 @@ ${indent}}` : "}";
43958
43958
  var parseIntAsNumberOrBigInt = (str) => {
43959
43959
  if (!isInteger(str))
43960
43960
  return parseFloat(str);
43961
- const num4 = parseInt(str, 10);
43962
- return Number.isSafeInteger(num4) ? num4 : BigInt(str);
43961
+ const num2 = parseInt(str, 10);
43962
+ return Number.isSafeInteger(num2) ? num2 : BigInt(str);
43963
43963
  };
43964
43964
  var parse2 = (str) => parse(String(str), void 0, parseIntAsNumberOrBigInt);
43965
43965
  var parseAlwaysAsBig = (str) => parse(String(str), void 0, parseNumberAndBigInt);
@@ -49667,8 +49667,8 @@ ${indent}}` : "}";
49667
49667
  throw new Error(prefix + "expected safe integer, got type=" + typeof value);
49668
49668
  }
49669
49669
  }
49670
- function numberToHexUnpadded3(num4) {
49671
- const hex = abignumber(num4).toString(16);
49670
+ function numberToHexUnpadded3(num2) {
49671
+ const hex = abignumber(num2).toString(16);
49672
49672
  return hex.length & 1 ? "0" + hex : hex;
49673
49673
  }
49674
49674
  function hexToNumber3(hex) {
@@ -49956,15 +49956,15 @@ ${indent}}` : "}";
49956
49956
  validateObject3(field, opts);
49957
49957
  return field;
49958
49958
  }
49959
- function FpPow3(Fp2, num4, power) {
49959
+ function FpPow3(Fp2, num2, power) {
49960
49960
  if (power < _0n13)
49961
49961
  throw new Error("invalid exponent, negatives unsupported");
49962
49962
  if (power === _0n13)
49963
49963
  return Fp2.ONE;
49964
49964
  if (power === _1n13)
49965
- return num4;
49965
+ return num2;
49966
49966
  let p = Fp2.ONE;
49967
- let d = num4;
49967
+ let d = num2;
49968
49968
  while (power > _0n13) {
49969
49969
  if (power & _1n13)
49970
49970
  p = Fp2.mul(p, d);
@@ -49975,18 +49975,18 @@ ${indent}}` : "}";
49975
49975
  }
49976
49976
  function FpInvertBatch3(Fp2, nums, passZero = false) {
49977
49977
  const inverted = new Array(nums.length).fill(passZero ? Fp2.ZERO : void 0);
49978
- const multipliedAcc = nums.reduce((acc, num4, i) => {
49979
- if (Fp2.is0(num4))
49978
+ const multipliedAcc = nums.reduce((acc, num2, i) => {
49979
+ if (Fp2.is0(num2))
49980
49980
  return acc;
49981
49981
  inverted[i] = acc;
49982
- return Fp2.mul(acc, num4);
49982
+ return Fp2.mul(acc, num2);
49983
49983
  }, Fp2.ONE);
49984
49984
  const invertedAcc = Fp2.inv(multipliedAcc);
49985
- nums.reduceRight((acc, num4, i) => {
49986
- if (Fp2.is0(num4))
49985
+ nums.reduceRight((acc, num2, i) => {
49986
+ if (Fp2.is0(num2))
49987
49987
  return acc;
49988
49988
  inverted[i] = Fp2.mul(acc, inverted[i]);
49989
- return Fp2.mul(acc, num4);
49989
+ return Fp2.mul(acc, num2);
49990
49990
  }, invertedAcc);
49991
49991
  return inverted;
49992
49992
  }
@@ -50044,32 +50044,32 @@ ${indent}}` : "}";
50044
50044
  this._sqrt = void 0;
50045
50045
  Object.preventExtensions(this);
50046
50046
  }
50047
- create(num4) {
50048
- return mod3(num4, this.ORDER);
50047
+ create(num2) {
50048
+ return mod3(num2, this.ORDER);
50049
50049
  }
50050
- isValid(num4) {
50051
- if (typeof num4 !== "bigint")
50052
- throw new Error("invalid field element: expected bigint, got " + typeof num4);
50053
- return _0n13 <= num4 && num4 < this.ORDER;
50050
+ isValid(num2) {
50051
+ if (typeof num2 !== "bigint")
50052
+ throw new Error("invalid field element: expected bigint, got " + typeof num2);
50053
+ return _0n13 <= num2 && num2 < this.ORDER;
50054
50054
  }
50055
- is0(num4) {
50056
- return num4 === _0n13;
50055
+ is0(num2) {
50056
+ return num2 === _0n13;
50057
50057
  }
50058
50058
  // is valid and invertible
50059
- isValidNot0(num4) {
50060
- return !this.is0(num4) && this.isValid(num4);
50059
+ isValidNot0(num2) {
50060
+ return !this.is0(num2) && this.isValid(num2);
50061
50061
  }
50062
- isOdd(num4) {
50063
- return (num4 & _1n13) === _1n13;
50062
+ isOdd(num2) {
50063
+ return (num2 & _1n13) === _1n13;
50064
50064
  }
50065
- neg(num4) {
50066
- return mod3(-num4, this.ORDER);
50065
+ neg(num2) {
50066
+ return mod3(-num2, this.ORDER);
50067
50067
  }
50068
50068
  eql(lhs, rhs) {
50069
50069
  return lhs === rhs;
50070
50070
  }
50071
- sqr(num4) {
50072
- return mod3(num4 * num4, this.ORDER);
50071
+ sqr(num2) {
50072
+ return mod3(num2 * num2, this.ORDER);
50073
50073
  }
50074
50074
  add(lhs, rhs) {
50075
50075
  return mod3(lhs + rhs, this.ORDER);
@@ -50080,15 +50080,15 @@ ${indent}}` : "}";
50080
50080
  mul(lhs, rhs) {
50081
50081
  return mod3(lhs * rhs, this.ORDER);
50082
50082
  }
50083
- pow(num4, power) {
50084
- return FpPow3(this, num4, power);
50083
+ pow(num2, power) {
50084
+ return FpPow3(this, num2, power);
50085
50085
  }
50086
50086
  div(lhs, rhs) {
50087
50087
  return mod3(lhs * invert3(rhs, this.ORDER), this.ORDER);
50088
50088
  }
50089
50089
  // Same as above, but doesn't normalize
50090
- sqrN(num4) {
50091
- return num4 * num4;
50090
+ sqrN(num2) {
50091
+ return num2 * num2;
50092
50092
  }
50093
50093
  addN(lhs, rhs) {
50094
50094
  return lhs + rhs;
@@ -50099,16 +50099,16 @@ ${indent}}` : "}";
50099
50099
  mulN(lhs, rhs) {
50100
50100
  return lhs * rhs;
50101
50101
  }
50102
- inv(num4) {
50103
- return invert3(num4, this.ORDER);
50102
+ inv(num2) {
50103
+ return invert3(num2, this.ORDER);
50104
50104
  }
50105
- sqrt(num4) {
50105
+ sqrt(num2) {
50106
50106
  if (!this._sqrt)
50107
50107
  this._sqrt = FpSqrt3(this.ORDER);
50108
- return this._sqrt(this, num4);
50108
+ return this._sqrt(this, num2);
50109
50109
  }
50110
- toBytes(num4) {
50111
- return this.isLE ? numberToBytesLE3(num4, this.BYTES) : numberToBytesBE3(num4, this.BYTES);
50110
+ toBytes(num2) {
50111
+ return this.isLE ? numberToBytesLE3(num2, this.BYTES) : numberToBytesBE3(num2, this.BYTES);
50112
50112
  }
50113
50113
  fromBytes(bytes3, skipValidation = false) {
50114
50114
  abytes3(bytes3);
@@ -50162,8 +50162,8 @@ ${indent}}` : "}";
50162
50162
  const minLen = getMinHashLength3(fieldOrder);
50163
50163
  if (len < 16 || len < minLen || len > 1024)
50164
50164
  throw new Error("expected " + minLen + "-1024 bytes of input, got " + len);
50165
- const num4 = isLE4 ? bytesToNumberLE3(key) : bytesToNumberBE3(key);
50166
- const reduced = mod3(num4, fieldOrder - _1n13) + _1n13;
50165
+ const num2 = isLE4 ? bytesToNumberLE3(key) : bytesToNumberBE3(key);
50166
+ const reduced = mod3(num2, fieldOrder - _1n13) + _1n13;
50167
50167
  return isLE4 ? numberToBytesLE3(reduced, fieldLen) : numberToBytesBE3(reduced, fieldLen);
50168
50168
  }
50169
50169
 
@@ -50569,7 +50569,7 @@ ${indent}}` : "}";
50569
50569
  }
50570
50570
 
50571
50571
  // node_modules/.pnpm/@noble+curves@2.0.0/node_modules/@noble/curves/abstract/weierstrass.js
50572
- var divNearest2 = (num4, den) => (num4 + (num4 >= 0 ? den : -den) / _2n11) / den;
50572
+ var divNearest2 = (num2, den) => (num2 + (num2 >= 0 ? den : -den) / _2n11) / den;
50573
50573
  function _splitEndoScalar(k, basis, n) {
50574
50574
  const [[a1, b1], [a2, b2]] = basis;
50575
50575
  const c1 = divNearest2(b2 * k, n);
@@ -50669,11 +50669,11 @@ ${indent}}` : "}";
50669
50669
  // - add zero byte if exists
50670
50670
  // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
50671
50671
  _int: {
50672
- encode(num4) {
50672
+ encode(num2) {
50673
50673
  const { Err: E } = DER3;
50674
- if (num4 < _0n15)
50674
+ if (num2 < _0n15)
50675
50675
  throw new E("integer: negative integers are not allowed");
50676
- let hex = numberToHexUnpadded3(num4);
50676
+ let hex = numberToHexUnpadded3(num2);
50677
50677
  if (Number.parseInt(hex[0], 16) & 8)
50678
50678
  hex = "00" + hex;
50679
50679
  if (hex.length & 1)
@@ -51157,8 +51157,8 @@ ${indent}}` : "}";
51157
51157
  const lengths = Object.assign(getWLengths(Point3.Fp, Fn), { seed: getMinHashLength3(Fn.ORDER) });
51158
51158
  function isValidSecretKey(secretKey) {
51159
51159
  try {
51160
- const num4 = Fn.fromBytes(secretKey);
51161
- return Fn.isValidNot0(num4);
51160
+ const num2 = Fn.fromBytes(secretKey);
51161
+ return Fn.isValidNot0(num2);
51162
51162
  } catch (error2) {
51163
51163
  return false;
51164
51164
  }
@@ -51234,10 +51234,10 @@ ${indent}}` : "}";
51234
51234
  const HALF = CURVE_ORDER3 >> _1n15;
51235
51235
  return number3 > HALF;
51236
51236
  }
51237
- function validateRS(title, num4) {
51238
- if (!Fn.isValidNot0(num4))
51237
+ function validateRS(title, num2) {
51238
+ if (!Fn.isValidNot0(num2))
51239
51239
  throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`);
51240
- return num4;
51240
+ return num2;
51241
51241
  }
51242
51242
  function assertSmallCofactor() {
51243
51243
  if (hasLargeCofactor)
@@ -51335,17 +51335,17 @@ ${indent}}` : "}";
51335
51335
  const bits2int3 = ecdsaOpts.bits2int || function bits2int_def(bytes3) {
51336
51336
  if (bytes3.length > 8192)
51337
51337
  throw new Error("input is too large");
51338
- const num4 = bytesToNumberBE3(bytes3);
51338
+ const num2 = bytesToNumberBE3(bytes3);
51339
51339
  const delta = bytes3.length * 8 - fnBits;
51340
- return delta > 0 ? num4 >> BigInt(delta) : num4;
51340
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
51341
51341
  };
51342
51342
  const bits2int_modN = ecdsaOpts.bits2int_modN || function bits2int_modN_def(bytes3) {
51343
51343
  return Fn.create(bits2int3(bytes3));
51344
51344
  };
51345
51345
  const ORDER_MASK = bitMask3(fnBits);
51346
- function int2octets(num4) {
51347
- aInRange("num < 2^" + fnBits, num4, _0n15, ORDER_MASK);
51348
- return Fn.toBytes(num4);
51346
+ function int2octets(num2) {
51347
+ aInRange("num < 2^" + fnBits, num2, _0n15, ORDER_MASK);
51348
+ return Fn.toBytes(num2);
51349
51349
  }
51350
51350
  function validateMsgAndHash(message, prehash) {
51351
51351
  abytes3(message, void 0, "message");
@@ -51712,8 +51712,8 @@ ${indent}}` : "}";
51712
51712
  while (bytes3[0] === 0)
51713
51713
  bytes3 = bytes3.subarray(1);
51714
51714
  const delta = bytes3.length * 8 - nBitLength2;
51715
- const num4 = bytesToNumberBE3(bytes3);
51716
- return delta > 0 ? num4 >> BigInt(delta) : num4;
51715
+ const num2 = bytesToNumberBE3(bytes3);
51716
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
51717
51717
  }
51718
51718
  function hex0xToBytes2(hex) {
51719
51719
  if (typeof hex === "string") {
@@ -53786,11 +53786,12 @@ ${indent}}` : "}";
53786
53786
  return rewards.sort((a, b) => b.endDate.getTime() - a.endDate.getTime());
53787
53787
  }
53788
53788
  };
53789
+ var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
53789
53790
  var VesuHarvests = class _VesuHarvests extends Harvests {
53790
53791
  async getHarvests(addr) {
53791
53792
  const result = await fetch(`https://api.vesu.xyz/users/${addr.address}/strk-rewards/calldata`);
53792
53793
  const data = await result.json();
53793
- const rewardsContract = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
53794
+ const rewardsContract = VESU_REWARDS_CONTRACT;
53794
53795
  const cls = await this.config.provider.getClassAt(rewardsContract.address);
53795
53796
  const contract = new Contract(cls.abi, rewardsContract.address, this.config.provider);
53796
53797
  const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
@@ -65440,8 +65441,8 @@ ${indent}}` : "}";
65440
65441
  upperTick: _EkuboCLVault.i129ToNumber(result.bounds.upper)
65441
65442
  };
65442
65443
  }
65443
- static div2Power128(num4) {
65444
- return Number(BigInt(num4.toString()) * BigInt(1e18) / BigInt(2 ** 128)) / 1e18;
65444
+ static div2Power128(num2) {
65445
+ return Number(BigInt(num2.toString()) * BigInt(1e18) / BigInt(2 ** 128)) / 1e18;
65445
65446
  }
65446
65447
  static priceToTick(price, isRoundDown, tickSpacing) {
65447
65448
  const value = isRoundDown ? Math.floor(Math.log(price) / Math.log(1.000001)) : Math.ceil(Math.log(price) / Math.log(1.000001));
@@ -68369,7 +68370,9 @@ ${indent}}` : "}";
68369
68370
  ];
68370
68371
 
68371
68372
  // src/strategies/universal-adapters/adapter-utils.ts
68372
- var SIMPLE_SANITIZER = ContractAddr.from("0x3798dc4f83fdfad199e5236e3656cf2fb79bc50c00504d0dd41522e0f042072");
68373
+ var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
68374
+ var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
68375
+ var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
68373
68376
  function toBigInt3(value) {
68374
68377
  if (typeof value === "string") {
68375
68378
  return BigInt(value);
@@ -68512,6 +68515,66 @@ ${indent}}` : "}";
68512
68515
  };
68513
68516
  };
68514
68517
  }
68518
+ getAvnuAdapter(fromToken, toToken, id) {
68519
+ return () => ({
68520
+ leaf: this.constructSimpleLeafData({
68521
+ id,
68522
+ target: AVNU_MIDDLEWARE,
68523
+ method: "multi_route_swap",
68524
+ packedArguments: [
68525
+ fromToken.toBigInt(),
68526
+ toToken.toBigInt(),
68527
+ this.config.vaultAllocator.toBigInt()
68528
+ ]
68529
+ }),
68530
+ callConstructor: this.getAvnuCall(fromToken, toToken).bind(this)
68531
+ });
68532
+ }
68533
+ getAvnuCall(fromToken, toToken) {
68534
+ return (params) => {
68535
+ return {
68536
+ sanitizer: SIMPLE_SANITIZER,
68537
+ call: {
68538
+ contractAddress: AVNU_MIDDLEWARE,
68539
+ selector: hash_exports.getSelectorFromName("multi_route_swap"),
68540
+ calldata: [
68541
+ fromToken.toBigInt(),
68542
+ // sell_token_address
68543
+ toBigInt3(params.props.token_from_amount.low.toString()),
68544
+ // sell_token_amount low
68545
+ toBigInt3(params.props.token_from_amount.high.toString()),
68546
+ // sell_token_amount high
68547
+ toToken.toBigInt(),
68548
+ // buy_token_address
68549
+ toBigInt3(params.props.token_to_amount.low.toString()),
68550
+ // buy_token_amount low
68551
+ toBigInt3(params.props.token_to_amount.high.toString()),
68552
+ // buy_token_amount high
68553
+ toBigInt3(params.props.token_to_min_amount.low.toString()),
68554
+ // buy_token_min_amount low
68555
+ toBigInt3(params.props.token_to_min_amount.high.toString()),
68556
+ // buy_token_min_amount high
68557
+ this.config.vaultAllocator.toBigInt(),
68558
+ // beneficiary
68559
+ toBigInt3(0),
68560
+ // integrator_fee_amount_bps
68561
+ this.config.vaultAllocator.toBigInt(),
68562
+ // integrator_fee_recipient
68563
+ // unpack routes
68564
+ BigInt(params.props.routes.length),
68565
+ ...params.props.routes.map((r) => [
68566
+ BigInt(num_exports.hexToDecimalString(r.token_from)),
68567
+ BigInt(num_exports.hexToDecimalString(r.token_to)),
68568
+ BigInt(num_exports.hexToDecimalString(r.exchange_address)),
68569
+ BigInt(r.percent),
68570
+ BigInt(r.additional_swap_params.length),
68571
+ ...r.additional_swap_params.map((p) => BigInt(num_exports.hexToDecimalString(p)))
68572
+ ]).flat()
68573
+ ]
68574
+ }
68575
+ };
68576
+ };
68577
+ }
68515
68578
  };
68516
68579
 
68517
68580
  // src/data/vesu-singleton.abi.json
@@ -70845,6 +70908,40 @@ ${indent}}` : "}";
70845
70908
  }
70846
70909
  };
70847
70910
  };
70911
+ this.getDefispringRewardsAdapter = (id) => {
70912
+ return () => {
70913
+ const packedArguments = [];
70914
+ const output3 = {
70915
+ id: BigInt(num_exports.getDecimalString(shortString_exports.encodeShortString(id))),
70916
+ readableId: id,
70917
+ data: [
70918
+ SIMPLE_SANITIZER.toBigInt(),
70919
+ // sanitizer address
70920
+ VESU_REWARDS_CONTRACT.toBigInt(),
70921
+ // contract
70922
+ toBigInt3(hash_exports.getSelectorFromName("claim")),
70923
+ // method name
70924
+ BigInt(packedArguments.length),
70925
+ ...packedArguments
70926
+ ]
70927
+ };
70928
+ return { leaf: output3, callConstructor: this.getDefiSpringClaimCall().bind(this) };
70929
+ };
70930
+ };
70931
+ this.getDefiSpringClaimCall = () => {
70932
+ return (params) => ({
70933
+ sanitizer: SIMPLE_SANITIZER,
70934
+ call: {
70935
+ contractAddress: VESU_REWARDS_CONTRACT,
70936
+ selector: hash_exports.getSelectorFromName("claim"),
70937
+ calldata: [
70938
+ BigInt(params.amount.toWei()),
70939
+ BigInt(params.proofs.length),
70940
+ ...params.proofs.map((proof) => BigInt(num_exports.hexToDecimalString(proof)))
70941
+ ]
70942
+ }
70943
+ });
70944
+ };
70848
70945
  this.config = config2;
70849
70946
  }
70850
70947
  static getDefaultModifyPositionCallParams(params) {
@@ -73471,7 +73568,7 @@ ${indent}}` : "}";
73471
73568
  const aumToken = vesuAum.plus(balance.amount);
73472
73569
  logger.verbose(`${this.getTag()} Actual AUM: ${aumToken}`);
73473
73570
  const netAPY = await this.netAPY();
73474
- const defispringAPY = netAPY.splits.find((s) => s.id === "defispring")?.apy || 0;
73571
+ const defispringAPY = (netAPY.splits.find((s) => s.id === "defispring")?.apy || 0) * 0.8;
73475
73572
  if (!defispringAPY) throw new Error("DefiSpring APY not found");
73476
73573
  const timeDiff = Math.round(Date.now() / 1e3) - Number(lastReportTime);
73477
73574
  const growthRate = timeDiff * defispringAPY / (365 * 24 * 60 * 60);
@@ -73714,6 +73811,51 @@ ${indent}}` : "}";
73714
73811
  const manageCall = this.getManageCall(["approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */, "bring_liquidity" /* BRING_LIQUIDITY */], [manageCall1, manageCall2]);
73715
73812
  return manageCall;
73716
73813
  }
73814
+ async getHarvestCall() {
73815
+ const vesuHarvest = new VesuHarvests(this.config);
73816
+ const harvestInfo = await vesuHarvest.getUnHarvestedRewards(this.metadata.additionalInfo.vaultAllocator);
73817
+ if (harvestInfo.length != 1) {
73818
+ throw new Error(`Expected 1 harvest info, got ${harvestInfo.length}`);
73819
+ }
73820
+ const amount = harvestInfo[0].claim.amount;
73821
+ const actualReward = harvestInfo[0].actualReward;
73822
+ const proofs = harvestInfo[0].proof;
73823
+ if (actualReward.isZero()) {
73824
+ throw new Error(`Expected non-zero actual reward, got ${harvestInfo[0].actualReward}`);
73825
+ }
73826
+ const manage1Info = this.getProofs("defispring_rewards" /* DEFISPRING_REWARDS */);
73827
+ const manageCall1 = manage1Info.callConstructor({
73828
+ amount,
73829
+ proofs
73830
+ });
73831
+ const proofIds = ["defispring_rewards" /* DEFISPRING_REWARDS */];
73832
+ const manageCalls = [manageCall1];
73833
+ const STRK2 = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
73834
+ if (this.asset().symbol != "STRK") {
73835
+ const manage2Info = this.getProofs("approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */);
73836
+ const manageCall2 = manage2Info.callConstructor({
73837
+ amount: actualReward
73838
+ });
73839
+ const avnuModule = new AvnuWrapper();
73840
+ const quote = await avnuModule.getQuotes(
73841
+ STRK2.address.address,
73842
+ this.asset().address.address,
73843
+ actualReward.toWei(),
73844
+ this.address.address
73845
+ );
73846
+ const swapInfo = await avnuModule.getSwapInfo(quote, this.address.address, 0, this.address.address);
73847
+ const manage3Info = this.getProofs("avnu_swap_rewards" /* AVNU_SWAP_REWARDS */);
73848
+ const manageCall3 = manage3Info.callConstructor({
73849
+ props: swapInfo
73850
+ });
73851
+ proofIds.push("approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */);
73852
+ proofIds.push("avnu_swap_rewards" /* AVNU_SWAP_REWARDS */);
73853
+ manageCalls.push(manageCall2);
73854
+ manageCalls.push(manageCall3);
73855
+ }
73856
+ const manageCall = this.getManageCall(proofIds, manageCalls);
73857
+ return { call: manageCall, reward: actualReward, tokenInfo: STRK2 };
73858
+ }
73717
73859
  async getRebalanceCall(params) {
73718
73860
  let callSet1 = this.getVesuModifyPositionCalls({
73719
73861
  isLeg1: true,
@@ -73750,6 +73892,9 @@ ${indent}}` : "}";
73750
73892
  UNIVERSAL_MANAGE_IDS2["APPROVE_TOKEN2"] = "approve_token2";
73751
73893
  UNIVERSAL_MANAGE_IDS2["APPROVE_BRING_LIQUIDITY"] = "approve_bring_liquidity";
73752
73894
  UNIVERSAL_MANAGE_IDS2["BRING_LIQUIDITY"] = "bring_liquidity";
73895
+ UNIVERSAL_MANAGE_IDS2["DEFISPRING_REWARDS"] = "defispring_rewards";
73896
+ UNIVERSAL_MANAGE_IDS2["APPROVE_SWAP_TOKEN1"] = "approve_swap_token1";
73897
+ UNIVERSAL_MANAGE_IDS2["AVNU_SWAP_REWARDS"] = "avnu_swap_rewards";
73753
73898
  return UNIVERSAL_MANAGE_IDS2;
73754
73899
  })(UNIVERSAL_MANAGE_IDS || {});
73755
73900
  var UNIVERSAL_ADAPTERS = /* @__PURE__ */ ((UNIVERSAL_ADAPTERS2) => {
@@ -73799,6 +73944,10 @@ ${indent}}` : "}";
73799
73944
  vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(ETHToken.address, vesuAdapterETHUSDC.VESU_SINGLETON, "approve_token2" /* APPROVE_TOKEN2 */).bind(commonAdapter));
73800
73945
  vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(USDCToken.address, vaultSettings.vaultAddress, "approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */).bind(commonAdapter));
73801
73946
  vaultSettings.leafAdapters.push(commonAdapter.getBringLiquidityAdapter("bring_liquidity" /* BRING_LIQUIDITY */).bind(commonAdapter));
73947
+ vaultSettings.leafAdapters.push(vesuAdapterUSDCETH.getDefispringRewardsAdapter("defispring_rewards" /* DEFISPRING_REWARDS */).bind(vesuAdapterUSDCETH));
73948
+ const STRKToken = Global.getDefaultTokens().find((token) => token.symbol === "STRK");
73949
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(STRKToken.address, AVNU_MIDDLEWARE, "approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */).bind(commonAdapter));
73950
+ vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, USDCToken.address, "avnu_swap_rewards" /* AVNU_SWAP_REWARDS */).bind(commonAdapter));
73802
73951
  return vaultSettings;
73803
73952
  }
73804
73953
  var _riskFactor4 = [