@ethereansos/interfaces-core 0.4.88 → 0.4.92

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.cjs.js CHANGED
@@ -7525,14 +7525,9 @@ function ownKeys(object, enumerableOnly) {
7525
7525
 
7526
7526
  if (Object.getOwnPropertySymbols) {
7527
7527
  var symbols = Object.getOwnPropertySymbols(object);
7528
-
7529
- if (enumerableOnly) {
7530
- symbols = symbols.filter(function (sym) {
7531
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
7532
- });
7533
- }
7534
-
7535
- keys.push.apply(keys, symbols);
7528
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
7529
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
7530
+ })), keys.push.apply(keys, symbols);
7536
7531
  }
7537
7532
 
7538
7533
  return keys;
@@ -7540,19 +7535,12 @@ function ownKeys(object, enumerableOnly) {
7540
7535
 
7541
7536
  function _objectSpread2(target) {
7542
7537
  for (var i = 1; i < arguments.length; i++) {
7543
- var source = arguments[i] != null ? arguments[i] : {};
7544
-
7545
- if (i % 2) {
7546
- ownKeys(Object(source), true).forEach(function (key) {
7547
- _defineProperty(target, key, source[key]);
7548
- });
7549
- } else if (Object.getOwnPropertyDescriptors) {
7550
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7551
- } else {
7552
- ownKeys(Object(source)).forEach(function (key) {
7553
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7554
- });
7555
- }
7538
+ var source = null != arguments[i] ? arguments[i] : {};
7539
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
7540
+ _defineProperty(target, key, source[key]);
7541
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
7542
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7543
+ });
7556
7544
  }
7557
7545
 
7558
7546
  return target;
@@ -7561,17 +7549,11 @@ function _objectSpread2(target) {
7561
7549
  function _typeof(obj) {
7562
7550
  "@babel/helpers - typeof";
7563
7551
 
7564
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
7565
- _typeof = function (obj) {
7566
- return typeof obj;
7567
- };
7568
- } else {
7569
- _typeof = function (obj) {
7570
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
7571
- };
7572
- }
7573
-
7574
- return _typeof(obj);
7552
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
7553
+ return typeof obj;
7554
+ } : function (obj) {
7555
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
7556
+ }, _typeof(obj);
7575
7557
  }
7576
7558
 
7577
7559
  function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
@@ -7629,6 +7611,9 @@ function _defineProperties$2(target, props) {
7629
7611
  function _createClass$2(Constructor, protoProps, staticProps) {
7630
7612
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
7631
7613
  if (staticProps) _defineProperties$2(Constructor, staticProps);
7614
+ Object.defineProperty(Constructor, "prototype", {
7615
+ writable: false
7616
+ });
7632
7617
  return Constructor;
7633
7618
  }
7634
7619
 
@@ -7659,6 +7644,9 @@ function _inherits(subClass, superClass) {
7659
7644
  configurable: true
7660
7645
  }
7661
7646
  });
7647
+ Object.defineProperty(subClass, "prototype", {
7648
+ writable: false
7649
+ });
7662
7650
  if (superClass) _setPrototypeOf(subClass, superClass);
7663
7651
  }
7664
7652
 
