impermax-sdk 1.2.20 → 1.2.22

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.
@@ -2,6 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WHITELIST_SUBGRAPH_URL = exports.CONFIG_MANAGER_SUBGRAPH_URL = exports.XIMX_SUBGRAPH_URL = exports.BLOCKS_SUBGRAPH_URL = exports.LENDING_VAULT_SUBGRAPH_URL = exports.IMPERMAX_CHEF_SUBGRAPH_URL = exports.IMPERMAX_SUBGRAPH_URL = void 0;
4
4
  const types_1 = require("./types");
5
+ /*
6
+ * Unsupported networks by latest SDK update (old subgraph version)
7
+ * - Ethereum
8
+ * - Arbitrum
9
+ * - Avalanche
10
+ * - Moonriver
11
+ * - Aurora
12
+ * - Fantom
13
+ * - Canto
14
+ * - ZkSync
15
+ */
5
16
  exports.IMPERMAX_SUBGRAPH_URL = {
6
17
  [types_1.Networks.Ropsten]: {
7
18
  [types_1.Factory.V2V1]: 'https://api.thegraph.com/subgraphs/name/impermax-finance/impermax-x-uniswap-v2-ropsten'
@@ -57,12 +57,7 @@ class OffchainBorrowable extends offchainPoolToken_1.default {
57
57
  // Borrow tracker
58
58
  getBorrowTracker() {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
- //return this.getPoolTokenParamFloat("borrowTracker");
61
- const poolTokenData = yield this.getPoolTokenData();
62
- const farmingPoolData = poolTokenData.farmingPool;
63
- if (farmingPoolData === null)
64
- return "0x0000000000000000000000000000000000000000";
65
- return farmingPoolData.id;
60
+ return this.getPoolTokenParam("borrowTracker");
66
61
  });
67
62
  }
68
63
  // Borrow Index
@@ -55,6 +55,7 @@ class Offchain {
55
55
  * - ximxData
56
56
  * - lendingVaultData
57
57
  */
58
+ // TODO make everything protected
58
59
  // Fetchers
59
60
  this.apolloFetcher = initializer.apolloFetcher;
60
61
  this.fetchLendingPools = initializer.fetchLendingPools;
@@ -680,9 +680,9 @@ function fetchWhitelist() {
680
680
  if (!subgraph)
681
681
  return [];
682
682
  const result = yield this.apolloFetcher(subgraph, query.whitelistQuery());
683
- if (!result || !result.data.whitelistState)
683
+ if (!result || !result.data.whitelistStates)
684
684
  return [];
685
- return result.data.whitelistState;
685
+ return result.data.whitelistStates;
686
686
  });
687
687
  }
688
688
  exports.fetchWhitelist = fetchWhitelist;
@@ -47,12 +47,14 @@ function lendingPoolsQuery(factory, addressesFilter) {
47
47
  reserveFactor
48
48
  kinkBorrowRate
49
49
  kinkUtilizationRate
50
+ adjustSpeed
50
51
  borrowIndex
51
52
  accrualTimestamp
52
53
  exchangeRate
53
54
  totalBalanceUSD
54
55
  totalSupplyUSD
55
56
  totalBorrowsUSD
57
+ borrowTracker
56
58
  farmingPool ${farmingPoolStr}
57
59
  }`;
58
60
  const collateralStr = `{
@@ -273,7 +275,7 @@ exports.lendingVaultsUserQuery = lendingVaultsUserQuery;
273
275
  function proposalsMetaQuery(rangeBegin, rangeLength, descending) {
274
276
  return (0, graphql_tag_1.default) `{
275
277
  proposals(
276
- orderBy: id,
278
+ orderBy: idInt,
277
279
  orderDirection: ${descending ? "desc" : "asc"},
278
280
  first: ${rangeLength},
279
281
  skip: ${rangeBegin}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",