@scallop-io/sui-scallop-sdk 0.44.24 → 0.44.26

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.
@@ -290,9 +290,13 @@ export declare class ScallopQuery {
290
290
  * @return Borrow incentive pools data.
291
291
  */
292
292
  getBorrowIncentivePools(coinNames?: SupportBorrowIncentiveCoins[], indexer?: boolean): Promise<{
293
+ eth?: import("../types").BorrowIncentivePool | undefined;
293
294
  usdc?: import("../types").BorrowIncentivePool | undefined;
294
295
  usdt?: import("../types").BorrowIncentivePool | undefined;
295
296
  sui?: import("../types").BorrowIncentivePool | undefined;
297
+ afsui?: import("../types").BorrowIncentivePool | undefined;
298
+ hasui?: import("../types").BorrowIncentivePool | undefined;
299
+ vsui?: import("../types").BorrowIncentivePool | undefined;
296
300
  sca?: import("../types").BorrowIncentivePool | undefined;
297
301
  }>;
298
302
  /**
@@ -303,9 +307,13 @@ export declare class ScallopQuery {
303
307
  * @return Borrow incentive accounts data.
304
308
  */
305
309
  getBorrowIncentiveAccounts(obligationId: string, coinNames?: SupportBorrowIncentiveCoins[]): Promise<{
310
+ eth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
306
311
  usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
307
312
  usdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
308
313
  sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
314
+ afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
315
+ hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
316
+ vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
309
317
  sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
310
318
  }>;
311
319
  /**
@@ -9,9 +9,13 @@ import type { SupportBorrowIncentiveCoins } from '../types';
9
9
  * @return Borrow incentive pools data.
10
10
  */
11
11
  export declare const queryBorrowIncentivePools: (query: ScallopQuery, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[], indexer?: boolean) => Promise<{
12
+ eth?: import("../types").BorrowIncentivePool | undefined;
12
13
  usdc?: import("../types").BorrowIncentivePool | undefined;
13
14
  usdt?: import("../types").BorrowIncentivePool | undefined;
14
15
  sui?: import("../types").BorrowIncentivePool | undefined;
16
+ afsui?: import("../types").BorrowIncentivePool | undefined;
17
+ hasui?: import("../types").BorrowIncentivePool | undefined;
18
+ vsui?: import("../types").BorrowIncentivePool | undefined;
15
19
  sca?: import("../types").BorrowIncentivePool | undefined;
16
20
  }>;
17
21
  /**
@@ -22,8 +26,12 @@ export declare const queryBorrowIncentivePools: (query: ScallopQuery, borrowInce
22
26
  * @return Borrow incentive accounts data.
23
27
  */
24
28
  export declare const queryBorrowIncentiveAccounts: (query: ScallopQuery, obligationId: string, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[]) => Promise<{
29
+ eth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
25
30
  usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
26
31
  usdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
27
32
  sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
33
+ afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
34
+ hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
35
+ vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
28
36
  sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
29
37
  }>;
@@ -1,4 +1,4 @@
1
- import type { SuiTxBlock as SuiKitTxBlock, SuiAddressArg, SuiTxArg } from '@scallop-io/sui-kit';
1
+ import type { SuiTxBlock as SuiKitTxBlock, SuiTxArg, 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';
@@ -11,16 +11,17 @@ export type BorrowIncentiveIds = {
11
11
  obligationAccessStore: string;
12
12
  };
13
13
  export type BorrowIncentiveNormalMethods = {
14
- stakeObligation: (obligation: SuiAddressArg, obligationKey: SuiAddressArg) => void;
15
- stakeObligationWithVesca: (obligation: SuiAddressArg, obligationKey: SuiAddressArg, veScaKey: SuiTxArg) => void;
16
- unstakeObligation: (obligation: SuiAddressArg, obligationKey: SuiAddressArg) => void;
17
- claimBorrowIncentive: (obligation: SuiAddressArg, obligationKey: SuiAddressArg, coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
14
+ stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
15
+ stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiTxArg) => void;
16
+ unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
17
+ claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
18
+ deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
18
19
  };
19
20
  export type BorrowIncentiveQuickMethods = {
20
- stakeObligationQuick(obligation?: SuiAddressArg, obligationKey?: SuiAddressArg): Promise<void>;
21
- stakeObligationWithVeScaQuick(obligation?: SuiAddressArg, obligationKey?: SuiAddressArg, veScaKey?: SuiAddressArg): Promise<void>;
22
- unstakeObligationQuick(obligation?: SuiAddressArg, obligationKey?: SuiAddressArg): Promise<void>;
23
- claimBorrowIncentiveQuick(coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins, obligation?: SuiAddressArg, obligationKey?: SuiAddressArg): Promise<TransactionResult>;
21
+ stakeObligationQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<void>;
22
+ stakeObligationWithVeScaQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg, veScaKey?: SuiObjectArg): Promise<void>;
23
+ unstakeObligationQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<void>;
24
+ claimBorrowIncentiveQuick(coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins, obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<TransactionResult>;
24
25
  };
25
26
  export type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiKitTxBlock & BorrowIncentiveNormalMethods;
26
27
  export type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
@@ -1,4 +1,4 @@
1
- import { SuiTxBlock as SuiKitTxBlock, SuiAddressArg, SuiObjectArg, SuiTxArg } from '@scallop-io/sui-kit';
1
+ import { SuiTxBlock as SuiKitTxBlock, SuiObjectArg, SuiTxArg } from '@scallop-io/sui-kit';
2
2
  import type { TransactionResult } from '@mysten/sui.js/transactions';
3
3
  import { ScallopBuilder } from 'src/models';
4
4
  export type VescaIds = {
@@ -9,17 +9,17 @@ export type VescaIds = {
9
9
  };
10
10
  export type VeScaNormalMethods = {
11
11
  lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: SuiTxArg) => TransactionResult;
12
- extendLockPeriod: (veScaKey: SuiAddressArg, newUnlockAtInSecondTimestamp: SuiTxArg) => void;
13
- extendLockAmount: (veScaKey: SuiAddressArg, scaCoin: SuiObjectArg) => void;
14
- renewExpiredVeSca: (veScaKey: SuiAddressArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: SuiTxArg) => void;
15
- redeemSca: (veScaKey: SuiAddressArg) => TransactionResult;
12
+ extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: SuiTxArg) => void;
13
+ extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
14
+ renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: SuiTxArg) => void;
15
+ redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
16
16
  };
