@proton/wrap-constants 0.2.12 → 0.2.14

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.
@@ -1474,6 +1474,13 @@ var getDepthParser = /*#__PURE__*/z.object({
1474
1474
  return n <= 250;
1475
1475
  }, 'Max limit is 250')
1476
1476
  });
1477
+ var dailyParser = /*#__PURE__*/z.object({
1478
+ market_id: /*#__PURE__*/z.number(),
1479
+ first: /*#__PURE__*/z.number(),
1480
+ last: /*#__PURE__*/z.number(),
1481
+ bid: /*#__PURE__*/z.number(),
1482
+ ask: /*#__PURE__*/z.number()
1483
+ });
1477
1484
  var tradeParser = /*#__PURE__*/z.object({
1478
1485
  block_num: /*#__PURE__*/z.number(),
1479
1486
  block_time: /*#__PURE__*/z.string(),
@@ -1762,12 +1769,12 @@ var Graph = /*#__PURE__*/function () {
1762
1769
 
1763
1770
  var compute_transfer = function compute_transfer(pool1, pool2, swap, exchange_fee, precision) {
1764
1771
  var term1 = pool2;
1765
- var term2over = pool1.multipliedBy(pool2);
1772
+ var term2over = pool1.times(pool2);
1766
1773
  var term2under = pool1.plus(swap);
1767
- var term2 = term2over.dividedBy(term2under).integerValue(BigNumber.ROUND_DOWN);
1774
+ var term2 = term2over.div(term2under).integerValue(BigNumber.ROUND_DOWN);
1768
1775
  var term = term1.minus(term2);
1769
- var fee = new BigNumber(exchange_fee).dividedBy(FEE_FACTOR);
1770
- var result = term.minus(term.multipliedBy(fee));
1776
+ var fee = new BigNumber(exchange_fee).div(FEE_FACTOR);
1777
+ var result = term.minus(term.times(fee));
1771
1778
  return result.integerValue(BigNumber.ROUND_DOWN).shiftedBy(-precision);
1772
1779
  };
1773
1780
  var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve_out, amount_in, exchange_fee, precision, amplifier) {
@@ -1800,7 +1807,7 @@ var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve
1800
1807
 
1801
1808
  while (x != x_prev && i--) {
1802
1809
  x_prev = F(x);
1803
- x = +new BigNumber(x * x + c).dividedBy(2 * x + b).toFixed(0, BigNumber.ROUND_DOWN);
1810
+ x = +new BigNumber(x * x + c).div(2 * x + b).toFixed(0, BigNumber.ROUND_DOWN);
1804
1811
  }
1805
1812
 
1806
1813
  if (reserve_out <= x) {
@@ -1811,15 +1818,15 @@ var compute_transfer_curve = function compute_transfer_curve(reserve_in, reserve
1811
1818
  var amount_out_with_fee = new BigNumber(reserve_out - x); // Fee + 1
1812
1819
  // +1 covers small precision issues
1813
1820
 
1814
- var fee = amount_out_with_fee.multipliedBy(exchange_fee).dividedBy(FEE_FACTOR).plus(1).toFixed(0, BigNumber.ROUND_DOWN); // Amount out
1821
+ var fee = amount_out_with_fee.times(exchange_fee).div(FEE_FACTOR).plus(1).toFixed(0, BigNumber.ROUND_DOWN); // Amount out
1815
1822
 
1816
1823
  var amount_out = amount_out_with_fee.minus(fee);
1817
1824
  return amount_out.integerValue(BigNumber.ROUND_DOWN).shiftedBy(-precision);
1818
1825
  };
1819
1826
  var compute_liquidity = function compute_liquidity(amount_lt, pool, lt_supply, precision) {
1820
- var over = amount_lt.multipliedBy(pool);
1827
+ var over = amount_lt.times(pool);
1821
1828
  var under = lt_supply;
1822
- var result = over.dividedBy(under).integerValue(BigNumber.ROUND_DOWN);
1829
+ var result = over.div(under).integerValue(BigNumber.ROUND_DOWN);
1823
1830
  return +result.shiftedBy(-precision).toFixed(precision, BigNumber.ROUND_DOWN);
1824
1831
  };
1825
1832
  var isInputInvalid = function isInputInvalid(data, value, pool) {
@@ -1843,5 +1850,5 @@ var applyDiscountToFee = function applyDiscountToFee(fee, staked) {
1843
1850
  }
1844
1851
  };
1845
1852
 
1846
- export { Chains, ExtendedAssetParser, FEE_FACTOR, Graph, ILink, INode, ITopics, Networks, Providers, Status, TOPICS, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDepthParser, getOhlcvParser, getOrderHistoryParser, getTradesParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, logStatus, median, ohlcvParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, similarChains, singleActionTransactionParser, syncParser, tradeParser, transactionParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
1853
+ export { Chains, ExtendedAssetParser, FEE_FACTOR, Graph, ILink, INode, ITopics, Networks, Providers, Status, TOPICS, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, accountParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, dailyParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDepthParser, getOhlcvParser, getOrderHistoryParser, getTradesParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, logStatus, median, ohlcvParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, similarChains, singleActionTransactionParser, syncParser, tradeParser, transactionParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
1847
1854
  //# sourceMappingURL=wrap-constants.esm.js.map