@scallop-io/sui-scallop-sdk 0.44.25 → 0.44.27
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/builders/vescaBuilder.d.ts +3 -2
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/builder/borrowIncentive.d.ts +10 -9
- package/dist/types/builder/vesca.d.ts +9 -9
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +26 -6
- package/src/builders/vescaBuilder.ts +5 -6
- package/src/types/builder/borrowIncentive.ts +20 -20
- package/src/types/builder/vesca.ts +8 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiTxBlock, TransactionBlock, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
|
|
2
2
|
import { ScallopBuilder } from '../models';
|
|
3
|
+
import type { SuiObjectArg } from '@scallop-io/sui-kit';
|
|
3
4
|
import type { ScallopTxBlock, VeScaTxBlock } from 'src/types';
|
|
4
5
|
/**
|
|
5
6
|
* Check and get veSCA data from transaction block.
|
|
@@ -13,7 +14,7 @@ import type { ScallopTxBlock, VeScaTxBlock } from 'src/types';
|
|
|
13
14
|
* @param veScaKey - veSCA key.
|
|
14
15
|
* @return veSCA key, ID, locked amount and unlock at timestamp.
|
|
15
16
|
*/
|
|
16
|
-
export declare const requireVeSca: (builder: ScallopBuilder, SuiTxBlock: SuiTxBlock, veScaKey?:
|
|
17
|
+
export declare const requireVeSca: (builder: ScallopBuilder, SuiTxBlock: SuiTxBlock, veScaKey?: SuiObjectArg | undefined) => Promise<import("src/types").Vesca | undefined>;
|
|
17
18
|
/**
|
|
18
19
|
* Create an enhanced transaction block instance for interaction with veSCA modules of the Scallop contract.
|
|
19
20
|
*
|
package/dist/index.js
CHANGED
|
@@ -4927,10 +4927,13 @@ var requireObligationInfo2 = async (...params) => {
|
|
|
4927
4927
|
if (obligations.length === 0) {
|
|
4928
4928
|
throw new Error(`No obligation found for sender ${sender}`);
|
|
4929
4929
|
}
|
|
4930
|
+
const selectedObligation = obligations.find(
|
|
4931
|
+
(obligation) => obligation.id === obligationId || obligation.keyId === obligationKey
|
|
4932
|
+
) ?? obligations[0];
|
|
4930
4933
|
return {
|
|
4931
|
-
obligationId:
|
|
4932
|
-
obligationKey:
|
|
4933
|
-
obligationLocked:
|
|
4934
|
+
obligationId: selectedObligation.id,
|
|
4935
|
+
obligationKey: selectedObligation.keyId,
|
|
4936
|
+
obligationLocked: selectedObligation.locked
|
|
4934
4937
|
};
|
|
4935
4938
|
};
|
|
4936
4939
|
var getBindedObligationId = async (builder, veScaKey) => {
|
|
@@ -5045,6 +5048,19 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
5045
5048
|
],
|
|
5046
5049
|
[rewardType]
|
|
5047
5050
|
);
|
|
5051
|
+
},
|
|
5052
|
+
deactivateBoost: (obligation, veScaKey) => {
|
|
5053
|
+
return txBlock.moveCall(
|
|
5054
|
+
`${borrowIncentiveIds.borrowIncentivePkg}::user::deactivate_boost`,
|
|
5055
|
+
[
|
|
5056
|
+
borrowIncentiveIds.config,
|
|
5057
|
+
borrowIncentiveIds.incentivePools,
|
|
5058
|
+
borrowIncentiveIds.incentiveAccounts,
|
|
5059
|
+
obligation,
|
|
5060
|
+
veScaKey,
|
|
5061
|
+
import_utils17.SUI_CLOCK_OBJECT_ID
|
|
5062
|
+
]
|
|
5063
|
+
);
|
|
5048
5064
|
}
|
|
5049
5065
|
};
|
|
5050
5066
|
};
|