@scallop-io/sui-scallop-sdk 0.44.26 → 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/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/builder/borrowIncentive.d.ts +2 -2
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +10 -3
- package/src/types/builder/borrowIncentive.ts +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SuiTxBlock as SuiKitTxBlock,
|
|
1
|
+
import type { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
|
|
2
2
|
import type { TransactionResult } from '@mysten/sui.js/transactions';
|
|
3
3
|
import type { ScallopBuilder } from '../../models';
|
|
4
4
|
import type { SupportBorrowIncentiveCoins, SupportBorrowIncentiveRewardCoins } from '../constant';
|
|
@@ -12,7 +12,7 @@ export type BorrowIncentiveIds = {
|
|
|
12
12
|
};
|
|
13
13
|
export type BorrowIncentiveNormalMethods = {
|
|
14
14
|
stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
15
|
-
stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey:
|
|
15
|
+
stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
|
16
16
|
unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
17
17
|
claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
|
|
18
18
|
deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
package/package.json
CHANGED
|
@@ -61,10 +61,17 @@ const requireObligationInfo = async (
|
|
|
61
61
|
if (obligations.length === 0) {
|
|
62
62
|
throw new Error(`No obligation found for sender ${sender}`);
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
const selectedObligation =
|
|
66
|
+
obligations.find(
|
|
67
|
+
(obligation) =>
|
|
68
|
+
obligation.id === obligationId || obligation.keyId === obligationKey
|
|
69
|
+
) ?? obligations[0];
|
|
70
|
+
|
|
64
71
|
return {
|
|
65
|
-
obligationId:
|
|
66
|
-
obligationKey:
|
|
67
|
-
obligationLocked:
|
|
72
|
+
obligationId: selectedObligation.id,
|
|
73
|
+
obligationKey: selectedObligation.keyId,
|
|
74
|
+
obligationLocked: selectedObligation.locked,
|
|
68
75
|
};
|
|
69
76
|
};
|
|
70
77
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
SuiTxBlock as SuiKitTxBlock,
|
|
3
|
-
SuiTxArg,
|
|
4
3
|
SuiObjectArg,
|
|
5
4
|
} from '@scallop-io/sui-kit';
|
|
6
5
|
import type { TransactionResult } from '@mysten/sui.js/transactions';
|
|
@@ -27,7 +26,7 @@ export type BorrowIncentiveNormalMethods = {
|
|
|
27
26
|
stakeObligationWithVesca: (
|
|
28
27
|
obligation: SuiObjectArg,
|
|
29
28
|
obligationKey: SuiObjectArg,
|
|
30
|
-
veScaKey:
|
|
29
|
+
veScaKey: SuiObjectArg
|
|
31
30
|
) => void;
|
|
32
31
|
unstakeObligation: (
|
|
33
32
|
obligation: SuiObjectArg,
|