17
17
  export type VeScaQuickMethods = {
18
18
  lockScaQuick(amountOrCoin?: SuiObjectArg | number, lockPeriodInDays?: number, autoCheck?: boolean): Promise<void>;
19
- extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiAddressArg, autoCheck?: boolean) => Promise<void>;
20
- extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiAddressArg, autoCheck?: boolean) => Promise<void>;
21
- renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiAddressArg, autoCheck?: boolean) => Promise<void>;
22
- redeemScaQuick: (veScaKey?: SuiAddressArg) => Promise<void>;
19
+ extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
20
+ extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
21
+ renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
22
+ redeemScaQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
23
23
  };
24
24
  export type SuiTxBlockWithVeScaNormalMethods = SuiKitTxBlock & VeScaNormalMethods;
25
25
  export type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.44.24",
3
+ "version": "0.44.26",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -4,7 +4,7 @@ import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
4
4
  import { borrowIncentiveRewardCoins } from '../constants/enum';
5
5
  import { getObligations, getObligationLocked } from '../queries';
6
6
  import { requireSender } from '../utils';
7
- import type { SuiAddressArg } from '@scallop-io/sui-kit';
7
+ import type { SuiObjectArg } from '@scallop-io/sui-kit';
8
8
  import type { ScallopBuilder } from '../models';
9
9
  import type {
10
10
  BorrowIncentiveIds,
@@ -39,8 +39,8 @@ const requireObligationInfo = async (
39
39
  ...params: [
40
40
  builder: ScallopBuilder,
41
41
  txBlock: SuiKitTxBlock,
42
- obligationId?: SuiAddressArg,
43
- obligationKey?: SuiAddressArg,
42
+ obligationId?: SuiObjectArg,
43
+ obligationKey?: SuiObjectArg,
44
44
  ]
45
45
  ) => {
46
46
  const [builder, txBlock, obligationId, obligationKey] = params;
@@ -220,6 +220,19 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
220
220
  [rewardType]
221
221
  );
222
222
  },
223
+ deactivateBoost: (obligation, veScaKey) => {
224
+ return txBlock.moveCall(
225
+ `${borrowIncentiveIds.borrowIncentivePkg}::user::deactivate_boost`,
226
+ [
227
+ borrowIncentiveIds.config,
228
+ borrowIncentiveIds.incentivePools,
229
+ borrowIncentiveIds.incentiveAccounts,
230
+ obligation,
231
+ veScaKey,
232
+ SUI_CLOCK_OBJECT_ID,
233
+ ]
234
+ );
235
+ },
223
236
  };
