@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.
@@ -1,4 +1,4 @@
1
- import type { SuiTxBlock as SuiKitTxBlock, SuiTxArg, SuiObjectArg } from '@scallop-io/sui-kit';
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: SuiTxArg) => void;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.44.26",
3
+ "version": "0.44.27",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -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: obligations[0].id,
66
- obligationKey: obligations[0].keyId,
67
- obligationLocked: obligations[0].locked,
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: SuiTxArg
29
+ veScaKey: SuiObjectArg
31
30
  ) => void;
32
31
  unstakeObligation: (
33
32
  obligation: SuiObjectArg,