@scallop-io/sui-scallop-sdk 2.1.2 → 2.1.3-merge-split-ve-sca-alpha.2

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,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;
@@ -124,10 +127,18 @@ export interface AddressesInterface {
124
127
  };
125
128
  loyaltyProgram: {
126
129
  id: string;
130
+ adminCap?: string;
127
131
  object: string;
128
132
  rewardPool: string;
129
133
  userRewardTableId: string;
130
134
  };
135
+ veScaLoyaltyProgram: {
136
+ id: string;
137
+ adminCap?: string;
138
+ object: string;
139
+ veScaRewardPool: string;
140
+ veScaRewardTableId: string;
141
+ };
131
142
  scoin: {
132
143
  id: string;
133
144
  coins: Partial<
@@ -5,18 +5,14 @@ import {
5
5
  } from '@scallop-io/sui-kit';
6
6
  import { type ScallopBuilder } from 'src/models';
7
7
 
8
- export type LoyaltyProgramIds = {
9
- loyaltyProgramPkgId: string;
10
- rewardPool: string;
11
- userRewardTableId: string;
12
- };
13
-
14
8
  export type LoyaltyProgramNormalMethods = {
15
9
  claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult;
10
+ claimVeScaLoyaltyReward: (veScaKey: SuiObjectArg) => TransactionResult;
16
11
  };
17
12
 
18
13
  export type LoyaltyProgramQuickMethods = {
19
14
  claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
15
+ claimVeScaLoyaltyRewardQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
20
16
  };
21
17
 
22
18
  export type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiKitTxBlock &
@@ -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 &
@@ -3,3 +3,10 @@ export type LoyaltyProgramInfo = {
3
3
  totalPoolReward: number;
4
4
  isClaimEnabled: boolean;
5
5
  };
6
+
7
+ export type VeScaLoyaltyProgramInfo = {
8
+ pendingVeScaReward: number;
9
+ pendingScaReward: number;
10
+ totalPoolReward: number;
11
+ isClaimEnabled: boolean;
12
+ };
@@ -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
  /**