224
237
  };
225
238
 
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  SUI_CLOCK_OBJECT_ID,
3
- SuiAddressArg,
4
3
  SuiTxBlock,
5
4
  TransactionBlock,
6
5
  SuiTxBlock as SuiKitTxBlock,
@@ -46,7 +45,7 @@ export const requireVeSca = async (
46
45
  ...params: [
47
46
  builder: ScallopBuilder,
48
47
  SuiTxBlock: SuiTxBlock,
49
- veScaKey?: SuiAddressArg,
48
+ veScaKey?: SuiObjectArg,
50
49
  ]
51
50
  ) => {
52
51
  const [builder, txBlock, veScaKey] = params;
@@ -254,7 +253,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
254
253
  },
255
254
  extendLockPeriodQuick: async (
256
255
  lockPeriodInDays: number,
257
- veScaKey?: SuiAddressArg,
256
+ veScaKey?: SuiObjectArg,
258
257
  autoCheck = true
259
258
  ) => {
260
259
  const veSca = await requireVeSca(builder, txBlock, veScaKey);
@@ -269,7 +268,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
269
268
  },
270
269
  extendLockAmountQuick: async (
271
270
  scaAmount: number,
272
- veScaKey?: SuiAddressArg,
271
+ veScaKey?: SuiObjectArg,
273
272
  autoCheck = true
274
273
  ) => {
275
274
  const sender = requireSender(txBlock);
@@ -295,7 +294,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
295
294
  renewExpiredVeScaQuick: async (
296
295
  scaAmount: number,
297
296
  lockPeriodInDays: number,
298
- veScaKey?: SuiAddressArg,
297
+ veScaKey?: SuiObjectArg,
299
298
  autoCheck = true
300
299
  ) => {
301
300
  const sender = requireSender(txBlock);
@@ -329,7 +328,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
329
328
  txBlock.transferObjects(transferObjects, sender);
330
329
  }
331
330
  },
