@scallop-io/sui-scallop-sdk 2.1.2 → 2.1.3-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/dist/index.d.mts +188 -15
- package/dist/index.d.ts +188 -15
- package/dist/index.js +22 -20
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +17 -8
- package/src/builders/coreBuilder.ts +2 -2
- package/src/builders/index.ts +2 -2
- package/src/builders/loyaltyProgramBuilder.ts +41 -8
- package/src/builders/spoolBuilder.ts +2 -2
- package/src/builders/vescaBuilder.ts +132 -14
- package/src/constants/testAddress.ts +421 -16
- package/src/models/scallopAddress.ts +9 -0
- package/src/models/scallopQuery.ts +11 -1
- package/src/queries/coreQuery.ts +2 -2
- package/src/queries/loyaltyProgramQuery.ts +82 -1
- package/src/queries/portfolioQuery.ts +2 -2
- package/src/queries/spoolQuery.ts +2 -2
- package/src/queries/vescaQuery.ts +2 -2
- package/src/types/address.ts +11 -0
- package/src/types/builder/loyaltyProgram.ts +2 -6
- package/src/types/builder/vesca.ts +20 -10
- package/src/types/query/loyaltyProgram.ts +6 -0
- package/src/utils/builder.ts +1 -1
package/src/types/address.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
75
|
+
veScaKey?: SuiObjectArg,
|
|
75
76
|
transferSca?: T
|
|
76
|
-
) => Promise<
|
|
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 &
|