@aurigami/sdk 1.9.0 → 1.9.1
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/sdk.cjs.development.js +22 -12
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +22 -12
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/helpers.ts +1 -1
- package/src/helpers/priceFetcher.ts +5 -1
|
@@ -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
|
-
|
|
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.
|
|
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 =
|
|
1985
|
-
_context5.next =
|
|
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
|
|
2001
|
+
case 21:
|
|
1992
2002
|
return _context5.abrupt("return", _context5.sent);
|
|
1993
2003
|
|
|
1994
|
-
case
|
|
1995
|
-
_context5.prev =
|
|
1996
|
-
_context5.t1 = _context5["catch"](
|
|
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
|
|
2010
|
+
case 28:
|
|
2001
2011
|
case "end":
|
|
2002
2012
|
return _context5.stop();
|
|
2003
2013
|
}
|
|
2004
2014
|
}
|
|
2005
|
-
}, _callee5, null, [[6,
|
|
2015
|
+
}, _callee5, null, [[6, 15], [18, 24]]);
|
|
2006
2016
|
}));
|
|
2007
2017
|
return _fetchLPPrice.apply(this, arguments);
|
|
2008
2018
|
}
|