332
- redeemScaQuick: async (veScaKey?: SuiAddressArg) => {
331
+ redeemScaQuick: async (veScaKey?: SuiObjectArg) => {
333
332
  const sender = requireSender(txBlock);
334
333
  const veSca = await requireVeSca(builder, txBlock, veScaKey);
335
334
 
@@ -70,6 +70,10 @@ export const SUPPORT_BORROW_INCENTIVE_POOLS = [
70
70
  'sui',
71
71
  'usdc',
72
72
  'usdt',
73
+ 'afsui',
74
+ 'hasui',
75
+ 'vsui',
76
+ 'eth',
73
77
  'sca',
74
78
  ] as const;
75
79
 
@@ -95,6 +95,10 @@ export const borrowIncentiveRewardCoins: BorrowIncentiveRewardCoins = {
95
95
  usdc: ['sui', 'sca'],
96
96
  usdt: ['sui', 'sca'],
97
97
  sca: ['sui', 'sca'],
98
+ afsui: ['sui'],
99
+ hasui: ['sui'],
100
+ vsui: ['sui'],
101
+ eth: ['sui'],
98
102
  };
99
103
 
100
104
  export const coinIds: AssetCoinIds = {
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  SuiTxBlock as SuiKitTxBlock,
3
- SuiAddressArg,
4
3
  SuiTxArg,
4
+ SuiObjectArg,
5
5
  } from '@scallop-io/sui-kit';
6
6
  import type { TransactionResult } from '@mysten/sui.js/transactions';
7
7
  import type { ScallopBuilder } from '../../models';
@@ -21,45 +21,46 @@ export type BorrowIncentiveIds = {
21
21
 
22
22
  export type BorrowIncentiveNormalMethods = {
23
23
  stakeObligation: (
24
- obligation: SuiAddressArg,
25
- obligationKey: SuiAddressArg
24
+ obligation: SuiObjectArg,
25
+ obligationKey: SuiObjectArg
26
26
  ) => void;
27
27
  stakeObligationWithVesca: (
28
- obligation: SuiAddressArg,
29
- obligationKey: SuiAddressArg,
28
+ obligation: SuiObjectArg,
29
+ obligationKey: SuiObjectArg,
30
30
  veScaKey: SuiTxArg
31
31
  ) => void;
32
32
  unstakeObligation: (
33
- obligation: SuiAddressArg,
34
- obligationKey: SuiAddressArg
33
+ obligation: SuiObjectArg,
34
+ obligationKey: SuiObjectArg
35
35
  ) => void;
36
36
  claimBorrowIncentive: (
37
- obligation: SuiAddressArg,
38
- obligationKey: SuiAddressArg,
37
+ obligation: SuiObjectArg,
38
+ obligationKey: SuiObjectArg,
39
39
  coinName: SupportBorrowIncentiveCoins,
40
40
  rewardType: SupportBorrowIncentiveRewardCoins
41
41
  ) => TransactionResult;
42
+ deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
42
43
  };
43
44
 
44
45
  export type BorrowIncentiveQuickMethods = {
45
46
  stakeObligationQuick(
46
- obligation?: SuiAddressArg,
47
- obligationKey?: SuiAddressArg
47
+ obligation?: SuiObjectArg,
48
+ obligationKey?: SuiObjectArg
48
49
  ): Promise<void>;
49
50
  stakeObligationWithVeScaQuick(
50
- obligation?: SuiAddressArg,
51
- obligationKey?: SuiAddressArg,
52
- veScaKey?: SuiAddressArg
51
+ obligation?: SuiObjectArg,
52
+ obligationKey?: SuiObjectArg,
53
+ veScaKey?: SuiObjectArg
53
54
  ): Promise<void>;
54
55
  unstakeObligationQuick(
55
- obligation?: SuiAddressArg,
56
- obligationKey?: SuiAddressArg
56
+ obligation?: SuiObjectArg,
57
+ obligationKey?: SuiObjectArg
57
58
  ): Promise<void>;
58
59
  claimBorrowIncentiveQuick(
59
60
  coinName: SupportBorrowIncentiveCoins,
60
61
  rewardType: SupportBorrowIncentiveRewardCoins,
61
- obligation?: SuiAddressArg,
62
- obligationKey?: SuiAddressArg
62
+ obligation?: SuiObjectArg,
63
+ obligationKey?: SuiObjectArg
63
64
  ): Promise<TransactionResult>;
64
65
  };
65
66
 
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  SuiTxBlock as SuiKitTxBlock,
3
- SuiAddressArg,
4
3
  SuiObjectArg,
5
4
  SuiTxArg,
6
5
  } from '@scallop-io/sui-kit';
@@ -20,16 +19,16 @@ export type VeScaNormalMethods = {
20
19
  unlockAtInSecondTimestamp: SuiTxArg
21
20
  ) => TransactionResult;
22
21
  extendLockPeriod: (
23
- veScaKey: SuiAddressArg,
22
+ veScaKey: SuiObjectArg,
24
23
  newUnlockAtInSecondTimestamp: SuiTxArg
25
24
  ) => void;
26
- extendLockAmount: (veScaKey: SuiAddressArg, scaCoin: SuiObjectArg) => void;
25
+ extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
27
26
  renewExpiredVeSca: (
28
- veScaKey: SuiAddressArg,
27
+ veScaKey: SuiObjectArg,
29
28
  scaCoin: SuiObjectArg,
30
29
  newUnlockAtInSecondTimestamp: SuiTxArg
31
30
  ) => void;
32
- redeemSca: (veScaKey: SuiAddressArg) => TransactionResult;
31
+ redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
33
32
  };
34
33
 
35
34
  export type VeScaQuickMethods = {
@@ -40,21 +39,21 @@ export type VeScaQuickMethods = {
40
39
  ): Promise<void>;
41
40
  extendLockPeriodQuick: (
42
41
  lockPeriodInDays: number,
43
- veScaKey?: SuiAddressArg,
42
+ veScaKey?: SuiObjectArg,
44
43
  autoCheck?: boolean
45
44
  ) => Promise<void>;
46
45
  extendLockAmountQuick: (
47
46
  scaAmount: number,
48
- veScaKey?: SuiAddressArg,
47
+ veScaKey?: SuiObjectArg,
49
48
  autoCheck?: boolean
50
49
  ) => Promise<void>;
51
50
  renewExpiredVeScaQuick: (
52
51
  scaAmount: number,
53
52
  lockPeriodInDays: number,
54
- veScaKey?: SuiAddressArg,
53
+ veScaKey?: SuiObjectArg,
55
54
  autoCheck?: boolean
56
55
  ) => Promise<void>;
57
- redeemScaQuick: (veScaKey?: SuiAddressArg) => Promise<void>;
56
+ redeemScaQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
58
57
  };
59
58
 
60
59
  export type SuiTxBlockWithVeScaNormalMethods = SuiKitTxBlock &