@aurigami/sdk 1.19.4 → 1.19.5
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 +11 -5
- 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 +11 -5
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/priceFetcher.ts +3 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -1892,25 +1892,31 @@ function _fetchPrice2() {
|
|
|
1892
1892
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1893
1893
|
case 0:
|
|
1894
1894
|
assert(PRICE_WHITELISTED.has(address.toLocaleLowerCase()), "Address " + address + " is not whitelisted for price fetching");
|
|
1895
|
-
if (!
|
|
1895
|
+
if (!(address.toLowerCase() == networkAddresses.tokens.META)) {
|
|
1896
1896
|
_context14.next = 3;
|
|
1897
1897
|
break;
|
|
1898
1898
|
}
|
|
1899
|
+
return _context14.abrupt("return", fetchPriceFromDefiLlamaAndCoingecko(address));
|
|
1900
|
+
case 3:
|
|
1901
|
+
if (!shouldFetchFromKyberSwap(address)) {
|
|
1902
|
+
_context14.next = 5;
|
|
1903
|
+
break;
|
|
1904
|
+
}
|
|
1899
1905
|
return _context14.abrupt("return", fetchPriceFromKyberSwap(address, provider)["catch"](function (e) {
|
|
1900
1906
|
return fetchPriceFromDefiLlamaAndCoingecko(address);
|
|
1901
1907
|
}));
|
|
1902
|
-
case
|
|
1908
|
+
case 5:
|
|
1903
1909
|
matchingAuToken = networkAddresses.auTokens.find(function (auToken) {
|
|
1904
1910
|
return isSameAddress(auToken.underlying, address);
|
|
1905
1911
|
});
|
|
1906
1912
|
if (!(matchingAuToken !== undefined)) {
|
|
1907
|
-
_context14.next =
|
|
1913
|
+
_context14.next = 10;
|
|
1908
1914
|
break;
|
|
1909
1915
|
}
|
|
1910
1916
|
return _context14.abrupt("return", fetchPriceFromOracle(matchingAuToken.address, getDecimal(address), provider));
|
|
1911
|
-
case
|
|
1917
|
+
case 10:
|
|
1912
1918
|
throw Error("Unable to fetch price for " + address);
|
|
1913
|
-
case
|
|
1919
|
+
case 11:
|
|
1914
1920
|
case "end":
|
|
1915
1921
|
return _context14.stop();
|
|
1916
1922
|
}
|