@aurigami/sdk 1.9.0 → 1.9.2

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.
@@ -1618,7 +1618,7 @@ function devLog(message) {
1618
1618
  optionalParams[_key - 1] = arguments[_key];
1619
1619
  }
1620
1620
 
1621
- (_console = console).log.apply(_console, [message].concat(optionalParams));
1621
+ (_console = console).log.apply(_console, ['[DEV LOG]', message].concat(optionalParams));
1622
1622
  }
1623
1623
  }
1624
1624
 
@@ -1916,7 +1916,7 @@ function fetchLPPrice(_x5, _x6) {
1916
1916
 
1917
1917
  function _fetchLPPrice() {
1918
1918
  _fetchLPPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(address, provider) {
1919
- var LPInfo, LPDecimal, fetchLPPriceBy, _fetchLPPriceBy;
1919
+ var LPInfo, LPDecimal, fetchLPPriceBy, _fetchLPPriceBy, lpPrice;
1920
1920
 
1921
1921
  return runtime_1.wrap(function _callee5$(_context5) {
1922
1922
  while (1) {
@@ -1975,34 +1975,44 @@ function _fetchLPPrice() {
1975
1975
  });
1976
1976
 
1977
1977
  case 9:
1978
- return _context5.abrupt("return", _context5.sent);
1978
+ lpPrice = _context5.sent;
1979
+
1980
+ if (!lpPrice.isZero()) {
1981
+ _context5.next = 12;
1982
+ break;
1983
+ }
1984
+
1985
+ throw Error("Price is zero");
1979
1986
 
1980
1987
  case 12:
1981
- _context5.prev = 12;
1988
+ return _context5.abrupt("return", lpPrice);
1989
+
1990
+ case 15:
1991
+ _context5.prev = 15;
1982
1992
  _context5.t0 = _context5["catch"](6);
1983
1993
  devLog("fetchLPPriceBy " + LPInfo.token0 + " failed", _context5.t0);
1984
- _context5.prev = 15;
1985
- _context5.next = 18;
1994
+ _context5.prev = 18;
1995
+ _context5.next = 21;
1986
1996
  return fetchLPPriceBy({
1987
1997
  address: LPInfo.token1,
1988
1998
  reserve: LPInfo.reserve1
1989
1999
  });
1990
2000
 
1991
- case 18:
2001
+ case 21:
1992
2002
  return _context5.abrupt("return", _context5.sent);
1993
2003
 
1994
- case 21:
1995
- _context5.prev = 21;
1996
- _context5.t1 = _context5["catch"](15);
2004
+ case 24:
2005
+ _context5.prev = 24;
2006
+ _context5.t1 = _context5["catch"](18);
1997
2007
  devLog("fetchLPPriceBy " + LPInfo.token1 + " failed", _context5.t1);
1998
2008
  throw Error("Unable to fetch price for both tokens of LP " + address);
1999
2009
 
2000
- case 25:
2010
+ case 28:
2001
2011
  case "end":
2002
2012
  return _context5.stop();
2003
2013
  }
2004
2014
  }
2005
- }, _callee5, null, [[6, 12], [15, 21]]);
2015
+ }, _callee5, null, [[6, 15], [18, 24]]);
2006
2016
  }));
2007
2017
  return _fetchLPPrice.apply(this, arguments);
2008
2018
  }
@@ -4390,11 +4400,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4390
4400
  returnTypes: ['uint256']
4391
4401
  };
4392
4402
  _context3.next = 4;
4393
- return multicallRead.aggregate([// Get total supply
4394
- _extends({}, baseBalanceOfCall, {
4395
- method: 'totalSupply',
4396
- args: []
4397
- }), // balance in team multisig
4403
+ return multicallRead.aggregate([// balance in team multisig
4398
4404
  _extends({}, baseBalanceOfCall, {
4399
4405
  args: [networkAddresses.misc.TEAM_MULTISIG]
4400
4406
  }), // balance in comptroller
@@ -4410,13 +4416,9 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4410
4416
 
4411
4417
  case 4:
4412
4418
  callResults = _context3.sent;
4413
- circulatingSupply = ethers.BigNumber.from(0);
4419
+ circulatingSupply = ethers.BigNumber.from('1' + '0'.repeat(10) + '0'.repeat(getDecimal(this.env.ply.address)));
4414
4420
  callResults.forEach(function (result, i) {
4415
- if (i === 0) {
4416
- circulatingSupply = result[0];
4417
- } else {
4418
- circulatingSupply = circulatingSupply.sub(result[0]);
4419
- }
4421
+ circulatingSupply = circulatingSupply.sub(result[0]);
4420
4422
  });
4421
4423
  return _context3.abrupt("return", new TokenAmount(PLYToken, circulatingSupply.toString()));
4422
4424