@scallop-io/sui-scallop-sdk 2.1.5 → 2.1.6

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.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -473,13 +473,6 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
473
473
  isInSubsTable(builder, sourceKey, table),
474
474
  ]);
475
475
 
476
- console.log({
477
- targetKey,
478
- sourceKey,
479
- isTargetInSubTable,
480
- isSourceInSubTable,
481
- });
482
-
483
476
  const unstakeObligationBeforeStake =
484
477
  !!txBlock.txBlock.blockData.transactions.find(
485
478
  (txn) =>
@@ -776,8 +776,8 @@ class ScallopQuery implements ScallopQueryInterface {
776
776
  /**
777
777
  * Get list of isolated assets
778
778
  */
779
- async getIsolatedAssets() {
780
- return await getIsolatedAssets(this);
779
+ async getIsolatedAssets(useOnChainQuery: boolean = false) {
780
+ return await getIsolatedAssets(this, useOnChainQuery);
781
781
  }
782
782
 
783
783
  /**
@@ -247,6 +247,7 @@ const queryRequiredMarketObjects = async (
247
247
  borrowFeeKey?: string;
248
248
  supplyLimitKey?: string;
249
249
  borrowLimitKey?: string;
250
+ isolatedAssetKey?: string;
250
251
  };
251
252
 
252
253
  const keyCollections: Record<keyof KeyType, string[]> = {
@@ -258,6 +259,7 @@ const queryRequiredMarketObjects = async (
258
259
  borrowFeeKey: [],
259
260
  supplyLimitKey: [],
260
261
  borrowLimitKey: [],
262
+ isolatedAssetKey: [],
261
263
  };
262
264
 
263
265
  const taskMap = new Map<string, KeyType>();
@@ -274,6 +276,7 @@ const queryRequiredMarketObjects = async (
274
276
  borrowFeeKey: poolData?.borrowFeeKey,
275
277
  supplyLimitKey: poolData?.supplyLimitKey,
276
278
  borrowLimitKey: poolData?.borrowLimitKey,
279
+ isolatedAssetKey: poolData?.isolatedAssetKey,
277
280
  };
278
281
 
279
282
  // Add to key collections
@@ -311,6 +314,7 @@ const queryRequiredMarketObjects = async (
311
314
  borrowFeeKey: new Map<string, SuiObjectData>(),
312
315
  supplyLimitKey: new Map<string, SuiObjectData>(),
313
316
  borrowLimitKey: new Map<string, SuiObjectData>(),
317
+ isolatedAssetKey: new Map<string, SuiObjectData>(),
314
318
  isIsolated: new Map<string, boolean>(),
315
319
  } as Record<keyof KeyType, Map<string, SuiObjectData>>;
316
320
 
@@ -349,7 +353,10 @@ const queryRequiredMarketObjects = async (
349
353
  borrowLimitKey: task.borrowLimitKey
350
354
  ? resultMaps.borrowLimitKey.get(task.borrowLimitKey)
351
355
  : undefined,
352
- isolatedAssetKey: utils.constants.poolAddresses[poolCoinName]?.isIsolated,
356
+ isolatedAssetKey: task.isolatedAssetKey
357
+ ? resultMaps.isolatedAssetKey.get(task.isolatedAssetKey)
358
+ : undefined,
359
+ isIsolated: utils.constants.poolAddresses[poolCoinName]?.isIsolated,
353
360
  };
354
361
  }
355
362
 
@@ -553,6 +560,7 @@ export const getMarketPool = async (
553
560
  borrowFeeKey: SuiObjectData;
554
561
  supplyLimitKey: SuiObjectData;
555
562
  borrowLimitKey: SuiObjectData;
563
+ isolatedAssetKey?: SuiObjectData;
556
564
  isIsolated: boolean;
557
565
  }
558
566
  ): Promise<