@scallop-io/sui-scallop-sdk 2.1.1 → 2.1.2-merge-split-ve-sca-alpha.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "2.1.1",
3
+ "version": "2.1.2-merge-split-ve-sca-alpha.1",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -3,8 +3,8 @@ import {
3
3
  SuiTxBlock as SuiKitTxBlock,
4
4
  SUI_CLOCK_OBJECT_ID,
5
5
  } from '@scallop-io/sui-kit';
6
- import { getObligations, getObligationLocked } from '../queries';
7
- import { requireSender } from '../utils';
6
+ import { getObligations, getObligationLocked } from 'src/queries';
7
+ import { requireSender } from 'src/utils';
8
8
  import type { SuiObjectArg } from '@scallop-io/sui-kit';
9
9
  import type { ScallopBuilder } from 'src/models';
10
10
  import type {
@@ -14,8 +14,7 @@ import type {
14
14
  SuiTxBlockWithBorrowIncentiveNormalMethods,
15
15
  BorrowIncentiveTxBlock,
16
16
  ScallopTxBlock,
17
- VescaIds,
18
- } from '../types';
17
+ } from 'src/types';
19
18
  import { OLD_BORROW_INCENTIVE_PROTOCOL_ID } from 'src/constants';
20
19
 
21
20
  /**
@@ -89,7 +88,7 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
89
88
  obligationAccessStore: builder.address.get('core.obligationAccessStore'),
90
89
  };
91
90
 
92
- const veScaIds: Omit<VescaIds, 'pkgId'> = {
91
+ const veScaIds = {
93
92
  table: builder.address.get('vesca.table'),
94
93
  treasury: builder.address.get('vesca.treasury'),
95
94
  config: builder.address.get('vesca.config'),
@@ -120,7 +119,7 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
120
119
  stakeObligationWithVesca: (obligationId, obligationKey, veScaKey) => {
121
120
  builder.moveCall(
122
121
  txBlock,
123
- `${borrowIncentiveIds.borrowIncentivePkg}::user::stake_with_ve_sca`,
122
+ `${borrowIncentiveIds.borrowIncentivePkg}::user::stake_with_ve_sca_v2`,
124
123
  [
125
124
  borrowIncentiveIds.config,
126
125
  borrowIncentiveIds.incentivePools,
@@ -132,6 +131,8 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
132
131
  veScaIds.treasury,
133
132
  veScaIds.table,
134
133
  veScaKey,
134
+ builder.address.get('vesca.subsTable'),
135
+ builder.address.get('vesca.subsWhitelist'),
135
136
  clockObjectRef,
136
137
  ],
137
138
  []
@@ -140,13 +141,15 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
140
141
  unstakeObligation: (obligationId, obligationKey) => {
141
142
  builder.moveCall(
142
143
  txBlock,
143
- `${borrowIncentiveIds.borrowIncentivePkg}::user::unstake`,
144
+ `${borrowIncentiveIds.borrowIncentivePkg}::user::unstake_v2`,
144
145
  [
145
146
  borrowIncentiveIds.config,
146
147
  borrowIncentiveIds.incentivePools,
147
148
  borrowIncentiveIds.incentiveAccounts,
148
149
  obligationKey,
149
150
  obligationId,
151
+ builder.address.get('vesca.subsTable'),
152
+ builder.address.get('vesca.subsWhitelist'),
150
153
  clockObjectRef,
151
154
  ]
152
155
  );
@@ -170,13 +173,15 @@ const generateBorrowIncentiveNormalMethod: GenerateBorrowIncentiveNormalMethod =
170
173
  deactivateBoost: (obligation, veScaKey) => {
171
174
  builder.moveCall(
172
175
  txBlock,
173
- `${borrowIncentiveIds.borrowIncentivePkg}::user::deactivate_boost`,
176
+ `${borrowIncentiveIds.borrowIncentivePkg}::user::deactivate_boost_v2`,
174
177
  [
175
178
  borrowIncentiveIds.config,
176
179
  borrowIncentiveIds.incentivePools,
177
180
  borrowIncentiveIds.incentiveAccounts,
178
181
  obligation,
179
182
  veScaKey,
183
+ builder.address.get('vesca.subsTable'),
184
+ builder.address.get('vesca.subsWhitelist'),
180
185
  clockObjectRef,
181
186
  ]
182
187
  );
@@ -217,6 +222,8 @@ const generateBorrowIncentiveQuickMethod: GenerateBorrowIncentiveQuickMethod =
217
222
  txn.kind === 'MoveCall' &&
218
223
  (txn.target ===
219
224
  `${OLD_BORROW_INCENTIVE_PROTOCOL_ID}::user::unstake` ||
225
+ txn.target ===
226
+ `${builder.address.get('borrowIncentive.id')}::user::unstake_v2` ||
220
227
  txn.target ===
221
228
  `${builder.address.get('borrowIncentive.id')}::user::unstake`)
222
229
  );
@@ -247,6 +254,8 @@ const generateBorrowIncentiveQuickMethod: GenerateBorrowIncentiveQuickMethod =
247
254
  txn.kind === 'MoveCall' &&
248
255
  (txn.target ===
249
256
  `${OLD_BORROW_INCENTIVE_PROTOCOL_ID}::user::unstake` ||
257
+ txn.target ===
258
+ `${builder.address.get('borrowIncentive.id')}::user::unstake_v2` ||
250
259
  txn.target ===
251
260
  `${builder.address.get('borrowIncentive.id')}::user::unstake`)
252
261
  );
@@ -5,7 +5,7 @@ import { getObligations } from '../queries';
5
5
  import { updateOracles } from './oracles';
6
6
  import { requireSender } from '../utils';
7
7
  import type { SuiObjectArg, TransactionResult } from '@scallop-io/sui-kit';
8
- import type { ScallopBuilder } from '../models';
8
+ import type { ScallopBuilder } from 'src/models';
9
9
  import type {
10
10
  CoreIds,
11
11
  GenerateCoreNormalMethod,
@@ -15,7 +15,7 @@ import type {
15
15
  ScallopTxBlock,
16
16
  NestedResult,
17
17
  SuiTxBlockWithSpool,
18
- } from '../types';
18
+ } from 'src/types';
19
19
 
20
20
  /**
21
21
  * Check and get Obligation information from transaction block.
@@ -4,8 +4,8 @@ import { newCoreTxBlock } from './coreBuilder';
4
4
  import { newSpoolTxBlock } from './spoolBuilder';
5
5
  import { newBorrowIncentiveTxBlock } from './borrowIncentiveBuilder';
6
6
  import { newVeScaTxBlock } from './vescaBuilder';
7
- import type { ScallopBuilder } from '../models';
8
- import type { ScallopTxBlock } from '../types';
7
+ import type { ScallopBuilder } from 'src/models';
8
+ import type { ScallopTxBlock } from 'src/types';
9
9
  import { newReferralTxBlock } from './referralBuilder';
10
10
  import { newLoyaltyProgramTxBlock } from './loyaltyProgramBuilder';
11
11
  import { newSCoinTxBlock } from './sCoinBuilder';
@@ -5,7 +5,7 @@ import { getStakeAccounts } from '../queries/spoolQuery';
5
5
  import { requireSender } from '../utils';
6
6
  import type { SuiAddressArg } from '@scallop-io/sui-kit';
7
7
  import type { TransactionResult } from '@mysten/sui/transactions';
8
- import type { ScallopBuilder } from '../models';
8
+ import type { ScallopBuilder } from 'src/models';
9
9
  import type {
10
10
  SpoolIds,
11
11
  GenerateSpoolNormalMethod,
@@ -14,7 +14,7 @@ import type {
14
14
  SpoolTxBlock,
15
15
  ScallopTxBlock,
16
16
  SuiTxBlockWithSCoin,
17
- } from '../types';
17
+ } from 'src/types';
18
18
 
19
19
  /**
20
20
  * Check and get stake account id from transaction block.
@@ -5,8 +5,8 @@ import {
5
5
  SuiTxBlock as SuiKitTxBlock,
6
6
  } from '@scallop-io/sui-kit';
7
7
  import { SCA_COIN_TYPE } from 'src/constants';
8
- import { ScallopBuilder } from '../models';
9
- import { getVeSca, getVeScas } from '../queries';
8
+ import { ScallopBuilder } from 'src/models';
9
+ import { getVeSca, getVeScas } from 'src/queries';
10
10
  import {
11
11
  requireSender,
12
12
  checkLockSca,
@@ -14,19 +14,19 @@ import {
14
14
  checkExtendLockAmount,
15
15
  checkRenewExpiredVeSca,
16
16
  checkVesca,
17
- } from '../utils';
17
+ } from 'src/utils';
18
18
  import type {
19
19
  TransactionObjectArgument,
20
20
  SuiObjectArg,
21
21
  } from '@scallop-io/sui-kit';
22
22
  import type {
23
+ AddressesInterface,
23
24
  GenerateVeScaNormalMethod,
24
25
  GenerateVeScaQuickMethod,
25
- RedeemScaQuickReturnType,
26
+ QuickMethodReturnType,
26
27
  ScallopTxBlock,
27
28
  SuiTxBlockWithVeScaNormalMethods,
28
29
  VeScaTxBlock,
29
- VescaIds,
30
30
  } from 'src/types';
31
31
 
32
32
  /**
@@ -70,6 +70,27 @@ export const requireVeSca = async (
70
70
  return veScaKey ? veScas.find(({ keyId }) => veScaKey === keyId) : veScas[0];
71
71
  };
72
72
 
73
+ export const isInSubsTable = async (
74
+ ...params: [builder: ScallopBuilder, veScaKey: string, tableId: string]
75
+ ) => {
76
+ const [builder, veScaKey, tableId] = params;
77
+ try {
78
+ const resp = await builder.scallopSuiKit.queryGetDynamicFieldObject({
79
+ parentId: tableId,
80
+ name: {
81
+ type: '0x2::object::ID',
82
+ value: veScaKey,
83
+ },
84
+ });
85
+ return !!resp?.data;
86
+ } catch (e) {
87
+ console.error(e);
88
+ return false;
89
+ }
90
+ };
91
+
92
+ type VeScaProps = 'id' | 'table' | 'treasury' | 'config' | 'subsTable';
93
+
73
94
  /**
74
95
  * Generate veSCA normal methods.
75
96
  *
@@ -81,12 +102,14 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
81
102
  builder,
82
103
  txBlock,
83
104
  }) => {
84
- const veScaIds: VescaIds = {
85
- pkgId: builder.address.get('vesca.id'),
105
+ const veScaIds: Pick<AddressesInterface['vesca'], VeScaProps> = {
106
+ id: builder.address.get('vesca.id'),
86
107
  table: builder.address.get('vesca.table'),
87
108
  treasury: builder.address.get('vesca.treasury'),
88
109
  config: builder.address.get('vesca.config'),
110
+ subsTable: builder.address.get('vesca.subsTable'),
89
111
  };
112
+
90
113
  const clockObjectRef = txBlock.sharedObjectRef({
91
114
  objectId: SUI_CLOCK_OBJECT_ID,
92
115
  mutable: false,
@@ -97,7 +120,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
97
120
  lockSca: (scaCoin, unlockAtInSecondTimestamp) => {
98
121
  return builder.moveCall(
99
122
  txBlock,
100
- `${veScaIds.pkgId}::ve_sca::mint_ve_sca_key`,
123
+ `${veScaIds.id}::ve_sca::mint_ve_sca_key`,
101
124
  [
102
125
  veScaIds.config,
103
126
  veScaIds.table,
@@ -112,7 +135,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
112
135
  extendLockPeriod: (veScaKey, newUnlockAtInSecondTimestamp) => {
113
136
  builder.moveCall(
114
137
  txBlock,
115
- `${veScaIds.pkgId}::ve_sca::extend_lock_period`,
138
+ `${veScaIds.id}::ve_sca::extend_lock_period`,
116
139
  [
117
140
  veScaIds.config,
118
141
  veScaKey,
@@ -127,7 +150,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
127
150
  extendLockAmount: (veScaKey, scaCoin) => {
128
151
  builder.moveCall(
129
152
  txBlock,
130
- `${veScaIds.pkgId}::ve_sca::lock_more_sca`,
153
+ `${veScaIds.id}::ve_sca::lock_more_sca`,
131
154
  [
132
155
  veScaIds.config,
133
156
  veScaKey,
@@ -142,7 +165,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
142
165
  renewExpiredVeSca: (veScaKey, scaCoin, newUnlockAtInSecondTimestamp) => {
143
166
  builder.moveCall(
144
167
  txBlock,
145
- `${veScaIds.pkgId}::ve_sca::renew_expired_ve_sca`,
168
+ `${veScaIds.id}::ve_sca::renew_expired_ve_sca`,
146
169
  [
147
170
  veScaIds.config,
148
171
  veScaKey,
@@ -158,7 +181,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
158
181
  redeemSca: (veScaKey) => {
159
182
  return builder.moveCall(
160
183
  txBlock,
161
- `${veScaIds.pkgId}::ve_sca::redeem`,
184
+ `${veScaIds.id}::ve_sca::redeem`,
162
185
  [
163
186
  veScaIds.config,
164
187
  veScaKey,
@@ -172,11 +195,39 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
172
195
  mintEmptyVeSca: () => {
173
196
  return builder.moveCall(
174
197
  txBlock,
175
- `${veScaIds.pkgId}::ve_sca::mint_ve_sca_placeholder_key`,
198
+ `${veScaIds.id}::ve_sca::mint_ve_sca_placeholder_key`,
176
199
  [veScaIds.config, veScaIds.table],
177
200
  []
178
201
  );
179
202
  },
203
+ splitVeSca: (veScaKey, splitAmount) => {
204
+ return builder.moveCall(txBlock, `${veScaIds.id}::ve_sca::split`, [
205
+ veScaIds.config,
206
+ veScaKey,
207
+ veScaIds.table,
208
+ veScaIds.subsTable,
209
+ txBlock.pure.u64(splitAmount),
210
+ ]);
211
+ },
212
+ mergeVeSca: (targetKey, sourceKey) => {
213
+ return builder.moveCall(
214
+ txBlock,
215
+ `${veScaIds.id}::ve_sca::merge`,
216
+ [
217
+ veScaIds.config,
218
+ targetKey,
219
+ sourceKey,
220
+ veScaIds.table,
221
+ veScaIds.subsTable,
222
+ txBlock.sharedObjectRef({
223
+ objectId: SUI_CLOCK_OBJECT_ID,
224
+ mutable: false,
225
+ initialSharedVersion: '1',
226
+ }),
227
+ ],
228
+ []
229
+ );
230
+ },
180
231
  };
181
232
  };
182
233
 
@@ -362,8 +413,75 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
362
413
  txBlock.transferObjects([sca], sender);
363
414
  return;
364
415
  }
365
- return sca as RedeemScaQuickReturnType<S>;
416
+ return sca as QuickMethodReturnType<S>;
417
+ }
418
+ },
419
+ splitVeScaQuick: async <S extends boolean>(
420
+ splitAmount: string,
421
+ veScaKey: string,
422
+ transferVeScaKey: S = true as S
423
+ ) => {
424
+ const isKeyInSubTable = await isInSubsTable(
425
+ builder,
426
+ veScaKey,
427
+ builder.address.get('vesca.subsTable')
428
+ );
429
+
430
+ const unstakeObligationBeforeStake =
431
+ !!txBlock.txBlock.blockData.transactions.find(
432
+ (txn) =>
433
+ txn.kind === 'MoveCall' &&
434
+ txn.target ===
435
+ `${builder.address.get('borrowIncentive.id')}::user::unstake_v2`
436
+ );
437
+
438
+ if (isKeyInSubTable && !unstakeObligationBeforeStake) {
439
+ throw new Error(
440
+ 'Key cannot be in the subs table, please call unsubscribe vesca or unstake obligation first'
441
+ );
366
442
  }
443
+
444
+ const newVeScaKey = txBlock.splitVeSca(veScaKey, splitAmount);
445
+ if (transferVeScaKey) {
446
+ txBlock.transferObjects([newVeScaKey], requireSender(txBlock));
447
+ return;
448
+ } else {
449
+ return newVeScaKey as QuickMethodReturnType<S>;
450
+ }
451
+ },
452
+ mergeVeScaQuick: async (targetKey: string, sourceKey: string) => {
453
+ // check targetKey and sourceKey
454
+ const [isTargetInSubTable, isSourceInSubTable] = await Promise.all([
455
+ isInSubsTable(
456
+ builder,
457
+ targetKey,
458
+ builder.address.get('vesca.subsTableId')
459
+ ),
460
+ isInSubsTable(
461
+ builder,
462
+ sourceKey,
463
+ builder.address.get('vesca.subsTableId')
464
+ ),
465
+ ]);
466
+
467
+ const unstakeObligationBeforeStake =
468
+ !!txBlock.txBlock.blockData.transactions.find(
469
+ (txn) =>
470
+ txn.kind === 'MoveCall' &&
471
+ txn.target ===
472
+ `${builder.address.get('borrowIncentive.id')}::user::unstake_v2`
473
+ );
474
+
475
+ if (
476
+ (isTargetInSubTable || isSourceInSubTable) &&
477
+ !unstakeObligationBeforeStake
478
+ ) {
479
+ throw new Error(
480
+ 'Both target and source cannot be in the subs table. Please call unsubscribe vesca or unstake obligation first'
481
+ );
482
+ }
483
+
484
+ return txBlock.mergeVeSca(targetKey, sourceKey);
367
485
  },
368
486
  };
369
487
  };
@@ -256,18 +256,24 @@ export const TEST_ADDRESSES: AddressesInterface = {
256
256
  '0x9636e7b947b806b9fe438d037f02bb24026c5b2691d2f6bad349c2e117f77cc3',
257
257
  },
258
258
  vesca: {
259
- id: '0x1158813b32962c2d22888fae257d5f2365b03631f0cd5d5b912ccdf51ff4e2f2',
259
+ id: '0x0c7f5568dbd69488437ee95f2d9a028724e1de12432965ff8acca7c67310ba46',
260
260
  object:
261
- '0xcfe2d87aa5712b67cad2732edb6a2201bfdf592377e5c0968b7cb02099bd8e21',
261
+ '0x0c7f5568dbd69488437ee95f2d9a028724e1de12432965ff8acca7c67310ba46',
262
262
  adminCap:
263
263
  '0x4d105b16467acca81d18c132cdd1a3cee159920a86c1ef4bdbf2e8d7878500c5',
264
264
  tableId:
265
- '0x0a0b7f749baeb61e3dfee2b42245e32d0e6b484063f0a536b33e771d573d7246',
266
- table: '0xd3a4632b1080f7d96e1c2487d4dabf2c1196916937c505a69954ac9f393be8d0',
265
+ '0x06f763060ea5da3d639fb56df70674490a8354511cfe61584062aafd83b1940d',
266
+ table: '0x06f763060ea5da3d639fb56df70674490a8354511cfe61584062aafd83b1940d',
267
267
  treasury:
268
- '0xafa4b6231e49c15a22d641ce33fda761baaf650fa21899dfa2eb1716146e7306',
268
+ '0x934919cc31fa89b67578039bb10d5518fa23c50bc8f78500f1d1a718407a0a71',
269
269
  config:
270
- '0x7cbcb0a342179577a117dfdff974cf1ab765d3b571067bf22ddf5f9e3a667922',
270
+ '0x38d3f7a1fa5071226535d4d8bfca8ccab3d24871402df1be669d7d5e9e3e9cb4',
271
+ subsTable:
272
+ '0x4756b716670ff62760b22bebed73c6eb2c2cb118674a2eea3a56ebea9e27ae76',
273
+ subsTableId:
274
+ '0x924b56d383b45445984a80002185b670aa2e72cd7df496d345f45f9407a12c07',
275
+ subsWhitelist:
276
+ '0xfc72adae643da4f2fe080adc1e2cca981eadcb518facb02324eeaab169752ffb',
271
277
  },
272
278
  referral: {
273
279
  id: '0x1bf5a8ce77050d8052549d743e16b469f15aa6b81b752b78b6ebb65179665f5a',
@@ -335,6 +335,9 @@ const EMPTY_ADDRESSES: AddressesInterface = {
335
335
  table: '',
336
336
  treasury: '',
337
337
  config: '',
338
+ subsTable: '',
339
+ subsTableId: '',
340
+ subsWhitelist: '',
338
341
  },
339
342
  referral: {
340
343
  id: '',
@@ -5,7 +5,7 @@ import {
5
5
  parseOriginMarketCollateralData,
6
6
  calculateMarketCollateralData,
7
7
  parseObjectAs,
8
- } from '../utils';
8
+ } from 'src/utils';
9
9
  import type {
10
10
  SuiObjectResponse,
11
11
  SuiObjectData,
@@ -32,7 +32,7 @@ import {
32
32
  BorrowFee,
33
33
  BorrowDynamic,
34
34
  OriginMarketCollateralData,
35
- } from '../types';
35
+ } from 'src/types';
36
36
  import BigNumber from 'bignumber.js';
37
37
  import { getSupplyLimit } from './supplyLimitQuery';
38
38
  import { isIsolatedAsset } from './isolatedAssetQuery';
@@ -1,6 +1,6 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { minBigNumber, estimatedFactor } from 'src/utils';
3
- import type { ScallopQuery } from '../models';
3
+ import type { ScallopQuery } from 'src/models';
4
4
  import type {
5
5
  Market,
6
6
  MarketPool,
@@ -16,7 +16,7 @@ import type {
16
16
  ObligationBorrowIncentiveReward,
17
17
  MarketPools,
18
18
  MarketCollaterals,
19
- } from '../types';
19
+ } from 'src/types';
20
20
  import { SuiObjectRef } from '@mysten/sui/client';
21
21
  import { normalizeStructTag, SUI_TYPE_ARG } from '@scallop-io/sui-kit';
22
22
 
@@ -5,9 +5,9 @@ import {
5
5
  parseOriginSpoolRewardPoolData,
6
6
  calculateSpoolRewardPoolData,
7
7
  parseObjectAs,
8
- } from '../utils';
8
+ } from 'src/utils';
9
9
  import type { SuiObjectData, SuiObjectResponse } from '@mysten/sui/client';
10
- import type { ScallopQuery, ScallopUtils } from '../models';
10
+ import type { ScallopQuery, ScallopUtils } from 'src/models';
11
11
  import type {
12
12
  Spools,
13
13
  Spool,
@@ -1,11 +1,11 @@
1
1
  import BigNumber from 'bignumber.js';
2
- import { VeScaTreasuryFields, VeScaTreasuryInfo, Vesca } from '../types';
2
+ import { VeScaTreasuryFields, VeScaTreasuryInfo, Vesca } from 'src/types';
3
3
  import {
4
4
  type SuiObjectResponse,
5
5
  type SuiObjectData,
6
6
  DevInspectResults,
7
7
  } from '@mysten/sui/client';
8
- import type { ScallopUtils } from '../models';
8
+ import type { ScallopUtils } from 'src/models';
9
9
  import { MAX_LOCK_DURATION } from 'src/constants';
10
10
  import { SUI_CLOCK_OBJECT_ID, SuiTxBlock } from '@scallop-io/sui-kit';
11
11
  import { bcs } from '@mysten/sui/bcs';
@@ -108,6 +108,9 @@ export interface AddressesInterface {
108
108
  table: string;
109
109
  treasury: string;
110
110
  config: string;
111
+ subsTable: string;
112
+ subsTableId: string;
113
+ subsWhitelist: string;
111
114
  };
112
115
  referral: {
113
116
  id: string;
@@ -2,13 +2,6 @@ import { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
2
2
  import type { TransactionResult } from '@mysten/sui/transactions';
3
3
  import { ScallopBuilder } from 'src/models';
4
4
 
5
- export type VescaIds = {
6
- pkgId: string;
7
- table: string;
8
- treasury: string;
9
- config: string;
10
- };
11
-
12
5
  export type VeScaNormalMethods = {
13
6
  lockSca: (
14
7
  scaCoin: SuiObjectArg,
@@ -26,9 +19,17 @@ export type VeScaNormalMethods = {
26
19
  ) => void;
27
20
  redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
28
21
  mintEmptyVeSca: () => TransactionResult;
22
+ splitVeSca: (
23
+ veScaKey: SuiObjectArg,
24
+ splitAmount: string
25
+ ) => TransactionResult;
26
+ mergeVeSca: (
27
+ targetVeScaKey: SuiObjectArg,
28
+ sourceVeScaKey: SuiObjectArg
29
+ ) => void;
29
30
  };
30
31
 
31
- export type RedeemScaQuickReturnType<T extends boolean> = T extends true
32
+ export type QuickMethodReturnType<T extends boolean> = T extends true
32
33
  ? void
33
34
  : TransactionResult | undefined;
34
35
 
@@ -71,9 +72,18 @@ export type VeScaQuickMethods = {
71
72
  autoCheck?: boolean
72
73
  ) => Promise<void>;
73
74
  redeemScaQuick: <T extends boolean>(
74
- veSCaKey?: SuiObjectArg,
75
+ veScaKey?: SuiObjectArg,
75
76
  transferSca?: T
76
- ) => Promise<RedeemScaQuickReturnType<T>>;
77
+ ) => Promise<QuickMethodReturnType<T>>;
78
+ splitVeScaQuick: <T extends boolean>(
79
+ splitAmount: string,
80
+ veScaKey: string,
81
+ transferVeScaKey?: T
82
+ ) => Promise<QuickMethodReturnType<T>>;
83
+ mergeVeScaQuick: (
84
+ targetVeScaKey: string,
85
+ sourceVeScaKey: string
86
+ ) => Promise<void>;
77
87
  };
78
88
 
79
89
  export type SuiTxBlockWithVeScaNormalMethods = SuiKitTxBlock &
@@ -5,7 +5,7 @@ import {
5
5
  MAX_LOCK_ROUNDS,
6
6
  MIN_INITIAL_LOCK_AMOUNT,
7
7
  MIN_TOP_UP_AMOUNT,
8
- } from '../constants';
8
+ } from 'src/constants';
9
9
  import type { SuiObjectArg } from '@scallop-io/sui-kit';
10
10
 
11
11
  /**