@aurigami/sdk 1.20.8 → 1.21.0
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/consts/constants.d.ts +2 -1
- package/dist/entities/auriEnv.d.ts +1 -1
- package/dist/sdk.cjs.development.js +13 -9
- 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 +13 -9
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/a.ts.log +29 -0
- package/src/consts/constants.ts +2 -1
- package/src/entities/auriEnv.ts +4 -4
- package/src/helpers/historicalPriceFetcher.ts +8 -1
- package/src/helpers/priceFetcher.ts +5 -5
- package/src/interactors/misc.ts +2 -5
package/dist/sdk.esm.js
CHANGED
|
@@ -106,7 +106,8 @@ var networkAddresses = {
|
|
|
106
106
|
}],
|
|
107
107
|
misc: {
|
|
108
108
|
COMPTROLLER: /*#__PURE__*/MAINNET_ADDRESSES.comptroller.toLowerCase(),
|
|
109
|
-
|
|
109
|
+
DEPRECATED_OLD_ORACLE: /*#__PURE__*/MAINNET_ADDRESSES.oracle.toLowerCase(),
|
|
110
|
+
PYTH_ORACLE: /*#__PURE__*/MAINNET_ADDRESSES.pythOracle.toLowerCase(),
|
|
110
111
|
AURIFAIRLAUNCH: /*#__PURE__*/MAINNET_ADDRESSES.fairLaunch.toLowerCase(),
|
|
111
112
|
AURILENS: /*#__PURE__*/MAINNET_ADDRESSES.auriLens.toLowerCase(),
|
|
112
113
|
ETHREPAYHELPER: /*#__PURE__*/MAINNET_ADDRESSES.ethRepayHelper.toLowerCase(),
|
|
@@ -1176,7 +1177,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
1176
1177
|
key: "oracle",
|
|
1177
1178
|
get: function get() {
|
|
1178
1179
|
if (!this._oracle) {
|
|
1179
|
-
this._oracle = this.getContract(networkAddresses.misc.
|
|
1180
|
+
this._oracle = this.getContract(networkAddresses.misc.PYTH_ORACLE, AuriOracleABI.abi);
|
|
1180
1181
|
}
|
|
1181
1182
|
return this._oracle;
|
|
1182
1183
|
}
|
|
@@ -1809,7 +1810,7 @@ function _fetchPriceFromOracle() {
|
|
|
1809
1810
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1810
1811
|
while (1) switch (_context12.prev = _context12.next) {
|
|
1811
1812
|
case 0:
|
|
1812
|
-
oracleContract = new Contract(networkAddresses.misc.
|
|
1813
|
+
oracleContract = new Contract(networkAddresses.misc.PYTH_ORACLE, AuriOracleABI.abi, provider);
|
|
1813
1814
|
_context12.next = 3;
|
|
1814
1815
|
return oracleContract.getUnderlyingPrice(auTokenAddress)["catch"](function (e) {
|
|
1815
1816
|
console.log("Unable to fetch price from oracle for " + auTokenAddress);
|
|
@@ -2303,22 +2304,25 @@ function fetchHistoricalPriceFromOracle(_x7, _x8, _x9, _x10) {
|
|
|
2303
2304
|
}
|
|
2304
2305
|
function _fetchHistoricalPriceFromOracle() {
|
|
2305
2306
|
_fetchHistoricalPriceFromOracle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(auTokenAddress, underlyingDecimal, provider, block) {
|
|
2306
|
-
var oracleContract, rawPrice;
|
|
2307
|
+
var oracleAddress, oracleContract, rawPrice;
|
|
2307
2308
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2308
2309
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2309
2310
|
case 0:
|
|
2310
|
-
|
|
2311
|
-
|
|
2311
|
+
// from this block, we switch to use pyth
|
|
2312
|
+
// TODO: add to consts
|
|
2313
|
+
oracleAddress = block < 102438637 ? networkAddresses.misc.DEPRECATED_OLD_ORACLE : networkAddresses.misc.PYTH_ORACLE;
|
|
2314
|
+
oracleContract = new Contract(oracleAddress, AuriOracleABI.abi, provider);
|
|
2315
|
+
_context4.next = 4;
|
|
2312
2316
|
return oracleContract.getUnderlyingPrice(auTokenAddress, {
|
|
2313
2317
|
blockTag: block
|
|
2314
2318
|
})["catch"](function (e) {
|
|
2315
2319
|
console.log("Unable to fetch price from oracle for " + auTokenAddress);
|
|
2316
2320
|
return BigNumber$1.from(0);
|
|
2317
2321
|
});
|
|
2318
|
-
case
|
|
2322
|
+
case 4:
|
|
2319
2323
|
rawPrice = _context4.sent;
|
|
2320
2324
|
return _context4.abrupt("return", processPriceFromOracle$1(rawPrice, underlyingDecimal));
|
|
2321
|
-
case
|
|
2325
|
+
case 6:
|
|
2322
2326
|
case "end":
|
|
2323
2327
|
return _context4.stop();
|
|
2324
2328
|
}
|
|
@@ -5337,7 +5341,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5337
5341
|
dust = /*#__PURE__*/new BigNumber(0.1);
|
|
5338
5342
|
}
|
|
5339
5343
|
_1E18 = BigNumber$1.from(10).pow(18);
|
|
5340
|
-
oracle = this.env.
|
|
5344
|
+
oracle = this.env.oracle;
|
|
5341
5345
|
tokens = tokenAddresses.map(function (addr) {
|
|
5342
5346
|
return _this2.env.getContract(addr, abis.abi);
|
|
5343
5347
|
});
|