@scallop-io/sui-scallop-sdk 2.0.9-emerging-asset-alpha.1 → 2.0.10

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.0.9-emerging-asset-alpha.1",
3
+ "version": "2.0.10",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -1092,12 +1092,12 @@ export class ScallopClient {
1092
1092
  */
1093
1093
  public async claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
1094
1094
  public async claimAllUnlockedSca<S extends boolean>(
1095
- walletAddress?: string,
1096
- sign?: S
1095
+ sign?: S,
1096
+ walletAddress?: string
1097
1097
  ): Promise<ScallopClientVeScaReturnType<S>>;
1098
1098
  public async claimAllUnlockedSca<S extends boolean>(
1099
- walletAddress?: string,
1100
- sign: S = true as S
1099
+ sign: S = true as S,
1100
+ walletAddress?: string
1101
1101
  ): Promise<ScallopClientVeScaReturnType<S>> {
1102
1102
  const sender = walletAddress ?? this.walletAddress;
1103
1103
  // get all veSca keys
@@ -352,8 +352,7 @@ const queryRequiredMarketObjects = async (
352
352
  borrowFeeKey: borrowFeeMap[name],
353
353
  supplyLimitKey: supplyLimitMap[name],
354
354
  borrowLimitKey: borrowLimitMap[name],
355
- isolatedAssetKey:
356
- query.constants.poolAddresses[name]?.isolatedAssetKey ?? false,
355
+ isIsolated: query.constants.poolAddresses[name]?.isIsolated ?? false,
357
356
  };
358
357
  return acc;
359
358
  },
@@ -368,7 +367,7 @@ const queryRequiredMarketObjects = async (
368
367
  borrowFeeKey: SuiObjectData;
369
368
  supplyLimitKey: SuiObjectData;
370
369
  borrowLimitKey: SuiObjectData;
371
- isolatedAssetKey: boolean;
370
+ isIsolated: boolean;
372
371
  }
373
372
  >
374
373
  );
@@ -472,7 +471,7 @@ const parseMarketPoolObjects = ({
472
471
  borrowFeeKey,
473
472
  supplyLimitKey,
474
473
  borrowLimitKey,
475
- isolatedAssetKey,
474
+ isIsolated,
476
475
  }: {
477
476
  balanceSheet: SuiObjectData;
478
477
  borrowDynamic: SuiObjectData;
@@ -482,7 +481,7 @@ const parseMarketPoolObjects = ({
482
481
  borrowFeeKey?: SuiObjectData;
483
482
  supplyLimitKey?: SuiObjectData;
484
483
  borrowLimitKey?: SuiObjectData;
485
- isolatedAssetKey: boolean;
484
+ isIsolated: boolean;
486
485
  }): OriginMarketPoolData & {
487
486
  parsedOriginMarketCollateral?: OriginMarketCollateralData;
488
487
  } => {
@@ -509,7 +508,7 @@ const parseMarketPoolObjects = ({
509
508
  _riskModel && _collateralStat
510
509
  ? {
511
510
  type: _interestModel.type.fields,
512
- isIsolated: isolatedAssetKey,
511
+ isIsolated: isIsolated,
513
512
  collateralFactor: _riskModel.collateral_factor.fields,
514
513
  liquidationFactor: _riskModel.liquidation_factor.fields,
515
514
  liquidationPenalty: _riskModel.liquidation_penalty.fields,
@@ -541,7 +540,7 @@ const parseMarketPoolObjects = ({
541
540
  highKink: _interestModel.high_kink.fields,
542
541
  midKink: _interestModel.mid_kink.fields,
543
542
  minBorrowAmount: _interestModel.min_borrow_amount,
544
- isIsolated: !!isolatedAssetKey,
543
+ isIsolated,
545
544
  supplyLimit: _supplyLimit,
546
545
  borrowLimit: _borrowLimit,
547
546
  parsedOriginMarketCollateral,
@@ -570,7 +569,7 @@ export const getMarketPool = async (
570
569
  borrowFeeKey: SuiObjectData;
571
570
  supplyLimitKey: SuiObjectData;
572
571
  borrowLimitKey: SuiObjectData;
573
- isolatedAssetKey: boolean;
572
+ isIsolated: boolean;
574
573
  }
575
574
  ): Promise<
576
575
  { marketPool: MarketPool; collateral?: MarketCollateral } | undefined
@@ -90,7 +90,7 @@ export const isIsolatedAsset = async (
90
90
  ): Promise<boolean> => {
91
91
  const assetInPoolAddresses = utils.constants.poolAddresses[coinName];
92
92
  if (assetInPoolAddresses) {
93
- return assetInPoolAddresses.isolatedAssetKey;
93
+ return assetInPoolAddresses.isIsolated;
94
94
  }
95
95
 
96
96
  const marketObject = utils.address.get('core.market');
@@ -296,7 +296,8 @@ export const getPoolAddresses = async (
296
296
  borrowFeeKey: addresses[5] ?? '',
297
297
  supplyLimitKey: addresses[6] ?? '',
298
298
  borrowLimitKey: addresses[7] ?? '',
299
- isolatedAssetKey: (addresses[8]?.fields as any)?.value ?? false,
299
+ isolatedAssetKey: (addresses[8]?.fields as any)?.id.id ?? '',
300
+ isIsolated: (addresses[8]?.fields as any)?.value ?? false,
300
301
  ...spoolData,
301
302
  ...sCoinData,
302
303
  sCoinName,
@@ -4,6 +4,7 @@ export type PoolAddress = {
4
4
  coinType: string;
5
5
  coinMetadataId: string;
6
6
  decimals: number;
7
+ isIsolated: boolean;
7
8
  // optional keys
8
9
  pythFeed?: string;
9
10
  pythFeedObjectId?: string;
@@ -22,7 +23,7 @@ export type PoolAddress = {
22
23
  sCoinSymbol?: string;
23
24
  sCoinMetadataId?: string;
24
25
  sCoinTreasury?: string;
25
- isolatedAssetKey: boolean;
26
+ isolatedAssetKey: string;
26
27
  spool?: string;
27
28
  spoolReward?: string;
28
29
  spoolName?: string;