@aurigami/sdk 1.12.1 → 1.12.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/helpers/priceFetcher.d.ts +2 -0
- package/dist/sdk.cjs.development.js +245 -166
- 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 +244 -167
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/priceFetcher.ts +34 -4
package/dist/sdk.esm.js
CHANGED
|
@@ -1893,18 +1893,53 @@ function _getPaginatedApi() {
|
|
|
1893
1893
|
return _getPaginatedApi.apply(this, arguments);
|
|
1894
1894
|
}
|
|
1895
1895
|
|
|
1896
|
-
function
|
|
1897
|
-
return
|
|
1896
|
+
function fetchPriceFromDefiLlamaAPI(_x) {
|
|
1897
|
+
return _fetchPriceFromDefiLlamaAPI.apply(this, arguments);
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
|
-
function
|
|
1901
|
-
|
|
1900
|
+
function _fetchPriceFromDefiLlamaAPI() {
|
|
1901
|
+
_fetchPriceFromDefiLlamaAPI = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(id) {
|
|
1902
1902
|
var price;
|
|
1903
1903
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1904
1904
|
while (1) {
|
|
1905
1905
|
switch (_context.prev = _context.next) {
|
|
1906
1906
|
case 0:
|
|
1907
1907
|
_context.next = 2;
|
|
1908
|
+
return axios.post("https://coins.llama.fi/prices", {
|
|
1909
|
+
coins: [id]
|
|
1910
|
+
}).then(function (res) {
|
|
1911
|
+
return res.data.coins[id].price;
|
|
1912
|
+
})["catch"](function (err) {
|
|
1913
|
+
console.log("unable to fetch price from DefiLlama API: " + err);
|
|
1914
|
+
return 0;
|
|
1915
|
+
});
|
|
1916
|
+
|
|
1917
|
+
case 2:
|
|
1918
|
+
price = _context.sent;
|
|
1919
|
+
return _context.abrupt("return", new BigNumber(price));
|
|
1920
|
+
|
|
1921
|
+
case 4:
|
|
1922
|
+
case "end":
|
|
1923
|
+
return _context.stop();
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
}, _callee);
|
|
1927
|
+
}));
|
|
1928
|
+
return _fetchPriceFromDefiLlamaAPI.apply(this, arguments);
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
function fetchPriceFromCoingeckoAPI(_x2) {
|
|
1932
|
+
return _fetchPriceFromCoingeckoAPI.apply(this, arguments);
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
function _fetchPriceFromCoingeckoAPI() {
|
|
1936
|
+
_fetchPriceFromCoingeckoAPI = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(id) {
|
|
1937
|
+
var price;
|
|
1938
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1939
|
+
while (1) {
|
|
1940
|
+
switch (_context2.prev = _context2.next) {
|
|
1941
|
+
case 0:
|
|
1942
|
+
_context2.next = 2;
|
|
1908
1943
|
return axios.get("https://api.coingecko.com/api/v3/simple/price?ids=" + id + "&vs_currencies=usd").then(function (res) {
|
|
1909
1944
|
return res.data[id];
|
|
1910
1945
|
})["catch"](function (err) {
|
|
@@ -1915,65 +1950,95 @@ function _fetchPriceFromCoingeckoAPI() {
|
|
|
1915
1950
|
});
|
|
1916
1951
|
|
|
1917
1952
|
case 2:
|
|
1918
|
-
price =
|
|
1919
|
-
return
|
|
1953
|
+
price = _context2.sent;
|
|
1954
|
+
return _context2.abrupt("return", new BigNumber(price.usd));
|
|
1920
1955
|
|
|
1921
1956
|
case 4:
|
|
1922
1957
|
case "end":
|
|
1923
|
-
return
|
|
1958
|
+
return _context2.stop();
|
|
1924
1959
|
}
|
|
1925
1960
|
}
|
|
1926
|
-
},
|
|
1961
|
+
}, _callee2);
|
|
1927
1962
|
}));
|
|
1928
1963
|
return _fetchPriceFromCoingeckoAPI.apply(this, arguments);
|
|
1929
1964
|
}
|
|
1930
1965
|
|
|
1931
|
-
function
|
|
1966
|
+
function fetchPriceFromDefiLlama(_x3) {
|
|
1967
|
+
return _fetchPriceFromDefiLlama.apply(this, arguments);
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
function _fetchPriceFromDefiLlama() {
|
|
1971
|
+
_fetchPriceFromDefiLlama = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(id) {
|
|
1972
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1973
|
+
while (1) {
|
|
1974
|
+
switch (_context3.prev = _context3.next) {
|
|
1975
|
+
case 0:
|
|
1976
|
+
if (!(id.toLowerCase() == networkAddresses.tokens.AURORA || id.toLowerCase() == networkAddresses.tokens.TRI || id.toLowerCase() == networkAddresses.tokens.META)) {
|
|
1977
|
+
_context3.next = 2;
|
|
1978
|
+
break;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
return _context3.abrupt("return", fetchPriceFromDefiLlamaAPI("aurora:" + id.toLowerCase()));
|
|
1982
|
+
|
|
1983
|
+
case 2:
|
|
1984
|
+
throw Error("Unknown token " + id + " in fetchPriceFromDefiLlama");
|
|
1985
|
+
|
|
1986
|
+
case 3:
|
|
1987
|
+
case "end":
|
|
1988
|
+
return _context3.stop();
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}, _callee3);
|
|
1992
|
+
}));
|
|
1993
|
+
return _fetchPriceFromDefiLlama.apply(this, arguments);
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
function fetchPriceFromCoingecko(_x4) {
|
|
1932
1997
|
return _fetchPriceFromCoingecko.apply(this, arguments);
|
|
1933
1998
|
}
|
|
1934
1999
|
|
|
1935
2000
|
function _fetchPriceFromCoingecko() {
|
|
1936
|
-
_fetchPriceFromCoingecko = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1937
|
-
return runtime_1.wrap(function
|
|
2001
|
+
_fetchPriceFromCoingecko = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(id) {
|
|
2002
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
1938
2003
|
while (1) {
|
|
1939
|
-
switch (
|
|
2004
|
+
switch (_context4.prev = _context4.next) {
|
|
1940
2005
|
case 0:
|
|
1941
|
-
|
|
1942
|
-
|
|
2006
|
+
_context4.t0 = id.toLowerCase();
|
|
2007
|
+
_context4.next = _context4.t0 === networkAddresses.tokens.AURORA ? 3 : _context4.t0 === networkAddresses.tokens.TRI ? 4 : _context4.t0 === networkAddresses.tokens.META ? 5 : 6;
|
|
1943
2008
|
break;
|
|
1944
2009
|
|
|
1945
2010
|
case 3:
|
|
1946
|
-
return
|
|
2011
|
+
return _context4.abrupt("return", fetchPriceFromCoingeckoAPI('aurora-near'));
|
|
1947
2012
|
|
|
1948
2013
|
case 4:
|
|
1949
|
-
return
|
|
2014
|
+
return _context4.abrupt("return", fetchPriceFromCoingeckoAPI('trisolaris'));
|
|
1950
2015
|
|
|
1951
2016
|
case 5:
|
|
1952
|
-
return
|
|
2017
|
+
return _context4.abrupt("return", fetchPriceFromCoingeckoAPI('meta-pool'));
|
|
1953
2018
|
|
|
1954
2019
|
case 6:
|
|
1955
2020
|
throw Error("Unknown token " + id + " in fetchPriceFromCoingecko");
|
|
1956
2021
|
|
|
1957
2022
|
case 7:
|
|
1958
2023
|
case "end":
|
|
1959
|
-
return
|
|
2024
|
+
return _context4.stop();
|
|
1960
2025
|
}
|
|
1961
2026
|
}
|
|
1962
|
-
},
|
|
2027
|
+
}, _callee4);
|
|
1963
2028
|
}));
|
|
1964
2029
|
return _fetchPriceFromCoingecko.apply(this, arguments);
|
|
1965
2030
|
}
|
|
1966
2031
|
|
|
1967
|
-
function fetchLPPositions(
|
|
2032
|
+
function fetchLPPositions(_x5, _x6) {
|
|
1968
2033
|
return _fetchLPPositions.apply(this, arguments);
|
|
1969
2034
|
}
|
|
1970
2035
|
|
|
1971
2036
|
function _fetchLPPositions() {
|
|
1972
|
-
_fetchLPPositions = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2037
|
+
_fetchLPPositions = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(LPAddress, provider) {
|
|
1973
2038
|
var LPContract, promises, values;
|
|
1974
|
-
return runtime_1.wrap(function
|
|
2039
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
1975
2040
|
while (1) {
|
|
1976
|
-
switch (
|
|
2041
|
+
switch (_context5.prev = _context5.next) {
|
|
1977
2042
|
case 0:
|
|
1978
2043
|
LPContract = new Contract(LPAddress, IUniswapV2PairABI.abi, provider);
|
|
1979
2044
|
promises = [];
|
|
@@ -1981,12 +2046,12 @@ function _fetchLPPositions() {
|
|
|
1981
2046
|
promises.push(LPContract.token1());
|
|
1982
2047
|
promises.push(LPContract.getReserves());
|
|
1983
2048
|
promises.push(LPContract.totalSupply());
|
|
1984
|
-
|
|
2049
|
+
_context5.next = 8;
|
|
1985
2050
|
return Promise.all(promises);
|
|
1986
2051
|
|
|
1987
2052
|
case 8:
|
|
1988
|
-
values =
|
|
1989
|
-
return
|
|
2053
|
+
values = _context5.sent;
|
|
2054
|
+
return _context5.abrupt("return", {
|
|
1990
2055
|
token0: values[0],
|
|
1991
2056
|
token1: values[1],
|
|
1992
2057
|
reserve0: values[2].reserve0,
|
|
@@ -1996,117 +2061,117 @@ function _fetchLPPositions() {
|
|
|
1996
2061
|
|
|
1997
2062
|
case 10:
|
|
1998
2063
|
case "end":
|
|
1999
|
-
return
|
|
2064
|
+
return _context5.stop();
|
|
2000
2065
|
}
|
|
2001
2066
|
}
|
|
2002
|
-
},
|
|
2067
|
+
}, _callee5);
|
|
2003
2068
|
}));
|
|
2004
2069
|
return _fetchLPPositions.apply(this, arguments);
|
|
2005
2070
|
}
|
|
2006
2071
|
|
|
2007
|
-
function fetchLPPrice(
|
|
2072
|
+
function fetchLPPrice(_x7, _x8) {
|
|
2008
2073
|
return _fetchLPPrice.apply(this, arguments);
|
|
2009
2074
|
}
|
|
2010
2075
|
|
|
2011
2076
|
function _fetchLPPrice() {
|
|
2012
|
-
_fetchLPPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2077
|
+
_fetchLPPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(address, provider) {
|
|
2013
2078
|
var LPInfo, LPDecimal, fetchLPPriceBy, _fetchLPPriceBy, lpPrice;
|
|
2014
2079
|
|
|
2015
|
-
return runtime_1.wrap(function
|
|
2080
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
2016
2081
|
while (1) {
|
|
2017
|
-
switch (
|
|
2082
|
+
switch (_context7.prev = _context7.next) {
|
|
2018
2083
|
case 0:
|
|
2019
2084
|
_fetchLPPriceBy = function _fetchLPPriceBy3() {
|
|
2020
|
-
_fetchLPPriceBy = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2085
|
+
_fetchLPPriceBy = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(tokenReverse) {
|
|
2021
2086
|
var tokenPrice, tokenDecimal, reserveUSD;
|
|
2022
|
-
return runtime_1.wrap(function
|
|
2087
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2023
2088
|
while (1) {
|
|
2024
|
-
switch (
|
|
2089
|
+
switch (_context6.prev = _context6.next) {
|
|
2025
2090
|
case 0:
|
|
2026
2091
|
if (!tokenReverse.reserve.isZero()) {
|
|
2027
|
-
|
|
2092
|
+
_context6.next = 2;
|
|
2028
2093
|
break;
|
|
2029
2094
|
}
|
|
2030
2095
|
|
|
2031
|
-
return
|
|
2096
|
+
return _context6.abrupt("return", new BigNumber(0));
|
|
2032
2097
|
|
|
2033
2098
|
case 2:
|
|
2034
|
-
|
|
2099
|
+
_context6.next = 4;
|
|
2035
2100
|
return _fetchPrice(tokenReverse.address, provider);
|
|
2036
2101
|
|
|
2037
2102
|
case 4:
|
|
2038
|
-
tokenPrice =
|
|
2103
|
+
tokenPrice = _context6.sent;
|
|
2039
2104
|
tokenDecimal = getDecimal(tokenReverse.address); // reserveUSD will be divided by 10^tokenDecimal later for more precision
|
|
2040
2105
|
|
|
2041
2106
|
reserveUSD = tokenPrice.multipliedBy(tokenReverse.reserve.toString()).multipliedBy(2);
|
|
2042
|
-
return
|
|
2107
|
+
return _context6.abrupt("return", reserveUSD.multipliedBy(decimalFactor(LPDecimal)).dividedBy(new BigNumber(LPInfo.totalSupply.toString())).dividedBy(decimalFactor(tokenDecimal)));
|
|
2043
2108
|
|
|
2044
2109
|
case 8:
|
|
2045
2110
|
case "end":
|
|
2046
|
-
return
|
|
2111
|
+
return _context6.stop();
|
|
2047
2112
|
}
|
|
2048
2113
|
}
|
|
2049
|
-
},
|
|
2114
|
+
}, _callee6);
|
|
2050
2115
|
}));
|
|
2051
2116
|
return _fetchLPPriceBy.apply(this, arguments);
|
|
2052
2117
|
};
|
|
2053
2118
|
|
|
2054
|
-
fetchLPPriceBy = function _fetchLPPriceBy2(
|
|
2119
|
+
fetchLPPriceBy = function _fetchLPPriceBy2(_x25) {
|
|
2055
2120
|
return _fetchLPPriceBy.apply(this, arguments);
|
|
2056
2121
|
};
|
|
2057
2122
|
|
|
2058
|
-
|
|
2123
|
+
_context7.next = 4;
|
|
2059
2124
|
return fetchLPPositions(address, provider);
|
|
2060
2125
|
|
|
2061
2126
|
case 4:
|
|
2062
|
-
LPInfo =
|
|
2127
|
+
LPInfo = _context7.sent;
|
|
2063
2128
|
LPDecimal = getDecimal(address);
|
|
2064
|
-
|
|
2065
|
-
|
|
2129
|
+
_context7.prev = 6;
|
|
2130
|
+
_context7.next = 9;
|
|
2066
2131
|
return fetchLPPriceBy({
|
|
2067
2132
|
address: LPInfo.token0,
|
|
2068
2133
|
reserve: LPInfo.reserve0
|
|
2069
2134
|
});
|
|
2070
2135
|
|
|
2071
2136
|
case 9:
|
|
2072
|
-
lpPrice =
|
|
2137
|
+
lpPrice = _context7.sent;
|
|
2073
2138
|
|
|
2074
2139
|
if (!lpPrice.isZero()) {
|
|
2075
|
-
|
|
2140
|
+
_context7.next = 12;
|
|
2076
2141
|
break;
|
|
2077
2142
|
}
|
|
2078
2143
|
|
|
2079
2144
|
throw Error("Price is zero");
|
|
2080
2145
|
|
|
2081
2146
|
case 12:
|
|
2082
|
-
return
|
|
2147
|
+
return _context7.abrupt("return", lpPrice);
|
|
2083
2148
|
|
|
2084
2149
|
case 15:
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
devLog("fetchLPPriceBy " + LPInfo.token0 + " failed",
|
|
2088
|
-
|
|
2089
|
-
|
|
2150
|
+
_context7.prev = 15;
|
|
2151
|
+
_context7.t0 = _context7["catch"](6);
|
|
2152
|
+
devLog("fetchLPPriceBy " + LPInfo.token0 + " failed", _context7.t0);
|
|
2153
|
+
_context7.prev = 18;
|
|
2154
|
+
_context7.next = 21;
|
|
2090
2155
|
return fetchLPPriceBy({
|
|
2091
2156
|
address: LPInfo.token1,
|
|
2092
2157
|
reserve: LPInfo.reserve1
|
|
2093
2158
|
});
|
|
2094
2159
|
|
|
2095
2160
|
case 21:
|
|
2096
|
-
return
|
|
2161
|
+
return _context7.abrupt("return", _context7.sent);
|
|
2097
2162
|
|
|
2098
2163
|
case 24:
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
devLog("fetchLPPriceBy " + LPInfo.token1 + " failed",
|
|
2164
|
+
_context7.prev = 24;
|
|
2165
|
+
_context7.t1 = _context7["catch"](18);
|
|
2166
|
+
devLog("fetchLPPriceBy " + LPInfo.token1 + " failed", _context7.t1);
|
|
2102
2167
|
throw Error("Unable to fetch price for both tokens of LP " + address);
|
|
2103
2168
|
|
|
2104
2169
|
case 28:
|
|
2105
2170
|
case "end":
|
|
2106
|
-
return
|
|
2171
|
+
return _context7.stop();
|
|
2107
2172
|
}
|
|
2108
2173
|
}
|
|
2109
|
-
},
|
|
2174
|
+
}, _callee7, null, [[6, 15], [18, 24]]);
|
|
2110
2175
|
}));
|
|
2111
2176
|
return _fetchLPPrice.apply(this, arguments);
|
|
2112
2177
|
}
|
|
@@ -2116,33 +2181,33 @@ function fetchStNEARPrice() {
|
|
|
2116
2181
|
}
|
|
2117
2182
|
|
|
2118
2183
|
function _fetchStNEARPrice() {
|
|
2119
|
-
_fetchStNEARPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2184
|
+
_fetchStNEARPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
|
|
2120
2185
|
var ratioPromise, nearPricePromise, _yield$Promise$all, ratioRes, nearPrice, ratio;
|
|
2121
2186
|
|
|
2122
|
-
return runtime_1.wrap(function
|
|
2187
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
2123
2188
|
while (1) {
|
|
2124
|
-
switch (
|
|
2189
|
+
switch (_context8.prev = _context8.next) {
|
|
2125
2190
|
case 0:
|
|
2126
2191
|
ratioPromise = axios.get('https://validators.narwallets.com/metrics_json').then(function (res) {
|
|
2127
2192
|
return res.data;
|
|
2128
2193
|
});
|
|
2129
2194
|
nearPricePromise = fetchPriceFromCoingeckoAPI('near');
|
|
2130
|
-
|
|
2195
|
+
_context8.next = 4;
|
|
2131
2196
|
return Promise.all([ratioPromise, nearPricePromise]);
|
|
2132
2197
|
|
|
2133
2198
|
case 4:
|
|
2134
|
-
_yield$Promise$all =
|
|
2199
|
+
_yield$Promise$all = _context8.sent;
|
|
2135
2200
|
ratioRes = _yield$Promise$all[0];
|
|
2136
2201
|
nearPrice = _yield$Promise$all[1];
|
|
2137
2202
|
ratio = new BigNumber(ratioRes.st_near_price);
|
|
2138
|
-
return
|
|
2203
|
+
return _context8.abrupt("return", ratio.multipliedBy(nearPrice));
|
|
2139
2204
|
|
|
2140
2205
|
case 9:
|
|
2141
2206
|
case "end":
|
|
2142
|
-
return
|
|
2207
|
+
return _context8.stop();
|
|
2143
2208
|
}
|
|
2144
2209
|
}
|
|
2145
|
-
},
|
|
2210
|
+
}, _callee8);
|
|
2146
2211
|
}));
|
|
2147
2212
|
return _fetchStNEARPrice.apply(this, arguments);
|
|
2148
2213
|
}
|
|
@@ -2151,29 +2216,29 @@ function processPriceFromOracle(rawPrice, underlyingDecimal) {
|
|
|
2151
2216
|
return new BigNumber(rawPrice.toString()).div(decimalFactor(36 - underlyingDecimal));
|
|
2152
2217
|
}
|
|
2153
2218
|
|
|
2154
|
-
function fetchPriceFromOracle(
|
|
2219
|
+
function fetchPriceFromOracle(_x9, _x10, _x11) {
|
|
2155
2220
|
return _fetchPriceFromOracle.apply(this, arguments);
|
|
2156
2221
|
}
|
|
2157
2222
|
|
|
2158
2223
|
function _fetchPriceFromOracle() {
|
|
2159
|
-
_fetchPriceFromOracle = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2224
|
+
_fetchPriceFromOracle = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(auTokenAddress, underlyingDecimal, provider) {
|
|
2160
2225
|
var oracleContract, rawPrice, matchingAuToken;
|
|
2161
|
-
return runtime_1.wrap(function
|
|
2226
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
2162
2227
|
while (1) {
|
|
2163
|
-
switch (
|
|
2228
|
+
switch (_context9.prev = _context9.next) {
|
|
2164
2229
|
case 0:
|
|
2165
2230
|
oracleContract = new Contract(networkAddresses.misc.oracle, abis.abi, provider);
|
|
2166
|
-
|
|
2231
|
+
_context9.next = 3;
|
|
2167
2232
|
return oracleContract.getUnderlyingPrice(auTokenAddress)["catch"](function (e) {
|
|
2168
2233
|
console.log("Unable to fetch price from oracle for " + auTokenAddress);
|
|
2169
2234
|
return BigNumber$1.from(0);
|
|
2170
2235
|
});
|
|
2171
2236
|
|
|
2172
2237
|
case 3:
|
|
2173
|
-
rawPrice =
|
|
2238
|
+
rawPrice = _context9.sent;
|
|
2174
2239
|
|
|
2175
2240
|
if (!rawPrice.isZero()) {
|
|
2176
|
-
|
|
2241
|
+
_context9.next = 8;
|
|
2177
2242
|
break;
|
|
2178
2243
|
}
|
|
2179
2244
|
|
|
@@ -2182,35 +2247,35 @@ function _fetchPriceFromOracle() {
|
|
|
2182
2247
|
});
|
|
2183
2248
|
|
|
2184
2249
|
if (!((matchingAuToken == null ? void 0 : matchingAuToken.name) == 'auSTNEAR')) {
|
|
2185
|
-
|
|
2250
|
+
_context9.next = 8;
|
|
2186
2251
|
break;
|
|
2187
2252
|
}
|
|
2188
2253
|
|
|
2189
|
-
return
|
|
2254
|
+
return _context9.abrupt("return", fetchStNEARPrice());
|
|
2190
2255
|
|
|
2191
2256
|
case 8:
|
|
2192
|
-
return
|
|
2257
|
+
return _context9.abrupt("return", processPriceFromOracle(rawPrice, underlyingDecimal));
|
|
2193
2258
|
|
|
2194
2259
|
case 9:
|
|
2195
2260
|
case "end":
|
|
2196
|
-
return
|
|
2261
|
+
return _context9.stop();
|
|
2197
2262
|
}
|
|
2198
2263
|
}
|
|
2199
|
-
},
|
|
2264
|
+
}, _callee9);
|
|
2200
2265
|
}));
|
|
2201
2266
|
return _fetchPriceFromOracle.apply(this, arguments);
|
|
2202
2267
|
}
|
|
2203
2268
|
|
|
2204
|
-
function fetchUnderlyingTokensPrices(
|
|
2269
|
+
function fetchUnderlyingTokensPrices(_x12) {
|
|
2205
2270
|
return _fetchUnderlyingTokensPrices.apply(this, arguments);
|
|
2206
2271
|
}
|
|
2207
2272
|
|
|
2208
2273
|
function _fetchUnderlyingTokensPrices() {
|
|
2209
|
-
_fetchUnderlyingTokensPrices = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2274
|
+
_fetchUnderlyingTokensPrices = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(provider) {
|
|
2210
2275
|
var auriLens, auTokenAddresses, underlyingDecimals, rawPrices;
|
|
2211
|
-
return runtime_1.wrap(function
|
|
2276
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
2212
2277
|
while (1) {
|
|
2213
|
-
switch (
|
|
2278
|
+
switch (_context10.prev = _context10.next) {
|
|
2214
2279
|
case 0:
|
|
2215
2280
|
auriLens = new Contract(networkAddresses.misc.AURILENS, abis$4.abi, provider);
|
|
2216
2281
|
auTokenAddresses = networkAddresses.auTokens.map(function (auToken) {
|
|
@@ -2219,12 +2284,12 @@ function _fetchUnderlyingTokensPrices() {
|
|
|
2219
2284
|
underlyingDecimals = networkAddresses.auTokens.map(function (auToken) {
|
|
2220
2285
|
return getDecimal(auToken.underlying);
|
|
2221
2286
|
});
|
|
2222
|
-
|
|
2287
|
+
_context10.next = 5;
|
|
2223
2288
|
return auriLens.auTokenUnderlyingPriceAll(auTokenAddresses);
|
|
2224
2289
|
|
|
2225
2290
|
case 5:
|
|
2226
|
-
rawPrices =
|
|
2227
|
-
return
|
|
2291
|
+
rawPrices = _context10.sent;
|
|
2292
|
+
return _context10.abrupt("return", rawPrices.map(function (res, ind) {
|
|
2228
2293
|
return {
|
|
2229
2294
|
auToken: res.auToken,
|
|
2230
2295
|
underlyingPrice: processPriceFromOracle(res.underlyingPrice, underlyingDecimals[ind])
|
|
@@ -2233,15 +2298,15 @@ function _fetchUnderlyingTokensPrices() {
|
|
|
2233
2298
|
|
|
2234
2299
|
case 7:
|
|
2235
2300
|
case "end":
|
|
2236
|
-
return
|
|
2301
|
+
return _context10.stop();
|
|
2237
2302
|
}
|
|
2238
2303
|
}
|
|
2239
|
-
},
|
|
2304
|
+
}, _callee10);
|
|
2240
2305
|
}));
|
|
2241
2306
|
return _fetchUnderlyingTokensPrices.apply(this, arguments);
|
|
2242
2307
|
}
|
|
2243
2308
|
|
|
2244
|
-
function
|
|
2309
|
+
function shouldFetchFromCoingeckoOrDefiLlama(address) {
|
|
2245
2310
|
address = address.toLowerCase();
|
|
2246
2311
|
return address == networkAddresses.tokens.AURORA || address == networkAddresses.tokens.TRI || address == networkAddresses.tokens.META;
|
|
2247
2312
|
}
|
|
@@ -2250,226 +2315,236 @@ function shouldFetchFromCoingecko(address) {
|
|
|
2250
2315
|
*/
|
|
2251
2316
|
|
|
2252
2317
|
|
|
2253
|
-
function _fetchPrice(
|
|
2318
|
+
function _fetchPrice(_x13, _x14) {
|
|
2254
2319
|
return _fetchPrice2.apply(this, arguments);
|
|
2255
2320
|
}
|
|
2256
2321
|
|
|
2257
2322
|
function _fetchPrice2() {
|
|
2258
|
-
_fetchPrice2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2323
|
+
_fetchPrice2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(address, provider) {
|
|
2259
2324
|
var matchingAuToken;
|
|
2260
|
-
return runtime_1.wrap(function
|
|
2325
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
2261
2326
|
while (1) {
|
|
2262
|
-
switch (
|
|
2327
|
+
switch (_context11.prev = _context11.next) {
|
|
2263
2328
|
case 0:
|
|
2264
2329
|
assert(PRICE_WHITELISTED.has(address.toLocaleLowerCase()), "Address " + address + " is not whitelisted for price fetching");
|
|
2265
2330
|
|
|
2266
|
-
if (!
|
|
2267
|
-
|
|
2331
|
+
if (!shouldFetchFromCoingeckoOrDefiLlama(address)) {
|
|
2332
|
+
_context11.next = 11;
|
|
2268
2333
|
break;
|
|
2269
2334
|
}
|
|
2270
2335
|
|
|
2271
|
-
|
|
2336
|
+
_context11.prev = 2;
|
|
2337
|
+
_context11.next = 5;
|
|
2338
|
+
return fetchPriceFromCoingecko(address);
|
|
2272
2339
|
|
|
2273
|
-
case
|
|
2340
|
+
case 5:
|
|
2341
|
+
return _context11.abrupt("return", _context11.sent);
|
|
2342
|
+
|
|
2343
|
+
case 8:
|
|
2344
|
+
_context11.prev = 8;
|
|
2345
|
+
_context11.t0 = _context11["catch"](2);
|
|
2346
|
+
return _context11.abrupt("return", fetchPriceFromDefiLlama(address));
|
|
2347
|
+
|
|
2348
|
+
case 11:
|
|
2274
2349
|
matchingAuToken = networkAddresses.auTokens.find(function (auToken) {
|
|
2275
2350
|
return isSameAddress(auToken.underlying, address);
|
|
2276
2351
|
});
|
|
2277
2352
|
|
|
2278
2353
|
if (!(matchingAuToken !== undefined)) {
|
|
2279
|
-
|
|
2354
|
+
_context11.next = 16;
|
|
2280
2355
|
break;
|
|
2281
2356
|
}
|
|
2282
2357
|
|
|
2283
|
-
return
|
|
2358
|
+
return _context11.abrupt("return", fetchPriceFromOracle(matchingAuToken.address, getDecimal(address), provider));
|
|
2284
2359
|
|
|
2285
|
-
case
|
|
2360
|
+
case 16:
|
|
2286
2361
|
throw Error("Unable to fetch price for " + address);
|
|
2287
2362
|
|
|
2288
|
-
case
|
|
2363
|
+
case 17:
|
|
2289
2364
|
case "end":
|
|
2290
|
-
return
|
|
2365
|
+
return _context11.stop();
|
|
2291
2366
|
}
|
|
2292
2367
|
}
|
|
2293
|
-
},
|
|
2368
|
+
}, _callee11, null, [[2, 8]]);
|
|
2294
2369
|
}));
|
|
2295
2370
|
return _fetchPrice2.apply(this, arguments);
|
|
2296
2371
|
}
|
|
2297
2372
|
|
|
2298
|
-
function fetchPrice(
|
|
2373
|
+
function fetchPrice(_x15, _x16) {
|
|
2299
2374
|
return _fetchPrice3.apply(this, arguments);
|
|
2300
2375
|
}
|
|
2301
2376
|
|
|
2302
2377
|
function _fetchPrice3() {
|
|
2303
|
-
_fetchPrice3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2304
|
-
return runtime_1.wrap(function
|
|
2378
|
+
_fetchPrice3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(address, provider) {
|
|
2379
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
2305
2380
|
while (1) {
|
|
2306
|
-
switch (
|
|
2381
|
+
switch (_context12.prev = _context12.next) {
|
|
2307
2382
|
case 0:
|
|
2308
2383
|
if (!(address.toLowerCase() in HARDCODE_PRICE_TOKENS)) {
|
|
2309
|
-
|
|
2384
|
+
_context12.next = 4;
|
|
2310
2385
|
break;
|
|
2311
2386
|
}
|
|
2312
2387
|
|
|
2313
|
-
return
|
|
2388
|
+
return _context12.abrupt("return", new BigNumber(HARDCODE_PRICE_TOKENS[address.toLowerCase()]));
|
|
2314
2389
|
|
|
2315
2390
|
case 4:
|
|
2316
2391
|
if (!isSameAddress(address, networkAddresses.tokens.PLYWNEAR)) {
|
|
2317
|
-
|
|
2392
|
+
_context12.next = 8;
|
|
2318
2393
|
break;
|
|
2319
2394
|
}
|
|
2320
2395
|
|
|
2321
|
-
return
|
|
2396
|
+
return _context12.abrupt("return", fetchLPPrice(address, provider));
|
|
2322
2397
|
|
|
2323
2398
|
case 8:
|
|
2324
2399
|
if (!isSameAddress(address, networkAddresses.tokens.PLY)) {
|
|
2325
|
-
|
|
2400
|
+
_context12.next = 12;
|
|
2326
2401
|
break;
|
|
2327
2402
|
}
|
|
2328
2403
|
|
|
2329
|
-
return
|
|
2404
|
+
return _context12.abrupt("return", fetchPLYPrice(provider));
|
|
2330
2405
|
|
|
2331
2406
|
case 12:
|
|
2332
2407
|
if (!isSameAddress(address, networkAddresses.tokens.PULP)) {
|
|
2333
|
-
|
|
2408
|
+
_context12.next = 14;
|
|
2334
2409
|
break;
|
|
2335
2410
|
}
|
|
2336
2411
|
|
|
2337
|
-
return
|
|
2412
|
+
return _context12.abrupt("return", fetchPULPPrice(provider));
|
|
2338
2413
|
|
|
2339
2414
|
case 14:
|
|
2340
|
-
return
|
|
2415
|
+
return _context12.abrupt("return", _fetchPrice(address, provider));
|
|
2341
2416
|
|
|
2342
2417
|
case 15:
|
|
2343
2418
|
case "end":
|
|
2344
|
-
return
|
|
2419
|
+
return _context12.stop();
|
|
2345
2420
|
}
|
|
2346
2421
|
}
|
|
2347
|
-
},
|
|
2422
|
+
}, _callee12);
|
|
2348
2423
|
}));
|
|
2349
2424
|
return _fetchPrice3.apply(this, arguments);
|
|
2350
2425
|
}
|
|
2351
2426
|
|
|
2352
|
-
function fetchPLYPrice(
|
|
2427
|
+
function fetchPLYPrice(_x17) {
|
|
2353
2428
|
return _fetchPLYPrice.apply(this, arguments);
|
|
2354
2429
|
}
|
|
2355
2430
|
|
|
2356
2431
|
function _fetchPLYPrice() {
|
|
2357
|
-
_fetchPLYPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2358
|
-
return runtime_1.wrap(function
|
|
2432
|
+
_fetchPLYPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(provider) {
|
|
2433
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
2359
2434
|
while (1) {
|
|
2360
|
-
switch (
|
|
2435
|
+
switch (_context13.prev = _context13.next) {
|
|
2361
2436
|
case 0:
|
|
2362
|
-
return
|
|
2437
|
+
return _context13.abrupt("return", fetchToken0PriceByLP(networkAddresses.tokens.PLYWNEAR, provider));
|
|
2363
2438
|
|
|
2364
2439
|
case 1:
|
|
2365
2440
|
case "end":
|
|
2366
|
-
return
|
|
2441
|
+
return _context13.stop();
|
|
2367
2442
|
}
|
|
2368
2443
|
}
|
|
2369
|
-
},
|
|
2444
|
+
}, _callee13);
|
|
2370
2445
|
}));
|
|
2371
2446
|
return _fetchPLYPrice.apply(this, arguments);
|
|
2372
2447
|
}
|
|
2373
2448
|
|
|
2374
|
-
function fetchPULPPrice(
|
|
2449
|
+
function fetchPULPPrice(_x18) {
|
|
2375
2450
|
return _fetchPULPPrice.apply(this, arguments);
|
|
2376
2451
|
}
|
|
2377
2452
|
|
|
2378
2453
|
function _fetchPULPPrice() {
|
|
2379
|
-
_fetchPULPPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2380
|
-
return runtime_1.wrap(function
|
|
2454
|
+
_fetchPULPPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(provider) {
|
|
2455
|
+
return runtime_1.wrap(function _callee14$(_context14) {
|
|
2381
2456
|
while (1) {
|
|
2382
|
-
switch (
|
|
2457
|
+
switch (_context14.prev = _context14.next) {
|
|
2383
2458
|
case 0:
|
|
2384
|
-
return
|
|
2459
|
+
return _context14.abrupt("return", new BigNumber(0));
|
|
2385
2460
|
|
|
2386
2461
|
case 1:
|
|
2387
2462
|
case "end":
|
|
2388
|
-
return
|
|
2463
|
+
return _context14.stop();
|
|
2389
2464
|
}
|
|
2390
2465
|
}
|
|
2391
|
-
},
|
|
2466
|
+
}, _callee14);
|
|
2392
2467
|
}));
|
|
2393
2468
|
return _fetchPULPPrice.apply(this, arguments);
|
|
2394
2469
|
}
|
|
2395
2470
|
|
|
2396
|
-
function fetchToken0PriceByLP(
|
|
2471
|
+
function fetchToken0PriceByLP(_x19, _x20) {
|
|
2397
2472
|
return _fetchToken0PriceByLP.apply(this, arguments);
|
|
2398
2473
|
}
|
|
2399
2474
|
|
|
2400
2475
|
function _fetchToken0PriceByLP() {
|
|
2401
|
-
_fetchToken0PriceByLP = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2476
|
+
_fetchToken0PriceByLP = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(LP, provider) {
|
|
2402
2477
|
var LPInfo, token0Decimal, token1Decimal;
|
|
2403
|
-
return runtime_1.wrap(function
|
|
2478
|
+
return runtime_1.wrap(function _callee15$(_context15) {
|
|
2404
2479
|
while (1) {
|
|
2405
|
-
switch (
|
|
2480
|
+
switch (_context15.prev = _context15.next) {
|
|
2406
2481
|
case 0:
|
|
2407
|
-
|
|
2482
|
+
_context15.next = 2;
|
|
2408
2483
|
return fetchLPPositions(LP, provider);
|
|
2409
2484
|
|
|
2410
2485
|
case 2:
|
|
2411
|
-
LPInfo =
|
|
2486
|
+
LPInfo = _context15.sent;
|
|
2412
2487
|
|
|
2413
2488
|
if (!LPInfo.reserve1.isZero()) {
|
|
2414
|
-
|
|
2489
|
+
_context15.next = 5;
|
|
2415
2490
|
break;
|
|
2416
2491
|
}
|
|
2417
2492
|
|
|
2418
|
-
return
|
|
2493
|
+
return _context15.abrupt("return", new BigNumber(0));
|
|
2419
2494
|
|
|
2420
2495
|
case 5:
|
|
2421
2496
|
token0Decimal = getDecimal(LPInfo.token0);
|
|
2422
2497
|
token1Decimal = getDecimal(LPInfo.token1); // (token0Price * reserve0) / 10^decimal0 = (token1Price * reserve1) / 10^decimal1
|
|
2423
2498
|
// token0Price = (token1Price * reserve1) * 10^decimal0 / 10^decimal1 / reserve0
|
|
2424
2499
|
|
|
2425
|
-
|
|
2500
|
+
_context15.next = 9;
|
|
2426
2501
|
return fetchPrice(LPInfo.token1, provider);
|
|
2427
2502
|
|
|
2428
2503
|
case 9:
|
|
2429
|
-
return
|
|
2504
|
+
return _context15.abrupt("return", _context15.sent.multipliedBy(LPInfo.reserve1.toString()).multipliedBy(decimalFactor(token0Decimal)).dividedBy(decimalFactor(token1Decimal)).dividedBy(LPInfo.reserve0.toString()));
|
|
2430
2505
|
|
|
2431
2506
|
case 10:
|
|
2432
2507
|
case "end":
|
|
2433
|
-
return
|
|
2508
|
+
return _context15.stop();
|
|
2434
2509
|
}
|
|
2435
2510
|
}
|
|
2436
|
-
},
|
|
2511
|
+
}, _callee15);
|
|
2437
2512
|
}));
|
|
2438
2513
|
return _fetchToken0PriceByLP.apply(this, arguments);
|
|
2439
2514
|
}
|
|
2440
2515
|
|
|
2441
|
-
function fetchValuation(
|
|
2516
|
+
function fetchValuation(_x21, _x22) {
|
|
2442
2517
|
return _fetchValuation.apply(this, arguments);
|
|
2443
2518
|
}
|
|
2444
2519
|
|
|
2445
2520
|
function _fetchValuation() {
|
|
2446
|
-
_fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2521
|
+
_fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(tokenAmount, provider) {
|
|
2447
2522
|
var price;
|
|
2448
|
-
return runtime_1.wrap(function
|
|
2523
|
+
return runtime_1.wrap(function _callee16$(_context16) {
|
|
2449
2524
|
while (1) {
|
|
2450
|
-
switch (
|
|
2525
|
+
switch (_context16.prev = _context16.next) {
|
|
2451
2526
|
case 0:
|
|
2452
2527
|
if (!(tokenAmount.rawAmount() == '0')) {
|
|
2453
|
-
|
|
2528
|
+
_context16.next = 2;
|
|
2454
2529
|
break;
|
|
2455
2530
|
}
|
|
2456
2531
|
|
|
2457
|
-
return
|
|
2532
|
+
return _context16.abrupt("return", new BigNumber(0));
|
|
2458
2533
|
|
|
2459
2534
|
case 2:
|
|
2460
|
-
|
|
2535
|
+
_context16.next = 4;
|
|
2461
2536
|
return fetchPrice(tokenAmount.token.address, provider);
|
|
2462
2537
|
|
|
2463
2538
|
case 4:
|
|
2464
|
-
price =
|
|
2465
|
-
return
|
|
2539
|
+
price = _context16.sent;
|
|
2540
|
+
return _context16.abrupt("return", calcValuation(tokenAmount, price));
|
|
2466
2541
|
|
|
2467
2542
|
case 6:
|
|
2468
2543
|
case "end":
|
|
2469
|
-
return
|
|
2544
|
+
return _context16.stop();
|
|
2470
2545
|
}
|
|
2471
2546
|
}
|
|
2472
|
-
},
|
|
2547
|
+
}, _callee16);
|
|
2473
2548
|
}));
|
|
2474
2549
|
return _fetchValuation.apply(this, arguments);
|
|
2475
2550
|
}
|
|
@@ -2477,23 +2552,23 @@ function _fetchValuation() {
|
|
|
2477
2552
|
function calcValuation(tokenAmount, price) {
|
|
2478
2553
|
return new BigNumber(tokenAmount.formattedAmount()).multipliedBy(price);
|
|
2479
2554
|
}
|
|
2480
|
-
function valuateToken(
|
|
2555
|
+
function valuateToken(_x23, _x24) {
|
|
2481
2556
|
return _valuateToken.apply(this, arguments);
|
|
2482
2557
|
}
|
|
2483
2558
|
|
|
2484
2559
|
function _valuateToken() {
|
|
2485
|
-
_valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2560
|
+
_valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee17(tokenAmount, provider) {
|
|
2486
2561
|
var tokenValuation;
|
|
2487
|
-
return runtime_1.wrap(function
|
|
2562
|
+
return runtime_1.wrap(function _callee17$(_context17) {
|
|
2488
2563
|
while (1) {
|
|
2489
|
-
switch (
|
|
2564
|
+
switch (_context17.prev = _context17.next) {
|
|
2490
2565
|
case 0:
|
|
2491
|
-
|
|
2566
|
+
_context17.next = 2;
|
|
2492
2567
|
return fetchValuation(tokenAmount, provider);
|
|
2493
2568
|
|
|
2494
2569
|
case 2:
|
|
2495
|
-
tokenValuation =
|
|
2496
|
-
return
|
|
2570
|
+
tokenValuation = _context17.sent;
|
|
2571
|
+
return _context17.abrupt("return", {
|
|
2497
2572
|
tokenAmount: tokenAmount,
|
|
2498
2573
|
currencyAmount: {
|
|
2499
2574
|
currency: 'USD',
|
|
@@ -2503,10 +2578,10 @@ function _valuateToken() {
|
|
|
2503
2578
|
|
|
2504
2579
|
case 4:
|
|
2505
2580
|
case "end":
|
|
2506
|
-
return
|
|
2581
|
+
return _context17.stop();
|
|
2507
2582
|
}
|
|
2508
2583
|
}
|
|
2509
|
-
},
|
|
2584
|
+
}, _callee17);
|
|
2510
2585
|
}));
|
|
2511
2586
|
return _valuateToken.apply(this, arguments);
|
|
2512
2587
|
}
|
|
@@ -2637,7 +2712,9 @@ var helpers = {
|
|
|
2637
2712
|
getBlockBeforeTimestamp: getBlockBeforeTimestamp,
|
|
2638
2713
|
devLog: devLog,
|
|
2639
2714
|
sortEvents: sortEvents,
|
|
2715
|
+
fetchPriceFromDefiLlamaAPI: fetchPriceFromDefiLlamaAPI,
|
|
2640
2716
|
fetchPriceFromCoingeckoAPI: fetchPriceFromCoingeckoAPI,
|
|
2717
|
+
fetchPriceFromDefiLlama: fetchPriceFromDefiLlama,
|
|
2641
2718
|
fetchPriceFromCoingecko: fetchPriceFromCoingecko,
|
|
2642
2719
|
fetchLPPositions: fetchLPPositions,
|
|
2643
2720
|
fetchLPPrice: fetchLPPrice,
|
|
@@ -6087,5 +6164,5 @@ BigNumber.config({
|
|
|
6087
6164
|
DECIMAL_PLACES: 50
|
|
6088
6165
|
});
|
|
6089
6166
|
|
|
6090
|
-
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
|
|
6167
|
+
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromDefiLlama, fetchPriceFromDefiLlamaAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
|
|
6091
6168
|
//# sourceMappingURL=sdk.esm.js.map
|