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