@typus/typus-perp-sdk 1.2.1 → 1.3.0
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/src/client.d.ts +22 -3
- package/dist/src/client.js +66 -8
- package/dist/src/fetch.d.ts +61 -20
- package/dist/src/fetch.js +20 -14
- package/dist/src/generated/typus_perp/admin.d.ts +65 -21
- package/dist/src/generated/typus_perp/admin.js +139 -123
- package/dist/src/generated/typus_perp/competition.d.ts +5 -17
- package/dist/src/generated/typus_perp/competition.js +63 -39
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +9 -9
- package/dist/src/generated/typus_perp/deps/std/type_name.js +13 -16
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +2 -2
- package/dist/src/generated/typus_perp/deps/sui/balance.js +5 -8
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_perp/deps/sui/object.js +13 -0
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +5 -3
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +40 -9
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +5 -3
- package/dist/src/generated/typus_perp/deps/sui/table.js +40 -9
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +5 -3
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +5 -8
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +4 -2
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +9 -12
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +12 -6
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +41 -10
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +4 -2
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +40 -9
- package/dist/src/generated/typus_perp/error.d.ts +201 -94
- package/dist/src/generated/typus_perp/error.js +300 -273
- package/dist/src/generated/typus_perp/escrow.d.ts +14 -6
- package/dist/src/generated/typus_perp/escrow.js +38 -37
- package/dist/src/generated/typus_perp/lending.d.ts +1 -1
- package/dist/src/generated/typus_perp/lending.js +3 -3
- package/dist/src/generated/typus_perp/lp_pool.d.ts +438 -392
- package/dist/src/generated/typus_perp/lp_pool.js +987 -934
- package/dist/src/generated/typus_perp/math.d.ts +13 -16
- package/dist/src/generated/typus_perp/math.js +51 -50
- package/dist/src/generated/typus_perp/position.d.ts +194 -106
- package/dist/src/generated/typus_perp/position.js +714 -733
- package/dist/src/generated/typus_perp/profit_vault.d.ts +62 -20
- package/dist/src/generated/typus_perp/profit_vault.js +162 -148
- package/dist/src/generated/typus_perp/symbol.d.ts +12 -5
- package/dist/src/generated/typus_perp/symbol.js +28 -25
- package/dist/src/generated/typus_perp/trading.d.ts +956 -139
- package/dist/src/generated/typus_perp/trading.js +1577 -1151
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +16 -7
- package/dist/src/generated/typus_perp/treasury_caps.js +60 -24
- package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
- package/dist/src/generated/typus_perp/user_account.js +66 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +144 -10
- package/dist/src/generated/typus_stake_pool/admin.js +132 -49
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +9 -9
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +13 -16
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +13 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +31 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +5 -3
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +5 -8
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +180 -79
- package/dist/src/generated/typus_stake_pool/stake_pool.js +446 -414
- package/dist/src/generated/utils/index.d.ts +4 -23
- package/dist/src/generated/utils/index.js +34 -54
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +35 -13
- package/dist/src/user/order.d.ts +0 -4
- package/dist/src/user/order.js +31 -74
- package/dist/src/user/orderWithBidReceipt.d.ts +0 -3
- package/dist/src/user/orderWithBidReceipt.js +24 -45
- package/dist/src/user/tlp.d.ts +0 -5
- package/dist/src/user/tlp.js +28 -73
- package/package.json +42 -40
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
/**************************************************************
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
|
-
import { MoveStruct, type RawTransactionArgument } from
|
|
5
|
-
import { type Transaction } from
|
|
4
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index';
|
|
5
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
6
|
export declare const ProfitVault: MoveStruct<{
|
|
7
|
-
id:
|
|
7
|
+
id: MoveStruct<{
|
|
8
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
+
}, "0x2::object::UID">;
|
|
8
10
|
whitelist: MoveStruct<{
|
|
9
11
|
contents: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
10
12
|
length: number;
|
|
11
13
|
}, string>;
|
|
12
14
|
}, "0x2::vec_set::VecSet<bytes[32]>">;
|
|
13
15
|
user_profits: MoveStruct<{
|
|
14
|
-
id:
|
|
16
|
+
id: MoveStruct<{
|
|
17
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
18
|
+
}, "0x2::object::UID">;
|
|
15
19
|
size: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
16
|
-
}, "0x2::table::Table
|
|
20
|
+
}, "0x2::table::Table">;
|
|
17
21
|
unlock_countdown_ts_ms: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
18
22
|
}, "@typus/perp::profit_vault::ProfitVault">;
|
|
19
23
|
export declare const LockVault: MoveStruct<{
|
|
20
|
-
id:
|
|
21
|
-
user_profits: MoveStruct<{
|
|
24
|
+
id: MoveStruct<{
|
|
22
25
|
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
26
|
+
}, "0x2::object::UID">;
|
|
27
|
+
user_profits: MoveStruct<{
|
|
28
|
+
id: MoveStruct<{
|
|
29
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
30
|
+
}, "0x2::object::UID">;
|
|
23
31
|
size: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
24
|
-
}, "0x2::table::Table
|
|
32
|
+
}, "0x2::table::Table">;
|
|
25
33
|
}, "@typus/perp::profit_vault::LockVault">;
|
|
26
34
|
export declare const UserProfit: MoveStruct<{
|
|
27
35
|
collateral_token: MoveStruct<{
|
|
@@ -120,7 +128,10 @@ export interface CreateProfitVaultArguments {
|
|
|
120
128
|
}
|
|
121
129
|
export interface CreateProfitVaultOptions {
|
|
122
130
|
package?: string;
|
|
123
|
-
arguments: CreateProfitVaultArguments | [
|
|
131
|
+
arguments: CreateProfitVaultArguments | [
|
|
132
|
+
version: RawTransactionArgument<string>,
|
|
133
|
+
unlockCountdownTsMs: RawTransactionArgument<number | bigint>
|
|
134
|
+
];
|
|
124
135
|
}
|
|
125
136
|
export declare function createProfitVault(options: CreateProfitVaultOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
126
137
|
export interface CreateLockVaultArguments {
|
|
@@ -128,7 +139,9 @@ export interface CreateLockVaultArguments {
|
|
|
128
139
|
}
|
|
129
140
|
export interface CreateLockVaultOptions {
|
|
130
141
|
package?: string;
|
|
131
|
-
arguments: CreateLockVaultArguments | [
|
|
142
|
+
arguments: CreateLockVaultArguments | [
|
|
143
|
+
version: RawTransactionArgument<string>
|
|
144
|
+
];
|
|
132
145
|
}
|
|
133
146
|
export declare function createLockVault(options: CreateLockVaultOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
134
147
|
export interface AddWhitelistArguments {
|
|
@@ -138,7 +151,11 @@ export interface AddWhitelistArguments {
|
|
|
138
151
|
}
|
|
139
152
|
export interface AddWhitelistOptions {
|
|
140
153
|
package?: string;
|
|
141
|
-
arguments: AddWhitelistArguments | [
|
|
154
|
+
arguments: AddWhitelistArguments | [
|
|
155
|
+
version: RawTransactionArgument<string>,
|
|
156
|
+
profitVault: RawTransactionArgument<string>,
|
|
157
|
+
user: RawTransactionArgument<string>
|
|
158
|
+
];
|
|
142
159
|
}
|
|
143
160
|
export declare function addWhitelist(options: AddWhitelistOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
144
161
|
export interface RemoveWhitelistArguments {
|
|
@@ -148,7 +165,11 @@ export interface RemoveWhitelistArguments {
|
|
|
148
165
|
}
|
|
149
166
|
export interface RemoveWhitelistOptions {
|
|
150
167
|
package?: string;
|
|
151
|
-
arguments: RemoveWhitelistArguments | [
|
|
168
|
+
arguments: RemoveWhitelistArguments | [
|
|
169
|
+
version: RawTransactionArgument<string>,
|
|
170
|
+
profitVault: RawTransactionArgument<string>,
|
|
171
|
+
user: RawTransactionArgument<string>
|
|
172
|
+
];
|
|
152
173
|
}
|
|
153
174
|
export declare function removeWhitelist(options: RemoveWhitelistOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
154
175
|
export interface UpdateUnlockCountdownTsMsArguments {
|
|
@@ -181,7 +202,9 @@ export interface LockUserProfitOptions {
|
|
|
181
202
|
user: RawTransactionArgument<string>,
|
|
182
203
|
idx: RawTransactionArgument<number | bigint>
|
|
183
204
|
];
|
|
184
|
-
typeArguments: [
|
|
205
|
+
typeArguments: [
|
|
206
|
+
string
|
|
207
|
+
];
|
|
185
208
|
}
|
|
186
209
|
export declare function lockUserProfit(options: LockUserProfitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
187
210
|
export interface UnlockUserProfitArguments {
|
|
@@ -200,7 +223,9 @@ export interface UnlockUserProfitOptions {
|
|
|
200
223
|
user: RawTransactionArgument<string>,
|
|
201
224
|
idx: RawTransactionArgument<number | bigint>
|
|
202
225
|
];
|
|
203
|
-
typeArguments: [
|
|
226
|
+
typeArguments: [
|
|
227
|
+
string
|
|
228
|
+
];
|
|
204
229
|
}
|
|
205
230
|
export declare function unlockUserProfit(options: UnlockUserProfitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
206
231
|
export interface PutUserProfitArguments {
|
|
@@ -221,7 +246,9 @@ export interface PutUserProfitOptions {
|
|
|
221
246
|
positionId: RawTransactionArgument<number | bigint>,
|
|
222
247
|
orderId: RawTransactionArgument<number | bigint>
|
|
223
248
|
];
|
|
224
|
-
typeArguments: [
|
|
249
|
+
typeArguments: [
|
|
250
|
+
string
|
|
251
|
+
];
|
|
225
252
|
}
|
|
226
253
|
export declare function putUserProfit(options: PutUserProfitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
227
254
|
export interface WithdrawProfitArguments {
|
|
@@ -229,8 +256,12 @@ export interface WithdrawProfitArguments {
|
|
|
229
256
|
}
|
|
230
257
|
export interface WithdrawProfitOptions {
|
|
231
258
|
package?: string;
|
|
232
|
-
arguments: WithdrawProfitArguments | [
|
|
233
|
-
|
|
259
|
+
arguments: WithdrawProfitArguments | [
|
|
260
|
+
profitVault: RawTransactionArgument<string>
|
|
261
|
+
];
|
|
262
|
+
typeArguments: [
|
|
263
|
+
string
|
|
264
|
+
];
|
|
234
265
|
}
|
|
235
266
|
export declare function withdrawProfit(options: WithdrawProfitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
236
267
|
export interface IsWhitelistArguments {
|
|
@@ -239,7 +270,10 @@ export interface IsWhitelistArguments {
|
|
|
239
270
|
}
|
|
240
271
|
export interface IsWhitelistOptions {
|
|
241
272
|
package?: string;
|
|
242
|
-
arguments: IsWhitelistArguments | [
|
|
273
|
+
arguments: IsWhitelistArguments | [
|
|
274
|
+
profitVault: RawTransactionArgument<string>,
|
|
275
|
+
user: RawTransactionArgument<string>
|
|
276
|
+
];
|
|
243
277
|
}
|
|
244
278
|
export declare function isWhitelist(options: IsWhitelistOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
245
279
|
export interface GetUserProfitsArguments {
|
|
@@ -249,7 +283,11 @@ export interface GetUserProfitsArguments {
|
|
|
249
283
|
}
|
|
250
284
|
export interface GetUserProfitsOptions {
|
|
251
285
|
package?: string;
|
|
252
|
-
arguments: GetUserProfitsArguments | [
|
|
286
|
+
arguments: GetUserProfitsArguments | [
|
|
287
|
+
version: RawTransactionArgument<string>,
|
|
288
|
+
profitVault: RawTransactionArgument<string>,
|
|
289
|
+
user: RawTransactionArgument<string>
|
|
290
|
+
];
|
|
253
291
|
}
|
|
254
292
|
export declare function getUserProfits(options: GetUserProfitsOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
255
293
|
export interface GetLockedUserProfitsArguments {
|
|
@@ -259,6 +297,10 @@ export interface GetLockedUserProfitsArguments {
|
|
|
259
297
|
}
|
|
260
298
|
export interface GetLockedUserProfitsOptions {
|
|
261
299
|
package?: string;
|
|
262
|
-
arguments: GetLockedUserProfitsArguments | [
|
|
300
|
+
arguments: GetLockedUserProfitsArguments | [
|
|
301
|
+
version: RawTransactionArgument<string>,
|
|
302
|
+
lockVault: RawTransactionArgument<string>,
|
|
303
|
+
user: RawTransactionArgument<string>
|
|
304
|
+
];
|
|
263
305
|
}
|
|
264
306
|
export declare function getLockedUserProfits(options: GetLockedUserProfitsOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
@@ -49,235 +49,249 @@ exports.getLockedUserProfits = getLockedUserProfits;
|
|
|
49
49
|
/**************************************************************
|
|
50
50
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
51
51
|
**************************************************************/
|
|
52
|
-
const
|
|
52
|
+
const index_1 = require("../utils/index");
|
|
53
53
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const type_name = __importStar(require("./deps/std/type_name
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
exports.ProfitVault = new index_js_1.MoveStruct({
|
|
62
|
-
name: `${$moduleName}::ProfitVault`,
|
|
63
|
-
fields: {
|
|
64
|
-
id: bcs_1.bcs.Address,
|
|
54
|
+
const object = __importStar(require("./deps/sui/object"));
|
|
55
|
+
const vec_set = __importStar(require("./deps/sui/vec_set"));
|
|
56
|
+
const table = __importStar(require("./deps/sui/table"));
|
|
57
|
+
const type_name = __importStar(require("./deps/std/type_name"));
|
|
58
|
+
const $moduleName = '@typus/perp::profit_vault';
|
|
59
|
+
exports.ProfitVault = new index_1.MoveStruct({ name: `${$moduleName}::ProfitVault`, fields: {
|
|
60
|
+
id: object.UID,
|
|
65
61
|
whitelist: vec_set.VecSet(bcs_1.bcs.Address),
|
|
66
62
|
user_profits: table.Table,
|
|
67
|
-
unlock_countdown_ts_ms: bcs_1.bcs.u64()
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
user_profits: table_1.Table,
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
exports.UserProfit = new index_js_1.MoveStruct({
|
|
78
|
-
name: `${$moduleName}::UserProfit`,
|
|
79
|
-
fields: {
|
|
63
|
+
unlock_countdown_ts_ms: bcs_1.bcs.u64()
|
|
64
|
+
} });
|
|
65
|
+
exports.LockVault = new index_1.MoveStruct({ name: `${$moduleName}::LockVault`, fields: {
|
|
66
|
+
id: object.UID,
|
|
67
|
+
user_profits: table.Table
|
|
68
|
+
} });
|
|
69
|
+
exports.UserProfit = new index_1.MoveStruct({ name: `${$moduleName}::UserProfit`, fields: {
|
|
80
70
|
collateral_token: type_name.TypeName,
|
|
81
|
-
base_token:
|
|
71
|
+
base_token: type_name.TypeName,
|
|
82
72
|
position_id: bcs_1.bcs.u64(),
|
|
83
73
|
order_id: bcs_1.bcs.u64(),
|
|
84
74
|
amount: bcs_1.bcs.u64(),
|
|
85
|
-
create_ts_ms: bcs_1.bcs.u64()
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.LockedUserProfit = new index_js_1.MoveStruct({
|
|
89
|
-
name: `${$moduleName}::LockedUserProfit`,
|
|
90
|
-
fields: {
|
|
75
|
+
create_ts_ms: bcs_1.bcs.u64()
|
|
76
|
+
} });
|
|
77
|
+
exports.LockedUserProfit = new index_1.MoveStruct({ name: `${$moduleName}::LockedUserProfit`, fields: {
|
|
91
78
|
user_profit: exports.UserProfit,
|
|
92
|
-
create_ts_ms: bcs_1.bcs.u64()
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
new_whitelist_address: bcs_1.bcs.Address,
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
exports.RemoveWhitelistEvent = new index_js_1.MoveStruct({
|
|
108
|
-
name: `${$moduleName}::RemoveWhitelistEvent`,
|
|
109
|
-
fields: {
|
|
110
|
-
removed_whitelist_address: bcs_1.bcs.Address,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
exports.UpdateUnlockCountdownTsMsEvent = new index_js_1.MoveStruct({
|
|
114
|
-
name: `${$moduleName}::UpdateUnlockCountdownTsMsEvent`,
|
|
115
|
-
fields: {
|
|
79
|
+
create_ts_ms: bcs_1.bcs.u64()
|
|
80
|
+
} });
|
|
81
|
+
exports.CreateProfitVaultEvent = new index_1.MoveStruct({ name: `${$moduleName}::CreateProfitVaultEvent`, fields: {
|
|
82
|
+
unlock_countdown_ts_ms: bcs_1.bcs.u64()
|
|
83
|
+
} });
|
|
84
|
+
exports.AddWhitelistEvent = new index_1.MoveStruct({ name: `${$moduleName}::AddWhitelistEvent`, fields: {
|
|
85
|
+
new_whitelist_address: bcs_1.bcs.Address
|
|
86
|
+
} });
|
|
87
|
+
exports.RemoveWhitelistEvent = new index_1.MoveStruct({ name: `${$moduleName}::RemoveWhitelistEvent`, fields: {
|
|
88
|
+
removed_whitelist_address: bcs_1.bcs.Address
|
|
89
|
+
} });
|
|
90
|
+
exports.UpdateUnlockCountdownTsMsEvent = new index_1.MoveStruct({ name: `${$moduleName}::UpdateUnlockCountdownTsMsEvent`, fields: {
|
|
116
91
|
previous: bcs_1.bcs.u64(),
|
|
117
|
-
new: bcs_1.bcs.u64()
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.LockUserProfitEvent = new index_js_1.MoveStruct({
|
|
121
|
-
name: `${$moduleName}::LockUserProfitEvent`,
|
|
122
|
-
fields: {
|
|
92
|
+
new: bcs_1.bcs.u64()
|
|
93
|
+
} });
|
|
94
|
+
exports.LockUserProfitEvent = new index_1.MoveStruct({ name: `${$moduleName}::LockUserProfitEvent`, fields: {
|
|
123
95
|
user: bcs_1.bcs.Address,
|
|
124
|
-
user_profit: exports.UserProfit
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
exports.UnlockUserProfitEvent = new index_js_1.MoveStruct({
|
|
128
|
-
name: `${$moduleName}::UnlockUserProfitEvent`,
|
|
129
|
-
fields: {
|
|
96
|
+
user_profit: exports.UserProfit
|
|
97
|
+
} });
|
|
98
|
+
exports.UnlockUserProfitEvent = new index_1.MoveStruct({ name: `${$moduleName}::UnlockUserProfitEvent`, fields: {
|
|
130
99
|
user: bcs_1.bcs.Address,
|
|
131
|
-
user_profit: exports.UserProfit
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.PutUserProfitEvent = new index_js_1.MoveStruct({
|
|
135
|
-
name: `${$moduleName}::PutUserProfitEvent`,
|
|
136
|
-
fields: {
|
|
100
|
+
user_profit: exports.UserProfit
|
|
101
|
+
} });
|
|
102
|
+
exports.PutUserProfitEvent = new index_1.MoveStruct({ name: `${$moduleName}::PutUserProfitEvent`, fields: {
|
|
137
103
|
user: bcs_1.bcs.Address,
|
|
138
|
-
user_profit: exports.UserProfit
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
token_type: type_name_2.TypeName,
|
|
145
|
-
withdraw_amount: bcs_1.bcs.u64(),
|
|
146
|
-
},
|
|
147
|
-
});
|
|
104
|
+
user_profit: exports.UserProfit
|
|
105
|
+
} });
|
|
106
|
+
exports.WithdrawProfitEvent = new index_1.MoveStruct({ name: `${$moduleName}::WithdrawProfitEvent`, fields: {
|
|
107
|
+
token_type: type_name.TypeName,
|
|
108
|
+
withdraw_amount: bcs_1.bcs.u64()
|
|
109
|
+
} });
|
|
148
110
|
function createProfitVault(options) {
|
|
149
|
-
const packageAddress = options.package ??
|
|
150
|
-
const argumentsTypes = [
|
|
111
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
112
|
+
const argumentsTypes = [
|
|
113
|
+
`${packageAddress}::admin::Version`,
|
|
114
|
+
'u64'
|
|
115
|
+
];
|
|
151
116
|
const parameterNames = ["version", "unlockCountdownTsMs"];
|
|
152
117
|
return (tx) => tx.moveCall({
|
|
153
118
|
package: packageAddress,
|
|
154
|
-
module:
|
|
155
|
-
function:
|
|
156
|
-
arguments: (0,
|
|
119
|
+
module: 'profit_vault',
|
|
120
|
+
function: 'create_profit_vault',
|
|
121
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
157
122
|
});
|
|
158
123
|
}
|
|
159
124
|
function createLockVault(options) {
|
|
160
|
-
const packageAddress = options.package ??
|
|
161
|
-
const argumentsTypes = [
|
|
125
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
126
|
+
const argumentsTypes = [
|
|
127
|
+
`${packageAddress}::admin::Version`
|
|
128
|
+
];
|
|
162
129
|
const parameterNames = ["version"];
|
|
163
130
|
return (tx) => tx.moveCall({
|
|
164
131
|
package: packageAddress,
|
|
165
|
-
module:
|
|
166
|
-
function:
|
|
167
|
-
arguments: (0,
|
|
132
|
+
module: 'profit_vault',
|
|
133
|
+
function: 'create_lock_vault',
|
|
134
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
168
135
|
});
|
|
169
136
|
}
|
|
170
137
|
function addWhitelist(options) {
|
|
171
|
-
const packageAddress = options.package ??
|
|
172
|
-
const argumentsTypes = [
|
|
138
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
139
|
+
const argumentsTypes = [
|
|
140
|
+
`${packageAddress}::admin::Version`,
|
|
141
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
142
|
+
'address'
|
|
143
|
+
];
|
|
173
144
|
const parameterNames = ["version", "profitVault", "user"];
|
|
174
145
|
return (tx) => tx.moveCall({
|
|
175
146
|
package: packageAddress,
|
|
176
|
-
module:
|
|
177
|
-
function:
|
|
178
|
-
arguments: (0,
|
|
147
|
+
module: 'profit_vault',
|
|
148
|
+
function: 'add_whitelist',
|
|
149
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
179
150
|
});
|
|
180
151
|
}
|
|
181
152
|
function removeWhitelist(options) {
|
|
182
|
-
const packageAddress = options.package ??
|
|
183
|
-
const argumentsTypes = [
|
|
153
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
154
|
+
const argumentsTypes = [
|
|
155
|
+
`${packageAddress}::admin::Version`,
|
|
156
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
157
|
+
'address'
|
|
158
|
+
];
|
|
184
159
|
const parameterNames = ["version", "profitVault", "user"];
|
|
185
160
|
return (tx) => tx.moveCall({
|
|
186
161
|
package: packageAddress,
|
|
187
|
-
module:
|
|
188
|
-
function:
|
|
189
|
-
arguments: (0,
|
|
162
|
+
module: 'profit_vault',
|
|
163
|
+
function: 'remove_whitelist',
|
|
164
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
190
165
|
});
|
|
191
166
|
}
|
|
192
167
|
function updateUnlockCountdownTsMs(options) {
|
|
193
|
-
const packageAddress = options.package ??
|
|
194
|
-
const argumentsTypes = [
|
|
168
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
169
|
+
const argumentsTypes = [
|
|
170
|
+
`${packageAddress}::admin::Version`,
|
|
171
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
172
|
+
'u64'
|
|
173
|
+
];
|
|
195
174
|
const parameterNames = ["version", "profitVault", "newUnlockCountdownTsMs"];
|
|
196
175
|
return (tx) => tx.moveCall({
|
|
197
176
|
package: packageAddress,
|
|
198
|
-
module:
|
|
199
|
-
function:
|
|
200
|
-
arguments: (0,
|
|
177
|
+
module: 'profit_vault',
|
|
178
|
+
function: 'update_unlock_countdown_ts_ms',
|
|
179
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
201
180
|
});
|
|
202
181
|
}
|
|
203
182
|
function lockUserProfit(options) {
|
|
204
|
-
const packageAddress = options.package ??
|
|
205
|
-
const argumentsTypes = [
|
|
183
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
184
|
+
const argumentsTypes = [
|
|
185
|
+
`${packageAddress}::admin::Version`,
|
|
186
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
187
|
+
`${packageAddress}::profit_vault::LockVault`,
|
|
188
|
+
'address',
|
|
189
|
+
'u64',
|
|
190
|
+
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
|
|
191
|
+
];
|
|
206
192
|
const parameterNames = ["version", "profitVault", "lockVault", "user", "idx"];
|
|
207
193
|
return (tx) => tx.moveCall({
|
|
208
194
|
package: packageAddress,
|
|
209
|
-
module:
|
|
210
|
-
function:
|
|
211
|
-
arguments: (0,
|
|
212
|
-
typeArguments: options.typeArguments
|
|
195
|
+
module: 'profit_vault',
|
|
196
|
+
function: 'lock_user_profit',
|
|
197
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
198
|
+
typeArguments: options.typeArguments
|
|
213
199
|
});
|
|
214
200
|
}
|
|
215
201
|
function unlockUserProfit(options) {
|
|
216
|
-
const packageAddress = options.package ??
|
|
217
|
-
const argumentsTypes = [
|
|
202
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
203
|
+
const argumentsTypes = [
|
|
204
|
+
`${packageAddress}::admin::Version`,
|
|
205
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
206
|
+
`${packageAddress}::profit_vault::LockVault`,
|
|
207
|
+
'address',
|
|
208
|
+
'u64'
|
|
209
|
+
];
|
|
218
210
|
const parameterNames = ["version", "profitVault", "lockVault", "user", "idx"];
|
|
219
211
|
return (tx) => tx.moveCall({
|
|
220
212
|
package: packageAddress,
|
|
221
|
-
module:
|
|
222
|
-
function:
|
|
223
|
-
arguments: (0,
|
|
224
|
-
typeArguments: options.typeArguments
|
|
213
|
+
module: 'profit_vault',
|
|
214
|
+
function: 'unlock_user_profit',
|
|
215
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
216
|
+
typeArguments: options.typeArguments
|
|
225
217
|
});
|
|
226
218
|
}
|
|
227
219
|
function putUserProfit(options) {
|
|
228
|
-
const packageAddress = options.package ??
|
|
229
|
-
const argumentsTypes = [
|
|
220
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
221
|
+
const argumentsTypes = [
|
|
222
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
223
|
+
'address',
|
|
224
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
225
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName',
|
|
226
|
+
'u64',
|
|
227
|
+
'u64',
|
|
228
|
+
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
|
|
229
|
+
];
|
|
230
230
|
const parameterNames = ["profitVault", "user", "balance", "baseTokenType", "positionId", "orderId"];
|
|
231
231
|
return (tx) => tx.moveCall({
|
|
232
232
|
package: packageAddress,
|
|
233
|
-
module:
|
|
234
|
-
function:
|
|
235
|
-
arguments: (0,
|
|
236
|
-
typeArguments: options.typeArguments
|
|
233
|
+
module: 'profit_vault',
|
|
234
|
+
function: 'put_user_profit',
|
|
235
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
236
|
+
typeArguments: options.typeArguments
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
function withdrawProfit(options) {
|
|
240
|
-
const packageAddress = options.package ??
|
|
241
|
-
const argumentsTypes = [
|
|
240
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
241
|
+
const argumentsTypes = [
|
|
242
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
243
|
+
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
|
|
244
|
+
];
|
|
242
245
|
const parameterNames = ["profitVault"];
|
|
243
246
|
return (tx) => tx.moveCall({
|
|
244
247
|
package: packageAddress,
|
|
245
|
-
module:
|
|
246
|
-
function:
|
|
247
|
-
arguments: (0,
|
|
248
|
-
typeArguments: options.typeArguments
|
|
248
|
+
module: 'profit_vault',
|
|
249
|
+
function: 'withdraw_profit',
|
|
250
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
251
|
+
typeArguments: options.typeArguments
|
|
249
252
|
});
|
|
250
253
|
}
|
|
251
254
|
function isWhitelist(options) {
|
|
252
|
-
const packageAddress = options.package ??
|
|
253
|
-
const argumentsTypes = [
|
|
255
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
258
|
+
'address'
|
|
259
|
+
];
|
|
254
260
|
const parameterNames = ["profitVault", "user"];
|
|
255
261
|
return (tx) => tx.moveCall({
|
|
256
262
|
package: packageAddress,
|
|
257
|
-
module:
|
|
258
|
-
function:
|
|
259
|
-
arguments: (0,
|
|
263
|
+
module: 'profit_vault',
|
|
264
|
+
function: 'is_whitelist',
|
|
265
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
260
266
|
});
|
|
261
267
|
}
|
|
262
268
|
function getUserProfits(options) {
|
|
263
|
-
const packageAddress = options.package ??
|
|
264
|
-
const argumentsTypes = [
|
|
269
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
270
|
+
const argumentsTypes = [
|
|
271
|
+
`${packageAddress}::admin::Version`,
|
|
272
|
+
`${packageAddress}::profit_vault::ProfitVault`,
|
|
273
|
+
'address'
|
|
274
|
+
];
|
|
265
275
|
const parameterNames = ["version", "profitVault", "user"];
|
|
266
276
|
return (tx) => tx.moveCall({
|
|
267
277
|
package: packageAddress,
|
|
268
|
-
module:
|
|
269
|
-
function:
|
|
270
|
-
arguments: (0,
|
|
278
|
+
module: 'profit_vault',
|
|
279
|
+
function: 'get_user_profits',
|
|
280
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
271
281
|
});
|
|
272
282
|
}
|
|
273
283
|
function getLockedUserProfits(options) {
|
|
274
|
-
const packageAddress = options.package ??
|
|
275
|
-
const argumentsTypes = [
|
|
284
|
+
const packageAddress = options.package ?? '@typus/perp';
|
|
285
|
+
const argumentsTypes = [
|
|
286
|
+
`${packageAddress}::admin::Version`,
|
|
287
|
+
`${packageAddress}::profit_vault::LockVault`,
|
|
288
|
+
'address'
|
|
289
|
+
];
|
|
276
290
|
const parameterNames = ["version", "lockVault", "user"];
|
|
277
291
|
return (tx) => tx.moveCall({
|
|
278
292
|
package: packageAddress,
|
|
279
|
-
module:
|
|
280
|
-
function:
|
|
281
|
-
arguments: (0,
|
|
293
|
+
module: 'profit_vault',
|
|
294
|
+
function: 'get_locked_user_profits',
|
|
295
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
282
296
|
});
|
|
283
297
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* The `symbol` module defines the `Symbol` struct, which represents a trading
|
|
6
6
|
* pair.
|
|
7
7
|
*/
|
|
8
|
-
import { MoveStruct, type RawTransactionArgument } from
|
|
9
|
-
import { type Transaction } from
|
|
8
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index';
|
|
9
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
10
10
|
export declare const Symbol: MoveStruct<{
|
|
11
11
|
/** The base token of the trading pair. */
|
|
12
12
|
base_token: MoveStruct<{
|
|
@@ -23,7 +23,10 @@ export interface CreateArguments {
|
|
|
23
23
|
}
|
|
24
24
|
export interface CreateOptions {
|
|
25
25
|
package?: string;
|
|
26
|
-
arguments: CreateArguments | [
|
|
26
|
+
arguments: CreateArguments | [
|
|
27
|
+
baseToken: RawTransactionArgument<string>,
|
|
28
|
+
quoteToken: RawTransactionArgument<string>
|
|
29
|
+
];
|
|
27
30
|
}
|
|
28
31
|
/** Creates a new `Symbol` from `TypeName`s. */
|
|
29
32
|
export declare function create(options: CreateOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
@@ -32,7 +35,9 @@ export interface BaseTokenArguments {
|
|
|
32
35
|
}
|
|
33
36
|
export interface BaseTokenOptions {
|
|
34
37
|
package?: string;
|
|
35
|
-
arguments: BaseTokenArguments | [
|
|
38
|
+
arguments: BaseTokenArguments | [
|
|
39
|
+
self: RawTransactionArgument<string>
|
|
40
|
+
];
|
|
36
41
|
}
|
|
37
42
|
/** Gets the base token of a `Symbol`. */
|
|
38
43
|
export declare function baseToken(options: BaseTokenOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
@@ -41,7 +46,9 @@ export interface QuoteTokenArguments {
|
|
|
41
46
|
}
|
|
42
47
|
export interface QuoteTokenOptions {
|
|
43
48
|
package?: string;
|
|
44
|
-
arguments: QuoteTokenArguments | [
|
|
49
|
+
arguments: QuoteTokenArguments | [
|
|
50
|
+
self: RawTransactionArgument<string>
|
|
51
|
+
];
|
|
45
52
|
}
|
|
46
53
|
/** Gets the quote token of a `Symbol`. */
|
|
47
54
|
export declare function quoteToken(options: QuoteTokenOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|