@@ -32323,35 +32311,24 @@ function sendBlockchainTransaction(provider, fromOrPlainPrivateKey, to, data, va
32323
32311
 
32324
32312
  case 2:
32325
32313
  receipt = _context.sent;
32326
- _context.t0 = !receipt || !receipt.blockNumber;
32327
32314
 
32328
- if (_context.t0) {
32329
- _context.next = 12;
32330
- break;
32331
- }
32332
-
32333
- _context.t1 = parseInt;
32334
- _context.next = 8;
32335
- return sendAsync(provider, 'eth_getBlockByNumber', 'latest', false);
32336
-
32337
- case 8:
32338
- _context.t2 = _context.sent.number;
32339
- _context.t3 = (0, _context.t1)(_context.t2);
32340
- _context.t4 = parseInt(receipt.blockNumber);
32341
- _context.t0 = _context.t3 <= _context.t4;
32342
-
32343
- case 12:
32344
- if (!_context.t0) {
32345
- _context.next = 14;
32315
+ if (!(!receipt || !receipt.blockNumber
32316
+ /* ||
32317
+ parseInt(
32318
+ (await sendAsync(provider, 'eth_getBlockByNumber', 'latest', false))
32319
+ .number
32320
+ ) <= parseInt(receipt.blockNumber)*/
32321
+ )) {
32322
+ _context.next = 5;
32346
32323
  break;
32347
32324
  }
32348
32325
 
32349
32326
  return _context.abrupt("return", setTimeout(timeout, 3000));
32350
32327
 
32351
- case 14:
32328
+ case 5:
32352
32329
  return _context.abrupt("return", ok(receipt));
32353
32330
 
32354
- case 15:
32331
+ case 6:
32355
32332
  case "end":
32356
32333
  return _context.stop();
32357
32334
  }
@@ -34709,7 +34686,7 @@ var symbols = {
34709
34686
  */
34710
34687
 
34711
34688
  function toEthereumSymbol(decimals) {
34712
- var d = '1' + new Array(decimals + 1).join('0');
34689
+ var d = '1' + new Array(parseInt(decimals) + 1).join('0');
34713
34690
  return (Object.entries(symbols).find(function (_ref) {
34714
34691
  var _ref2 = _slicedToArray(_ref, 2);
34715
34692
  _ref2[0];
@@ -44773,6 +44750,7 @@ var POOL_INIT_CODE_HASH = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea8932
44773
44750
  exports.FeeAmount = void 0;
44774
44751
 
44775
44752
  (function (FeeAmount) {
44753
+ FeeAmount[FeeAmount["LOWEST"] = 100] = "LOWEST";
44776
44754
  FeeAmount[FeeAmount["LOW"] = 500] = "LOW";
44777
44755
  FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
44778
44756
  FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH";
@@ -44782,7 +44760,7 @@ exports.FeeAmount = void 0;
44782
44760
  */
44783
44761
 
44784
44762
 
44785
- var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[exports.FeeAmount.LOW] = 10, _TICK_SPACINGS[exports.FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[exports.FeeAmount.HIGH] = 200, _TICK_SPACINGS);
44763
+ var TICK_SPACINGS = (_TICK_SPACINGS = {}, _TICK_SPACINGS[exports.FeeAmount.LOWEST] = 1, _TICK_SPACINGS[exports.FeeAmount.LOW] = 10, _TICK_SPACINGS[exports.FeeAmount.MEDIUM] = 60, _TICK_SPACINGS[exports.FeeAmount.HIGH] = 200, _TICK_SPACINGS);
44786
44764
 
44787
44765
  var NEGATIVE_ONE = /*#__PURE__*/JSBI.BigInt(-1);
44788
44766
  var ZERO = /*#__PURE__*/JSBI.BigInt(0);
@@ -45313,7 +45291,7 @@ var TickList = /*#__PURE__*/function () {
45313
45291
  } else {
45314
45292
  var _wordPos = compressed + 1 >> 8;
45315
45293
 
45316
- var maximum = (_wordPos + 1 << 8) * tickSpacing - 1;
45294
+ var maximum = ((_wordPos + 1 << 8) - 1) * tickSpacing;
45317
45295
 
45318
45296
  if (this.isAtOrAboveLargest(ticks, tick)) {
45319
45297
  return [maximum, false];
@@ -45508,6 +45486,23 @@ function nearestUsableTick(tick, tickSpacing) {
45508
45486
  if (rounded < TickMath.MIN_TICK) return rounded + tickSpacing;else if (rounded > TickMath.MAX_TICK) return rounded - tickSpacing;else return rounded;
45509
45487
  }
45510
45488
 
45489
+ var Q128 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(128));
45490
+ var PositionLibrary = /*#__PURE__*/function () {
45491
+ /**
45492
+ * Cannot be constructed.
45493
+ */
45494
+ function PositionLibrary() {} // replicates the portions of Position#update required to compute unaccounted fees
45495
+
45496
+
45497
+ PositionLibrary.getTokensOwed = function getTokensOwed(feeGrowthInside0LastX128, feeGrowthInside1LastX128, liquidity, feeGrowthInside0X128, feeGrowthInside1X128) {
45498
+ var tokensOwed0 = JSBI.divide(JSBI.multiply(subIn256(feeGrowthInside0X128, feeGrowthInside0LastX128), liquidity), Q128);
45499
+ var tokensOwed1 = JSBI.divide(JSBI.multiply(subIn256(feeGrowthInside1X128, feeGrowthInside1LastX128), liquidity), Q128);
45500
+ return [tokensOwed0, tokensOwed1];
45501
+ };
45502
+
45503
+ return PositionLibrary;
45504
+ }();
45505
+
45511
45506
  /**
45512
45507
  * Returns a price object corresponding to the input tick and the base/quote token
45513
45508
  * Inputs must be tokens because the address order is used to interpret the price represented by the tick
@@ -45546,6 +45541,51 @@ function priceToClosestTick(price) {
45546
45541
  return tick;
45547
45542
  }
45548
45543
 
45544
+ var Q256 = /*#__PURE__*/JSBI.exponentiate( /*#__PURE__*/JSBI.BigInt(2), /*#__PURE__*/JSBI.BigInt(256));
45545
+ function subIn256(x, y) {
45546
+ var difference = JSBI.subtract(x, y);
45547
+
45548
+ if (JSBI.lessThan(difference, ZERO)) {
45549
+ return JSBI.add(Q256, difference);
45550
+ } else {
45551
+ return difference;
45552
+ }
45553
+ }
45554
+ var TickLibrary = /*#__PURE__*/function () {
45555
+ /**
45556
+ * Cannot be constructed.
45557
+ */
45558
+ function TickLibrary() {}
45559
+
45560
+ TickLibrary.getFeeGrowthInside = function getFeeGrowthInside(feeGrowthOutsideLower, feeGrowthOutsideUpper, tickLower, tickUpper, tickCurrent, feeGrowthGlobal0X128, feeGrowthGlobal1X128) {
45561
+ var feeGrowthBelow0X128;
45562
+ var feeGrowthBelow1X128;
45563
+
45564
+ if (tickCurrent >= tickLower) {
45565
+ feeGrowthBelow0X128 = feeGrowthOutsideLower.feeGrowthOutside0X128;
45566
+ feeGrowthBelow1X128 = feeGrowthOutsideLower.feeGrowthOutside1X128;
45567
+ } else {
45568
+ feeGrowthBelow0X128 = subIn256(feeGrowthGlobal0X128, feeGrowthOutsideLower.feeGrowthOutside0X128);
45569
+ feeGrowthBelow1X128 = subIn256(feeGrowthGlobal1X128, feeGrowthOutsideLower.feeGrowthOutside1X128);
45570
+ }
45571
+
45572
+ var feeGrowthAbove0X128;
45573
+ var feeGrowthAbove1X128;
45574
+
45575
+ if (tickCurrent < tickUpper) {
45576
+ feeGrowthAbove0X128 = feeGrowthOutsideUpper.feeGrowthOutside0X128;
45577
+ feeGrowthAbove1X128 = feeGrowthOutsideUpper.feeGrowthOutside1X128;
45578
+ } else {
45579
+ feeGrowthAbove0X128 = subIn256(feeGrowthGlobal0X128, feeGrowthOutsideUpper.feeGrowthOutside0X128);
45580
+ feeGrowthAbove1X128 = subIn256(feeGrowthGlobal1X128, feeGrowthOutsideUpper.feeGrowthOutside1X128);
45581
+ }
45582
+
45583
+ return [subIn256(subIn256(feeGrowthGlobal0X128, feeGrowthBelow0X128), feeGrowthAbove0X128), subIn256(subIn256(feeGrowthGlobal1X128, feeGrowthBelow1X128), feeGrowthAbove1X128)];
45584
+ };
45585
+
45586
+ return TickLibrary;
45587
+ }();
45588
+
45549
45589
  var Tick = function Tick(_ref) {
45550
45590
  var index = _ref.index,
45551
45591
  liquidityGross = _ref.liquidityGross,
@@ -49158,15 +49198,18 @@ exports.Percent = Percent;
49158
49198
  exports.PluginsContextProvider = PluginsContextProvider;
49159
49199
  exports.Pool = Pool;
49160
49200
  exports.Position = Position;
49201
+ exports.PositionLibrary = PositionLibrary;
49161
49202
  exports.Price = Price;
49162
49203
  exports.Route = Route;
49163
49204
  exports.SelfPermit = SelfPermit;
49164
49205
  exports.SqrtPriceMath = SqrtPriceMath;
49165
49206
  exports.Staker = Staker;
49207
+ exports.SwapMath = SwapMath;
49166
49208
  exports.SwapQuoter = SwapQuoter;
49167
49209
  exports.SwapRouter = SwapRouter;
49168
49210
  exports.TICK_SPACINGS = TICK_SPACINGS;
49169
49211
  exports.Tick = Tick;
49212
+ exports.TickLibrary = TickLibrary;
49170
49213
  exports.TickList = TickList;
49171
49214
  exports.TickListDataProvider = TickListDataProvider;
49172
49215
  exports.TickMath = TickMath;
@@ -49244,6 +49287,7 @@ exports.split = split;
49244
49287
  exports.sqrt = sqrt;
49245
49288
  exports.stringToLines = toLines;
49246
49289
  exports.sub = sub;
49290
+ exports.subIn256 = subIn256;
49247
49291
  exports.swap = swap;
49248
49292
  exports.tickToPrice = tickToPrice;
49249
49293
  exports.toDecimals = toDecimals;