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