@typus/typus-perp-sdk 1.1.54 → 1.2.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/api/sentio.js +2 -2
- package/dist/src/client.d.ts +13 -12
- package/dist/src/client.js +24 -49
- package/dist/src/fetch.d.ts +15 -61
- package/dist/src/fetch.js +63 -163
- 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/index.js +4 -4
- package/dist/src/user/history.js +13 -12
- package/dist/src/user/order.d.ts +1 -1
- package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
- package/package.json +7 -13
- 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
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BurnLpEvent = exports.UpdateLiquidityValueEvent = exports.CompleteRebalancingEvent = exports.RebalanceEvent = exports.RebalanceProcess = exports.ManagerRemoveLiquidityTokenEvent = exports.ResumeTokenPoolEvent = exports.SuspendTokenPoolEvent = exports.ResumePoolEvent = exports.SuspendPoolEvent = exports.RedeemEvent = exports.SwapEvent = exports.UpdateBorrowInfoEvent = exports.MintLpEvent = exports.UpdateMarginConfigEvent = exports.ManagerEmergencyWithdrawEvent = exports.ManagerEmergencyDepositEvent = exports.UpdateSpotConfigEvent = exports.AddLiquidityTokenEvent = exports.UpdateRebalanceCostThresholdBpEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.NewLiquidityPoolEvent = exports.ManagerDepositReceipt = exports.DeactivatingShares = exports.LiquidityPool = exports.LiquidityPoolInfo = exports.TokenPool = exports.State = exports.Config = exports.MarginConfig = exports.SpotConfig = exports.Registry = void 0;
|
|
39
|
+
exports.BurnLpEvent = exports.UpdateLiquidityValueEvent = exports.CompleteRebalancingEvent = exports.RebalanceEvent = exports.RebalanceProcess = exports.ManagerRemoveLiquidityTokenEvent = exports.WithdrawLendingEvent = exports.DepositLendingEvent = exports.ResumeTokenPoolEvent = exports.SuspendTokenPoolEvent = exports.ResumePoolEvent = exports.SuspendPoolEvent = exports.RedeemEvent = exports.SwapEvent = exports.UpdateBorrowInfoEvent = exports.MintLpEvent = exports.UpdateMarginConfigEvent = exports.ManagerEmergencyWithdrawEvent = exports.ManagerEmergencyDepositEvent = exports.UpdateSpotConfigEvent = exports.AddLiquidityTokenEvent = exports.UpdateRebalanceCostThresholdBpEvent = exports.UpdateUnlockCountdownTsMsEvent = exports.NewLiquidityPoolEvent = exports.ManagerDepositReceipt = exports.DeactivatingShares = exports.LiquidityPool = exports.LiquidityPoolInfo = exports.TokenPool = exports.State = exports.Config = exports.MarginConfig = exports.SpotConfig = exports.Registry = void 0;
|
|
40
40
|
exports.init = init;
|
|
41
41
|
exports.newLiquidityPool = newLiquidityPool;
|
|
42
42
|
exports.updateUnlockCountdownTsMs = updateUnlockCountdownTsMs;
|
|
@@ -55,6 +55,11 @@ exports.suspendPool = suspendPool;
|
|
|
55
55
|
exports.resumePool = resumePool;
|
|
56
56
|
exports.suspendTokenPool = suspendTokenPool;
|
|
57
57
|
exports.resumeTokenPool = resumeTokenPool;
|
|
58
|
+
exports.managerDepositScallop = managerDepositScallop;
|
|
59
|
+
exports.managerDepositNavi = managerDepositNavi;
|
|
60
|
+
exports.managerWithdrawScallop = managerWithdrawScallop;
|
|
61
|
+
exports.managerWithdrawNavi = managerWithdrawNavi;
|
|
62
|
+
exports.managerRewardNavi = managerRewardNavi;
|
|
58
63
|
exports.managerRemoveLiquidityToken = managerRemoveLiquidityToken;
|
|
59
64
|
exports.checkTokenPoolStatus = checkTokenPoolStatus;
|
|
60
65
|
exports.tokenPoolIsActive = tokenPoolIsActive;
|
|
@@ -73,8 +78,16 @@ exports.getReceiptCollateral = getReceiptCollateral;
|
|
|
73
78
|
exports.calculateMintLp = calculateMintLp;
|
|
74
79
|
exports.calculateBurnLp = calculateBurnLp;
|
|
75
80
|
exports.calculateLpFee = calculateLpFee;
|
|
81
|
+
exports.calculateFee_ = calculateFee_;
|
|
82
|
+
exports.normalSafetyCheck = normalSafetyCheck;
|
|
76
83
|
exports.calculateSwapFee = calculateSwapFee;
|
|
77
84
|
exports.checkTvlUpdated = checkTvlUpdated;
|
|
85
|
+
exports.calculateLendingAmountCapped = calculateLendingAmountCapped;
|
|
86
|
+
exports.depositScallopBasic = depositScallopBasic;
|
|
87
|
+
exports.withdrawScallopBasic = withdrawScallopBasic;
|
|
88
|
+
exports.depositNavi = depositNavi;
|
|
89
|
+
exports.withdrawNavi = withdrawNavi;
|
|
90
|
+
exports.rewardNavi = rewardNavi;
|
|
78
91
|
exports.burnLp_ = burnLp_;
|
|
79
92
|
exports.viewSwapResult = viewSwapResult;
|
|
80
93
|
exports.getReceiptCollateralBcs = getReceiptCollateralBcs;
|
|
@@ -101,24 +114,52 @@ exports.getUserDeactivatingShares = getUserDeactivatingShares;
|
|
|
101
114
|
* configurations. It also contains the entry functions for creating pools, adding
|
|
102
115
|
* liquidity, swapping, and redeeming.
|
|
103
116
|
*/
|
|
104
|
-
const
|
|
117
|
+
const index_js_1 = require("../utils/index.js");
|
|
105
118
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const
|
|
119
|
+
const type_name = __importStar(require("./deps/std/type_name.js"));
|
|
120
|
+
const type_name_1 = __importStar(require("./deps/std/type_name.js"));
|
|
121
|
+
const type_name_2 = __importStar(require("./deps/std/type_name.js"));
|
|
122
|
+
const escrow = __importStar(require("./escrow.js"));
|
|
123
|
+
const balance = __importStar(require("./deps/sui/balance.js"));
|
|
124
|
+
const type_name_3 = __importStar(require("./deps/std/type_name.js"));
|
|
125
|
+
const type_name_4 = __importStar(require("./deps/std/type_name.js"));
|
|
126
|
+
const type_name_5 = __importStar(require("./deps/std/type_name.js"));
|
|
127
|
+
const type_name_6 = __importStar(require("./deps/std/type_name.js"));
|
|
128
|
+
const type_name_7 = __importStar(require("./deps/std/type_name.js"));
|
|
129
|
+
const type_name_8 = __importStar(require("./deps/std/type_name.js"));
|
|
130
|
+
const type_name_9 = __importStar(require("./deps/std/type_name.js"));
|
|
131
|
+
const type_name_10 = __importStar(require("./deps/std/type_name.js"));
|
|
132
|
+
const type_name_11 = __importStar(require("./deps/std/type_name.js"));
|
|
133
|
+
const type_name_12 = __importStar(require("./deps/std/type_name.js"));
|
|
134
|
+
const type_name_13 = __importStar(require("./deps/std/type_name.js"));
|
|
135
|
+
const type_name_14 = __importStar(require("./deps/std/type_name.js"));
|
|
136
|
+
const type_name_15 = __importStar(require("./deps/std/type_name.js"));
|
|
137
|
+
const type_name_16 = __importStar(require("./deps/std/type_name.js"));
|
|
138
|
+
const type_name_17 = __importStar(require("./deps/std/type_name.js"));
|
|
139
|
+
const type_name_18 = __importStar(require("./deps/std/type_name.js"));
|
|
140
|
+
const type_name_19 = __importStar(require("./deps/std/type_name.js"));
|
|
141
|
+
const type_name_20 = __importStar(require("./deps/std/type_name.js"));
|
|
142
|
+
const type_name_21 = __importStar(require("./deps/std/type_name.js"));
|
|
143
|
+
const type_name_22 = __importStar(require("./deps/std/type_name.js"));
|
|
144
|
+
const type_name_23 = __importStar(require("./deps/std/type_name.js"));
|
|
145
|
+
const type_name_24 = __importStar(require("./deps/std/type_name.js"));
|
|
146
|
+
const type_name_25 = __importStar(require("./deps/std/type_name.js"));
|
|
147
|
+
const type_name_26 = __importStar(require("./deps/std/type_name.js"));
|
|
148
|
+
const type_name_27 = __importStar(require("./deps/std/type_name.js"));
|
|
149
|
+
const type_name_28 = __importStar(require("./deps/std/type_name.js"));
|
|
150
|
+
const type_name_29 = __importStar(require("./deps/std/type_name.js"));
|
|
110
151
|
const $moduleName = "@typus/perp::lp_pool";
|
|
111
|
-
exports.Registry = new
|
|
152
|
+
exports.Registry = new index_js_1.MoveStruct({
|
|
112
153
|
name: `${$moduleName}::Registry`,
|
|
113
154
|
fields: {
|
|
114
|
-
id:
|
|
155
|
+
id: bcs_1.bcs.Address,
|
|
115
156
|
/** The number of pools in the registry. */
|
|
116
157
|
num_pool: bcs_1.bcs.u64(),
|
|
117
158
|
/** The UID of the liquidity pool registry. */
|
|
118
|
-
liquidity_pool_registry:
|
|
159
|
+
liquidity_pool_registry: bcs_1.bcs.Address,
|
|
119
160
|
},
|
|
120
161
|
});
|
|
121
|
-
exports.SpotConfig = new
|
|
162
|
+
exports.SpotConfig = new index_js_1.MoveStruct({
|
|
122
163
|
name: `${$moduleName}::SpotConfig`,
|
|
123
164
|
fields: {
|
|
124
165
|
/** The minimum deposit amount. */
|
|
@@ -145,7 +186,7 @@ exports.SpotConfig = new index_1.MoveStruct({
|
|
|
145
186
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
146
187
|
},
|
|
147
188
|
});
|
|
148
|
-
exports.MarginConfig = new
|
|
189
|
+
exports.MarginConfig = new index_js_1.MoveStruct({
|
|
149
190
|
name: `${$moduleName}::MarginConfig`,
|
|
150
191
|
fields: {
|
|
151
192
|
/** The basic borrow rate at utilization 0. */
|
|
@@ -166,7 +207,7 @@ exports.MarginConfig = new index_1.MoveStruct({
|
|
|
166
207
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
167
208
|
},
|
|
168
209
|
});
|
|
169
|
-
exports.Config = new
|
|
210
|
+
exports.Config = new index_js_1.MoveStruct({
|
|
170
211
|
name: `${$moduleName}::Config`,
|
|
171
212
|
fields: {
|
|
172
213
|
/** The address of the oracle. */
|
|
@@ -181,7 +222,7 @@ exports.Config = new index_1.MoveStruct({
|
|
|
181
222
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
182
223
|
},
|
|
183
224
|
});
|
|
184
|
-
exports.State = new
|
|
225
|
+
exports.State = new index_js_1.MoveStruct({
|
|
185
226
|
name: `${$moduleName}::State`,
|
|
186
227
|
fields: {
|
|
187
228
|
/** The amount of liquidity in the pool. */
|
|
@@ -208,7 +249,7 @@ exports.State = new index_1.MoveStruct({
|
|
|
208
249
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
209
250
|
},
|
|
210
251
|
});
|
|
211
|
-
exports.TokenPool = new
|
|
252
|
+
exports.TokenPool = new index_js_1.MoveStruct({
|
|
212
253
|
name: `${$moduleName}::TokenPool`,
|
|
213
254
|
fields: {
|
|
214
255
|
/** The type name of the token. */
|
|
@@ -219,7 +260,7 @@ exports.TokenPool = new index_1.MoveStruct({
|
|
|
219
260
|
state: exports.State,
|
|
220
261
|
},
|
|
221
262
|
});
|
|
222
|
-
exports.LiquidityPoolInfo = new
|
|
263
|
+
exports.LiquidityPoolInfo = new index_js_1.MoveStruct({
|
|
223
264
|
name: `${$moduleName}::LiquidityPoolInfo`,
|
|
224
265
|
fields: {
|
|
225
266
|
/** The number of decimals for the LP token. */
|
|
@@ -232,20 +273,20 @@ exports.LiquidityPoolInfo = new index_1.MoveStruct({
|
|
|
232
273
|
is_active: bcs_1.bcs.bool(),
|
|
233
274
|
},
|
|
234
275
|
});
|
|
235
|
-
exports.LiquidityPool = new
|
|
276
|
+
exports.LiquidityPool = new index_js_1.MoveStruct({
|
|
236
277
|
name: `${$moduleName}::LiquidityPool`,
|
|
237
278
|
fields: {
|
|
238
279
|
/**
|
|
239
280
|
* The UID of the object. Token balances are dynamic fields under this id with
|
|
240
281
|
* TypeName key.
|
|
241
282
|
*/
|
|
242
|
-
id:
|
|
283
|
+
id: bcs_1.bcs.Address,
|
|
243
284
|
/** The index of the pool. */
|
|
244
285
|
index: bcs_1.bcs.u64(),
|
|
245
286
|
/** The type name of the LP token. */
|
|
246
|
-
lp_token_type:
|
|
287
|
+
lp_token_type: type_name_1.TypeName,
|
|
247
288
|
/** A vector of the type names of the liquidity tokens. */
|
|
248
|
-
liquidity_tokens: bcs_1.bcs.vector(
|
|
289
|
+
liquidity_tokens: bcs_1.bcs.vector(type_name_2.TypeName),
|
|
249
290
|
/** A vector of the token pools. */
|
|
250
291
|
token_pools: bcs_1.bcs.vector(exports.TokenPool),
|
|
251
292
|
/** Information about the liquidity pool. */
|
|
@@ -258,8 +299,8 @@ exports.LiquidityPool = new index_1.MoveStruct({
|
|
|
258
299
|
bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.u8()),
|
|
259
300
|
},
|
|
260
301
|
});
|
|
261
|
-
exports.DeactivatingShares = new
|
|
262
|
-
name: `${$moduleName}::DeactivatingShares
|
|
302
|
+
exports.DeactivatingShares = new index_js_1.MoveStruct({
|
|
303
|
+
name: `${$moduleName}::DeactivatingShares<phantom TOKEN>`,
|
|
263
304
|
fields: {
|
|
264
305
|
/** The balance of the deactivating shares. */
|
|
265
306
|
balance: balance.Balance,
|
|
@@ -271,31 +312,31 @@ exports.DeactivatingShares = new index_1.MoveStruct({
|
|
|
271
312
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
272
313
|
},
|
|
273
314
|
});
|
|
274
|
-
exports.ManagerDepositReceipt = new
|
|
315
|
+
exports.ManagerDepositReceipt = new index_js_1.MoveStruct({
|
|
275
316
|
name: `${$moduleName}::ManagerDepositReceipt`,
|
|
276
317
|
fields: {
|
|
277
|
-
id:
|
|
318
|
+
id: bcs_1.bcs.Address,
|
|
278
319
|
/** The index of the pool. */
|
|
279
320
|
index: bcs_1.bcs.u64(),
|
|
280
321
|
/** The type name of the token. */
|
|
281
|
-
token_type:
|
|
322
|
+
token_type: type_name_3.TypeName,
|
|
282
323
|
/** The amount of the deposit. */
|
|
283
324
|
amount: bcs_1.bcs.u64(),
|
|
284
325
|
/** Padding for future use. */
|
|
285
326
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
286
327
|
},
|
|
287
328
|
});
|
|
288
|
-
exports.NewLiquidityPoolEvent = new
|
|
329
|
+
exports.NewLiquidityPoolEvent = new index_js_1.MoveStruct({
|
|
289
330
|
name: `${$moduleName}::NewLiquidityPoolEvent`,
|
|
290
331
|
fields: {
|
|
291
332
|
sender: bcs_1.bcs.Address,
|
|
292
333
|
index: bcs_1.bcs.u64(),
|
|
293
|
-
lp_token_type:
|
|
334
|
+
lp_token_type: type_name_4.TypeName,
|
|
294
335
|
lp_token_decimal: bcs_1.bcs.u64(),
|
|
295
336
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
296
337
|
},
|
|
297
338
|
});
|
|
298
|
-
exports.UpdateUnlockCountdownTsMsEvent = new
|
|
339
|
+
exports.UpdateUnlockCountdownTsMsEvent = new index_js_1.MoveStruct({
|
|
299
340
|
name: `${$moduleName}::UpdateUnlockCountdownTsMsEvent`,
|
|
300
341
|
fields: {
|
|
301
342
|
sender: bcs_1.bcs.Address,
|
|
@@ -305,7 +346,7 @@ exports.UpdateUnlockCountdownTsMsEvent = new index_1.MoveStruct({
|
|
|
305
346
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
306
347
|
},
|
|
307
348
|
});
|
|
308
|
-
exports.UpdateRebalanceCostThresholdBpEvent = new
|
|
349
|
+
exports.UpdateRebalanceCostThresholdBpEvent = new index_js_1.MoveStruct({
|
|
309
350
|
name: `${$moduleName}::UpdateRebalanceCostThresholdBpEvent`,
|
|
310
351
|
fields: {
|
|
311
352
|
sender: bcs_1.bcs.Address,
|
|
@@ -315,78 +356,78 @@ exports.UpdateRebalanceCostThresholdBpEvent = new index_1.MoveStruct({
|
|
|
315
356
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
316
357
|
},
|
|
317
358
|
});
|
|
318
|
-
exports.AddLiquidityTokenEvent = new
|
|
359
|
+
exports.AddLiquidityTokenEvent = new index_js_1.MoveStruct({
|
|
319
360
|
name: `${$moduleName}::AddLiquidityTokenEvent`,
|
|
320
361
|
fields: {
|
|
321
362
|
sender: bcs_1.bcs.Address,
|
|
322
363
|
index: bcs_1.bcs.u64(),
|
|
323
|
-
token_type:
|
|
364
|
+
token_type: type_name_5.TypeName,
|
|
324
365
|
config: exports.Config,
|
|
325
366
|
state: exports.State,
|
|
326
367
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
327
368
|
},
|
|
328
369
|
});
|
|
329
|
-
exports.UpdateSpotConfigEvent = new
|
|
370
|
+
exports.UpdateSpotConfigEvent = new index_js_1.MoveStruct({
|
|
330
371
|
name: `${$moduleName}::UpdateSpotConfigEvent`,
|
|
331
372
|
fields: {
|
|
332
373
|
sender: bcs_1.bcs.Address,
|
|
333
374
|
index: bcs_1.bcs.u64(),
|
|
334
|
-
liquidity_token_type:
|
|
375
|
+
liquidity_token_type: type_name_6.TypeName,
|
|
335
376
|
previous_spot_config: exports.SpotConfig,
|
|
336
377
|
new_spot_config: exports.SpotConfig,
|
|
337
378
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
338
379
|
},
|
|
339
380
|
});
|
|
340
|
-
exports.ManagerEmergencyDepositEvent = new
|
|
381
|
+
exports.ManagerEmergencyDepositEvent = new index_js_1.MoveStruct({
|
|
341
382
|
name: `${$moduleName}::ManagerEmergencyDepositEvent`,
|
|
342
383
|
fields: {
|
|
343
384
|
sender: bcs_1.bcs.Address,
|
|
344
385
|
index: bcs_1.bcs.u64(),
|
|
345
|
-
liquidity_token_type:
|
|
386
|
+
liquidity_token_type: type_name_7.TypeName,
|
|
346
387
|
amount: bcs_1.bcs.u64(),
|
|
347
388
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
348
389
|
},
|
|
349
390
|
});
|
|
350
|
-
exports.ManagerEmergencyWithdrawEvent = new
|
|
391
|
+
exports.ManagerEmergencyWithdrawEvent = new index_js_1.MoveStruct({
|
|
351
392
|
name: `${$moduleName}::ManagerEmergencyWithdrawEvent`,
|
|
352
393
|
fields: {
|
|
353
394
|
sender: bcs_1.bcs.Address,
|
|
354
395
|
index: bcs_1.bcs.u64(),
|
|
355
|
-
liquidity_token_type:
|
|
396
|
+
liquidity_token_type: type_name_8.TypeName,
|
|
356
397
|
amount: bcs_1.bcs.u64(),
|
|
357
398
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
358
399
|
},
|
|
359
400
|
});
|
|
360
|
-
exports.UpdateMarginConfigEvent = new
|
|
401
|
+
exports.UpdateMarginConfigEvent = new index_js_1.MoveStruct({
|
|
361
402
|
name: `${$moduleName}::UpdateMarginConfigEvent`,
|
|
362
403
|
fields: {
|
|
363
404
|
sender: bcs_1.bcs.Address,
|
|
364
405
|
index: bcs_1.bcs.u64(),
|
|
365
|
-
liquidity_token_type:
|
|
406
|
+
liquidity_token_type: type_name_9.TypeName,
|
|
366
407
|
previous_margin_config: exports.MarginConfig,
|
|
367
408
|
new_margin_config: exports.MarginConfig,
|
|
368
409
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
369
410
|
},
|
|
370
411
|
});
|
|
371
|
-
exports.MintLpEvent = new
|
|
412
|
+
exports.MintLpEvent = new index_js_1.MoveStruct({
|
|
372
413
|
name: `${$moduleName}::MintLpEvent`,
|
|
373
414
|
fields: {
|
|
374
415
|
sender: bcs_1.bcs.Address,
|
|
375
416
|
index: bcs_1.bcs.u64(),
|
|
376
|
-
liquidity_token_type:
|
|
417
|
+
liquidity_token_type: type_name_10.TypeName,
|
|
377
418
|
deposit_amount: bcs_1.bcs.u64(),
|
|
378
419
|
deposit_amount_usd: bcs_1.bcs.u64(),
|
|
379
420
|
mint_fee_usd: bcs_1.bcs.u64(),
|
|
380
|
-
lp_token_type:
|
|
421
|
+
lp_token_type: type_name_11.TypeName,
|
|
381
422
|
minted_lp_amount: bcs_1.bcs.u64(),
|
|
382
423
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
383
424
|
},
|
|
384
425
|
});
|
|
385
|
-
exports.UpdateBorrowInfoEvent = new
|
|
426
|
+
exports.UpdateBorrowInfoEvent = new index_js_1.MoveStruct({
|
|
386
427
|
name: `${$moduleName}::UpdateBorrowInfoEvent`,
|
|
387
428
|
fields: {
|
|
388
429
|
index: bcs_1.bcs.u64(),
|
|
389
|
-
liquidity_token_type:
|
|
430
|
+
liquidity_token_type: type_name_12.TypeName,
|
|
390
431
|
previous_borrow_ts_ms: bcs_1.bcs.u64(),
|
|
391
432
|
previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
|
|
392
433
|
borrow_interval_ts_ms: bcs_1.bcs.u64(),
|
|
@@ -395,14 +436,14 @@ exports.UpdateBorrowInfoEvent = new index_1.MoveStruct({
|
|
|
395
436
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
396
437
|
},
|
|
397
438
|
});
|
|
398
|
-
exports.SwapEvent = new
|
|
439
|
+
exports.SwapEvent = new index_js_1.MoveStruct({
|
|
399
440
|
name: `${$moduleName}::SwapEvent`,
|
|
400
441
|
fields: {
|
|
401
442
|
sender: bcs_1.bcs.Address,
|
|
402
443
|
index: bcs_1.bcs.u64(),
|
|
403
|
-
from_token_type:
|
|
444
|
+
from_token_type: type_name_13.TypeName,
|
|
404
445
|
from_amount: bcs_1.bcs.u64(),
|
|
405
|
-
to_token_type:
|
|
446
|
+
to_token_type: type_name_14.TypeName,
|
|
406
447
|
min_to_amount: bcs_1.bcs.u64(),
|
|
407
448
|
actual_to_amount: bcs_1.bcs.u64(),
|
|
408
449
|
fee_amount: bcs_1.bcs.u64(),
|
|
@@ -412,7 +453,7 @@ exports.SwapEvent = new index_1.MoveStruct({
|
|
|
412
453
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
413
454
|
},
|
|
414
455
|
});
|
|
415
|
-
exports.RedeemEvent = new
|
|
456
|
+
exports.RedeemEvent = new index_js_1.MoveStruct({
|
|
416
457
|
name: `${$moduleName}::RedeemEvent`,
|
|
417
458
|
fields: {
|
|
418
459
|
sender: bcs_1.bcs.Address,
|
|
@@ -424,7 +465,7 @@ exports.RedeemEvent = new index_1.MoveStruct({
|
|
|
424
465
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
425
466
|
},
|
|
426
467
|
});
|
|
427
|
-
exports.SuspendPoolEvent = new
|
|
468
|
+
exports.SuspendPoolEvent = new index_js_1.MoveStruct({
|
|
428
469
|
name: `${$moduleName}::SuspendPoolEvent`,
|
|
429
470
|
fields: {
|
|
430
471
|
sender: bcs_1.bcs.Address,
|
|
@@ -432,7 +473,7 @@ exports.SuspendPoolEvent = new index_1.MoveStruct({
|
|
|
432
473
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
433
474
|
},
|
|
434
475
|
});
|
|
435
|
-
exports.ResumePoolEvent = new
|
|
476
|
+
exports.ResumePoolEvent = new index_js_1.MoveStruct({
|
|
436
477
|
name: `${$moduleName}::ResumePoolEvent`,
|
|
437
478
|
fields: {
|
|
438
479
|
sender: bcs_1.bcs.Address,
|
|
@@ -440,52 +481,87 @@ exports.ResumePoolEvent = new index_1.MoveStruct({
|
|
|
440
481
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
441
482
|
},
|
|
442
483
|
});
|
|
443
|
-
exports.SuspendTokenPoolEvent = new
|
|
484
|
+
exports.SuspendTokenPoolEvent = new index_js_1.MoveStruct({
|
|
444
485
|
name: `${$moduleName}::SuspendTokenPoolEvent`,
|
|
445
486
|
fields: {
|
|
446
487
|
sender: bcs_1.bcs.Address,
|
|
447
488
|
index: bcs_1.bcs.u64(),
|
|
448
|
-
liquidity_token:
|
|
489
|
+
liquidity_token: type_name_15.TypeName,
|
|
449
490
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
450
491
|
},
|
|
451
492
|
});
|
|
452
|
-
exports.ResumeTokenPoolEvent = new
|
|
493
|
+
exports.ResumeTokenPoolEvent = new index_js_1.MoveStruct({
|
|
453
494
|
name: `${$moduleName}::ResumeTokenPoolEvent`,
|
|
454
495
|
fields: {
|
|
455
496
|
sender: bcs_1.bcs.Address,
|
|
456
497
|
index: bcs_1.bcs.u64(),
|
|
457
|
-
liquidity_token:
|
|
498
|
+
liquidity_token: type_name_16.TypeName,
|
|
499
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
500
|
+
},
|
|
501
|
+
});
|
|
502
|
+
exports.DepositLendingEvent = new index_js_1.MoveStruct({
|
|
503
|
+
name: `${$moduleName}::DepositLendingEvent`,
|
|
504
|
+
fields: {
|
|
505
|
+
index: bcs_1.bcs.u64(),
|
|
506
|
+
lending_index: bcs_1.bcs.u64(),
|
|
507
|
+
c_token_type: type_name_17.TypeName,
|
|
508
|
+
deposit_amount: bcs_1.bcs.u64(),
|
|
509
|
+
minted_market_coin_amount: bcs_1.bcs.u64(),
|
|
510
|
+
latest_lending_amount: bcs_1.bcs.u64(),
|
|
511
|
+
latest_market_coin_amount: bcs_1.bcs.u64(),
|
|
512
|
+
latest_reserved_amount: bcs_1.bcs.u64(),
|
|
513
|
+
latest_liquidity_amount: bcs_1.bcs.u64(),
|
|
458
514
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
459
515
|
},
|
|
460
516
|
});
|
|
461
|
-
exports.
|
|
517
|
+
exports.WithdrawLendingEvent = new index_js_1.MoveStruct({
|
|
518
|
+
name: `${$moduleName}::WithdrawLendingEvent`,
|
|
519
|
+
fields: {
|
|
520
|
+
index: bcs_1.bcs.u64(),
|
|
521
|
+
lending_index: bcs_1.bcs.u64(),
|
|
522
|
+
c_token_type: type_name_18.TypeName,
|
|
523
|
+
r_token_type: type_name_19.TypeName,
|
|
524
|
+
withdraw_amount: bcs_1.bcs.u64(),
|
|
525
|
+
withdrawn_collateral_amount: bcs_1.bcs.u64(),
|
|
526
|
+
latest_lending_amount: bcs_1.bcs.u64(),
|
|
527
|
+
latest_market_coin_amount: bcs_1.bcs.u64(),
|
|
528
|
+
latest_reserved_amount: bcs_1.bcs.u64(),
|
|
529
|
+
latest_liquidity_amount: bcs_1.bcs.u64(),
|
|
530
|
+
lending_interest: bcs_1.bcs.u64(),
|
|
531
|
+
protocol_share: bcs_1.bcs.u64(),
|
|
532
|
+
lending_reward: bcs_1.bcs.u64(),
|
|
533
|
+
reward_protocol_share: bcs_1.bcs.u64(),
|
|
534
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
535
|
+
},
|
|
536
|
+
});
|
|
537
|
+
exports.ManagerRemoveLiquidityTokenEvent = new index_js_1.MoveStruct({
|
|
462
538
|
name: `${$moduleName}::ManagerRemoveLiquidityTokenEvent`,
|
|
463
539
|
fields: {
|
|
464
540
|
index: bcs_1.bcs.u64(),
|
|
465
|
-
liquidity_token:
|
|
541
|
+
liquidity_token: type_name_20.TypeName,
|
|
466
542
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
467
543
|
},
|
|
468
544
|
});
|
|
469
|
-
exports.RebalanceProcess = new
|
|
545
|
+
exports.RebalanceProcess = new index_js_1.MoveStruct({
|
|
470
546
|
name: `${$moduleName}::RebalanceProcess`,
|
|
471
547
|
fields: {
|
|
472
548
|
index: bcs_1.bcs.u64(),
|
|
473
|
-
token_type_a:
|
|
549
|
+
token_type_a: type_name_21.TypeName,
|
|
474
550
|
token_decimal_a: bcs_1.bcs.u64(),
|
|
475
551
|
token_amount_a: bcs_1.bcs.u64(),
|
|
476
552
|
oracle_price_a: bcs_1.bcs.u64(),
|
|
477
553
|
reduced_usd: bcs_1.bcs.u64(),
|
|
478
|
-
token_type_b:
|
|
554
|
+
token_type_b: type_name_22.TypeName,
|
|
479
555
|
token_decimal_b: bcs_1.bcs.u64(),
|
|
480
556
|
oracle_price_b: bcs_1.bcs.u64(),
|
|
481
557
|
},
|
|
482
558
|
});
|
|
483
|
-
exports.RebalanceEvent = new
|
|
559
|
+
exports.RebalanceEvent = new index_js_1.MoveStruct({
|
|
484
560
|
name: `${$moduleName}::RebalanceEvent`,
|
|
485
561
|
fields: {
|
|
486
562
|
index: bcs_1.bcs.u64(),
|
|
487
|
-
from_token:
|
|
488
|
-
to_token:
|
|
563
|
+
from_token: type_name_23.TypeName,
|
|
564
|
+
to_token: type_name_24.TypeName,
|
|
489
565
|
rebalance_amount: bcs_1.bcs.u64(),
|
|
490
566
|
from_token_oracle_price: bcs_1.bcs.u64(),
|
|
491
567
|
to_token_oracle_price: bcs_1.bcs.u64(),
|
|
@@ -496,12 +572,12 @@ exports.RebalanceEvent = new index_1.MoveStruct({
|
|
|
496
572
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
497
573
|
},
|
|
498
574
|
});
|
|
499
|
-
exports.CompleteRebalancingEvent = new
|
|
575
|
+
exports.CompleteRebalancingEvent = new index_js_1.MoveStruct({
|
|
500
576
|
name: `${$moduleName}::CompleteRebalancingEvent`,
|
|
501
577
|
fields: {
|
|
502
578
|
index: bcs_1.bcs.u64(),
|
|
503
|
-
from_token:
|
|
504
|
-
to_token:
|
|
579
|
+
from_token: type_name_25.TypeName,
|
|
580
|
+
to_token: type_name_26.TypeName,
|
|
505
581
|
from_token_oracle_price: bcs_1.bcs.u64(),
|
|
506
582
|
to_token_oracle_price: bcs_1.bcs.u64(),
|
|
507
583
|
swapped_back_usd: bcs_1.bcs.u64(),
|
|
@@ -511,28 +587,28 @@ exports.CompleteRebalancingEvent = new index_1.MoveStruct({
|
|
|
511
587
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
512
588
|
},
|
|
513
589
|
});
|
|
514
|
-
exports.UpdateLiquidityValueEvent = new
|
|
590
|
+
exports.UpdateLiquidityValueEvent = new index_js_1.MoveStruct({
|
|
515
591
|
name: `${$moduleName}::UpdateLiquidityValueEvent`,
|
|
516
592
|
fields: {
|
|
517
593
|
sender: bcs_1.bcs.Address,
|
|
518
594
|
index: bcs_1.bcs.u64(),
|
|
519
|
-
liquidity_token:
|
|
595
|
+
liquidity_token: type_name_27.TypeName,
|
|
520
596
|
price: bcs_1.bcs.u64(),
|
|
521
597
|
value_in_usd: bcs_1.bcs.u64(),
|
|
522
598
|
lp_pool_tvl_usd: bcs_1.bcs.u64(),
|
|
523
599
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
524
600
|
},
|
|
525
601
|
});
|
|
526
|
-
exports.BurnLpEvent = new
|
|
602
|
+
exports.BurnLpEvent = new index_js_1.MoveStruct({
|
|
527
603
|
name: `${$moduleName}::BurnLpEvent`,
|
|
528
604
|
fields: {
|
|
529
605
|
sender: bcs_1.bcs.Address,
|
|
530
606
|
index: bcs_1.bcs.u64(),
|
|
531
|
-
lp_token_type:
|
|
607
|
+
lp_token_type: type_name_28.TypeName,
|
|
532
608
|
burn_lp_amount: bcs_1.bcs.u64(),
|
|
533
609
|
burn_amount_usd: bcs_1.bcs.u64(),
|
|
534
610
|
burn_fee_usd: bcs_1.bcs.u64(),
|
|
535
|
-
liquidity_token_type:
|
|
611
|
+
liquidity_token_type: type_name_29.TypeName,
|
|
536
612
|
withdraw_token_amount: bcs_1.bcs.u64(),
|
|
537
613
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
538
614
|
},
|
|
@@ -548,48 +624,48 @@ function init(options = {}) {
|
|
|
548
624
|
/** [Authorized Function] Creates a new liquidity pool. */
|
|
549
625
|
function newLiquidityPool(options) {
|
|
550
626
|
const packageAddress = options.package ?? "@typus/perp";
|
|
551
|
-
const argumentsTypes = [
|
|
627
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
552
628
|
const parameterNames = ["version", "registry", "lpTokenDecimal", "unlockCountdownTsMs"];
|
|
553
629
|
return (tx) => tx.moveCall({
|
|
554
630
|
package: packageAddress,
|
|
555
631
|
module: "lp_pool",
|
|
556
632
|
function: "new_liquidity_pool",
|
|
557
|
-
arguments: (0,
|
|
633
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
558
634
|
typeArguments: options.typeArguments,
|
|
559
635
|
});
|
|
560
636
|
}
|
|
561
637
|
/** [Authorized Function] Updates the unlock countdown. */
|
|
562
638
|
function updateUnlockCountdownTsMs(options) {
|
|
563
639
|
const packageAddress = options.package ?? "@typus/perp";
|
|
564
|
-
const argumentsTypes = [
|
|
640
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
565
641
|
const parameterNames = ["version", "registry", "index", "unlockCountdownTsMs"];
|
|
566
642
|
return (tx) => tx.moveCall({
|
|
567
643
|
package: packageAddress,
|
|
568
644
|
module: "lp_pool",
|
|
569
645
|
function: "update_unlock_countdown_ts_ms",
|
|
570
|
-
arguments: (0,
|
|
646
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
571
647
|
});
|
|
572
648
|
}
|
|
573
649
|
/** [Authorized Function] Updates the rebalance cost threshold. */
|
|
574
650
|
function updateRebalanceCostThresholdBp(options) {
|
|
575
651
|
const packageAddress = options.package ?? "@typus/perp";
|
|
576
|
-
const argumentsTypes = [
|
|
652
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
577
653
|
const parameterNames = ["version", "registry", "index", "rebalanceCostThresholdBp"];
|
|
578
654
|
return (tx) => tx.moveCall({
|
|
579
655
|
package: packageAddress,
|
|
580
656
|
module: "lp_pool",
|
|
581
657
|
function: "update_rebalance_cost_threshold_bp",
|
|
582
|
-
arguments: (0,
|
|
658
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
583
659
|
});
|
|
584
660
|
}
|
|
585
661
|
/** [Authorized Function] Adds a new liquidity token to a pool. */
|
|
586
662
|
function addLiquidityToken(options) {
|
|
587
663
|
const packageAddress = options.package ?? "@typus/perp";
|
|
588
664
|
const argumentsTypes = [
|
|
589
|
-
|
|
590
|
-
|
|
665
|
+
null,
|
|
666
|
+
null,
|
|
591
667
|
"u64",
|
|
592
|
-
|
|
668
|
+
null,
|
|
593
669
|
"u64",
|
|
594
670
|
"u64",
|
|
595
671
|
"u64",
|
|
@@ -608,7 +684,7 @@ function addLiquidityToken(options) {
|
|
|
608
684
|
"u64",
|
|
609
685
|
"u64",
|
|
610
686
|
"u64",
|
|
611
|
-
"
|
|
687
|
+
"0x2::clock::Clock",
|
|
612
688
|
];
|
|
613
689
|
const parameterNames = [
|
|
614
690
|
"version",
|
|
@@ -638,7 +714,7 @@ function addLiquidityToken(options) {
|
|
|
638
714
|
package: packageAddress,
|
|
639
715
|
module: "lp_pool",
|
|
640
716
|
function: "add_liquidity_token",
|
|
641
|
-
arguments: (0,
|
|
717
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
642
718
|
typeArguments: options.typeArguments,
|
|
643
719
|
});
|
|
644
720
|
}
|
|
@@ -646,19 +722,19 @@ function addLiquidityToken(options) {
|
|
|
646
722
|
function updateSpotConfig(options) {
|
|
647
723
|
const packageAddress = options.package ?? "@typus/perp";
|
|
648
724
|
const argumentsTypes = [
|
|
649
|
-
|
|
650
|
-
|
|
725
|
+
null,
|
|
726
|
+
null,
|
|
651
727
|
"u64",
|
|
652
|
-
"
|
|
653
|
-
"
|
|
654
|
-
"
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
"
|
|
658
|
-
"
|
|
659
|
-
"
|
|
660
|
-
"
|
|
661
|
-
"
|
|
728
|
+
"0x1::option::Option<u64>",
|
|
729
|
+
"0x1::option::Option<u64>",
|
|
730
|
+
"0x1::option::Option<u64>",
|
|
731
|
+
"0x1::option::Option<u64>",
|
|
732
|
+
"0x1::option::Option<u64>",
|
|
733
|
+
"0x1::option::Option<u64>",
|
|
734
|
+
"0x1::option::Option<u64>",
|
|
735
|
+
"0x1::option::Option<u64>",
|
|
736
|
+
"0x1::option::Option<u64>",
|
|
737
|
+
"0x1::option::Option<u64>",
|
|
662
738
|
];
|
|
663
739
|
const parameterNames = [
|
|
664
740
|
"version",
|
|
@@ -679,43 +755,33 @@ function updateSpotConfig(options) {
|
|
|
679
755
|
package: packageAddress,
|
|
680
756
|
module: "lp_pool",
|
|
681
757
|
function: "update_spot_config",
|
|
682
|
-
arguments: (0,
|
|
758
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
683
759
|
typeArguments: options.typeArguments,
|
|
684
760
|
});
|
|
685
761
|
}
|
|
686
762
|
/** [Authorized Function] Allows a manager to deposit tokens in an emergency. */
|
|
687
763
|
function managerEmergencyDeposit(options) {
|
|
688
764
|
const packageAddress = options.package ?? "@typus/perp";
|
|
689
|
-
const argumentsTypes = [
|
|
690
|
-
`${packageAddress}::admin::Version`,
|
|
691
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
692
|
-
"u64",
|
|
693
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
694
|
-
];
|
|
765
|
+
const argumentsTypes = [null, null, "u64", null];
|
|
695
766
|
const parameterNames = ["version", "registry", "index", "coin"];
|
|
696
767
|
return (tx) => tx.moveCall({
|
|
697
768
|
package: packageAddress,
|
|
698
769
|
module: "lp_pool",
|
|
699
770
|
function: "manager_emergency_deposit",
|
|
700
|
-
arguments: (0,
|
|
771
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
701
772
|
typeArguments: options.typeArguments,
|
|
702
773
|
});
|
|
703
774
|
}
|
|
704
775
|
/** [Authorized Function] Allows a manager to withdraw tokens in an emergency. */
|
|
705
776
|
function managerEmergencyWithdraw(options) {
|
|
706
777
|
const packageAddress = options.package ?? "@typus/perp";
|
|
707
|
-
const argumentsTypes = [
|
|
708
|
-
`${packageAddress}::admin::Version`,
|
|
709
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
710
|
-
"u64",
|
|
711
|
-
`${packageAddress}::lp_pool::ManagerDepositReceipt`,
|
|
712
|
-
];
|
|
778
|
+
const argumentsTypes = [null, null, "u64", null];
|
|
713
779
|
const parameterNames = ["version", "registry", "index", "receipt"];
|
|
714
780
|
return (tx) => tx.moveCall({
|
|
715
781
|
package: packageAddress,
|
|
716
782
|
module: "lp_pool",
|
|
717
783
|
function: "manager_emergency_withdraw",
|
|
718
|
-
arguments: (0,
|
|
784
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
719
785
|
typeArguments: options.typeArguments,
|
|
720
786
|
});
|
|
721
787
|
}
|
|
@@ -723,16 +789,16 @@ function managerEmergencyWithdraw(options) {
|
|
|
723
789
|
function updateMarginConfig(options) {
|
|
724
790
|
const packageAddress = options.package ?? "@typus/perp";
|
|
725
791
|
const argumentsTypes = [
|
|
726
|
-
|
|
727
|
-
|
|
792
|
+
null,
|
|
793
|
+
null,
|
|
728
794
|
"u64",
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"
|
|
732
|
-
"
|
|
733
|
-
"
|
|
734
|
-
"
|
|
735
|
-
"
|
|
795
|
+
"0x1::option::Option<u64>",
|
|
796
|
+
"0x1::option::Option<u64>",
|
|
797
|
+
"0x1::option::Option<u64>",
|
|
798
|
+
"0x1::option::Option<u64>",
|
|
799
|
+
"0x1::option::Option<u64>",
|
|
800
|
+
"0x1::option::Option<u64>",
|
|
801
|
+
"0x1::option::Option<u64>",
|
|
736
802
|
];
|
|
737
803
|
const parameterNames = [
|
|
738
804
|
"version",
|
|
@@ -750,235 +816,284 @@ function updateMarginConfig(options) {
|
|
|
750
816
|
package: packageAddress,
|
|
751
817
|
module: "lp_pool",
|
|
752
818
|
function: "update_margin_config",
|
|
753
|
-
arguments: (0,
|
|
819
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
754
820
|
typeArguments: options.typeArguments,
|
|
755
821
|
});
|
|
756
822
|
}
|
|
757
823
|
/** [User Function] Mints LP tokens. */
|
|
758
824
|
function mintLp(options) {
|
|
759
825
|
const packageAddress = options.package ?? "@typus/perp";
|
|
760
|
-
const argumentsTypes = [
|
|
761
|
-
`${packageAddress}::admin::Version`,
|
|
762
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
763
|
-
`${packageAddress}::treasury_caps::TreasuryCaps`,
|
|
764
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
765
|
-
"u64",
|
|
766
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
767
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
768
|
-
];
|
|
826
|
+
const argumentsTypes = [null, null, null, null, "u64", null, "0x2::clock::Clock"];
|
|
769
827
|
const parameterNames = ["version", "registry", "treasuryCaps", "oracle", "index", "coin"];
|
|
770
828
|
return (tx) => tx.moveCall({
|
|
771
829
|
package: packageAddress,
|
|
772
830
|
module: "lp_pool",
|
|
773
831
|
function: "mint_lp",
|
|
774
|
-
arguments: (0,
|
|
832
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
775
833
|
typeArguments: options.typeArguments,
|
|
776
834
|
});
|
|
777
835
|
}
|
|
778
836
|
/** [User Function] Updates the borrow information for all tokens in a pool. */
|
|
779
837
|
function updateBorrowInfo(options) {
|
|
780
838
|
const packageAddress = options.package ?? "@typus/perp";
|
|
781
|
-
const argumentsTypes = [
|
|
782
|
-
`${packageAddress}::admin::Version`,
|
|
783
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
784
|
-
"u64",
|
|
785
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
786
|
-
];
|
|
839
|
+
const argumentsTypes = [null, null, "u64", "0x2::clock::Clock"];
|
|
787
840
|
const parameterNames = ["version", "registry", "index"];
|
|
788
841
|
return (tx) => tx.moveCall({
|
|
789
842
|
package: packageAddress,
|
|
790
843
|
module: "lp_pool",
|
|
791
844
|
function: "update_borrow_info",
|
|
792
|
-
arguments: (0,
|
|
845
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
793
846
|
});
|
|
794
847
|
}
|
|
795
848
|
/** [User Function] Swaps one token for another. */
|
|
796
849
|
function swap(options) {
|
|
797
850
|
const packageAddress = options.package ?? "@typus/perp";
|
|
798
|
-
const argumentsTypes = [
|
|
799
|
-
`${packageAddress}::admin::Version`,
|
|
800
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
801
|
-
"u64",
|
|
802
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
803
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
804
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
805
|
-
"u64",
|
|
806
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
807
|
-
];
|
|
851
|
+
const argumentsTypes = [null, null, "u64", null, null, null, "u64", "0x2::clock::Clock"];
|
|
808
852
|
const parameterNames = ["version", "registry", "index", "oracleFromToken", "oracleToToken", "fromCoin", "minToAmount"];
|
|
809
853
|
return (tx) => tx.moveCall({
|
|
810
854
|
package: packageAddress,
|
|
811
855
|
module: "lp_pool",
|
|
812
856
|
function: "swap",
|
|
813
|
-
arguments: (0,
|
|
857
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
814
858
|
typeArguments: options.typeArguments,
|
|
815
859
|
});
|
|
816
860
|
}
|
|
817
861
|
/** [User Function] Redeems LP tokens for underlying assets. */
|
|
818
862
|
function redeem(options) {
|
|
819
863
|
const packageAddress = options.package ?? "@typus/perp";
|
|
820
|
-
const argumentsTypes = [
|
|
821
|
-
`${packageAddress}::admin::Version`,
|
|
822
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
823
|
-
"u64",
|
|
824
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
825
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
826
|
-
];
|
|
864
|
+
const argumentsTypes = [null, null, "u64", null, "0x2::clock::Clock"];
|
|
827
865
|
const parameterNames = ["version", "registry", "index", "balance"];
|
|
828
866
|
return (tx) => tx.moveCall({
|
|
829
867
|
package: packageAddress,
|
|
830
868
|
module: "lp_pool",
|
|
831
869
|
function: "redeem",
|
|
832
|
-
arguments: (0,
|
|
870
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
833
871
|
typeArguments: options.typeArguments,
|
|
834
872
|
});
|
|
835
873
|
}
|
|
836
874
|
/** [User Function] Claims underlying assets from redeemed LP tokens. */
|
|
837
875
|
function claim(options) {
|
|
838
876
|
const packageAddress = options.package ?? "@typus/perp";
|
|
839
|
-
const argumentsTypes = [
|
|
840
|
-
`${packageAddress}::admin::Version`,
|
|
841
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
842
|
-
"u64",
|
|
843
|
-
`${packageAddress}::treasury_caps::TreasuryCaps`,
|
|
844
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
845
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
846
|
-
];
|
|
877
|
+
const argumentsTypes = [null, null, "u64", null, null, "0x2::clock::Clock"];
|
|
847
878
|
const parameterNames = ["version", "registry", "index", "treasuryCaps", "oracle"];
|
|
848
879
|
return (tx) => tx.moveCall({
|
|
849
880
|
package: packageAddress,
|
|
850
881
|
module: "lp_pool",
|
|
851
882
|
function: "claim",
|
|
852
|
-
arguments: (0,
|
|
883
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
853
884
|
typeArguments: options.typeArguments,
|
|
854
885
|
});
|
|
855
886
|
}
|
|
856
887
|
/** [Authorized Function] Suspends a liquidity pool. */
|
|
857
888
|
function suspendPool(options) {
|
|
858
889
|
const packageAddress = options.package ?? "@typus/perp";
|
|
859
|
-
const argumentsTypes = [
|
|
890
|
+
const argumentsTypes = [null, null, "u64"];
|
|
860
891
|
const parameterNames = ["version", "registry", "index"];
|
|
861
892
|
return (tx) => tx.moveCall({
|
|
862
893
|
package: packageAddress,
|
|
863
894
|
module: "lp_pool",
|
|
864
895
|
function: "suspend_pool",
|
|
865
|
-
arguments: (0,
|
|
896
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
866
897
|
});
|
|
867
898
|
}
|
|
868
899
|
/** [Authorized Function] Resumes a liquidity pool. */
|
|
869
900
|
function resumePool(options) {
|
|
870
901
|
const packageAddress = options.package ?? "@typus/perp";
|
|
871
|
-
const argumentsTypes = [
|
|
902
|
+
const argumentsTypes = [null, null, "u64"];
|
|
872
903
|
const parameterNames = ["version", "registry", "index"];
|
|
873
904
|
return (tx) => tx.moveCall({
|
|
874
905
|
package: packageAddress,
|
|
875
906
|
module: "lp_pool",
|
|
876
907
|
function: "resume_pool",
|
|
877
|
-
arguments: (0,
|
|
908
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
878
909
|
});
|
|
879
910
|
}
|
|
880
911
|
/** [Authorized Function] Suspends a token pool. */
|
|
881
912
|
function suspendTokenPool(options) {
|
|
882
913
|
const packageAddress = options.package ?? "@typus/perp";
|
|
883
|
-
const argumentsTypes = [
|
|
914
|
+
const argumentsTypes = [null, null, "u64"];
|
|
884
915
|
const parameterNames = ["version", "registry", "index"];
|
|
885
916
|
return (tx) => tx.moveCall({
|
|
886
917
|
package: packageAddress,
|
|
887
918
|
module: "lp_pool",
|
|
888
919
|
function: "suspend_token_pool",
|
|
889
|
-
arguments: (0,
|
|
920
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
890
921
|
typeArguments: options.typeArguments,
|
|
891
922
|
});
|
|
892
923
|
}
|
|
893
924
|
/** [Authorized Function] Resumes a token pool. */
|
|
894
925
|
function resumeTokenPool(options) {
|
|
895
926
|
const packageAddress = options.package ?? "@typus/perp";
|
|
896
|
-
const argumentsTypes = [
|
|
927
|
+
const argumentsTypes = [null, null, "u64"];
|
|
897
928
|
const parameterNames = ["version", "registry", "index"];
|
|
898
929
|
return (tx) => tx.moveCall({
|
|
899
930
|
package: packageAddress,
|
|
900
931
|
module: "lp_pool",
|
|
901
932
|
function: "resume_token_pool",
|
|
902
|
-
arguments: (0,
|
|
933
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
934
|
+
typeArguments: options.typeArguments,
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
/** [Authorized Function] Manager deposits to Scallop. */
|
|
938
|
+
function managerDepositScallop(options) {
|
|
939
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
940
|
+
const argumentsTypes = [null, null, "u64", null, null, "0x2::clock::Clock", "0x1::option::Option<u64>"];
|
|
941
|
+
const parameterNames = ["version", "registry", "index", "scallopVersion", "scallopMarket", "lendingAmount"];
|
|
942
|
+
return (tx) => tx.moveCall({
|
|
943
|
+
package: packageAddress,
|
|
944
|
+
module: "lp_pool",
|
|
945
|
+
function: "manager_deposit_scallop",
|
|
946
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
947
|
+
typeArguments: options.typeArguments,
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
function managerDepositNavi(options) {
|
|
951
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
952
|
+
const argumentsTypes = [null, null, "u64", null, null, "u8", null, null, "0x2::clock::Clock", "0x1::option::Option<u64>"];
|
|
953
|
+
const parameterNames = ["version", "registry", "index", "storage", "pool", "asset", "incentiveV2", "incentiveV3", "lendingAmount"];
|
|
954
|
+
return (tx) => tx.moveCall({
|
|
955
|
+
package: packageAddress,
|
|
956
|
+
module: "lp_pool",
|
|
957
|
+
function: "manager_deposit_navi",
|
|
958
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
959
|
+
typeArguments: options.typeArguments,
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
/** [Authorized Function] Manager withdraws from Scallop. */
|
|
963
|
+
function managerWithdrawScallop(options) {
|
|
964
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
965
|
+
const argumentsTypes = [null, null, "u64", null, null, "0x2::clock::Clock", "0x1::option::Option<u64>"];
|
|
966
|
+
const parameterNames = ["version", "registry", "index", "scallopVersion", "scallopMarket", "withdrawAmount"];
|
|
967
|
+
return (tx) => tx.moveCall({
|
|
968
|
+
package: packageAddress,
|
|
969
|
+
module: "lp_pool",
|
|
970
|
+
function: "manager_withdraw_scallop",
|
|
971
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
972
|
+
typeArguments: options.typeArguments,
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
function managerWithdrawNavi(options) {
|
|
976
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
977
|
+
const argumentsTypes = [
|
|
978
|
+
null,
|
|
979
|
+
null,
|
|
980
|
+
"u64",
|
|
981
|
+
null,
|
|
982
|
+
null,
|
|
983
|
+
null,
|
|
984
|
+
null,
|
|
985
|
+
"address",
|
|
986
|
+
null,
|
|
987
|
+
null,
|
|
988
|
+
"u8",
|
|
989
|
+
null,
|
|
990
|
+
null,
|
|
991
|
+
"0x2::clock::Clock",
|
|
992
|
+
];
|
|
993
|
+
const parameterNames = [
|
|
994
|
+
"version",
|
|
995
|
+
"registry",
|
|
996
|
+
"index",
|
|
997
|
+
"oracleConfig",
|
|
998
|
+
"priceOracle",
|
|
999
|
+
"supraOracleHolder",
|
|
1000
|
+
"pythPriceInfo",
|
|
1001
|
+
"feedAddress",
|
|
1002
|
+
"storage",
|
|
1003
|
+
"pool",
|
|
1004
|
+
"asset",
|
|
1005
|
+
"incentiveV2",
|
|
1006
|
+
"incentiveV3",
|
|
1007
|
+
];
|
|
1008
|
+
return (tx) => tx.moveCall({
|
|
1009
|
+
package: packageAddress,
|
|
1010
|
+
module: "lp_pool",
|
|
1011
|
+
function: "manager_withdraw_navi",
|
|
1012
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1013
|
+
typeArguments: options.typeArguments,
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
function managerRewardNavi(options) {
|
|
1017
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1018
|
+
const argumentsTypes = [
|
|
1019
|
+
null,
|
|
1020
|
+
null,
|
|
1021
|
+
"u64",
|
|
1022
|
+
null,
|
|
1023
|
+
null,
|
|
1024
|
+
"vector<0x1::string::String>",
|
|
1025
|
+
"vector<address>",
|
|
1026
|
+
null,
|
|
1027
|
+
"0x2::clock::Clock",
|
|
1028
|
+
];
|
|
1029
|
+
const parameterNames = ["version", "registry", "index", "storage", "rewardFund", "coinTypes", "ruleIds", "incentiveV3"];
|
|
1030
|
+
return (tx) => tx.moveCall({
|
|
1031
|
+
package: packageAddress,
|
|
1032
|
+
module: "lp_pool",
|
|
1033
|
+
function: "manager_reward_navi",
|
|
1034
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
903
1035
|
typeArguments: options.typeArguments,
|
|
904
1036
|
});
|
|
905
1037
|
}
|
|
906
1038
|
/** [Authorized Function] Manager removes a liquidity token. */
|
|
907
1039
|
function managerRemoveLiquidityToken(options) {
|
|
908
1040
|
const packageAddress = options.package ?? "@typus/perp";
|
|
909
|
-
const argumentsTypes = [
|
|
1041
|
+
const argumentsTypes = [null, null, "u64"];
|
|
910
1042
|
const parameterNames = ["version", "registry", "index"];
|
|
911
1043
|
return (tx) => tx.moveCall({
|
|
912
1044
|
package: packageAddress,
|
|
913
1045
|
module: "lp_pool",
|
|
914
1046
|
function: "manager_remove_liquidity_token",
|
|
915
|
-
arguments: (0,
|
|
1047
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
916
1048
|
typeArguments: options.typeArguments,
|
|
917
1049
|
});
|
|
918
1050
|
}
|
|
919
1051
|
function checkTokenPoolStatus(options) {
|
|
920
1052
|
const packageAddress = options.package ?? "@typus/perp";
|
|
921
|
-
const argumentsTypes = [
|
|
1053
|
+
const argumentsTypes = [null, "u64", "bool"];
|
|
922
1054
|
const parameterNames = ["registry", "index", "assertActive"];
|
|
923
1055
|
return (tx) => tx.moveCall({
|
|
924
1056
|
package: packageAddress,
|
|
925
1057
|
module: "lp_pool",
|
|
926
1058
|
function: "check_token_pool_status",
|
|
927
|
-
arguments: (0,
|
|
1059
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
928
1060
|
typeArguments: options.typeArguments,
|
|
929
1061
|
});
|
|
930
1062
|
}
|
|
931
1063
|
function tokenPoolIsActive(options) {
|
|
932
1064
|
const packageAddress = options.package ?? "@typus/perp";
|
|
933
|
-
const argumentsTypes = [
|
|
1065
|
+
const argumentsTypes = [null];
|
|
934
1066
|
const parameterNames = ["tokenPool"];
|
|
935
1067
|
return (tx) => tx.moveCall({
|
|
936
1068
|
package: packageAddress,
|
|
937
1069
|
module: "lp_pool",
|
|
938
1070
|
function: "token_pool_is_active",
|
|
939
|
-
arguments: (0,
|
|
1071
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
940
1072
|
});
|
|
941
1073
|
}
|
|
942
1074
|
/** [Authorized Function] Manager take the liquidity token A to swap. */
|
|
943
1075
|
function rebalance(options) {
|
|
944
1076
|
const packageAddress = options.package ?? "@typus/perp";
|
|
945
|
-
const argumentsTypes = [
|
|
946
|
-
`${packageAddress}::admin::Version`,
|
|
947
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
948
|
-
"u64",
|
|
949
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
950
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
951
|
-
"u64",
|
|
952
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
953
|
-
];
|
|
1077
|
+
const argumentsTypes = [null, null, "u64", null, null, "u64", "0x2::clock::Clock"];
|
|
954
1078
|
const parameterNames = ["version", "registry", "index", "oracleTokenA", "oracleTokenB", "rebalanceAmount"];
|
|
955
1079
|
return (tx) => tx.moveCall({
|
|
956
1080
|
package: packageAddress,
|
|
957
1081
|
module: "lp_pool",
|
|
958
1082
|
function: "rebalance",
|
|
959
|
-
arguments: (0,
|
|
1083
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
960
1084
|
typeArguments: options.typeArguments,
|
|
961
1085
|
});
|
|
962
1086
|
}
|
|
963
1087
|
/** [Authorized Function] Manager swap back the liquidity token from A to B. */
|
|
964
1088
|
function completeRebalancing(options) {
|
|
965
1089
|
const packageAddress = options.package ?? "@typus/perp";
|
|
966
|
-
const argumentsTypes = [
|
|
967
|
-
`${packageAddress}::admin::Version`,
|
|
968
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
969
|
-
"u64",
|
|
970
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
971
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
972
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[1]}>`,
|
|
973
|
-
`${packageAddress}::lp_pool::RebalanceProcess`,
|
|
974
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
975
|
-
];
|
|
1090
|
+
const argumentsTypes = [null, null, "u64", null, null, null, null, "0x2::clock::Clock"];
|
|
976
1091
|
const parameterNames = ["version", "registry", "index", "oracleTokenA", "oracleTokenB", "swappedBackBalance", "rebalanceProcess"];
|
|
977
1092
|
return (tx) => tx.moveCall({
|
|
978
1093
|
package: packageAddress,
|
|
979
1094
|
module: "lp_pool",
|
|
980
1095
|
function: "complete_rebalancing",
|
|
981
|
-
arguments: (0,
|
|
1096
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
982
1097
|
typeArguments: options.typeArguments,
|
|
983
1098
|
});
|
|
984
1099
|
}
|
|
@@ -988,32 +1103,26 @@ function completeRebalancing(options) {
|
|
|
988
1103
|
*/
|
|
989
1104
|
function managerRemoveAllLiquidity(options) {
|
|
990
1105
|
const packageAddress = options.package ?? "@typus/perp";
|
|
991
|
-
const argumentsTypes = [
|
|
1106
|
+
const argumentsTypes = [null, null, "u64"];
|
|
992
1107
|
const parameterNames = ["version", "registry", "index"];
|
|
993
1108
|
return (tx) => tx.moveCall({
|
|
994
1109
|
package: packageAddress,
|
|
995
1110
|
module: "lp_pool",
|
|
996
1111
|
function: "manager_remove_all_liquidity",
|
|
997
|
-
arguments: (0,
|
|
1112
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
998
1113
|
typeArguments: options.typeArguments,
|
|
999
1114
|
});
|
|
1000
1115
|
}
|
|
1001
1116
|
/** [User Function] Update the liquidity value with oracle. */
|
|
1002
1117
|
function updateLiquidityValue(options) {
|
|
1003
1118
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1004
|
-
const argumentsTypes = [
|
|
1005
|
-
`${packageAddress}::admin::Version`,
|
|
1006
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1007
|
-
"u64",
|
|
1008
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1009
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1010
|
-
];
|
|
1119
|
+
const argumentsTypes = [null, null, "u64", null, "0x2::clock::Clock"];
|
|
1011
1120
|
const parameterNames = ["version", "registry", "index", "oracle"];
|
|
1012
1121
|
return (tx) => tx.moveCall({
|
|
1013
1122
|
package: packageAddress,
|
|
1014
1123
|
module: "lp_pool",
|
|
1015
1124
|
function: "update_liquidity_value",
|
|
1016
|
-
arguments: (0,
|
|
1125
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1017
1126
|
typeArguments: options.typeArguments,
|
|
1018
1127
|
});
|
|
1019
1128
|
}
|
|
@@ -1023,434 +1132,445 @@ function updateLiquidityValue(options) {
|
|
|
1023
1132
|
*/
|
|
1024
1133
|
function getPoolLiquidity(options) {
|
|
1025
1134
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1026
|
-
const argumentsTypes = [
|
|
1135
|
+
const argumentsTypes = [null, null, "u64"];
|
|
1027
1136
|
const parameterNames = ["version", "registry", "index"];
|
|
1028
1137
|
return (tx) => tx.moveCall({
|
|
1029
1138
|
package: packageAddress,
|
|
1030
1139
|
module: "lp_pool",
|
|
1031
1140
|
function: "get_pool_liquidity",
|
|
1032
|
-
arguments: (0,
|
|
1141
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1033
1142
|
});
|
|
1034
1143
|
}
|
|
1035
1144
|
function updateTvl(options) {
|
|
1036
1145
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1037
|
-
const argumentsTypes = [
|
|
1038
|
-
`${packageAddress}::admin::Version`,
|
|
1039
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1040
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1041
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1042
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1043
|
-
];
|
|
1146
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock"];
|
|
1044
1147
|
const parameterNames = ["version", "liquidityPool", "tokenType", "oracle"];
|
|
1045
1148
|
return (tx) => tx.moveCall({
|
|
1046
1149
|
package: packageAddress,
|
|
1047
1150
|
module: "lp_pool",
|
|
1048
1151
|
function: "update_tvl",
|
|
1049
|
-
arguments: (0,
|
|
1152
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1050
1153
|
});
|
|
1051
1154
|
}
|
|
1052
1155
|
function orderFilled(options) {
|
|
1053
1156
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1054
|
-
const argumentsTypes = [
|
|
1055
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1056
|
-
"bool",
|
|
1057
|
-
"u64",
|
|
1058
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
1059
|
-
];
|
|
1157
|
+
const argumentsTypes = [null, "bool", "u64", null];
|
|
1060
1158
|
const parameterNames = ["liquidityPool", "addReserve", "dReserve", "feeBalance"];
|
|
1061
1159
|
return (tx) => tx.moveCall({
|
|
1062
1160
|
package: packageAddress,
|
|
1063
1161
|
module: "lp_pool",
|
|
1064
1162
|
function: "order_filled",
|
|
1065
|
-
arguments: (0,
|
|
1163
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1066
1164
|
typeArguments: options.typeArguments,
|
|
1067
1165
|
});
|
|
1068
1166
|
}
|
|
1069
1167
|
function updateReserveAmount(options) {
|
|
1070
1168
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1071
|
-
const argumentsTypes = [
|
|
1169
|
+
const argumentsTypes = [null, "bool", "u64"];
|
|
1072
1170
|
const parameterNames = ["liquidityPool", "addReserve", "dReserve"];
|
|
1073
1171
|
return (tx) => tx.moveCall({
|
|
1074
1172
|
package: packageAddress,
|
|
1075
1173
|
module: "lp_pool",
|
|
1076
1174
|
function: "update_reserve_amount",
|
|
1077
|
-
arguments: (0,
|
|
1175
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1078
1176
|
typeArguments: options.typeArguments,
|
|
1079
1177
|
});
|
|
1080
1178
|
}
|
|
1081
1179
|
function putCollateral(options) {
|
|
1082
1180
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1083
|
-
const argumentsTypes = [
|
|
1084
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1085
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
1086
|
-
"u64",
|
|
1087
|
-
"u64",
|
|
1088
|
-
];
|
|
1181
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
1089
1182
|
const parameterNames = ["liquidityPool", "collateral", "collateralOraclePrice", "collateralOraclePriceDecimal"];
|
|
1090
1183
|
return (tx) => tx.moveCall({
|
|
1091
1184
|
package: packageAddress,
|
|
1092
1185
|
module: "lp_pool",
|
|
1093
1186
|
function: "put_collateral",
|
|
1094
|
-
arguments: (0,
|
|
1187
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1095
1188
|
typeArguments: options.typeArguments,
|
|
1096
1189
|
});
|
|
1097
1190
|
}
|
|
1098
1191
|
function requestCollateral(options) {
|
|
1099
1192
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1100
|
-
const argumentsTypes = [
|
|
1193
|
+
const argumentsTypes = [null, "u64", "u64", "u64"];
|
|
1101
1194
|
const parameterNames = ["liquidityPool", "collateralAmount", "collateralOraclePrice", "collateralOraclePriceDecimal"];
|
|
1102
1195
|
return (tx) => tx.moveCall({
|
|
1103
1196
|
package: packageAddress,
|
|
1104
1197
|
module: "lp_pool",
|
|
1105
1198
|
function: "request_collateral",
|
|
1106
|
-
arguments: (0,
|
|
1199
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1107
1200
|
typeArguments: options.typeArguments,
|
|
1108
1201
|
});
|
|
1109
1202
|
}
|
|
1110
1203
|
function putReceiptCollaterals(options) {
|
|
1111
1204
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1112
|
-
const argumentsTypes = [
|
|
1113
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1114
|
-
`vector<${packageAddress}::escrow::UnsettledBidReceipt>`,
|
|
1115
|
-
];
|
|
1205
|
+
const argumentsTypes = [null, "vector<null>"];
|
|
1116
1206
|
const parameterNames = ["liquidityPool", "unsettledBidReceipts"];
|
|
1117
1207
|
return (tx) => tx.moveCall({
|
|
1118
1208
|
package: packageAddress,
|
|
1119
1209
|
module: "lp_pool",
|
|
1120
1210
|
function: "put_receipt_collaterals",
|
|
1121
|
-
arguments: (0,
|
|
1211
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1122
1212
|
});
|
|
1123
1213
|
}
|
|
1124
1214
|
function getReceiptCollateral(options) {
|
|
1125
1215
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1126
|
-
const argumentsTypes = [
|
|
1216
|
+
const argumentsTypes = [null];
|
|
1127
1217
|
const parameterNames = ["liquidityPool"];
|
|
1128
1218
|
return (tx) => tx.moveCall({
|
|
1129
1219
|
package: packageAddress,
|
|
1130
1220
|
module: "lp_pool",
|
|
1131
1221
|
function: "get_receipt_collateral",
|
|
1132
|
-
arguments: (0,
|
|
1222
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1133
1223
|
});
|
|
1134
1224
|
}
|
|
1135
1225
|
function calculateMintLp(options) {
|
|
1136
1226
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1137
|
-
const argumentsTypes = [
|
|
1138
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1139
|
-
"u64",
|
|
1140
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1141
|
-
"u64",
|
|
1142
|
-
"u64",
|
|
1143
|
-
"u64",
|
|
1144
|
-
];
|
|
1227
|
+
const argumentsTypes = [null, "u64", null, "u64", "u64", "u64"];
|
|
1145
1228
|
const parameterNames = ["registry", "index", "tokenType", "price", "priceDecimal", "depositAmount"];
|
|
1146
1229
|
return (tx) => tx.moveCall({
|
|
1147
1230
|
package: packageAddress,
|
|
1148
1231
|
module: "lp_pool",
|
|
1149
1232
|
function: "calculate_mint_lp",
|
|
1150
|
-
arguments: (0,
|
|
1233
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1151
1234
|
});
|
|
1152
1235
|
}
|
|
1153
1236
|
function calculateBurnLp(options) {
|
|
1154
1237
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1155
|
-
const argumentsTypes = [
|
|
1156
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1157
|
-
"u64",
|
|
1158
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1159
|
-
"u64",
|
|
1160
|
-
"u64",
|
|
1161
|
-
"u64",
|
|
1162
|
-
];
|
|
1238
|
+
const argumentsTypes = [null, "u64", null, "u64", "u64", "u64"];
|
|
1163
1239
|
const parameterNames = ["registry", "index", "tokenType", "price", "priceDecimal", "burnAmount"];
|
|
1164
1240
|
return (tx) => tx.moveCall({
|
|
1165
1241
|
package: packageAddress,
|
|
1166
1242
|
module: "lp_pool",
|
|
1167
1243
|
function: "calculate_burn_lp",
|
|
1168
|
-
arguments: (0,
|
|
1244
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1169
1245
|
});
|
|
1170
1246
|
}
|
|
1171
1247
|
function calculateLpFee(options) {
|
|
1172
1248
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1173
|
-
const argumentsTypes = [
|
|
1174
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1175
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1176
|
-
"u64",
|
|
1177
|
-
"u64",
|
|
1178
|
-
"bool",
|
|
1179
|
-
];
|
|
1249
|
+
const argumentsTypes = [null, null, "u64", "u64", "bool"];
|
|
1180
1250
|
const parameterNames = ["liquidityPool", "tokenType", "depositAmount", "depositAmountUsd", "isMint"];
|
|
1181
1251
|
return (tx) => tx.moveCall({
|
|
1182
1252
|
package: packageAddress,
|
|
1183
1253
|
module: "lp_pool",
|
|
1184
1254
|
function: "calculate_lp_fee",
|
|
1185
|
-
arguments: (0,
|
|
1255
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
function calculateFee_(options) {
|
|
1259
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1260
|
+
const argumentsTypes = [null, null, "u64", "u64", "bool", "u64", "u64"];
|
|
1261
|
+
const parameterNames = ["liquidityPool", "tokenType", "depositAmount", "depositAmountUsd", "flowIn", "basicFeeBp", "additionalFeeBp"];
|
|
1262
|
+
return (tx) => tx.moveCall({
|
|
1263
|
+
package: packageAddress,
|
|
1264
|
+
module: "lp_pool",
|
|
1265
|
+
function: "calculate_fee_",
|
|
1266
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
function normalSafetyCheck(options) {
|
|
1270
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1271
|
+
const argumentsTypes = [null, null, "u64", null, "0x2::clock::Clock"];
|
|
1272
|
+
const parameterNames = ["version", "registry", "index", "oracle"];
|
|
1273
|
+
return (tx) => tx.moveCall({
|
|
1274
|
+
package: packageAddress,
|
|
1275
|
+
module: "lp_pool",
|
|
1276
|
+
function: "normal_safety_check",
|
|
1277
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1278
|
+
typeArguments: options.typeArguments,
|
|
1186
1279
|
});
|
|
1187
1280
|
}
|
|
1188
1281
|
function calculateSwapFee(options) {
|
|
1189
1282
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1190
|
-
const argumentsTypes = [
|
|
1191
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1192
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1193
|
-
"u64",
|
|
1194
|
-
"u64",
|
|
1195
|
-
"bool",
|
|
1196
|
-
];
|
|
1283
|
+
const argumentsTypes = [null, null, "u64", "u64", "bool"];
|
|
1197
1284
|
const parameterNames = ["liquidityPool", "tokenType", "amount", "amountUsd", "swapIn"];
|
|
1198
1285
|
return (tx) => tx.moveCall({
|
|
1199
1286
|
package: packageAddress,
|
|
1200
1287
|
module: "lp_pool",
|
|
1201
1288
|
function: "calculate_swap_fee",
|
|
1202
|
-
arguments: (0,
|
|
1289
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1203
1290
|
});
|
|
1204
1291
|
}
|
|
1205
1292
|
function checkTvlUpdated(options) {
|
|
1206
1293
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1207
|
-
const argumentsTypes = [
|
|
1208
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1209
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1210
|
-
];
|
|
1294
|
+
const argumentsTypes = [null, "0x2::clock::Clock"];
|
|
1211
1295
|
const parameterNames = ["liquidityPool"];
|
|
1212
1296
|
return (tx) => tx.moveCall({
|
|
1213
1297
|
package: packageAddress,
|
|
1214
1298
|
module: "lp_pool",
|
|
1215
1299
|
function: "check_tvl_updated",
|
|
1216
|
-
arguments: (0,
|
|
1300
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1217
1301
|
});
|
|
1218
1302
|
}
|
|
1219
|
-
function
|
|
1303
|
+
function calculateLendingAmountCapped(options) {
|
|
1220
1304
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1221
|
-
const argumentsTypes = [
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
"
|
|
1227
|
-
|
|
1228
|
-
|
|
1305
|
+
const argumentsTypes = [null, "0x1::option::Option<u64>"];
|
|
1306
|
+
const parameterNames = ["tokenPool", "lendingAmount"];
|
|
1307
|
+
return (tx) => tx.moveCall({
|
|
1308
|
+
package: packageAddress,
|
|
1309
|
+
module: "lp_pool",
|
|
1310
|
+
function: "calculate_lending_amount_capped",
|
|
1311
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
function depositScallopBasic(options) {
|
|
1315
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1316
|
+
const argumentsTypes = [null, null, null, "0x2::clock::Clock", "u64"];
|
|
1317
|
+
const parameterNames = ["liquidityPool", "scallopVersion", "scallopMarket", "depositAmount"];
|
|
1318
|
+
return (tx) => tx.moveCall({
|
|
1319
|
+
package: packageAddress,
|
|
1320
|
+
module: "lp_pool",
|
|
1321
|
+
function: "deposit_scallop_basic",
|
|
1322
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1323
|
+
typeArguments: options.typeArguments,
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
function withdrawScallopBasic(options) {
|
|
1327
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1328
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock", "u64"];
|
|
1329
|
+
const parameterNames = ["version", "liquidityPool", "scallopVersion", "scallopMarket", "withdrawAmount"];
|
|
1330
|
+
return (tx) => tx.moveCall({
|
|
1331
|
+
package: packageAddress,
|
|
1332
|
+
module: "lp_pool",
|
|
1333
|
+
function: "withdraw_scallop_basic",
|
|
1334
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1335
|
+
typeArguments: options.typeArguments,
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
function depositNavi(options) {
|
|
1339
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1340
|
+
const argumentsTypes = [null, null, null, "u8", null, null, "0x2::clock::Clock", "u64"];
|
|
1341
|
+
const parameterNames = ["liquidityPool", "storage", "pool", "asset", "incentiveV2", "incentiveV3", "depositAmount"];
|
|
1342
|
+
return (tx) => tx.moveCall({
|
|
1343
|
+
package: packageAddress,
|
|
1344
|
+
module: "lp_pool",
|
|
1345
|
+
function: "deposit_navi",
|
|
1346
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1347
|
+
typeArguments: options.typeArguments,
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
function withdrawNavi(options) {
|
|
1351
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1352
|
+
const argumentsTypes = [null, null, null, null, null, null, "address", null, null, "u8", null, null, "0x2::clock::Clock"];
|
|
1353
|
+
const parameterNames = [
|
|
1354
|
+
"version",
|
|
1355
|
+
"liquidityPool",
|
|
1356
|
+
"oracleConfig",
|
|
1357
|
+
"priceOracle",
|
|
1358
|
+
"supraOracleHolder",
|
|
1359
|
+
"pythPriceInfo",
|
|
1360
|
+
"feedAddress",
|
|
1361
|
+
"storage",
|
|
1362
|
+
"pool",
|
|
1363
|
+
"asset",
|
|
1364
|
+
"incentiveV2",
|
|
1365
|
+
"incentiveV3",
|
|
1229
1366
|
];
|
|
1367
|
+
return (tx) => tx.moveCall({
|
|
1368
|
+
package: packageAddress,
|
|
1369
|
+
module: "lp_pool",
|
|
1370
|
+
function: "withdraw_navi",
|
|
1371
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1372
|
+
typeArguments: options.typeArguments,
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
function rewardNavi(options) {
|
|
1376
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1377
|
+
const argumentsTypes = [null, null, null, null, "vector<0x1::string::String>", "vector<address>", null, "0x2::clock::Clock"];
|
|
1378
|
+
const parameterNames = ["version", "liquidityPool", "storage", "rewardFund", "coinTypes", "ruleIds", "incentiveV3"];
|
|
1379
|
+
return (tx) => tx.moveCall({
|
|
1380
|
+
package: packageAddress,
|
|
1381
|
+
module: "lp_pool",
|
|
1382
|
+
function: "reward_navi",
|
|
1383
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1384
|
+
typeArguments: options.typeArguments,
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
function burnLp_(options) {
|
|
1388
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1389
|
+
const argumentsTypes = [null, null, "u64", null, null, null, "0x2::clock::Clock"];
|
|
1230
1390
|
const parameterNames = ["version", "registry", "index", "treasuryCaps", "oracle", "burnLpBalance"];
|
|
1231
1391
|
return (tx) => tx.moveCall({
|
|
1232
1392
|
package: packageAddress,
|
|
1233
1393
|
module: "lp_pool",
|
|
1234
1394
|
function: "burn_lp_",
|
|
1235
|
-
arguments: (0,
|
|
1395
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1236
1396
|
typeArguments: options.typeArguments,
|
|
1237
1397
|
});
|
|
1238
1398
|
}
|
|
1239
1399
|
function viewSwapResult(options) {
|
|
1240
1400
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1241
|
-
const argumentsTypes = [
|
|
1242
|
-
`${packageAddress}::admin::Version`,
|
|
1243
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1244
|
-
"u64",
|
|
1245
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1246
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1247
|
-
"u64",
|
|
1248
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1249
|
-
];
|
|
1401
|
+
const argumentsTypes = [null, null, "u64", null, null, "u64", "0x2::clock::Clock"];
|
|
1250
1402
|
const parameterNames = ["version", "registry", "index", "oracleFromToken", "oracleToToken", "fromAmount"];
|
|
1251
1403
|
return (tx) => tx.moveCall({
|
|
1252
1404
|
package: packageAddress,
|
|
1253
1405
|
module: "lp_pool",
|
|
1254
1406
|
function: "view_swap_result",
|
|
1255
|
-
arguments: (0,
|
|
1407
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1256
1408
|
typeArguments: options.typeArguments,
|
|
1257
1409
|
});
|
|
1258
1410
|
}
|
|
1259
1411
|
function getReceiptCollateralBcs(options) {
|
|
1260
1412
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1261
|
-
const argumentsTypes = [
|
|
1413
|
+
const argumentsTypes = [null, "u64"];
|
|
1262
1414
|
const parameterNames = ["registry", "index"];
|
|
1263
1415
|
return (tx) => tx.moveCall({
|
|
1264
1416
|
package: packageAddress,
|
|
1265
1417
|
module: "lp_pool",
|
|
1266
1418
|
function: "get_receipt_collateral_bcs",
|
|
1267
|
-
arguments: (0,
|
|
1419
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1268
1420
|
});
|
|
1269
1421
|
}
|
|
1270
1422
|
function getExpiredReceiptCollateralBcs(options) {
|
|
1271
1423
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1272
|
-
const argumentsTypes = [
|
|
1273
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1274
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1275
|
-
"u64",
|
|
1276
|
-
];
|
|
1424
|
+
const argumentsTypes = [null, null, "u64"];
|
|
1277
1425
|
const parameterNames = ["registry", "dovRegistry", "index"];
|
|
1278
1426
|
return (tx) => tx.moveCall({
|
|
1279
1427
|
package: packageAddress,
|
|
1280
1428
|
module: "lp_pool",
|
|
1281
1429
|
function: "get_expired_receipt_collateral_bcs",
|
|
1282
|
-
arguments: (0,
|
|
1430
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1283
1431
|
});
|
|
1284
1432
|
}
|
|
1285
1433
|
function getLiquidityPool(options) {
|
|
1286
1434
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1287
|
-
const argumentsTypes = [
|
|
1435
|
+
const argumentsTypes = [null, "u64"];
|
|
1288
1436
|
const parameterNames = ["registry", "index"];
|
|
1289
1437
|
return (tx) => tx.moveCall({
|
|
1290
1438
|
package: packageAddress,
|
|
1291
1439
|
module: "lp_pool",
|
|
1292
1440
|
function: "get_liquidity_pool",
|
|
1293
|
-
arguments: (0,
|
|
1441
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1294
1442
|
});
|
|
1295
1443
|
}
|
|
1296
1444
|
function getMutLiquidityPool(options) {
|
|
1297
1445
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1298
|
-
const argumentsTypes = [
|
|
1446
|
+
const argumentsTypes = [null, "u64"];
|
|
1299
1447
|
const parameterNames = ["registry", "index"];
|
|
1300
1448
|
return (tx) => tx.moveCall({
|
|
1301
1449
|
package: packageAddress,
|
|
1302
1450
|
module: "lp_pool",
|
|
1303
1451
|
function: "get_mut_liquidity_pool",
|
|
1304
|
-
arguments: (0,
|
|
1452
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1305
1453
|
});
|
|
1306
1454
|
}
|
|
1307
1455
|
function safetyCheck(options) {
|
|
1308
1456
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1309
|
-
const argumentsTypes = [
|
|
1310
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1311
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1312
|
-
"address",
|
|
1313
|
-
];
|
|
1457
|
+
const argumentsTypes = [null, null, "address"];
|
|
1314
1458
|
const parameterNames = ["liquidityPool", "tokenType", "oracleId"];
|
|
1315
1459
|
return (tx) => tx.moveCall({
|
|
1316
1460
|
package: packageAddress,
|
|
1317
1461
|
module: "lp_pool",
|
|
1318
1462
|
function: "safety_check",
|
|
1319
|
-
arguments: (0,
|
|
1463
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1320
1464
|
});
|
|
1321
1465
|
}
|
|
1322
1466
|
function checkActive(options) {
|
|
1323
1467
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1324
|
-
const argumentsTypes = [
|
|
1468
|
+
const argumentsTypes = [null];
|
|
1325
1469
|
const parameterNames = ["liquidityPool"];
|
|
1326
1470
|
return (tx) => tx.moveCall({
|
|
1327
1471
|
package: packageAddress,
|
|
1328
1472
|
module: "lp_pool",
|
|
1329
1473
|
function: "check_active",
|
|
1330
|
-
arguments: (0,
|
|
1474
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1331
1475
|
});
|
|
1332
1476
|
}
|
|
1333
1477
|
function oracleMatched(options) {
|
|
1334
1478
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1335
|
-
const argumentsTypes = [
|
|
1336
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1337
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1338
|
-
"address",
|
|
1339
|
-
];
|
|
1479
|
+
const argumentsTypes = [null, null, "address"];
|
|
1340
1480
|
const parameterNames = ["liquidityPool", "tokenType", "oracleId"];
|
|
1341
1481
|
return (tx) => tx.moveCall({
|
|
1342
1482
|
package: packageAddress,
|
|
1343
1483
|
module: "lp_pool",
|
|
1344
1484
|
function: "oracle_matched",
|
|
1345
|
-
arguments: (0,
|
|
1485
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1346
1486
|
});
|
|
1347
1487
|
}
|
|
1348
1488
|
function getTokenPool(options) {
|
|
1349
1489
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1350
|
-
const argumentsTypes = [
|
|
1351
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1352
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1353
|
-
];
|
|
1490
|
+
const argumentsTypes = [null, null];
|
|
1354
1491
|
const parameterNames = ["liquidityPool", "tokenType"];
|
|
1355
1492
|
return (tx) => tx.moveCall({
|
|
1356
1493
|
package: packageAddress,
|
|
1357
1494
|
module: "lp_pool",
|
|
1358
1495
|
function: "get_token_pool",
|
|
1359
|
-
arguments: (0,
|
|
1496
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1360
1497
|
});
|
|
1361
1498
|
}
|
|
1362
1499
|
function getMutTokenPool(options) {
|
|
1363
1500
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1364
|
-
const argumentsTypes = [
|
|
1365
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1366
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1367
|
-
];
|
|
1501
|
+
const argumentsTypes = [null, null];
|
|
1368
1502
|
const parameterNames = ["liquidityPool", "tokenType"];
|
|
1369
1503
|
return (tx) => tx.moveCall({
|
|
1370
1504
|
package: packageAddress,
|
|
1371
1505
|
module: "lp_pool",
|
|
1372
1506
|
function: "get_mut_token_pool",
|
|
1373
|
-
arguments: (0,
|
|
1507
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1374
1508
|
});
|
|
1375
1509
|
}
|
|
1376
1510
|
function getLpTokenType(options) {
|
|
1377
1511
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1378
|
-
const argumentsTypes = [
|
|
1512
|
+
const argumentsTypes = [null, "u64"];
|
|
1379
1513
|
const parameterNames = ["registry", "index"];
|
|
1380
1514
|
return (tx) => tx.moveCall({
|
|
1381
1515
|
package: packageAddress,
|
|
1382
1516
|
module: "lp_pool",
|
|
1383
1517
|
function: "get_lp_token_type",
|
|
1384
|
-
arguments: (0,
|
|
1518
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1385
1519
|
});
|
|
1386
1520
|
}
|
|
1387
1521
|
function getLiquidityTokenDecimal(options) {
|
|
1388
1522
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1389
|
-
const argumentsTypes = [
|
|
1390
|
-
`${packageAddress}::lp_pool::Registry`,
|
|
1391
|
-
"u64",
|
|
1392
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1393
|
-
];
|
|
1523
|
+
const argumentsTypes = [null, "u64", null];
|
|
1394
1524
|
const parameterNames = ["registry", "index", "liquidityToken"];
|
|
1395
1525
|
return (tx) => tx.moveCall({
|
|
1396
1526
|
package: packageAddress,
|
|
1397
1527
|
module: "lp_pool",
|
|
1398
1528
|
function: "get_liquidity_token_decimal",
|
|
1399
|
-
arguments: (0,
|
|
1529
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1400
1530
|
});
|
|
1401
1531
|
}
|
|
1402
1532
|
function getTokenPoolState(options) {
|
|
1403
1533
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1404
|
-
const argumentsTypes = [
|
|
1405
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1406
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1407
|
-
];
|
|
1534
|
+
const argumentsTypes = [null, null];
|
|
1408
1535
|
const parameterNames = ["liquidityPool", "liquidityToken"];
|
|
1409
1536
|
return (tx) => tx.moveCall({
|
|
1410
1537
|
package: packageAddress,
|
|
1411
1538
|
module: "lp_pool",
|
|
1412
1539
|
function: "get_token_pool_state",
|
|
1413
|
-
arguments: (0,
|
|
1540
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1414
1541
|
});
|
|
1415
1542
|
}
|
|
1416
1543
|
function checkTradingOrderSizeValid(options) {
|
|
1417
1544
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1418
|
-
const argumentsTypes = [
|
|
1419
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1420
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1421
|
-
"u64",
|
|
1422
|
-
];
|
|
1545
|
+
const argumentsTypes = [null, null, "u64"];
|
|
1423
1546
|
const parameterNames = ["liquidityPool", "liquidityToken", "reserveAmount"];
|
|
1424
1547
|
return (tx) => tx.moveCall({
|
|
1425
1548
|
package: packageAddress,
|
|
1426
1549
|
module: "lp_pool",
|
|
1427
1550
|
function: "check_trading_order_size_valid",
|
|
1428
|
-
arguments: (0,
|
|
1551
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1429
1552
|
});
|
|
1430
1553
|
}
|
|
1431
1554
|
function getCumulativeBorrowRate(options) {
|
|
1432
1555
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1433
|
-
const argumentsTypes = [
|
|
1434
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
1435
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1436
|
-
];
|
|
1556
|
+
const argumentsTypes = [null, null];
|
|
1437
1557
|
const parameterNames = ["liquidityPool", "liquidityToken"];
|
|
1438
1558
|
return (tx) => tx.moveCall({
|
|
1439
1559
|
package: packageAddress,
|
|
1440
1560
|
module: "lp_pool",
|
|
1441
1561
|
function: "get_cumulative_borrow_rate",
|
|
1442
|
-
arguments: (0,
|
|
1562
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1443
1563
|
});
|
|
1444
1564
|
}
|
|
1445
1565
|
function getTvlUsd(options) {
|
|
1446
1566
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1447
|
-
const argumentsTypes = [
|
|
1567
|
+
const argumentsTypes = [null];
|
|
1448
1568
|
const parameterNames = ["liquidityPool"];
|
|
1449
1569
|
return (tx) => tx.moveCall({
|
|
1450
1570
|
package: packageAddress,
|
|
1451
1571
|
module: "lp_pool",
|
|
1452
1572
|
function: "get_tvl_usd",
|
|
1453
|
-
arguments: (0,
|
|
1573
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1454
1574
|
});
|
|
1455
1575
|
}
|
|
1456
1576
|
function getBorrowRateDecimal(options = {}) {
|
|
@@ -1471,13 +1591,13 @@ function deprecated(options = {}) {
|
|
|
1471
1591
|
}
|
|
1472
1592
|
function getUserDeactivatingShares(options) {
|
|
1473
1593
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1474
|
-
const argumentsTypes = [
|
|
1594
|
+
const argumentsTypes = [null, "u64", "address"];
|
|
1475
1595
|
const parameterNames = ["registry", "index", "user"];
|
|
1476
1596
|
return (tx) => tx.moveCall({
|
|
1477
1597
|
package: packageAddress,
|
|
1478
1598
|
module: "lp_pool",
|
|
1479
1599
|
function: "get_user_deactivating_shares",
|
|
1480
|
-
arguments: (0,
|
|
1600
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1481
1601
|
typeArguments: options.typeArguments,
|
|
1482
1602
|
});
|
|
1483
1603
|
}
|