@scallop-io/sui-scallop-sdk 2.2.7 → 2.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -11,7 +11,7 @@ export const queryKeys = {
11
11
  getPoolAddresses: () => ['api', 'getPoolAddresses'],
12
12
  getMarket: () => ['api', 'getMarket'],
13
13
  getSpools: () => ['api', 'getSpools'],
14
- getBorrowIncentivePool: () => ['api', 'getBorrowIncentivePools'],
14
+ getBorrowIncentivePools: () => ['api', 'getBorrowIncentivePools'],
15
15
  getTotalValueLocked: () => ['api', 'getTotalValueLocked'],
16
16
  },
17
17
 
@@ -134,7 +134,7 @@ class ScallopIndexer extends ScallopAxios {
134
134
  borrowIncentivePools: BorrowIncentivePool[];
135
135
  }>(
136
136
  '/api/borrowIncentivePools/migrate',
137
- queryKeys.api.getBorrowIncentivePool()
137
+ queryKeys.api.getBorrowIncentivePools()
138
138
  );
139
139
 
140
140
  if (response.status === 200) {
@@ -839,8 +839,6 @@ export const getTotalValueLocked = async (
839
839
  query: ScallopQuery,
840
840
  indexer: boolean = false
841
841
  ) => {
842
- const market = await query.getMarketPools(undefined, { indexer });
843
-
844
842
  let supplyLendingValue = BigNumber(0);
845
843
  let supplyCollateralValue = BigNumber(0);
846
844
  let borrowValue = BigNumber(0);
@@ -863,6 +861,8 @@ export const getTotalValueLocked = async (
863
861
  return tvl;
864
862
  }
865
863
 
864
+ const market = await query.getMarketPools(undefined, { indexer });
865
+
866
866
  for (const pool of Object.values(market.pools)) {
867
867
  if (!pool) continue;
868
868
  supplyLendingValue = supplyLendingValue.plus(