@scallop-io/sui-scallop-sdk 0.44.20 → 0.44.21

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/index.mjs CHANGED
@@ -168,7 +168,7 @@ var voloCoinIds = {
168
168
 
169
169
  // src/constants/vesca.ts
170
170
  var UNLOCK_ROUND_DURATION = 60 * 60 * 24;
171
- var MAX_LOCK_ROUNDS = 1460;
171
+ var MAX_LOCK_ROUNDS = IS_VE_SCA_TEST ? 9 : 1460;
172
172
  var MAX_LOCK_DURATION = MAX_LOCK_ROUNDS * UNLOCK_ROUND_DURATION;
173
173
  var MIN_INITIAL_LOCK_AMOUNT = 1e10;
174
174
  var MIN_TOP_UP_AMOUNT = 1e9;
@@ -1139,7 +1139,7 @@ var calculateBorrowIncentivePoolPointData = (pasredBorrowIncentinvePoolData, par
1139
1139
  -1 * rewardCoinDecimal
1140
1140
  );
1141
1141
  const rewardValueForYear = BigNumber(rewardPerSec).multipliedBy(rateYearFactor).multipliedBy(rewardCoinPrice);
1142
- const weightScale = BigNumber("1000000000000");
1142
+ const weightScale = BigNumber(1e12);
1143
1143
  const rewardRate = rewardValueForYear.multipliedBy(
1144
1144
  BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
1145
1145
  weightScale
@@ -2378,7 +2378,8 @@ var queryBorrowIncentivePools = async (query, borrowIncentiveCoinNames, indexer
2378
2378
  coinType: poolCoinType,
2379
2379
  coinDecimal: poolCoinDecimal,
2380
2380
  coinPrice: poolCoinPrice,
2381
- points: borrowIncentivePoolPoints
2381
+ points: borrowIncentivePoolPoints,
2382
+ staked: parsedBorrowIncentivePoolData.staked
2382
2383
  };
2383
2384
  }
2384
2385
  return borrowIncentivePools;
@@ -2786,10 +2787,12 @@ var getObligationAccount = async (query, obligationId, ownerAddress, indexer = f
2786
2787
  availableClaimCoin = availableClaimAmount.shiftedBy(
2787
2788
  -1 * poolPoint.coinDecimal
2788
2789
  );
2789
- const weightScale = BigNumber3("1000000000000");
2790
+ const weightScale = BigNumber3(1e12);
2790
2791
  const boostValue = BigNumber3(accountPoint.weightedAmount).div(
2791
2792
  BigNumber3(borrowIncentiveAccount.debtAmount).multipliedBy(poolPoint.baseWeight).dividedBy(weightScale)
2792
- ).toNumber();
2793
+ ).isFinite() ? BigNumber3(accountPoint.weightedAmount).div(
2794
+ BigNumber3(borrowIncentiveAccount.debtAmount).multipliedBy(poolPoint.baseWeight).dividedBy(weightScale)
2795
+ ).toNumber() : 1;
2793
2796
  if (availableClaimAmount.isGreaterThan(0)) {
2794
2797
  rewards.push({
2795
2798
  coinName: poolPoint.coinName,