@typus/typus-perp-sdk 1.1.49 → 1.1.51-upgrade
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/api/sentio.d.ts +1 -1
- package/dist/src/api/sentio.js +3 -3
- package/dist/src/client.d.ts +11 -12
- package/dist/src/client.js +16 -44
- package/dist/src/fetch.d.ts +15 -45
- package/dist/src/fetch.js +70 -69
- package/dist/src/generated/typus_perp/admin.d.ts +32 -42
- package/dist/src/generated/typus_perp/admin.js +41 -67
- package/dist/src/generated/typus_perp/competition.d.ts +22 -10
- package/dist/src/generated/typus_perp/competition.js +19 -54
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +2 -2
- package/dist/src/generated/typus_perp/deps/std/type_name.js +2 -2
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +3 -3
- package/dist/src/generated/typus_perp/deps/sui/balance.js +3 -3
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +4 -6
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +4 -38
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +4 -6
- package/dist/src/generated/typus_perp/deps/sui/table.js +4 -38
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +2 -2
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +2 -2
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +7 -9
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +6 -6
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +6 -10
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +5 -39
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +14 -8
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +13 -39
- package/dist/src/generated/typus_perp/error.d.ts +97 -87
- package/dist/src/generated/typus_perp/error.js +18 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +17 -21
- package/dist/src/generated/typus_perp/escrow.js +10 -22
- package/dist/src/generated/typus_perp/lending.d.ts +47 -0
- package/dist/src/generated/typus_perp/lending.js +40 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +718 -397
- package/dist/src/generated/typus_perp/lp_pool.js +485 -365
- package/dist/src/generated/typus_perp/math.d.ts +18 -8
- package/dist/src/generated/typus_perp/math.js +24 -6
- package/dist/src/generated/typus_perp/position.d.ts +207 -185
- package/dist/src/generated/typus_perp/position.js +236 -277
- package/dist/src/generated/typus_perp/profit_vault.d.ts +64 -72
- package/dist/src/generated/typus_perp/profit_vault.js +48 -86
- package/dist/src/generated/typus_perp/symbol.d.ts +6 -6
- package/dist/src/generated/typus_perp/symbol.js +11 -13
- package/dist/src/generated/typus_perp/trading.d.ts +451 -558
- package/dist/src/generated/typus_perp/trading.js +429 -681
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +5 -7
- package/dist/src/generated/typus_perp/treasury_caps.js +8 -45
- package/dist/src/generated/typus_stake_pool/admin.d.ts +13 -122
- package/dist/src/generated/typus_stake_pool/admin.js +19 -103
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +2 -2
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +2 -2
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +2 -2
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +2 -2
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +249 -240
- package/dist/src/generated/typus_stake_pool/stake_pool.js +159 -246
- package/dist/src/generated/utils/index.d.ts +21 -2
- package/dist/src/generated/utils/index.js +34 -10
- package/dist/src/user/history.d.ts +3 -2
- package/dist/src/user/history.js +60 -18
- package/dist/src/user/order.d.ts +1 -1
- package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
- package/package.json +8 -15
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_perp/user_account.d.ts +0 -146
- package/dist/src/generated/typus_perp/user_account.js +0 -221
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
- package/dist/src/grpc/graphql.d.ts +0 -26
- package/dist/src/grpc/graphql.js +0 -126
- package/dist/src/grpc/grpc.d.ts +0 -1
- package/dist/src/grpc/grpc.js +0 -38
- package/dist/src/grpc/ledgerService.d.ts +0 -0
- package/dist/src/grpc/ledgerService.js +0 -64
- package/dist/src/grpc/liveDataService.d.ts +0 -0
- package/dist/src/grpc/liveDataService.js +0 -49
|
@@ -53,10 +53,10 @@ exports.updatePoolInfoU64Padding = updatePoolInfoU64Padding;
|
|
|
53
53
|
exports.snapshot = snapshot;
|
|
54
54
|
exports.unsubscribe = unsubscribe;
|
|
55
55
|
exports.unstake = unstake;
|
|
56
|
-
exports.updateLastIncentivePriceIndex = updateLastIncentivePriceIndex;
|
|
57
56
|
exports.logHarvestedAmount = logHarvestedAmount;
|
|
58
57
|
exports.harvestPerUserShare = harvestPerUserShare;
|
|
59
|
-
exports.
|
|
58
|
+
exports.calculateIncentiveByIdx = calculateIncentiveByIdx;
|
|
59
|
+
exports.updateLastIncentivePriceIndexByIdx = updateLastIncentivePriceIndexByIdx;
|
|
60
60
|
exports.harvestProgressUpdated = harvestProgressUpdated;
|
|
61
61
|
exports.multiplier = multiplier;
|
|
62
62
|
exports.getUserShares = getUserShares;
|
|
@@ -67,25 +67,37 @@ exports.getIncentiveTokens = getIncentiveTokens;
|
|
|
67
67
|
exports.getIncentive = getIncentive;
|
|
68
68
|
exports.getMutIncentive = getMutIncentive;
|
|
69
69
|
exports.removeIncentive = removeIncentive;
|
|
70
|
+
exports.getIncentiveIdx = getIncentiveIdx;
|
|
70
71
|
exports.getLastIncentivePriceIndex = getLastIncentivePriceIndex;
|
|
71
72
|
exports.checkStakePoolActive = checkStakePoolActive;
|
|
72
73
|
/**************************************************************
|
|
73
74
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
74
75
|
**************************************************************/
|
|
75
|
-
const
|
|
76
|
+
const index_js_1 = require("../utils/index.js");
|
|
76
77
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
77
|
-
const
|
|
78
|
-
const
|
|
78
|
+
const type_name = __importStar(require("./deps/std/type_name.js"));
|
|
79
|
+
const type_name_1 = __importStar(require("./deps/std/type_name.js"));
|
|
80
|
+
const type_name_2 = __importStar(require("./deps/std/type_name.js"));
|
|
81
|
+
const type_name_3 = __importStar(require("./deps/std/type_name.js"));
|
|
82
|
+
const type_name_4 = __importStar(require("./deps/std/type_name.js"));
|
|
83
|
+
const type_name_5 = __importStar(require("./deps/std/type_name.js"));
|
|
84
|
+
const type_name_6 = __importStar(require("./deps/std/type_name.js"));
|
|
85
|
+
const type_name_7 = __importStar(require("./deps/std/type_name.js"));
|
|
86
|
+
const type_name_8 = __importStar(require("./deps/std/type_name.js"));
|
|
87
|
+
const type_name_9 = __importStar(require("./deps/std/type_name.js"));
|
|
88
|
+
const type_name_10 = __importStar(require("./deps/std/type_name.js"));
|
|
89
|
+
const type_name_11 = __importStar(require("./deps/std/type_name.js"));
|
|
90
|
+
const type_name_12 = __importStar(require("./deps/std/type_name.js"));
|
|
79
91
|
const $moduleName = "@typus/stake-pool::stake_pool";
|
|
80
|
-
exports.StakePoolRegistry = new
|
|
92
|
+
exports.StakePoolRegistry = new index_js_1.MoveStruct({
|
|
81
93
|
name: `${$moduleName}::StakePoolRegistry`,
|
|
82
94
|
fields: {
|
|
83
|
-
id:
|
|
95
|
+
id: bcs_1.bcs.Address,
|
|
84
96
|
/** The number of pools in the registry. */
|
|
85
97
|
num_pool: bcs_1.bcs.u64(),
|
|
86
98
|
},
|
|
87
99
|
});
|
|
88
|
-
exports.StakePoolInfo = new
|
|
100
|
+
exports.StakePoolInfo = new index_js_1.MoveStruct({
|
|
89
101
|
name: `${$moduleName}::StakePoolInfo`,
|
|
90
102
|
fields: {
|
|
91
103
|
/** The type name of the stake token. */
|
|
@@ -106,7 +118,7 @@ exports.StakePoolInfo = new index_1.MoveStruct({
|
|
|
106
118
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
107
119
|
},
|
|
108
120
|
});
|
|
109
|
-
exports.StakePoolConfig = new
|
|
121
|
+
exports.StakePoolConfig = new index_js_1.MoveStruct({
|
|
110
122
|
name: `${$moduleName}::StakePoolConfig`,
|
|
111
123
|
fields: {
|
|
112
124
|
/** The unlock countdown in milliseconds. */
|
|
@@ -117,7 +129,7 @@ exports.StakePoolConfig = new index_1.MoveStruct({
|
|
|
117
129
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
118
130
|
},
|
|
119
131
|
});
|
|
120
|
-
exports.IncentiveConfig = new
|
|
132
|
+
exports.IncentiveConfig = new index_js_1.MoveStruct({
|
|
121
133
|
name: `${$moduleName}::IncentiveConfig`,
|
|
122
134
|
fields: {
|
|
123
135
|
/** The amount of incentive per period. */
|
|
@@ -128,7 +140,7 @@ exports.IncentiveConfig = new index_1.MoveStruct({
|
|
|
128
140
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
129
141
|
},
|
|
130
142
|
});
|
|
131
|
-
exports.IncentiveInfo = new
|
|
143
|
+
exports.IncentiveInfo = new index_js_1.MoveStruct({
|
|
132
144
|
name: `${$moduleName}::IncentiveInfo`,
|
|
133
145
|
fields: {
|
|
134
146
|
/** Whether the incentive is active. */
|
|
@@ -143,21 +155,21 @@ exports.IncentiveInfo = new index_1.MoveStruct({
|
|
|
143
155
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
144
156
|
},
|
|
145
157
|
});
|
|
146
|
-
exports.Incentive = new
|
|
158
|
+
exports.Incentive = new index_js_1.MoveStruct({
|
|
147
159
|
name: `${$moduleName}::Incentive`,
|
|
148
160
|
fields: {
|
|
149
161
|
/** The type name of the incentive token. */
|
|
150
|
-
token_type:
|
|
162
|
+
token_type: type_name_1.TypeName,
|
|
151
163
|
/** The configuration for the incentive. */
|
|
152
164
|
config: exports.IncentiveConfig,
|
|
153
165
|
/** Information about the incentive. */
|
|
154
166
|
info: exports.IncentiveInfo,
|
|
155
167
|
},
|
|
156
168
|
});
|
|
157
|
-
exports.StakePool = new
|
|
169
|
+
exports.StakePool = new index_js_1.MoveStruct({
|
|
158
170
|
name: `${$moduleName}::StakePool`,
|
|
159
171
|
fields: {
|
|
160
|
-
id:
|
|
172
|
+
id: bcs_1.bcs.Address,
|
|
161
173
|
/** Information about the stake pool. */
|
|
162
174
|
pool_info: exports.StakePoolInfo,
|
|
163
175
|
/** Configuration for the stake pool. */
|
|
@@ -168,7 +180,7 @@ exports.StakePool = new index_1.MoveStruct({
|
|
|
168
180
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
169
181
|
},
|
|
170
182
|
});
|
|
171
|
-
exports.DeactivatingShares = new
|
|
183
|
+
exports.DeactivatingShares = new index_js_1.MoveStruct({
|
|
172
184
|
name: `${$moduleName}::DeactivatingShares`,
|
|
173
185
|
fields: {
|
|
174
186
|
/** The number of shares. */
|
|
@@ -177,13 +189,16 @@ exports.DeactivatingShares = new index_1.MoveStruct({
|
|
|
177
189
|
unsubscribed_ts_ms: bcs_1.bcs.u64(),
|
|
178
190
|
/** The timestamp when the shares can be unlocked. */
|
|
179
191
|
unlocked_ts_ms: bcs_1.bcs.u64(),
|
|
180
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* The unsubscribed incentive price index (aligned with StakePool.incentives by
|
|
194
|
+
* index).
|
|
195
|
+
*/
|
|
181
196
|
unsubscribed_incentive_price_index: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
182
197
|
/** Padding for future use. */
|
|
183
198
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
184
199
|
},
|
|
185
200
|
});
|
|
186
|
-
exports.LpUserShare = new
|
|
201
|
+
exports.LpUserShare = new index_js_1.MoveStruct({
|
|
187
202
|
name: `${$moduleName}::LpUserShare`,
|
|
188
203
|
fields: {
|
|
189
204
|
/** The address of the user. */
|
|
@@ -198,7 +213,7 @@ exports.LpUserShare = new index_1.MoveStruct({
|
|
|
198
213
|
active_shares: bcs_1.bcs.u64(),
|
|
199
214
|
/** A vector of deactivating shares. */
|
|
200
215
|
deactivating_shares: bcs_1.bcs.vector(exports.DeactivatingShares),
|
|
201
|
-
/** The last incentive price index. */
|
|
216
|
+
/** The last incentive price index (aligned with StakePool.incentives by index). */
|
|
202
217
|
last_incentive_price_index: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
203
218
|
/** The last snapshot ts for exp. */
|
|
204
219
|
snapshot_ts_ms: bcs_1.bcs.u64(),
|
|
@@ -210,7 +225,7 @@ exports.LpUserShare = new index_1.MoveStruct({
|
|
|
210
225
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
211
226
|
},
|
|
212
227
|
});
|
|
213
|
-
exports.NewStakePoolEvent = new
|
|
228
|
+
exports.NewStakePoolEvent = new index_js_1.MoveStruct({
|
|
214
229
|
name: `${$moduleName}::NewStakePoolEvent`,
|
|
215
230
|
fields: {
|
|
216
231
|
sender: bcs_1.bcs.Address,
|
|
@@ -219,12 +234,12 @@ exports.NewStakePoolEvent = new index_1.MoveStruct({
|
|
|
219
234
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
220
235
|
},
|
|
221
236
|
});
|
|
222
|
-
exports.AutoCompoundEvent = new
|
|
237
|
+
exports.AutoCompoundEvent = new index_js_1.MoveStruct({
|
|
223
238
|
name: `${$moduleName}::AutoCompoundEvent`,
|
|
224
239
|
fields: {
|
|
225
240
|
sender: bcs_1.bcs.Address,
|
|
226
241
|
index: bcs_1.bcs.u64(),
|
|
227
|
-
incentive_token:
|
|
242
|
+
incentive_token: type_name_2.TypeName,
|
|
228
243
|
incentive_price_index: bcs_1.bcs.u64(),
|
|
229
244
|
total_amount: bcs_1.bcs.u64(),
|
|
230
245
|
compound_users: bcs_1.bcs.u64(),
|
|
@@ -232,18 +247,18 @@ exports.AutoCompoundEvent = new index_1.MoveStruct({
|
|
|
232
247
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
233
248
|
},
|
|
234
249
|
});
|
|
235
|
-
exports.AddIncentiveTokenEvent = new
|
|
250
|
+
exports.AddIncentiveTokenEvent = new index_js_1.MoveStruct({
|
|
236
251
|
name: `${$moduleName}::AddIncentiveTokenEvent`,
|
|
237
252
|
fields: {
|
|
238
253
|
sender: bcs_1.bcs.Address,
|
|
239
254
|
index: bcs_1.bcs.u64(),
|
|
240
|
-
incentive_token:
|
|
255
|
+
incentive_token: type_name_3.TypeName,
|
|
241
256
|
incentive_info: exports.IncentiveInfo,
|
|
242
257
|
incentive_config: exports.IncentiveConfig,
|
|
243
258
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
244
259
|
},
|
|
245
260
|
});
|
|
246
|
-
exports.DeactivateStakePoolEvent = new
|
|
261
|
+
exports.DeactivateStakePoolEvent = new index_js_1.MoveStruct({
|
|
247
262
|
name: `${$moduleName}::DeactivateStakePoolEvent`,
|
|
248
263
|
fields: {
|
|
249
264
|
sender: bcs_1.bcs.Address,
|
|
@@ -251,7 +266,7 @@ exports.DeactivateStakePoolEvent = new index_1.MoveStruct({
|
|
|
251
266
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
252
267
|
},
|
|
253
268
|
});
|
|
254
|
-
exports.ActivateStakePoolEvent = new
|
|
269
|
+
exports.ActivateStakePoolEvent = new index_js_1.MoveStruct({
|
|
255
270
|
name: `${$moduleName}::ActivateStakePoolEvent`,
|
|
256
271
|
fields: {
|
|
257
272
|
sender: bcs_1.bcs.Address,
|
|
@@ -259,35 +274,35 @@ exports.ActivateStakePoolEvent = new index_1.MoveStruct({
|
|
|
259
274
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
260
275
|
},
|
|
261
276
|
});
|
|
262
|
-
exports.DeactivateIncentiveTokenEvent = new
|
|
277
|
+
exports.DeactivateIncentiveTokenEvent = new index_js_1.MoveStruct({
|
|
263
278
|
name: `${$moduleName}::DeactivateIncentiveTokenEvent`,
|
|
264
279
|
fields: {
|
|
265
280
|
sender: bcs_1.bcs.Address,
|
|
266
281
|
index: bcs_1.bcs.u64(),
|
|
267
|
-
incentive_token:
|
|
282
|
+
incentive_token: type_name_4.TypeName,
|
|
268
283
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
269
284
|
},
|
|
270
285
|
});
|
|
271
|
-
exports.ActivateIncentiveTokenEvent = new
|
|
286
|
+
exports.ActivateIncentiveTokenEvent = new index_js_1.MoveStruct({
|
|
272
287
|
name: `${$moduleName}::ActivateIncentiveTokenEvent`,
|
|
273
288
|
fields: {
|
|
274
289
|
sender: bcs_1.bcs.Address,
|
|
275
290
|
index: bcs_1.bcs.u64(),
|
|
276
|
-
incentive_token:
|
|
291
|
+
incentive_token: type_name_5.TypeName,
|
|
277
292
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
278
293
|
},
|
|
279
294
|
});
|
|
280
|
-
exports.RemoveIncentiveTokenEvent = new
|
|
295
|
+
exports.RemoveIncentiveTokenEvent = new index_js_1.MoveStruct({
|
|
281
296
|
name: `${$moduleName}::RemoveIncentiveTokenEvent`,
|
|
282
297
|
fields: {
|
|
283
298
|
sender: bcs_1.bcs.Address,
|
|
284
299
|
index: bcs_1.bcs.u64(),
|
|
285
|
-
incentive_token:
|
|
300
|
+
incentive_token: type_name_6.TypeName,
|
|
286
301
|
incentive_balance_value: bcs_1.bcs.u64(),
|
|
287
302
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
288
303
|
},
|
|
289
304
|
});
|
|
290
|
-
exports.UpdateUnlockCountdownTsMsEvent = new
|
|
305
|
+
exports.UpdateUnlockCountdownTsMsEvent = new index_js_1.MoveStruct({
|
|
291
306
|
name: `${$moduleName}::UpdateUnlockCountdownTsMsEvent`,
|
|
292
307
|
fields: {
|
|
293
308
|
sender: bcs_1.bcs.Address,
|
|
@@ -297,7 +312,7 @@ exports.UpdateUnlockCountdownTsMsEvent = new index_1.MoveStruct({
|
|
|
297
312
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
298
313
|
},
|
|
299
314
|
});
|
|
300
|
-
exports.UpdateIncentiveConfigEvent = new
|
|
315
|
+
exports.UpdateIncentiveConfigEvent = new index_js_1.MoveStruct({
|
|
301
316
|
name: `${$moduleName}::UpdateIncentiveConfigEvent`,
|
|
302
317
|
fields: {
|
|
303
318
|
sender: bcs_1.bcs.Address,
|
|
@@ -307,32 +322,32 @@ exports.UpdateIncentiveConfigEvent = new index_1.MoveStruct({
|
|
|
307
322
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
308
323
|
},
|
|
309
324
|
});
|
|
310
|
-
exports.DepositIncentiveEvent = new
|
|
325
|
+
exports.DepositIncentiveEvent = new index_js_1.MoveStruct({
|
|
311
326
|
name: `${$moduleName}::DepositIncentiveEvent`,
|
|
312
327
|
fields: {
|
|
313
328
|
sender: bcs_1.bcs.Address,
|
|
314
329
|
index: bcs_1.bcs.u64(),
|
|
315
|
-
incentive_token_type:
|
|
330
|
+
incentive_token_type: type_name_7.TypeName,
|
|
316
331
|
deposit_amount: bcs_1.bcs.u64(),
|
|
317
332
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
318
333
|
},
|
|
319
334
|
});
|
|
320
|
-
exports.WithdrawIncentiveEvent = new
|
|
335
|
+
exports.WithdrawIncentiveEvent = new index_js_1.MoveStruct({
|
|
321
336
|
name: `${$moduleName}::WithdrawIncentiveEvent`,
|
|
322
337
|
fields: {
|
|
323
338
|
sender: bcs_1.bcs.Address,
|
|
324
339
|
index: bcs_1.bcs.u64(),
|
|
325
|
-
incentive_token_type:
|
|
340
|
+
incentive_token_type: type_name_8.TypeName,
|
|
326
341
|
withdrawal_amount: bcs_1.bcs.u64(),
|
|
327
342
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
328
343
|
},
|
|
329
344
|
});
|
|
330
|
-
exports.StakeEvent = new
|
|
345
|
+
exports.StakeEvent = new index_js_1.MoveStruct({
|
|
331
346
|
name: `${$moduleName}::StakeEvent`,
|
|
332
347
|
fields: {
|
|
333
348
|
sender: bcs_1.bcs.Address,
|
|
334
349
|
index: bcs_1.bcs.u64(),
|
|
335
|
-
lp_token_type:
|
|
350
|
+
lp_token_type: type_name_9.TypeName,
|
|
336
351
|
stake_amount: bcs_1.bcs.u64(),
|
|
337
352
|
user_share_id: bcs_1.bcs.u64(),
|
|
338
353
|
stake_ts_ms: bcs_1.bcs.u64(),
|
|
@@ -340,7 +355,7 @@ exports.StakeEvent = new index_1.MoveStruct({
|
|
|
340
355
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
341
356
|
},
|
|
342
357
|
});
|
|
343
|
-
exports.UpdatePoolInfoU64PaddingEvent = new
|
|
358
|
+
exports.UpdatePoolInfoU64PaddingEvent = new index_js_1.MoveStruct({
|
|
344
359
|
name: `${$moduleName}::UpdatePoolInfoU64PaddingEvent`,
|
|
345
360
|
fields: {
|
|
346
361
|
sender: bcs_1.bcs.Address,
|
|
@@ -348,7 +363,7 @@ exports.UpdatePoolInfoU64PaddingEvent = new index_1.MoveStruct({
|
|
|
348
363
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
349
364
|
},
|
|
350
365
|
});
|
|
351
|
-
exports.SnapshotEvent = new
|
|
366
|
+
exports.SnapshotEvent = new index_js_1.MoveStruct({
|
|
352
367
|
name: `${$moduleName}::SnapshotEvent`,
|
|
353
368
|
fields: {
|
|
354
369
|
sender: bcs_1.bcs.Address,
|
|
@@ -362,12 +377,12 @@ exports.SnapshotEvent = new index_1.MoveStruct({
|
|
|
362
377
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
363
378
|
},
|
|
364
379
|
});
|
|
365
|
-
exports.UnsubscribeEvent = new
|
|
380
|
+
exports.UnsubscribeEvent = new index_js_1.MoveStruct({
|
|
366
381
|
name: `${$moduleName}::UnsubscribeEvent`,
|
|
367
382
|
fields: {
|
|
368
383
|
sender: bcs_1.bcs.Address,
|
|
369
384
|
index: bcs_1.bcs.u64(),
|
|
370
|
-
lp_token_type:
|
|
385
|
+
lp_token_type: type_name_10.TypeName,
|
|
371
386
|
user_share_id: bcs_1.bcs.u64(),
|
|
372
387
|
unsubscribed_shares: bcs_1.bcs.u64(),
|
|
373
388
|
unsubscribe_ts_ms: bcs_1.bcs.u64(),
|
|
@@ -375,24 +390,24 @@ exports.UnsubscribeEvent = new index_1.MoveStruct({
|
|
|
375
390
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
376
391
|
},
|
|
377
392
|
});
|
|
378
|
-
exports.UnstakeEvent = new
|
|
393
|
+
exports.UnstakeEvent = new index_js_1.MoveStruct({
|
|
379
394
|
name: `${$moduleName}::UnstakeEvent`,
|
|
380
395
|
fields: {
|
|
381
396
|
sender: bcs_1.bcs.Address,
|
|
382
397
|
index: bcs_1.bcs.u64(),
|
|
383
|
-
lp_token_type:
|
|
398
|
+
lp_token_type: type_name_11.TypeName,
|
|
384
399
|
user_share_id: bcs_1.bcs.u64(),
|
|
385
400
|
unstake_amount: bcs_1.bcs.u64(),
|
|
386
401
|
unstake_ts_ms: bcs_1.bcs.u64(),
|
|
387
402
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
388
403
|
},
|
|
389
404
|
});
|
|
390
|
-
exports.HarvestPerUserShareEvent = new
|
|
405
|
+
exports.HarvestPerUserShareEvent = new index_js_1.MoveStruct({
|
|
391
406
|
name: `${$moduleName}::HarvestPerUserShareEvent`,
|
|
392
407
|
fields: {
|
|
393
408
|
sender: bcs_1.bcs.Address,
|
|
394
409
|
index: bcs_1.bcs.u64(),
|
|
395
|
-
incentive_token_type:
|
|
410
|
+
incentive_token_type: type_name_12.TypeName,
|
|
396
411
|
harvest_amount: bcs_1.bcs.u64(),
|
|
397
412
|
user_share_id: bcs_1.bcs.u64(),
|
|
398
413
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
@@ -410,399 +425,294 @@ function init(options = {}) {
|
|
|
410
425
|
/** [Authorized Function] Creates a new stake pool. */
|
|
411
426
|
function newStakePool(options) {
|
|
412
427
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
413
|
-
const argumentsTypes = [
|
|
414
|
-
`${packageAddress}::admin::Version`,
|
|
415
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
416
|
-
"u64",
|
|
417
|
-
];
|
|
428
|
+
const argumentsTypes = [null, null, "u64"];
|
|
418
429
|
const parameterNames = ["version", "registry", "unlockCountdownTsMs"];
|
|
419
430
|
return (tx) => tx.moveCall({
|
|
420
431
|
package: packageAddress,
|
|
421
432
|
module: "stake_pool",
|
|
422
433
|
function: "new_stake_pool",
|
|
423
|
-
arguments: (0,
|
|
434
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
424
435
|
typeArguments: options.typeArguments,
|
|
425
436
|
});
|
|
426
437
|
}
|
|
427
438
|
/** [Authorized Function] */
|
|
428
439
|
function autoCompound(options) {
|
|
429
440
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
430
|
-
const argumentsTypes = [
|
|
431
|
-
`${packageAddress}::admin::Version`,
|
|
432
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
433
|
-
"u64",
|
|
434
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
435
|
-
];
|
|
441
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
436
442
|
const parameterNames = ["version", "registry", "index"];
|
|
437
443
|
return (tx) => tx.moveCall({
|
|
438
444
|
package: packageAddress,
|
|
439
445
|
module: "stake_pool",
|
|
440
446
|
function: "auto_compound",
|
|
441
|
-
arguments: (0,
|
|
447
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
442
448
|
typeArguments: options.typeArguments,
|
|
443
449
|
});
|
|
444
450
|
}
|
|
445
451
|
/** [Authorized Function] Adds a new incentive token to a pool. */
|
|
446
452
|
function addIncentiveToken(options) {
|
|
447
453
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
448
|
-
const argumentsTypes = [
|
|
449
|
-
`${packageAddress}::admin::Version`,
|
|
450
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
451
|
-
"u64",
|
|
452
|
-
"u64",
|
|
453
|
-
"u64",
|
|
454
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
455
|
-
];
|
|
454
|
+
const argumentsTypes = [null, null, "u64", "u64", "u64", "0x2::clock::Clock"];
|
|
456
455
|
const parameterNames = ["version", "registry", "index", "periodIncentiveAmount", "incentiveIntervalTsMs"];
|
|
457
456
|
return (tx) => tx.moveCall({
|
|
458
457
|
package: packageAddress,
|
|
459
458
|
module: "stake_pool",
|
|
460
459
|
function: "add_incentive_token",
|
|
461
|
-
arguments: (0,
|
|
460
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
462
461
|
typeArguments: options.typeArguments,
|
|
463
462
|
});
|
|
464
463
|
}
|
|
465
464
|
/** [Authorized Function] Activates a stake pool. */
|
|
466
465
|
function deactivateStakePool(options) {
|
|
467
466
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
468
|
-
const argumentsTypes = [
|
|
469
|
-
`${packageAddress}::admin::Version`,
|
|
470
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
471
|
-
"u64",
|
|
472
|
-
];
|
|
467
|
+
const argumentsTypes = [null, null, "u64"];
|
|
473
468
|
const parameterNames = ["version", "registry", "index"];
|
|
474
469
|
return (tx) => tx.moveCall({
|
|
475
470
|
package: packageAddress,
|
|
476
471
|
module: "stake_pool",
|
|
477
472
|
function: "deactivate_stake_pool",
|
|
478
|
-
arguments: (0,
|
|
473
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
479
474
|
});
|
|
480
475
|
}
|
|
481
476
|
/** [Authorized Function] Activates a stake pool. */
|
|
482
477
|
function activateStakePool(options) {
|
|
483
478
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
484
|
-
const argumentsTypes = [
|
|
485
|
-
`${packageAddress}::admin::Version`,
|
|
486
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
487
|
-
"u64",
|
|
488
|
-
];
|
|
479
|
+
const argumentsTypes = [null, null, "u64"];
|
|
489
480
|
const parameterNames = ["version", "registry", "index"];
|
|
490
481
|
return (tx) => tx.moveCall({
|
|
491
482
|
package: packageAddress,
|
|
492
483
|
module: "stake_pool",
|
|
493
484
|
function: "activate_stake_pool",
|
|
494
|
-
arguments: (0,
|
|
485
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
495
486
|
});
|
|
496
487
|
}
|
|
497
488
|
/** [Authorized Function] Deactivates an incentive token. */
|
|
498
489
|
function deactivateIncentiveToken(options) {
|
|
499
490
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
500
|
-
const argumentsTypes = [
|
|
501
|
-
`${packageAddress}::admin::Version`,
|
|
502
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
503
|
-
"u64",
|
|
504
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
505
|
-
];
|
|
491
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
506
492
|
const parameterNames = ["version", "registry", "index"];
|
|
507
493
|
return (tx) => tx.moveCall({
|
|
508
494
|
package: packageAddress,
|
|
509
495
|
module: "stake_pool",
|
|
510
496
|
function: "deactivate_incentive_token",
|
|
511
|
-
arguments: (0,
|
|
497
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
512
498
|
typeArguments: options.typeArguments,
|
|
513
499
|
});
|
|
514
500
|
}
|
|
515
501
|
/** [Authorized Function] Activates an incentive token. */
|
|
516
502
|
function activateIncentiveToken(options) {
|
|
517
503
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
518
|
-
const argumentsTypes = [
|
|
519
|
-
`${packageAddress}::admin::Version`,
|
|
520
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
521
|
-
"u64",
|
|
522
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
523
|
-
];
|
|
504
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
524
505
|
const parameterNames = ["version", "registry", "index"];
|
|
525
506
|
return (tx) => tx.moveCall({
|
|
526
507
|
package: packageAddress,
|
|
527
508
|
module: "stake_pool",
|
|
528
509
|
function: "activate_incentive_token",
|
|
529
|
-
arguments: (0,
|
|
510
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
530
511
|
typeArguments: options.typeArguments,
|
|
531
512
|
});
|
|
532
513
|
}
|
|
533
514
|
/** [Authorized Function] Removes an incentive token. */
|
|
534
515
|
function removeIncentiveToken(options) {
|
|
535
516
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
536
|
-
const argumentsTypes = [
|
|
537
|
-
`${packageAddress}::admin::Version`,
|
|
538
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
539
|
-
"u64",
|
|
540
|
-
];
|
|
517
|
+
const argumentsTypes = [null, null, "u64"];
|
|
541
518
|
const parameterNames = ["version", "registry", "index"];
|
|
542
519
|
return (tx) => tx.moveCall({
|
|
543
520
|
package: packageAddress,
|
|
544
521
|
module: "stake_pool",
|
|
545
522
|
function: "remove_incentive_token",
|
|
546
|
-
arguments: (0,
|
|
523
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
547
524
|
typeArguments: options.typeArguments,
|
|
548
525
|
});
|
|
549
526
|
}
|
|
550
527
|
/** [Authorized Function] Updates the unlock countdown. */
|
|
551
528
|
function updateUnlockCountdownTsMs(options) {
|
|
552
529
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
553
|
-
const argumentsTypes = [
|
|
554
|
-
`${packageAddress}::admin::Version`,
|
|
555
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
556
|
-
"u64",
|
|
557
|
-
"u64",
|
|
558
|
-
];
|
|
530
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
559
531
|
const parameterNames = ["version", "registry", "index", "unlockCountdownTsMs"];
|
|
560
532
|
return (tx) => tx.moveCall({
|
|
561
533
|
package: packageAddress,
|
|
562
534
|
module: "stake_pool",
|
|
563
535
|
function: "update_unlock_countdown_ts_ms",
|
|
564
|
-
arguments: (0,
|
|
536
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
565
537
|
});
|
|
566
538
|
}
|
|
567
539
|
/** [Authorized Function] Updates the incentive configuration. */
|
|
568
540
|
function updateIncentiveConfig(options) {
|
|
569
541
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
570
542
|
const argumentsTypes = [
|
|
571
|
-
|
|
572
|
-
|
|
543
|
+
null,
|
|
544
|
+
null,
|
|
573
545
|
"u64",
|
|
574
|
-
"
|
|
575
|
-
"
|
|
576
|
-
"
|
|
577
|
-
"
|
|
546
|
+
"0x2::clock::Clock",
|
|
547
|
+
"0x1::option::Option<u64>",
|
|
548
|
+
"0x1::option::Option<u64>",
|
|
549
|
+
"0x1::option::Option<vector<u64>>",
|
|
578
550
|
];
|
|
579
551
|
const parameterNames = ["version", "registry", "index", "periodIncentiveAmount", "incentiveIntervalTsMs", "u64Padding"];
|
|
580
552
|
return (tx) => tx.moveCall({
|
|
581
553
|
package: packageAddress,
|
|
582
554
|
module: "stake_pool",
|
|
583
555
|
function: "update_incentive_config",
|
|
584
|
-
arguments: (0,
|
|
556
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
585
557
|
typeArguments: options.typeArguments,
|
|
586
558
|
});
|
|
587
559
|
}
|
|
588
560
|
/** Allocates incentive to the pool. WARNING: no authority check inside */
|
|
589
561
|
function allocateIncentive(options) {
|
|
590
562
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
591
|
-
const argumentsTypes = [
|
|
592
|
-
`${packageAddress}::admin::Version`,
|
|
593
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
594
|
-
"u64",
|
|
595
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
596
|
-
];
|
|
563
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
597
564
|
const parameterNames = ["version", "registry", "index"];
|
|
598
565
|
return (tx) => tx.moveCall({
|
|
599
566
|
package: packageAddress,
|
|
600
567
|
module: "stake_pool",
|
|
601
568
|
function: "allocate_incentive",
|
|
602
|
-
arguments: (0,
|
|
569
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
603
570
|
});
|
|
604
571
|
}
|
|
605
572
|
/** [Authorized Function] Deposits incentive tokens. */
|
|
606
573
|
function depositIncentive(options) {
|
|
607
574
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
608
|
-
const argumentsTypes = [
|
|
609
|
-
`${packageAddress}::admin::Version`,
|
|
610
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
611
|
-
"u64",
|
|
612
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
613
|
-
];
|
|
575
|
+
const argumentsTypes = [null, null, "u64", null];
|
|
614
576
|
const parameterNames = ["version", "registry", "index", "coin"];
|
|
615
577
|
return (tx) => tx.moveCall({
|
|
616
578
|
package: packageAddress,
|
|
617
579
|
module: "stake_pool",
|
|
618
580
|
function: "deposit_incentive",
|
|
619
|
-
arguments: (0,
|
|
581
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
620
582
|
typeArguments: options.typeArguments,
|
|
621
583
|
});
|
|
622
584
|
}
|
|
623
585
|
/** [Authorized Function] Withdraws incentive tokens. */
|
|
624
586
|
function withdrawIncentive(options) {
|
|
625
587
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
626
|
-
const argumentsTypes = [
|
|
627
|
-
`${packageAddress}::admin::Version`,
|
|
628
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
629
|
-
"u64",
|
|
630
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::option::Option<u64>",
|
|
631
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
632
|
-
];
|
|
588
|
+
const argumentsTypes = [null, null, "u64", "0x1::option::Option<u64>", "0x2::clock::Clock"];
|
|
633
589
|
const parameterNames = ["version", "registry", "index", "amount"];
|
|
634
590
|
return (tx) => tx.moveCall({
|
|
635
591
|
package: packageAddress,
|
|
636
592
|
module: "stake_pool",
|
|
637
593
|
function: "withdraw_incentive",
|
|
638
|
-
arguments: (0,
|
|
594
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
639
595
|
typeArguments: options.typeArguments,
|
|
640
596
|
});
|
|
641
597
|
}
|
|
642
598
|
/** [User Function] Stake LP tokens. */
|
|
643
599
|
function stake(options) {
|
|
644
600
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
645
|
-
const argumentsTypes = [
|
|
646
|
-
`${packageAddress}::admin::Version`,
|
|
647
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
648
|
-
"u64",
|
|
649
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
650
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
651
|
-
];
|
|
601
|
+
const argumentsTypes = [null, null, "u64", null, "0x2::clock::Clock"];
|
|
652
602
|
const parameterNames = ["version", "registry", "index", "lpToken"];
|
|
653
603
|
return (tx) => tx.moveCall({
|
|
654
604
|
package: packageAddress,
|
|
655
605
|
module: "stake_pool",
|
|
656
606
|
function: "stake",
|
|
657
|
-
arguments: (0,
|
|
607
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
658
608
|
typeArguments: options.typeArguments,
|
|
659
609
|
});
|
|
660
610
|
}
|
|
661
611
|
/** [Authorized Function] Update TLP price for calculating staking exp */
|
|
662
612
|
function updatePoolInfoU64Padding(options) {
|
|
663
613
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
664
|
-
const argumentsTypes = [
|
|
665
|
-
`${packageAddress}::admin::Version`,
|
|
666
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
667
|
-
"u64",
|
|
668
|
-
"u64",
|
|
669
|
-
"u64",
|
|
670
|
-
];
|
|
614
|
+
const argumentsTypes = [null, null, "u64", "u64", "u64"];
|
|
671
615
|
const parameterNames = ["version", "registry", "index", "tlpPrice", "usdPerExp"];
|
|
672
616
|
return (tx) => tx.moveCall({
|
|
673
617
|
package: packageAddress,
|
|
674
618
|
module: "stake_pool",
|
|
675
619
|
function: "update_pool_info_u64_padding",
|
|
676
|
-
arguments: (0,
|
|
620
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
677
621
|
});
|
|
678
622
|
}
|
|
679
623
|
/** [User Function] Get the staking exp */
|
|
680
624
|
function snapshot(options) {
|
|
681
625
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
682
|
-
const argumentsTypes = [
|
|
683
|
-
`${packageAddress}::admin::Version`,
|
|
684
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
685
|
-
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
686
|
-
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::user::TypusUserRegistry",
|
|
687
|
-
"u64",
|
|
688
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
689
|
-
];
|
|
626
|
+
const argumentsTypes = [null, null, null, null, "u64", "0x2::clock::Clock"];
|
|
690
627
|
const parameterNames = ["version", "registry", "typusEcosystemVersion", "typusUserRegistry", "index"];
|
|
691
628
|
return (tx) => tx.moveCall({
|
|
692
629
|
package: packageAddress,
|
|
693
630
|
module: "stake_pool",
|
|
694
631
|
function: "snapshot",
|
|
695
|
-
arguments: (0,
|
|
632
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
696
633
|
});
|
|
697
634
|
}
|
|
698
635
|
/** [User Function] Pre-process to unstake the TLP */
|
|
699
636
|
function unsubscribe(options) {
|
|
700
637
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
701
|
-
const argumentsTypes = [
|
|
702
|
-
`${packageAddress}::admin::Version`,
|
|
703
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
704
|
-
"u64",
|
|
705
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::option::Option<u64>",
|
|
706
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
707
|
-
];
|
|
638
|
+
const argumentsTypes = [null, null, "u64", "0x1::option::Option<u64>", "0x2::clock::Clock"];
|
|
708
639
|
const parameterNames = ["version", "registry", "index", "unsubscribedShares"];
|
|
709
640
|
return (tx) => tx.moveCall({
|
|
710
641
|
package: packageAddress,
|
|
711
642
|
module: "stake_pool",
|
|
712
643
|
function: "unsubscribe",
|
|
713
|
-
arguments: (0,
|
|
644
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
714
645
|
typeArguments: options.typeArguments,
|
|
715
646
|
});
|
|
716
647
|
}
|
|
717
648
|
/** [User Function] Post-process to unstake the TLP */
|
|
718
649
|
function unstake(options) {
|
|
719
650
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
720
|
-
const argumentsTypes = [
|
|
721
|
-
`${packageAddress}::admin::Version`,
|
|
722
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
723
|
-
"u64",
|
|
724
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
725
|
-
];
|
|
651
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
726
652
|
const parameterNames = ["version", "registry", "index"];
|
|
727
653
|
return (tx) => tx.moveCall({
|
|
728
654
|
package: packageAddress,
|
|
729
655
|
module: "stake_pool",
|
|
730
656
|
function: "unstake",
|
|
731
|
-
arguments: (0,
|
|
657
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
732
658
|
typeArguments: options.typeArguments,
|
|
733
659
|
});
|
|
734
660
|
}
|
|
735
|
-
function updateLastIncentivePriceIndex(options) {
|
|
736
|
-
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
737
|
-
const argumentsTypes = [
|
|
738
|
-
`${packageAddress}::stake_pool::LpUserShare`,
|
|
739
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
740
|
-
"u64",
|
|
741
|
-
];
|
|
742
|
-
const parameterNames = ["lpUserShare", "incentiveToken", "currentIncentiveIndex"];
|
|
743
|
-
return (tx) => tx.moveCall({
|
|
744
|
-
package: packageAddress,
|
|
745
|
-
module: "stake_pool",
|
|
746
|
-
function: "update_last_incentive_price_index",
|
|
747
|
-
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
661
|
function logHarvestedAmount(options) {
|
|
751
662
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
752
|
-
const argumentsTypes = [
|
|
663
|
+
const argumentsTypes = [null, "u64"];
|
|
753
664
|
const parameterNames = ["userShare", "incentiveValue"];
|
|
754
665
|
return (tx) => tx.moveCall({
|
|
755
666
|
package: packageAddress,
|
|
756
667
|
module: "stake_pool",
|
|
757
668
|
function: "log_harvested_amount",
|
|
758
|
-
arguments: (0,
|
|
669
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
759
670
|
});
|
|
760
671
|
}
|
|
761
672
|
/** [User Function] Harvest the incentive from staking TLP */
|
|
762
673
|
function harvestPerUserShare(options) {
|
|
763
674
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
764
|
-
const argumentsTypes = [
|
|
765
|
-
`${packageAddress}::admin::Version`,
|
|
766
|
-
`${packageAddress}::stake_pool::StakePoolRegistry`,
|
|
767
|
-
"u64",
|
|
768
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
769
|
-
];
|
|
675
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
770
676
|
const parameterNames = ["version", "registry", "index"];
|
|
771
677
|
return (tx) => tx.moveCall({
|
|
772
678
|
package: packageAddress,
|
|
773
679
|
module: "stake_pool",
|
|
774
680
|
function: "harvest_per_user_share",
|
|
775
|
-
arguments: (0,
|
|
681
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
776
682
|
typeArguments: options.typeArguments,
|
|
777
683
|
});
|
|
778
684
|
}
|
|
779
|
-
function
|
|
685
|
+
function calculateIncentiveByIdx(options) {
|
|
780
686
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
781
|
-
const argumentsTypes = [
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
687
|
+
const argumentsTypes = ["u64", "u64", null];
|
|
688
|
+
const parameterNames = ["currentIncentiveIndex", "incentiveIdx", "lpUserShare"];
|
|
689
|
+
return (tx) => tx.moveCall({
|
|
690
|
+
package: packageAddress,
|
|
691
|
+
module: "stake_pool",
|
|
692
|
+
function: "calculate_incentive_by_idx",
|
|
693
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
function updateLastIncentivePriceIndexByIdx(options) {
|
|
697
|
+
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
698
|
+
const argumentsTypes = [null, "u64", "u64"];
|
|
699
|
+
const parameterNames = ["lpUserShare", "incentiveIdx", "currentIncentiveIndex"];
|
|
787
700
|
return (tx) => tx.moveCall({
|
|
788
701
|
package: packageAddress,
|
|
789
702
|
module: "stake_pool",
|
|
790
|
-
function: "
|
|
791
|
-
arguments: (0,
|
|
703
|
+
function: "update_last_incentive_price_index_by_idx",
|
|
704
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
792
705
|
});
|
|
793
706
|
}
|
|
794
707
|
function harvestProgressUpdated(options) {
|
|
795
708
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
796
|
-
const argumentsTypes = [
|
|
797
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::vector::vector<u64>",
|
|
798
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::vector::vector<u64>",
|
|
799
|
-
];
|
|
709
|
+
const argumentsTypes = ["vector<u64>", "vector<u64>"];
|
|
800
710
|
const parameterNames = ["current", "user"];
|
|
801
711
|
return (tx) => tx.moveCall({
|
|
802
712
|
package: packageAddress,
|
|
803
713
|
module: "stake_pool",
|
|
804
714
|
function: "harvest_progress_updated",
|
|
805
|
-
arguments: (0,
|
|
715
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
806
716
|
});
|
|
807
717
|
}
|
|
808
718
|
function multiplier(options) {
|
|
@@ -813,125 +723,128 @@ function multiplier(options) {
|
|
|
813
723
|
package: packageAddress,
|
|
814
724
|
module: "stake_pool",
|
|
815
725
|
function: "multiplier",
|
|
816
|
-
arguments: (0,
|
|
726
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
817
727
|
});
|
|
818
728
|
}
|
|
819
729
|
function getUserShares(options) {
|
|
820
730
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
821
|
-
const argumentsTypes = [
|
|
731
|
+
const argumentsTypes = [null, "u64", "address"];
|
|
822
732
|
const parameterNames = ["registry", "index", "user"];
|
|
823
733
|
return (tx) => tx.moveCall({
|
|
824
734
|
package: packageAddress,
|
|
825
735
|
module: "stake_pool",
|
|
826
736
|
function: "get_user_shares",
|
|
827
|
-
arguments: (0,
|
|
737
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
828
738
|
});
|
|
829
739
|
}
|
|
830
740
|
function getUserSharesByUserShareId(options) {
|
|
831
741
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
832
|
-
const argumentsTypes = [
|
|
742
|
+
const argumentsTypes = [null, "u64", "u64"];
|
|
833
743
|
const parameterNames = ["registry", "index", "userShareId"];
|
|
834
744
|
return (tx) => tx.moveCall({
|
|
835
745
|
package: packageAddress,
|
|
836
746
|
module: "stake_pool",
|
|
837
747
|
function: "get_user_shares_by_user_share_id",
|
|
838
|
-
arguments: (0,
|
|
748
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
839
749
|
});
|
|
840
750
|
}
|
|
841
751
|
function getStakePool(options) {
|
|
842
752
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
843
|
-
const argumentsTypes = ["
|
|
753
|
+
const argumentsTypes = ["0x2::object::ID", "u64"];
|
|
844
754
|
const parameterNames = ["id", "index"];
|
|
845
755
|
return (tx) => tx.moveCall({
|
|
846
756
|
package: packageAddress,
|
|
847
757
|
module: "stake_pool",
|
|
848
758
|
function: "get_stake_pool",
|
|
849
|
-
arguments: (0,
|
|
759
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
850
760
|
});
|
|
851
761
|
}
|
|
852
762
|
function getMutStakePool(options) {
|
|
853
763
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
854
|
-
const argumentsTypes = ["
|
|
764
|
+
const argumentsTypes = ["0x2::object::ID", "u64"];
|
|
855
765
|
const parameterNames = ["id", "index"];
|
|
856
766
|
return (tx) => tx.moveCall({
|
|
857
767
|
package: packageAddress,
|
|
858
768
|
module: "stake_pool",
|
|
859
769
|
function: "get_mut_stake_pool",
|
|
860
|
-
arguments: (0,
|
|
770
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
861
771
|
});
|
|
862
772
|
}
|
|
863
773
|
function getIncentiveTokens(options) {
|
|
864
774
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
865
|
-
const argumentsTypes = [
|
|
775
|
+
const argumentsTypes = [null];
|
|
866
776
|
const parameterNames = ["stakePool"];
|
|
867
777
|
return (tx) => tx.moveCall({
|
|
868
778
|
package: packageAddress,
|
|
869
779
|
module: "stake_pool",
|
|
870
780
|
function: "get_incentive_tokens",
|
|
871
|
-
arguments: (0,
|
|
781
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
872
782
|
});
|
|
873
783
|
}
|
|
874
784
|
function getIncentive(options) {
|
|
875
785
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
876
|
-
const argumentsTypes = [
|
|
877
|
-
`${packageAddress}::stake_pool::StakePool`,
|
|
878
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
879
|
-
];
|
|
786
|
+
const argumentsTypes = [null, null];
|
|
880
787
|
const parameterNames = ["stakePool", "tokenType"];
|
|
881
788
|
return (tx) => tx.moveCall({
|
|
882
789
|
package: packageAddress,
|
|
883
790
|
module: "stake_pool",
|
|
884
791
|
function: "get_incentive",
|
|
885
|
-
arguments: (0,
|
|
792
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
886
793
|
});
|
|
887
794
|
}
|
|
888
795
|
function getMutIncentive(options) {
|
|
889
796
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
890
|
-
const argumentsTypes = [
|
|
891
|
-
`${packageAddress}::stake_pool::StakePool`,
|
|
892
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
893
|
-
];
|
|
797
|
+
const argumentsTypes = [null, null];
|
|
894
798
|
const parameterNames = ["stakePool", "tokenType"];
|
|
895
799
|
return (tx) => tx.moveCall({
|
|
896
800
|
package: packageAddress,
|
|
897
801
|
module: "stake_pool",
|
|
898
802
|
function: "get_mut_incentive",
|
|
899
|
-
arguments: (0,
|
|
803
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
900
804
|
});
|
|
901
805
|
}
|
|
902
806
|
function removeIncentive(options) {
|
|
903
807
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
904
|
-
const argumentsTypes = [
|
|
905
|
-
`${packageAddress}::stake_pool::StakePool`,
|
|
906
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
907
|
-
];
|
|
808
|
+
const argumentsTypes = [null, null];
|
|
908
809
|
const parameterNames = ["stakePool", "tokenType"];
|
|
909
810
|
return (tx) => tx.moveCall({
|
|
910
811
|
package: packageAddress,
|
|
911
812
|
module: "stake_pool",
|
|
912
813
|
function: "remove_incentive",
|
|
913
|
-
arguments: (0,
|
|
814
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
/** Get incentive index by token type, returns None if not found */
|
|
818
|
+
function getIncentiveIdx(options) {
|
|
819
|
+
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
820
|
+
const argumentsTypes = [null, null];
|
|
821
|
+
const parameterNames = ["stakePool", "tokenType"];
|
|
822
|
+
return (tx) => tx.moveCall({
|
|
823
|
+
package: packageAddress,
|
|
824
|
+
module: "stake_pool",
|
|
825
|
+
function: "get_incentive_idx",
|
|
826
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
914
827
|
});
|
|
915
828
|
}
|
|
916
829
|
function getLastIncentivePriceIndex(options) {
|
|
917
830
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
918
|
-
const argumentsTypes = [
|
|
831
|
+
const argumentsTypes = [null];
|
|
919
832
|
const parameterNames = ["stakePool"];
|
|
920
833
|
return (tx) => tx.moveCall({
|
|
921
834
|
package: packageAddress,
|
|
922
835
|
module: "stake_pool",
|
|
923
836
|
function: "get_last_incentive_price_index",
|
|
924
|
-
arguments: (0,
|
|
837
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
925
838
|
});
|
|
926
839
|
}
|
|
927
840
|
function checkStakePoolActive(options) {
|
|
928
841
|
const packageAddress = options.package ?? "@typus/stake-pool";
|
|
929
|
-
const argumentsTypes = [
|
|
842
|
+
const argumentsTypes = [null];
|
|
930
843
|
const parameterNames = ["stakePool"];
|
|
931
844
|
return (tx) => tx.moveCall({
|
|
932
845
|
package: packageAddress,
|
|
933
846
|
module: "stake_pool",
|
|
934
847
|
function: "check_stake_pool_active",
|
|
935
|
-
arguments: (0,
|
|
848
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
936
849
|
});
|
|
937
850
|
}
|