@scallop-io/sui-scallop-sdk 0.44.20 → 0.44.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.
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/dist/types/query/borrowIncentive.d.ts +1 -0
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +2 -2
- package/src/constants/vesca.ts +3 -1
- package/src/queries/borrowIncentiveQuery.ts +1 -0
- package/src/queries/portfolioQuery.ts +10 -8
- package/src/types/query/borrowIncentive.ts +1 -0
- package/src/utils/query.ts +1 -1
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(
|
|
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(
|
|
2790
|
+
const weightScale = BigNumber3(1e12);
|
|
2790
2791
|
const boostValue = BigNumber3(accountPoint.weightedAmount).div(
|
|
2791
2792
|
BigNumber3(borrowIncentiveAccount.debtAmount).multipliedBy(poolPoint.baseWeight).dividedBy(weightScale)
|
|
2792
|
-
).
|
|
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,
|
|
@@ -4834,7 +4837,7 @@ var requireObligationInfo2 = async (...params) => {
|
|
|
4834
4837
|
};
|
|
4835
4838
|
};
|
|
4836
4839
|
var getBindedObligationId = async (builder, veScaKey) => {
|
|
4837
|
-
const
|
|
4840
|
+
const borrowIncentiveObjectId = builder.address.get("borrowIncentive.object");
|
|
4838
4841
|
const incentivePoolsId = builder.address.get(
|
|
4839
4842
|
"borrowIncentive.incentivePools"
|
|
4840
4843
|
);
|
|
@@ -4850,7 +4853,7 @@ var getBindedObligationId = async (builder, veScaKey) => {
|
|
|
4850
4853
|
return false;
|
|
4851
4854
|
const incentivePoolFields = incentivePoolsResponse.data.content.fields;
|
|
4852
4855
|
const veScaBindTableId = incentivePoolFields.ve_sca_bind.fields.id.id;
|
|
4853
|
-
const keyType = `${
|
|
4856
|
+
const keyType = `${borrowIncentiveObjectId}::typed_id::TypedID<${veScaPkgId}::ve_sca::VeScaKey>`;
|
|
4854
4857
|
const veScaBindTableResponse = await client.getDynamicFieldObject({
|
|
4855
4858
|
parentId: veScaBindTableId,
|
|
4856
4859
|
name: {
|