@typus/typus-perp-sdk 1.1.54 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/sentio.js +2 -2
- package/dist/src/client.d.ts +14 -14
- package/dist/src/client.js +25 -50
- 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/order.js +2 -2
- package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
- package/dist/src/user/tlp.js +3 -3
- package/package.json +40 -47
- 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
|
@@ -63,9 +63,9 @@ exports.updateOptionPositionCollateralAmount = updateOptionPositionCollateralAmo
|
|
|
63
63
|
exports.calculateRealizedPnlUsd = calculateRealizedPnlUsd;
|
|
64
64
|
exports.calculateFilled_ = calculateFilled_;
|
|
65
65
|
exports.calculateIntrinsicValue = calculateIntrinsicValue;
|
|
66
|
-
exports.calculateTradingFee = calculateTradingFee;
|
|
67
66
|
exports.collateralWithPnl = collateralWithPnl;
|
|
68
67
|
exports.calculatePositionFundingRate = calculatePositionFundingRate;
|
|
68
|
+
exports.calculateReserveAmount = calculateReserveAmount;
|
|
69
69
|
exports.isOptionCollateralOrder = isOptionCollateralOrder;
|
|
70
70
|
exports.getOrderCollateralToken = getOrderCollateralToken;
|
|
71
71
|
exports.getOrderCollateralTokenDecimal = getOrderCollateralTokenDecimal;
|
|
@@ -80,10 +80,12 @@ exports.getOrderLinkedPositionId = getOrderLinkedPositionId;
|
|
|
80
80
|
exports.getOrderTypeTag = getOrderTypeTag;
|
|
81
81
|
exports.getOrderCollateralAmount = getOrderCollateralAmount;
|
|
82
82
|
exports.getOptionCollateralOrderCollateralAmount = getOptionCollateralOrderCollateralAmount;
|
|
83
|
-
exports.
|
|
83
|
+
exports.calculateTradingFee = calculateTradingFee;
|
|
84
84
|
exports.splitBidReceipt = splitBidReceipt;
|
|
85
85
|
exports.isOptionCollateralPosition = isOptionCollateralPosition;
|
|
86
86
|
exports.emitRealizedFundingEvent = emitRealizedFundingEvent;
|
|
87
|
+
exports.checkPositionUpdateTimestamp = checkPositionUpdateTimestamp;
|
|
88
|
+
exports.checkPositionUpdateTimestamp_ = checkPositionUpdateTimestamp_;
|
|
87
89
|
exports.getPositionId = getPositionId;
|
|
88
90
|
exports.getPositionSize = getPositionSize;
|
|
89
91
|
exports.getPositionSide = getPositionSide;
|
|
@@ -106,13 +108,21 @@ exports.getMaxOrderTypeTag = getMaxOrderTypeTag;
|
|
|
106
108
|
* logic for creating, updating, and closing them. All of the functions are inner
|
|
107
109
|
* package functions used in `trading.move`.
|
|
108
110
|
*/
|
|
109
|
-
const
|
|
111
|
+
const index_js_1 = require("../utils/index.js");
|
|
110
112
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
111
|
-
const type_name = __importStar(require("./deps/std/type_name"));
|
|
112
|
-
const
|
|
113
|
-
const symbol = __importStar(require("./symbol"));
|
|
113
|
+
const type_name = __importStar(require("./deps/std/type_name.js"));
|
|
114
|
+
const type_name_1 = __importStar(require("./deps/std/type_name.js"));
|
|
115
|
+
const symbol = __importStar(require("./symbol.js"));
|
|
116
|
+
const type_name_2 = __importStar(require("./deps/std/type_name.js"));
|
|
117
|
+
const symbol_1 = __importStar(require("./symbol.js"));
|
|
118
|
+
const type_name_3 = __importStar(require("./deps/std/type_name.js"));
|
|
119
|
+
const symbol_2 = __importStar(require("./symbol.js"));
|
|
120
|
+
const type_name_4 = __importStar(require("./deps/std/type_name.js"));
|
|
121
|
+
const symbol_3 = __importStar(require("./symbol.js"));
|
|
122
|
+
const type_name_5 = __importStar(require("./deps/std/type_name.js"));
|
|
123
|
+
const symbol_4 = __importStar(require("./symbol.js"));
|
|
114
124
|
const $moduleName = "@typus/perp::position";
|
|
115
|
-
exports.OptionCollateralInfo = new
|
|
125
|
+
exports.OptionCollateralInfo = new index_js_1.MoveStruct({
|
|
116
126
|
name: `${$moduleName}::OptionCollateralInfo`,
|
|
117
127
|
fields: {
|
|
118
128
|
/** The index of the portfolio. */
|
|
@@ -123,10 +133,10 @@ exports.OptionCollateralInfo = new index_1.MoveStruct({
|
|
|
123
133
|
bid_receipts_bcs: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
|
|
124
134
|
},
|
|
125
135
|
});
|
|
126
|
-
exports.Position = new
|
|
136
|
+
exports.Position = new index_js_1.MoveStruct({
|
|
127
137
|
name: `${$moduleName}::Position`,
|
|
128
138
|
fields: {
|
|
129
|
-
id:
|
|
139
|
+
id: bcs_1.bcs.Address,
|
|
130
140
|
/** The timestamp when the position was created. */
|
|
131
141
|
create_ts_ms: bcs_1.bcs.u64(),
|
|
132
142
|
/** The timestamp when the position was last updated. */
|
|
@@ -146,7 +156,7 @@ exports.Position = new index_1.MoveStruct({
|
|
|
146
156
|
/** The number of decimals for the size. */
|
|
147
157
|
size_decimal: bcs_1.bcs.u64(),
|
|
148
158
|
/** The type name of the collateral token. */
|
|
149
|
-
collateral_token:
|
|
159
|
+
collateral_token: type_name_1.TypeName,
|
|
150
160
|
/** The number of decimals for the collateral token. */
|
|
151
161
|
collateral_token_decimal: bcs_1.bcs.u64(),
|
|
152
162
|
/** The symbol of the trading pair. */
|
|
@@ -181,10 +191,10 @@ exports.Position = new index_1.MoveStruct({
|
|
|
181
191
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
182
192
|
},
|
|
183
193
|
});
|
|
184
|
-
exports.TradingOrder = new
|
|
194
|
+
exports.TradingOrder = new index_js_1.MoveStruct({
|
|
185
195
|
name: `${$moduleName}::TradingOrder`,
|
|
186
196
|
fields: {
|
|
187
|
-
id:
|
|
197
|
+
id: bcs_1.bcs.Address,
|
|
188
198
|
/** The timestamp when the order was created. */
|
|
189
199
|
create_ts_ms: bcs_1.bcs.u64(),
|
|
190
200
|
/** The ID of the order. */
|
|
@@ -194,11 +204,11 @@ exports.TradingOrder = new index_1.MoveStruct({
|
|
|
194
204
|
/** The address of the user. */
|
|
195
205
|
user: bcs_1.bcs.Address,
|
|
196
206
|
/** The type name of the collateral token. */
|
|
197
|
-
collateral_token:
|
|
207
|
+
collateral_token: type_name_2.TypeName,
|
|
198
208
|
/** The number of decimals for the collateral token. */
|
|
199
209
|
collateral_token_decimal: bcs_1.bcs.u64(),
|
|
200
210
|
/** The symbol of the trading pair. */
|
|
201
|
-
symbol:
|
|
211
|
+
symbol: symbol_1.Symbol,
|
|
202
212
|
/** The leverage in mega basis points. */
|
|
203
213
|
leverage_mbp: bcs_1.bcs.u64(),
|
|
204
214
|
/** Whether the order is reduce-only. */
|
|
@@ -219,12 +229,12 @@ exports.TradingOrder = new index_1.MoveStruct({
|
|
|
219
229
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
220
230
|
},
|
|
221
231
|
});
|
|
222
|
-
exports.RemovePositionEvent = new
|
|
232
|
+
exports.RemovePositionEvent = new index_js_1.MoveStruct({
|
|
223
233
|
name: `${$moduleName}::RemovePositionEvent`,
|
|
224
234
|
fields: {
|
|
225
235
|
user: bcs_1.bcs.Address,
|
|
226
|
-
collateral_token:
|
|
227
|
-
symbol:
|
|
236
|
+
collateral_token: type_name_3.TypeName,
|
|
237
|
+
symbol: symbol_2.Symbol,
|
|
228
238
|
linked_order_ids: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
229
239
|
linked_order_prices: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
230
240
|
remaining_collateral_amount: bcs_1.bcs.u64(),
|
|
@@ -233,12 +243,12 @@ exports.RemovePositionEvent = new index_1.MoveStruct({
|
|
|
233
243
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
234
244
|
},
|
|
235
245
|
});
|
|
236
|
-
exports.OrderFilledEvent = new
|
|
246
|
+
exports.OrderFilledEvent = new index_js_1.MoveStruct({
|
|
237
247
|
name: `${$moduleName}::OrderFilledEvent`,
|
|
238
248
|
fields: {
|
|
239
249
|
user: bcs_1.bcs.Address,
|
|
240
|
-
collateral_token:
|
|
241
|
-
symbol:
|
|
250
|
+
collateral_token: type_name_4.TypeName,
|
|
251
|
+
symbol: symbol_3.Symbol,
|
|
242
252
|
order_id: bcs_1.bcs.u64(),
|
|
243
253
|
linked_position_id: bcs_1.bcs.option(bcs_1.bcs.u64()),
|
|
244
254
|
new_position_id: bcs_1.bcs.option(bcs_1.bcs.u64()),
|
|
@@ -255,12 +265,12 @@ exports.OrderFilledEvent = new index_1.MoveStruct({
|
|
|
255
265
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
256
266
|
},
|
|
257
267
|
});
|
|
258
|
-
exports.RealizeFundingEvent = new
|
|
268
|
+
exports.RealizeFundingEvent = new index_js_1.MoveStruct({
|
|
259
269
|
name: `${$moduleName}::RealizeFundingEvent`,
|
|
260
270
|
fields: {
|
|
261
271
|
user: bcs_1.bcs.Address,
|
|
262
|
-
collateral_token:
|
|
263
|
-
symbol:
|
|
272
|
+
collateral_token: type_name_5.TypeName,
|
|
273
|
+
symbol: symbol_4.Symbol,
|
|
264
274
|
position_id: bcs_1.bcs.u64(),
|
|
265
275
|
realized_funding_sign: bcs_1.bcs.bool(),
|
|
266
276
|
realized_funding_fee: bcs_1.bcs.u64(),
|
|
@@ -272,8 +282,8 @@ exports.RealizeFundingEvent = new index_1.MoveStruct({
|
|
|
272
282
|
function createOrder(options) {
|
|
273
283
|
const packageAddress = options.package ?? "@typus/perp";
|
|
274
284
|
const argumentsTypes = [
|
|
275
|
-
|
|
276
|
-
|
|
285
|
+
null,
|
|
286
|
+
null,
|
|
277
287
|
"u64",
|
|
278
288
|
"bool",
|
|
279
289
|
"bool",
|
|
@@ -281,12 +291,12 @@ function createOrder(options) {
|
|
|
281
291
|
"u64",
|
|
282
292
|
"u64",
|
|
283
293
|
"u64",
|
|
284
|
-
|
|
294
|
+
null,
|
|
285
295
|
"u64",
|
|
286
|
-
"
|
|
296
|
+
"0x1::option::Option<u64>",
|
|
287
297
|
"u64",
|
|
288
298
|
"u64",
|
|
289
|
-
"
|
|
299
|
+
"0x2::clock::Clock",
|
|
290
300
|
];
|
|
291
301
|
const parameterNames = [
|
|
292
302
|
"version",
|
|
@@ -308,20 +318,20 @@ function createOrder(options) {
|
|
|
308
318
|
package: packageAddress,
|
|
309
319
|
module: "position",
|
|
310
320
|
function: "create_order",
|
|
311
|
-
arguments: (0,
|
|
321
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
312
322
|
typeArguments: options.typeArguments,
|
|
313
323
|
});
|
|
314
324
|
}
|
|
315
325
|
/** Removes a trading order. WARNING: no authority check inside */
|
|
316
326
|
function removeOrder(options) {
|
|
317
327
|
const packageAddress = options.package ?? "@typus/perp";
|
|
318
|
-
const argumentsTypes = [
|
|
328
|
+
const argumentsTypes = [null, null];
|
|
319
329
|
const parameterNames = ["version", "order"];
|
|
320
330
|
return (tx) => tx.moveCall({
|
|
321
331
|
package: packageAddress,
|
|
322
332
|
module: "position",
|
|
323
333
|
function: "remove_order",
|
|
324
|
-
arguments: (0,
|
|
334
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
325
335
|
typeArguments: options.typeArguments,
|
|
326
336
|
});
|
|
327
337
|
}
|
|
@@ -329,19 +339,19 @@ function removeOrder(options) {
|
|
|
329
339
|
function managerCreateReduceOnlyOrder(options) {
|
|
330
340
|
const packageAddress = options.package ?? "@typus/perp";
|
|
331
341
|
const argumentsTypes = [
|
|
332
|
-
|
|
333
|
-
|
|
342
|
+
null,
|
|
343
|
+
null,
|
|
334
344
|
"bool",
|
|
335
345
|
"u64",
|
|
336
346
|
"u64",
|
|
337
347
|
"u64",
|
|
338
|
-
|
|
348
|
+
null,
|
|
339
349
|
"u64",
|
|
340
350
|
"u64",
|
|
341
351
|
"address",
|
|
342
352
|
"u64",
|
|
343
353
|
"u64",
|
|
344
|
-
"
|
|
354
|
+
"0x2::clock::Clock",
|
|
345
355
|
];
|
|
346
356
|
const parameterNames = [
|
|
347
357
|
"version",
|
|
@@ -361,21 +371,14 @@ function managerCreateReduceOnlyOrder(options) {
|
|
|
361
371
|
package: packageAddress,
|
|
362
372
|
module: "position",
|
|
363
373
|
function: "manager_create_reduce_only_order",
|
|
364
|
-
arguments: (0,
|
|
374
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
365
375
|
typeArguments: options.typeArguments,
|
|
366
376
|
});
|
|
367
377
|
}
|
|
368
378
|
/** Increases the collateral of a position. WARNING: no authority check inside */
|
|
369
379
|
function increaseCollateral(options) {
|
|
370
380
|
const packageAddress = options.package ?? "@typus/perp";
|
|
371
|
-
const argumentsTypes = [
|
|
372
|
-
`${packageAddress}::position::Position`,
|
|
373
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
374
|
-
"u64",
|
|
375
|
-
"u64",
|
|
376
|
-
"u64",
|
|
377
|
-
"u64",
|
|
378
|
-
];
|
|
381
|
+
const argumentsTypes = [null, null, "u64", "u64", "u64", "u64"];
|
|
379
382
|
const parameterNames = [
|
|
380
383
|
"position",
|
|
381
384
|
"collateral",
|
|
@@ -388,14 +391,14 @@ function increaseCollateral(options) {
|
|
|
388
391
|
package: packageAddress,
|
|
389
392
|
module: "position",
|
|
390
393
|
function: "increase_collateral",
|
|
391
|
-
arguments: (0,
|
|
394
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
392
395
|
typeArguments: options.typeArguments,
|
|
393
396
|
});
|
|
394
397
|
}
|
|
395
398
|
/** Releases collateral from a position. WARNING: no authority check inside */
|
|
396
399
|
function releaseCollateral(options) {
|
|
397
400
|
const packageAddress = options.package ?? "@typus/perp";
|
|
398
|
-
const argumentsTypes = [
|
|
401
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64"];
|
|
399
402
|
const parameterNames = [
|
|
400
403
|
"position",
|
|
401
404
|
"releaseAmount",
|
|
@@ -408,20 +411,20 @@ function releaseCollateral(options) {
|
|
|
408
411
|
package: packageAddress,
|
|
409
412
|
module: "position",
|
|
410
413
|
function: "release_collateral",
|
|
411
|
-
arguments: (0,
|
|
414
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
412
415
|
typeArguments: options.typeArguments,
|
|
413
416
|
});
|
|
414
417
|
}
|
|
415
418
|
/** Removes a position. WARNING: no authority check inside */
|
|
416
419
|
function removePosition(options) {
|
|
417
420
|
const packageAddress = options.package ?? "@typus/perp";
|
|
418
|
-
const argumentsTypes = [
|
|
421
|
+
const argumentsTypes = [null, null];
|
|
419
422
|
const parameterNames = ["version", "position"];
|
|
420
423
|
return (tx) => tx.moveCall({
|
|
421
424
|
package: packageAddress,
|
|
422
425
|
module: "position",
|
|
423
426
|
function: "remove_position",
|
|
424
|
-
arguments: (0,
|
|
427
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
425
428
|
typeArguments: options.typeArguments,
|
|
426
429
|
});
|
|
427
430
|
}
|
|
@@ -429,13 +432,13 @@ function removePosition(options) {
|
|
|
429
432
|
function orderFilled(options) {
|
|
430
433
|
const packageAddress = options.package ?? "@typus/perp";
|
|
431
434
|
const argumentsTypes = [
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
435
|
+
null,
|
|
436
|
+
null,
|
|
437
|
+
null,
|
|
438
|
+
null,
|
|
439
|
+
null,
|
|
440
|
+
null,
|
|
441
|
+
"0x1::option::Option<null>",
|
|
439
442
|
"u64",
|
|
440
443
|
"u64",
|
|
441
444
|
"u64",
|
|
@@ -445,7 +448,7 @@ function orderFilled(options) {
|
|
|
445
448
|
"bool",
|
|
446
449
|
"u64",
|
|
447
450
|
"u64",
|
|
448
|
-
"
|
|
451
|
+
"0x2::clock::Clock",
|
|
449
452
|
];
|
|
450
453
|
const parameterNames = [
|
|
451
454
|
"version",
|
|
@@ -469,24 +472,14 @@ function orderFilled(options) {
|
|
|
469
472
|
package: packageAddress,
|
|
470
473
|
module: "position",
|
|
471
474
|
function: "order_filled",
|
|
472
|
-
arguments: (0,
|
|
475
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
473
476
|
typeArguments: options.typeArguments,
|
|
474
477
|
});
|
|
475
478
|
}
|
|
476
479
|
/** Realizes the PnL and fees of a position. WARNING: no authority check inside */
|
|
477
480
|
function realizePositionPnlAndFee(options) {
|
|
478
481
|
const packageAddress = options.package ?? "@typus/perp";
|
|
479
|
-
const argumentsTypes = [
|
|
480
|
-
`${packageAddress}::admin::Version`,
|
|
481
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
482
|
-
`${packageAddress}::position::Position`,
|
|
483
|
-
"u64",
|
|
484
|
-
"u64",
|
|
485
|
-
"u64",
|
|
486
|
-
"u64",
|
|
487
|
-
"u64",
|
|
488
|
-
"u64",
|
|
489
|
-
];
|
|
482
|
+
const argumentsTypes = [null, null, null, "u64", "u64", "u64", "u64", "u64", "u64"];
|
|
490
483
|
const parameterNames = [
|
|
491
484
|
"version",
|
|
492
485
|
"liquidityPool",
|
|
@@ -502,42 +495,37 @@ function realizePositionPnlAndFee(options) {
|
|
|
502
495
|
package: packageAddress,
|
|
503
496
|
module: "position",
|
|
504
497
|
function: "realize_position_pnl_and_fee",
|
|
505
|
-
arguments: (0,
|
|
498
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
506
499
|
typeArguments: options.typeArguments,
|
|
507
500
|
});
|
|
508
501
|
}
|
|
509
502
|
/** Realizes the funding fee of a position. WARNING: no authority check inside */
|
|
510
503
|
function realizeFundingFee(options) {
|
|
511
504
|
const packageAddress = options.package ?? "@typus/perp";
|
|
512
|
-
const argumentsTypes = [
|
|
513
|
-
`${packageAddress}::lp_pool::LiquidityPool`,
|
|
514
|
-
`${packageAddress}::position::Position`,
|
|
515
|
-
"u64",
|
|
516
|
-
"u64",
|
|
517
|
-
];
|
|
505
|
+
const argumentsTypes = [null, null, "u64", "u64"];
|
|
518
506
|
const parameterNames = ["liquidityPool", "position", "collateralOraclePrice", "collateralOraclePriceDecimal"];
|
|
519
507
|
return (tx) => tx.moveCall({
|
|
520
508
|
package: packageAddress,
|
|
521
509
|
module: "position",
|
|
522
510
|
function: "realize_funding_fee",
|
|
523
|
-
arguments: (0,
|
|
511
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
524
512
|
typeArguments: options.typeArguments,
|
|
525
513
|
});
|
|
526
514
|
}
|
|
527
515
|
function checkOrderFilled(options) {
|
|
528
516
|
const packageAddress = options.package ?? "@typus/perp";
|
|
529
|
-
const argumentsTypes = [
|
|
517
|
+
const argumentsTypes = [null, "u64"];
|
|
530
518
|
const parameterNames = ["order", "oraclePrice"];
|
|
531
519
|
return (tx) => tx.moveCall({
|
|
532
520
|
package: packageAddress,
|
|
533
521
|
module: "position",
|
|
534
522
|
function: "check_order_filled",
|
|
535
|
-
arguments: (0,
|
|
523
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
536
524
|
});
|
|
537
525
|
}
|
|
538
526
|
function calculatePeriodBorrowCost(options) {
|
|
539
527
|
const packageAddress = options.package ?? "@typus/perp";
|
|
540
|
-
const argumentsTypes = [
|
|
528
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64"];
|
|
541
529
|
const parameterNames = [
|
|
542
530
|
"position",
|
|
543
531
|
"collateralOraclePrice",
|
|
@@ -550,23 +538,12 @@ function calculatePeriodBorrowCost(options) {
|
|
|
550
538
|
package: packageAddress,
|
|
551
539
|
module: "position",
|
|
552
540
|
function: "calculate_period_borrow_cost",
|
|
553
|
-
arguments: (0,
|
|
541
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
554
542
|
});
|
|
555
543
|
}
|
|
556
544
|
function checkPositionLiquidated(options) {
|
|
557
545
|
const packageAddress = options.package ?? "@typus/perp";
|
|
558
|
-
const argumentsTypes = [
|
|
559
|
-
`${packageAddress}::position::Position`,
|
|
560
|
-
"u64",
|
|
561
|
-
"u64",
|
|
562
|
-
"u64",
|
|
563
|
-
"u64",
|
|
564
|
-
"u64",
|
|
565
|
-
"u64",
|
|
566
|
-
"u64",
|
|
567
|
-
"bool",
|
|
568
|
-
"u64",
|
|
569
|
-
];
|
|
546
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64", "u64", "u64", "bool", "u64"];
|
|
570
547
|
const parameterNames = [
|
|
571
548
|
"position",
|
|
572
549
|
"collateralOraclePrice",
|
|
@@ -583,23 +560,23 @@ function checkPositionLiquidated(options) {
|
|
|
583
560
|
package: packageAddress,
|
|
584
561
|
module: "position",
|
|
585
562
|
function: "check_position_liquidated",
|
|
586
|
-
arguments: (0,
|
|
563
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
587
564
|
});
|
|
588
565
|
}
|
|
589
566
|
function calculateUnrealizedPnl(options) {
|
|
590
567
|
const packageAddress = options.package ?? "@typus/perp";
|
|
591
|
-
const argumentsTypes = [
|
|
568
|
+
const argumentsTypes = [null, "u64", "u64", "u64"];
|
|
592
569
|
const parameterNames = ["position", "tradingPairOraclePrice", "tradingPairOraclePriceDecimal", "tradingFeeMbp"];
|
|
593
570
|
return (tx) => tx.moveCall({
|
|
594
571
|
package: packageAddress,
|
|
595
572
|
module: "position",
|
|
596
573
|
function: "calculate_unrealized_pnl",
|
|
597
|
-
arguments: (0,
|
|
574
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
598
575
|
});
|
|
599
576
|
}
|
|
600
577
|
function maxReleasingCollateralAmount(options) {
|
|
601
578
|
const packageAddress = options.package ?? "@typus/perp";
|
|
602
|
-
const argumentsTypes = [
|
|
579
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64", "u64", "u64"];
|
|
603
580
|
const parameterNames = [
|
|
604
581
|
"position",
|
|
605
582
|
"collateralOraclePrice",
|
|
@@ -614,12 +591,12 @@ function maxReleasingCollateralAmount(options) {
|
|
|
614
591
|
package: packageAddress,
|
|
615
592
|
module: "position",
|
|
616
593
|
function: "max_releasing_collateral_amount",
|
|
617
|
-
arguments: (0,
|
|
594
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
618
595
|
});
|
|
619
596
|
}
|
|
620
597
|
function getEstimatedLiquidationPrice(options) {
|
|
621
598
|
const packageAddress = options.package ?? "@typus/perp";
|
|
622
|
-
const argumentsTypes = [
|
|
599
|
+
const argumentsTypes = [null, "bool", "u64", "u64", "u64", "u64", "u64"];
|
|
623
600
|
const parameterNames = [
|
|
624
601
|
"position",
|
|
625
602
|
"isSameToken",
|
|
@@ -633,16 +610,16 @@ function getEstimatedLiquidationPrice(options) {
|
|
|
633
610
|
package: packageAddress,
|
|
634
611
|
module: "position",
|
|
635
612
|
function: "get_estimated_liquidation_price",
|
|
636
|
-
arguments: (0,
|
|
613
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
637
614
|
});
|
|
638
615
|
}
|
|
639
616
|
function createOrderWithBidReceipts(options) {
|
|
640
617
|
const packageAddress = options.package ?? "@typus/perp";
|
|
641
618
|
const argumentsTypes = [
|
|
642
|
-
|
|
643
|
-
|
|
619
|
+
null,
|
|
620
|
+
null,
|
|
644
621
|
"u64",
|
|
645
|
-
|
|
622
|
+
null,
|
|
646
623
|
"u64",
|
|
647
624
|
"bool",
|
|
648
625
|
"bool",
|
|
@@ -650,13 +627,13 @@ function createOrderWithBidReceipts(options) {
|
|
|
650
627
|
"u64",
|
|
651
628
|
"u64",
|
|
652
629
|
"u64",
|
|
653
|
-
"vector<
|
|
630
|
+
"vector<null>",
|
|
654
631
|
"u64",
|
|
655
|
-
"
|
|
632
|
+
"0x1::option::Option<u64>",
|
|
656
633
|
"u64",
|
|
657
634
|
"u64",
|
|
658
635
|
"address",
|
|
659
|
-
"
|
|
636
|
+
"0x2::clock::Clock",
|
|
660
637
|
];
|
|
661
638
|
const parameterNames = [
|
|
662
639
|
"version",
|
|
@@ -681,34 +658,34 @@ function createOrderWithBidReceipts(options) {
|
|
|
681
658
|
package: packageAddress,
|
|
682
659
|
module: "position",
|
|
683
660
|
function: "create_order_with_bid_receipts",
|
|
684
|
-
arguments: (0,
|
|
661
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
685
662
|
});
|
|
686
663
|
}
|
|
687
664
|
function removePositionWithBidReceipts(options) {
|
|
688
665
|
const packageAddress = options.package ?? "@typus/perp";
|
|
689
|
-
const argumentsTypes = [
|
|
666
|
+
const argumentsTypes = [null, null];
|
|
690
667
|
const parameterNames = ["version", "position"];
|
|
691
668
|
return (tx) => tx.moveCall({
|
|
692
669
|
package: packageAddress,
|
|
693
670
|
module: "position",
|
|
694
671
|
function: "remove_position_with_bid_receipts",
|
|
695
|
-
arguments: (0,
|
|
672
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
696
673
|
});
|
|
697
674
|
}
|
|
698
675
|
function orderFilledWithBidReceiptsCollateral(options) {
|
|
699
676
|
const packageAddress = options.package ?? "@typus/perp";
|
|
700
677
|
const argumentsTypes = [
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
678
|
+
null,
|
|
679
|
+
null,
|
|
680
|
+
null,
|
|
681
|
+
null,
|
|
682
|
+
null,
|
|
683
|
+
null,
|
|
684
|
+
null,
|
|
685
|
+
null,
|
|
686
|
+
null,
|
|
687
|
+
null,
|
|
688
|
+
"0x1::option::Option<null>",
|
|
712
689
|
"u64",
|
|
713
690
|
"u64",
|
|
714
691
|
"u64",
|
|
@@ -718,7 +695,7 @@ function orderFilledWithBidReceiptsCollateral(options) {
|
|
|
718
695
|
"bool",
|
|
719
696
|
"u64",
|
|
720
697
|
"u64",
|
|
721
|
-
"
|
|
698
|
+
"0x2::clock::Clock",
|
|
722
699
|
];
|
|
723
700
|
const parameterNames = [
|
|
724
701
|
"version",
|
|
@@ -746,25 +723,27 @@ function orderFilledWithBidReceiptsCollateral(options) {
|
|
|
746
723
|
package: packageAddress,
|
|
747
724
|
module: "position",
|
|
748
725
|
function: "order_filled_with_bid_receipts_collateral",
|
|
749
|
-
arguments: (0,
|
|
726
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
750
727
|
typeArguments: options.typeArguments,
|
|
751
728
|
});
|
|
752
729
|
}
|
|
753
730
|
function checkOptionCollateralPositionLiquidated(options) {
|
|
754
731
|
const packageAddress = options.package ?? "@typus/perp";
|
|
755
732
|
const argumentsTypes = [
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
733
|
+
null,
|
|
734
|
+
null,
|
|
735
|
+
null,
|
|
736
|
+
null,
|
|
737
|
+
"u64",
|
|
760
738
|
"u64",
|
|
761
739
|
"u64",
|
|
762
740
|
"u64",
|
|
763
741
|
"u64",
|
|
764
742
|
"u64",
|
|
765
743
|
"u64",
|
|
744
|
+
"bool",
|
|
766
745
|
"u64",
|
|
767
|
-
"
|
|
746
|
+
"0x2::clock::Clock",
|
|
768
747
|
];
|
|
769
748
|
const parameterNames = [
|
|
770
749
|
"dovRegistry",
|
|
@@ -778,37 +757,39 @@ function checkOptionCollateralPositionLiquidated(options) {
|
|
|
778
757
|
"tradingFeeMbp",
|
|
779
758
|
"maintenanceMarginRateBp",
|
|
780
759
|
"cumulativeBorrowRate",
|
|
760
|
+
"cumulativeFundingRateIndexSign",
|
|
761
|
+
"cumulativeFundingRateIndex",
|
|
781
762
|
];
|
|
782
763
|
return (tx) => tx.moveCall({
|
|
783
764
|
package: packageAddress,
|
|
784
765
|
module: "position",
|
|
785
766
|
function: "check_option_collateral_position_liquidated",
|
|
786
|
-
arguments: (0,
|
|
767
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
787
768
|
typeArguments: options.typeArguments,
|
|
788
769
|
});
|
|
789
770
|
}
|
|
790
771
|
/** Adds linked order info to a position. WARNING: no authority check inside */
|
|
791
772
|
function addPositionLinkedOrderInfo(options) {
|
|
792
773
|
const packageAddress = options.package ?? "@typus/perp";
|
|
793
|
-
const argumentsTypes = [
|
|
774
|
+
const argumentsTypes = [null, "u64", "u64"];
|
|
794
775
|
const parameterNames = ["position", "linkedOrderId", "linkedOrderPrice"];
|
|
795
776
|
return (tx) => tx.moveCall({
|
|
796
777
|
package: packageAddress,
|
|
797
778
|
module: "position",
|
|
798
779
|
function: "add_position_linked_order_info",
|
|
799
|
-
arguments: (0,
|
|
780
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
800
781
|
});
|
|
801
782
|
}
|
|
802
783
|
/** Removes linked order info from a position. WARNING: no authority check inside */
|
|
803
784
|
function removePositionLinkedOrderInfo(options) {
|
|
804
785
|
const packageAddress = options.package ?? "@typus/perp";
|
|
805
|
-
const argumentsTypes = [
|
|
786
|
+
const argumentsTypes = [null, "u64"];
|
|
806
787
|
const parameterNames = ["position", "linkedOrderId"];
|
|
807
788
|
return (tx) => tx.moveCall({
|
|
808
789
|
package: packageAddress,
|
|
809
790
|
module: "position",
|
|
810
791
|
function: "remove_position_linked_order_info",
|
|
811
|
-
arguments: (0,
|
|
792
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
812
793
|
});
|
|
813
794
|
}
|
|
814
795
|
/**
|
|
@@ -817,7 +798,7 @@ function removePositionLinkedOrderInfo(options) {
|
|
|
817
798
|
*/
|
|
818
799
|
function updatePositionBorrowRateAndFundingRate(options) {
|
|
819
800
|
const packageAddress = options.package ?? "@typus/perp";
|
|
820
|
-
const argumentsTypes = [
|
|
801
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64", "bool", "u64"];
|
|
821
802
|
const parameterNames = [
|
|
822
803
|
"position",
|
|
823
804
|
"collateralOraclePrice",
|
|
@@ -832,7 +813,7 @@ function updatePositionBorrowRateAndFundingRate(options) {
|
|
|
832
813
|
package: packageAddress,
|
|
833
814
|
module: "position",
|
|
834
815
|
function: "update_position_borrow_rate_and_funding_rate",
|
|
835
|
-
arguments: (0,
|
|
816
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
836
817
|
});
|
|
837
818
|
}
|
|
838
819
|
/**
|
|
@@ -841,19 +822,13 @@ function updatePositionBorrowRateAndFundingRate(options) {
|
|
|
841
822
|
*/
|
|
842
823
|
function updateOptionPositionCollateralAmount(options) {
|
|
843
824
|
const packageAddress = options.package ?? "@typus/perp";
|
|
844
|
-
const argumentsTypes = [
|
|
845
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
846
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
847
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
848
|
-
`${packageAddress}::position::Position`,
|
|
849
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
850
|
-
];
|
|
825
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock"];
|
|
851
826
|
const parameterNames = ["dovRegistry", "typusOracleTradingSymbol", "typusOracleCToken", "position"];
|
|
852
827
|
return (tx) => tx.moveCall({
|
|
853
828
|
package: packageAddress,
|
|
854
829
|
module: "position",
|
|
855
830
|
function: "update_option_position_collateral_amount",
|
|
856
|
-
arguments: (0,
|
|
831
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
857
832
|
typeArguments: options.typeArguments,
|
|
858
833
|
});
|
|
859
834
|
}
|
|
@@ -865,313 +840,290 @@ function calculateRealizedPnlUsd(options) {
|
|
|
865
840
|
package: packageAddress,
|
|
866
841
|
module: "position",
|
|
867
842
|
function: "calculate_realized_pnl_usd",
|
|
868
|
-
arguments: (0,
|
|
843
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
869
844
|
});
|
|
870
845
|
}
|
|
871
846
|
function calculateFilled_(options) {
|
|
872
847
|
const packageAddress = options.package ?? "@typus/perp";
|
|
873
|
-
const argumentsTypes = [
|
|
848
|
+
const argumentsTypes = [null, "bool", "bool", "u64", "u64", "u64"];
|
|
874
849
|
const parameterNames = ["position", "reduceOnly", "orderSide", "orderSize", "tradingPairOraclePrice", "tradingPairOraclePriceDecimal"];
|
|
875
850
|
return (tx) => tx.moveCall({
|
|
876
851
|
package: packageAddress,
|
|
877
852
|
module: "position",
|
|
878
853
|
function: "calculate_filled_",
|
|
879
|
-
arguments: (0,
|
|
854
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
880
855
|
});
|
|
881
856
|
}
|
|
882
857
|
function calculateIntrinsicValue(options) {
|
|
883
858
|
const packageAddress = options.package ?? "@typus/perp";
|
|
884
|
-
const argumentsTypes = [
|
|
885
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
886
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
887
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
888
|
-
"vector<0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::vault::TypusBidReceipt>",
|
|
889
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
890
|
-
];
|
|
859
|
+
const argumentsTypes = [null, null, null, "vector<null>", "0x2::clock::Clock"];
|
|
891
860
|
const parameterNames = ["dovRegistry", "typusOracleTradingSymbol", "typusOracleCToken", "receipts"];
|
|
892
861
|
return (tx) => tx.moveCall({
|
|
893
862
|
package: packageAddress,
|
|
894
863
|
module: "position",
|
|
895
864
|
function: "calculate_intrinsic_value",
|
|
896
|
-
arguments: (0,
|
|
865
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
897
866
|
typeArguments: options.typeArguments,
|
|
898
867
|
});
|
|
899
868
|
}
|
|
900
|
-
function
|
|
869
|
+
function collateralWithPnl(options) {
|
|
901
870
|
const packageAddress = options.package ?? "@typus/perp";
|
|
902
|
-
const argumentsTypes = [
|
|
871
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "u64"];
|
|
903
872
|
const parameterNames = [
|
|
904
|
-
"
|
|
905
|
-
"sizeDecimal",
|
|
873
|
+
"position",
|
|
906
874
|
"collateralOraclePrice",
|
|
907
875
|
"collateralOraclePriceDecimal",
|
|
908
876
|
"tradingPairOraclePrice",
|
|
909
877
|
"tradingPairOraclePriceDecimal",
|
|
910
878
|
"tradingFeeMbp",
|
|
911
|
-
"collateralTokenDecimal",
|
|
912
879
|
];
|
|
913
880
|
return (tx) => tx.moveCall({
|
|
914
881
|
package: packageAddress,
|
|
915
882
|
module: "position",
|
|
916
|
-
function: "
|
|
917
|
-
arguments: (0,
|
|
883
|
+
function: "collateral_with_pnl",
|
|
884
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
918
885
|
});
|
|
919
886
|
}
|
|
920
|
-
function
|
|
887
|
+
function calculatePositionFundingRate(options) {
|
|
921
888
|
const packageAddress = options.package ?? "@typus/perp";
|
|
922
|
-
const argumentsTypes = [
|
|
889
|
+
const argumentsTypes = [null, "u64", "u64", "u64", "u64", "bool", "u64"];
|
|
923
890
|
const parameterNames = [
|
|
924
891
|
"position",
|
|
925
892
|
"collateralOraclePrice",
|
|
926
893
|
"collateralOraclePriceDecimal",
|
|
927
894
|
"tradingPairOraclePrice",
|
|
928
895
|
"tradingPairOraclePriceDecimal",
|
|
929
|
-
"
|
|
896
|
+
"cumulativeFundingRateIndexSign",
|
|
897
|
+
"cumulativeFundingRateIndex",
|
|
930
898
|
];
|
|
931
899
|
return (tx) => tx.moveCall({
|
|
932
900
|
package: packageAddress,
|
|
933
901
|
module: "position",
|
|
934
|
-
function: "
|
|
935
|
-
arguments: (0,
|
|
902
|
+
function: "calculate_position_funding_rate",
|
|
903
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
936
904
|
});
|
|
937
905
|
}
|
|
938
|
-
function
|
|
906
|
+
function calculateReserveAmount(options) {
|
|
939
907
|
const packageAddress = options.package ?? "@typus/perp";
|
|
940
|
-
const argumentsTypes = [
|
|
908
|
+
const argumentsTypes = ["u64", "u64", "u64", "u64", "u64", "u64", "u64", "u64"];
|
|
941
909
|
const parameterNames = [
|
|
942
|
-
"
|
|
910
|
+
"newSize",
|
|
911
|
+
"sizeDecimal",
|
|
912
|
+
"collateralAmount",
|
|
913
|
+
"collateralTokenDecimal",
|
|
943
914
|
"collateralOraclePrice",
|
|
944
915
|
"collateralOraclePriceDecimal",
|
|
945
916
|
"tradingPairOraclePrice",
|
|
946
917
|
"tradingPairOraclePriceDecimal",
|
|
947
|
-
"cumulativeFundingRateIndexSign",
|
|
948
|
-
"cumulativeFundingRateIndex",
|
|
949
918
|
];
|
|
950
919
|
return (tx) => tx.moveCall({
|
|
951
920
|
package: packageAddress,
|
|
952
921
|
module: "position",
|
|
953
|
-
function: "
|
|
954
|
-
arguments: (0,
|
|
922
|
+
function: "calculate_reserve_amount",
|
|
923
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
955
924
|
});
|
|
956
925
|
}
|
|
957
926
|
function isOptionCollateralOrder(options) {
|
|
958
927
|
const packageAddress = options.package ?? "@typus/perp";
|
|
959
|
-
const argumentsTypes = [
|
|
928
|
+
const argumentsTypes = [null];
|
|
960
929
|
const parameterNames = ["order"];
|
|
961
930
|
return (tx) => tx.moveCall({
|
|
962
931
|
package: packageAddress,
|
|
963
932
|
module: "position",
|
|
964
933
|
function: "is_option_collateral_order",
|
|
965
|
-
arguments: (0,
|
|
934
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
966
935
|
});
|
|
967
936
|
}
|
|
968
937
|
function getOrderCollateralToken(options) {
|
|
969
938
|
const packageAddress = options.package ?? "@typus/perp";
|
|
970
|
-
const argumentsTypes = [
|
|
939
|
+
const argumentsTypes = [null];
|
|
971
940
|
const parameterNames = ["order"];
|
|
972
941
|
return (tx) => tx.moveCall({
|
|
973
942
|
package: packageAddress,
|
|
974
943
|
module: "position",
|
|
975
944
|
function: "get_order_collateral_token",
|
|
976
|
-
arguments: (0,
|
|
945
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
977
946
|
});
|
|
978
947
|
}
|
|
979
948
|
function getOrderCollateralTokenDecimal(options) {
|
|
980
949
|
const packageAddress = options.package ?? "@typus/perp";
|
|
981
|
-
const argumentsTypes = [
|
|
950
|
+
const argumentsTypes = [null];
|
|
982
951
|
const parameterNames = ["order"];
|
|
983
952
|
return (tx) => tx.moveCall({
|
|
984
953
|
package: packageAddress,
|
|
985
954
|
module: "position",
|
|
986
955
|
function: "get_order_collateral_token_decimal",
|
|
987
|
-
arguments: (0,
|
|
956
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
988
957
|
});
|
|
989
958
|
}
|
|
990
959
|
function getOrderTradingSymbol(options) {
|
|
991
960
|
const packageAddress = options.package ?? "@typus/perp";
|
|
992
|
-
const argumentsTypes = [
|
|
961
|
+
const argumentsTypes = [null];
|
|
993
962
|
const parameterNames = ["order"];
|
|
994
963
|
return (tx) => tx.moveCall({
|
|
995
964
|
package: packageAddress,
|
|
996
965
|
module: "position",
|
|
997
966
|
function: "get_order_trading_symbol",
|
|
998
|
-
arguments: (0,
|
|
967
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
999
968
|
});
|
|
1000
969
|
}
|
|
1001
970
|
function getOrderPrice(options) {
|
|
1002
971
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1003
|
-
const argumentsTypes = [
|
|
972
|
+
const argumentsTypes = [null];
|
|
1004
973
|
const parameterNames = ["order"];
|
|
1005
974
|
return (tx) => tx.moveCall({
|
|
1006
975
|
package: packageAddress,
|
|
1007
976
|
module: "position",
|
|
1008
977
|
function: "get_order_price",
|
|
1009
|
-
arguments: (0,
|
|
978
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1010
979
|
});
|
|
1011
980
|
}
|
|
1012
981
|
function getOrderUser(options) {
|
|
1013
982
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1014
|
-
const argumentsTypes = [
|
|
983
|
+
const argumentsTypes = [null];
|
|
1015
984
|
const parameterNames = ["order"];
|
|
1016
985
|
return (tx) => tx.moveCall({
|
|
1017
986
|
package: packageAddress,
|
|
1018
987
|
module: "position",
|
|
1019
988
|
function: "get_order_user",
|
|
1020
|
-
arguments: (0,
|
|
989
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1021
990
|
});
|
|
1022
991
|
}
|
|
1023
992
|
function getOrderId(options) {
|
|
1024
993
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1025
|
-
const argumentsTypes = [
|
|
994
|
+
const argumentsTypes = [null];
|
|
1026
995
|
const parameterNames = ["order"];
|
|
1027
996
|
return (tx) => tx.moveCall({
|
|
1028
997
|
package: packageAddress,
|
|
1029
998
|
module: "position",
|
|
1030
999
|
function: "get_order_id",
|
|
1031
|
-
arguments: (0,
|
|
1000
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1032
1001
|
});
|
|
1033
1002
|
}
|
|
1034
1003
|
function getOrderSize(options) {
|
|
1035
1004
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1036
|
-
const argumentsTypes = [
|
|
1005
|
+
const argumentsTypes = [null];
|
|
1037
1006
|
const parameterNames = ["order"];
|
|
1038
1007
|
return (tx) => tx.moveCall({
|
|
1039
1008
|
package: packageAddress,
|
|
1040
1009
|
module: "position",
|
|
1041
1010
|
function: "get_order_size",
|
|
1042
|
-
arguments: (0,
|
|
1011
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1043
1012
|
});
|
|
1044
1013
|
}
|
|
1045
1014
|
function getOrderSide(options) {
|
|
1046
1015
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1047
|
-
const argumentsTypes = [
|
|
1016
|
+
const argumentsTypes = [null];
|
|
1048
1017
|
const parameterNames = ["order"];
|
|
1049
1018
|
return (tx) => tx.moveCall({
|
|
1050
1019
|
package: packageAddress,
|
|
1051
1020
|
module: "position",
|
|
1052
1021
|
function: "get_order_side",
|
|
1053
|
-
arguments: (0,
|
|
1022
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1054
1023
|
});
|
|
1055
1024
|
}
|
|
1056
1025
|
function getOrderReduceOnly(options) {
|
|
1057
1026
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1058
|
-
const argumentsTypes = [
|
|
1027
|
+
const argumentsTypes = [null];
|
|
1059
1028
|
const parameterNames = ["order"];
|
|
1060
1029
|
return (tx) => tx.moveCall({
|
|
1061
1030
|
package: packageAddress,
|
|
1062
1031
|
module: "position",
|
|
1063
1032
|
function: "get_order_reduce_only",
|
|
1064
|
-
arguments: (0,
|
|
1033
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1065
1034
|
});
|
|
1066
1035
|
}
|
|
1067
1036
|
function getOrderLinkedPositionId(options) {
|
|
1068
1037
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1069
|
-
const argumentsTypes = [
|
|
1038
|
+
const argumentsTypes = [null];
|
|
1070
1039
|
const parameterNames = ["order"];
|
|
1071
1040
|
return (tx) => tx.moveCall({
|
|
1072
1041
|
package: packageAddress,
|
|
1073
1042
|
module: "position",
|
|
1074
1043
|
function: "get_order_linked_position_id",
|
|
1075
|
-
arguments: (0,
|
|
1044
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1076
1045
|
});
|
|
1077
1046
|
}
|
|
1078
1047
|
function getOrderTypeTag(options) {
|
|
1079
1048
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1080
|
-
const argumentsTypes = [
|
|
1049
|
+
const argumentsTypes = [null];
|
|
1081
1050
|
const parameterNames = ["order"];
|
|
1082
1051
|
return (tx) => tx.moveCall({
|
|
1083
1052
|
package: packageAddress,
|
|
1084
1053
|
module: "position",
|
|
1085
1054
|
function: "get_order_type_tag",
|
|
1086
|
-
arguments: (0,
|
|
1055
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1087
1056
|
});
|
|
1088
1057
|
}
|
|
1089
1058
|
function getOrderCollateralAmount(options) {
|
|
1090
1059
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1091
|
-
const argumentsTypes = [
|
|
1060
|
+
const argumentsTypes = [null];
|
|
1092
1061
|
const parameterNames = ["order"];
|
|
1093
1062
|
return (tx) => tx.moveCall({
|
|
1094
1063
|
package: packageAddress,
|
|
1095
1064
|
module: "position",
|
|
1096
1065
|
function: "get_order_collateral_amount",
|
|
1097
|
-
arguments: (0,
|
|
1066
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1098
1067
|
typeArguments: options.typeArguments,
|
|
1099
1068
|
});
|
|
1100
1069
|
}
|
|
1101
1070
|
function getOptionCollateralOrderCollateralAmount(options) {
|
|
1102
1071
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1103
|
-
const argumentsTypes = [
|
|
1104
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1105
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1106
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1107
|
-
`${packageAddress}::position::TradingOrder`,
|
|
1108
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1109
|
-
];
|
|
1072
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock"];
|
|
1110
1073
|
const parameterNames = ["dovRegistry", "typusOracleTradingSymbol", "typusOracleCToken", "order"];
|
|
1111
1074
|
return (tx) => tx.moveCall({
|
|
1112
1075
|
package: packageAddress,
|
|
1113
1076
|
module: "position",
|
|
1114
1077
|
function: "get_option_collateral_order_collateral_amount",
|
|
1115
|
-
arguments: (0,
|
|
1078
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1116
1079
|
typeArguments: options.typeArguments,
|
|
1117
1080
|
});
|
|
1118
1081
|
}
|
|
1119
|
-
function
|
|
1082
|
+
function calculateTradingFee(options) {
|
|
1120
1083
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1121
|
-
const argumentsTypes = [
|
|
1084
|
+
const argumentsTypes = ["u64", "u64", "u64", "u64", "u64", "u64", "u64", "u64"];
|
|
1122
1085
|
const parameterNames = [
|
|
1123
|
-
"
|
|
1086
|
+
"size",
|
|
1087
|
+
"sizeDecimal",
|
|
1124
1088
|
"collateralOraclePrice",
|
|
1125
1089
|
"collateralOraclePriceDecimal",
|
|
1126
1090
|
"tradingPairOraclePrice",
|
|
1127
1091
|
"tradingPairOraclePriceDecimal",
|
|
1128
1092
|
"tradingFeeMbp",
|
|
1093
|
+
"collateralTokenDecimal",
|
|
1129
1094
|
];
|
|
1130
1095
|
return (tx) => tx.moveCall({
|
|
1131
1096
|
package: packageAddress,
|
|
1132
1097
|
module: "position",
|
|
1133
|
-
function: "
|
|
1134
|
-
arguments: (0,
|
|
1098
|
+
function: "calculate_trading_fee",
|
|
1099
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1135
1100
|
});
|
|
1136
1101
|
}
|
|
1137
1102
|
function splitBidReceipt(options) {
|
|
1138
1103
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1139
|
-
const argumentsTypes = [
|
|
1140
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1141
|
-
`${packageAddress}::position::Position`,
|
|
1142
|
-
"u64",
|
|
1143
|
-
];
|
|
1104
|
+
const argumentsTypes = [null, null, "u64"];
|
|
1144
1105
|
const parameterNames = ["dovRegistry", "position", "size"];
|
|
1145
1106
|
return (tx) => tx.moveCall({
|
|
1146
1107
|
package: packageAddress,
|
|
1147
1108
|
module: "position",
|
|
1148
1109
|
function: "split_bid_receipt",
|
|
1149
|
-
arguments: (0,
|
|
1110
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1150
1111
|
});
|
|
1151
1112
|
}
|
|
1152
1113
|
function isOptionCollateralPosition(options) {
|
|
1153
1114
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1154
|
-
const argumentsTypes = [
|
|
1115
|
+
const argumentsTypes = [null];
|
|
1155
1116
|
const parameterNames = ["position"];
|
|
1156
1117
|
return (tx) => tx.moveCall({
|
|
1157
1118
|
package: packageAddress,
|
|
1158
1119
|
module: "position",
|
|
1159
1120
|
function: "is_option_collateral_position",
|
|
1160
|
-
arguments: (0,
|
|
1121
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1161
1122
|
});
|
|
1162
1123
|
}
|
|
1163
1124
|
function emitRealizedFundingEvent(options) {
|
|
1164
1125
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1165
|
-
const argumentsTypes = [
|
|
1166
|
-
"address",
|
|
1167
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName",
|
|
1168
|
-
`${packageAddress}::symbol::Symbol`,
|
|
1169
|
-
"u64",
|
|
1170
|
-
"bool",
|
|
1171
|
-
"u64",
|
|
1172
|
-
"u64",
|
|
1173
|
-
"vector<u64>",
|
|
1174
|
-
];
|
|
1126
|
+
const argumentsTypes = ["address", null, null, "u64", "bool", "u64", "u64", "vector<u64>"];
|
|
1175
1127
|
const parameterNames = [
|
|
1176
1128
|
"user",
|
|
1177
1129
|
"collateralToken",
|
|
@@ -1186,200 +1138,207 @@ function emitRealizedFundingEvent(options) {
|
|
|
1186
1138
|
package: packageAddress,
|
|
1187
1139
|
module: "position",
|
|
1188
1140
|
function: "emit_realized_funding_event",
|
|
1189
|
-
arguments: (0,
|
|
1141
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
function checkPositionUpdateTimestamp(options) {
|
|
1145
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1146
|
+
const argumentsTypes = [null, "0x2::clock::Clock", "u64"];
|
|
1147
|
+
const parameterNames = ["position", "thresholdTsMs"];
|
|
1148
|
+
return (tx) => tx.moveCall({
|
|
1149
|
+
package: packageAddress,
|
|
1150
|
+
module: "position",
|
|
1151
|
+
function: "check_position_update_timestamp",
|
|
1152
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
function checkPositionUpdateTimestamp_(options) {
|
|
1156
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
1157
|
+
const argumentsTypes = [null, "0x2::clock::Clock", "u64"];
|
|
1158
|
+
const parameterNames = ["position", "thresholdTsMs"];
|
|
1159
|
+
return (tx) => tx.moveCall({
|
|
1160
|
+
package: packageAddress,
|
|
1161
|
+
module: "position",
|
|
1162
|
+
function: "check_position_update_timestamp_",
|
|
1163
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1190
1164
|
});
|
|
1191
1165
|
}
|
|
1192
1166
|
function getPositionId(options) {
|
|
1193
1167
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1194
|
-
const argumentsTypes = [
|
|
1168
|
+
const argumentsTypes = [null];
|
|
1195
1169
|
const parameterNames = ["position"];
|
|
1196
1170
|
return (tx) => tx.moveCall({
|
|
1197
1171
|
package: packageAddress,
|
|
1198
1172
|
module: "position",
|
|
1199
1173
|
function: "get_position_id",
|
|
1200
|
-
arguments: (0,
|
|
1174
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1201
1175
|
});
|
|
1202
1176
|
}
|
|
1203
1177
|
function getPositionSize(options) {
|
|
1204
1178
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1205
|
-
const argumentsTypes = [
|
|
1179
|
+
const argumentsTypes = [null];
|
|
1206
1180
|
const parameterNames = ["position"];
|
|
1207
1181
|
return (tx) => tx.moveCall({
|
|
1208
1182
|
package: packageAddress,
|
|
1209
1183
|
module: "position",
|
|
1210
1184
|
function: "get_position_size",
|
|
1211
|
-
arguments: (0,
|
|
1185
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1212
1186
|
});
|
|
1213
1187
|
}
|
|
1214
1188
|
function getPositionSide(options) {
|
|
1215
1189
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1216
|
-
const argumentsTypes = [
|
|
1190
|
+
const argumentsTypes = [null];
|
|
1217
1191
|
const parameterNames = ["position"];
|
|
1218
1192
|
return (tx) => tx.moveCall({
|
|
1219
1193
|
package: packageAddress,
|
|
1220
1194
|
module: "position",
|
|
1221
1195
|
function: "get_position_side",
|
|
1222
|
-
arguments: (0,
|
|
1196
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1223
1197
|
});
|
|
1224
1198
|
}
|
|
1225
1199
|
function getPositionUser(options) {
|
|
1226
1200
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1227
|
-
const argumentsTypes = [
|
|
1201
|
+
const argumentsTypes = [null];
|
|
1228
1202
|
const parameterNames = ["position"];
|
|
1229
1203
|
return (tx) => tx.moveCall({
|
|
1230
1204
|
package: packageAddress,
|
|
1231
1205
|
module: "position",
|
|
1232
1206
|
function: "get_position_user",
|
|
1233
|
-
arguments: (0,
|
|
1207
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1234
1208
|
});
|
|
1235
1209
|
}
|
|
1236
1210
|
function getPositionSymbol(options) {
|
|
1237
1211
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1238
|
-
const argumentsTypes = [
|
|
1212
|
+
const argumentsTypes = [null];
|
|
1239
1213
|
const parameterNames = ["position"];
|
|
1240
1214
|
return (tx) => tx.moveCall({
|
|
1241
1215
|
package: packageAddress,
|
|
1242
1216
|
module: "position",
|
|
1243
1217
|
function: "get_position_symbol",
|
|
1244
|
-
arguments: (0,
|
|
1218
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1245
1219
|
});
|
|
1246
1220
|
}
|
|
1247
1221
|
function getPositionOptionCollateralInfo(options) {
|
|
1248
1222
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1249
|
-
const argumentsTypes = [
|
|
1223
|
+
const argumentsTypes = [null];
|
|
1250
1224
|
const parameterNames = ["position"];
|
|
1251
1225
|
return (tx) => tx.moveCall({
|
|
1252
1226
|
package: packageAddress,
|
|
1253
1227
|
module: "position",
|
|
1254
1228
|
function: "get_position_option_collateral_info",
|
|
1255
|
-
arguments: (0,
|
|
1229
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1256
1230
|
});
|
|
1257
1231
|
}
|
|
1258
1232
|
function getReserveAmount(options) {
|
|
1259
1233
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1260
|
-
const argumentsTypes = [
|
|
1234
|
+
const argumentsTypes = [null];
|
|
1261
1235
|
const parameterNames = ["position"];
|
|
1262
1236
|
return (tx) => tx.moveCall({
|
|
1263
1237
|
package: packageAddress,
|
|
1264
1238
|
module: "position",
|
|
1265
1239
|
function: "get_reserve_amount",
|
|
1266
|
-
arguments: (0,
|
|
1240
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1267
1241
|
});
|
|
1268
1242
|
}
|
|
1269
1243
|
function getPositionSizeDecimal(options) {
|
|
1270
1244
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1271
|
-
const argumentsTypes = [
|
|
1245
|
+
const argumentsTypes = [null];
|
|
1272
1246
|
const parameterNames = ["position"];
|
|
1273
1247
|
return (tx) => tx.moveCall({
|
|
1274
1248
|
package: packageAddress,
|
|
1275
1249
|
module: "position",
|
|
1276
1250
|
function: "get_position_size_decimal",
|
|
1277
|
-
arguments: (0,
|
|
1251
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1278
1252
|
});
|
|
1279
1253
|
}
|
|
1280
1254
|
function getPositionCollateralTokenDecimal(options) {
|
|
1281
1255
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1282
|
-
const argumentsTypes = [
|
|
1256
|
+
const argumentsTypes = [null];
|
|
1283
1257
|
const parameterNames = ["position"];
|
|
1284
1258
|
return (tx) => tx.moveCall({
|
|
1285
1259
|
package: packageAddress,
|
|
1286
1260
|
module: "position",
|
|
1287
1261
|
function: "get_position_collateral_token_decimal",
|
|
1288
|
-
arguments: (0,
|
|
1262
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1289
1263
|
});
|
|
1290
1264
|
}
|
|
1291
1265
|
function calculateUnrealizedCost(options) {
|
|
1292
1266
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1293
|
-
const argumentsTypes = [
|
|
1267
|
+
const argumentsTypes = [null];
|
|
1294
1268
|
const parameterNames = ["position"];
|
|
1295
1269
|
return (tx) => tx.moveCall({
|
|
1296
1270
|
package: packageAddress,
|
|
1297
1271
|
module: "position",
|
|
1298
1272
|
function: "calculate_unrealized_cost",
|
|
1299
|
-
arguments: (0,
|
|
1273
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1300
1274
|
});
|
|
1301
1275
|
}
|
|
1302
1276
|
function getPositionLinkedOrderIds(options) {
|
|
1303
1277
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1304
|
-
const argumentsTypes = [
|
|
1278
|
+
const argumentsTypes = [null];
|
|
1305
1279
|
const parameterNames = ["position"];
|
|
1306
1280
|
return (tx) => tx.moveCall({
|
|
1307
1281
|
package: packageAddress,
|
|
1308
1282
|
module: "position",
|
|
1309
1283
|
function: "get_position_linked_order_ids",
|
|
1310
|
-
arguments: (0,
|
|
1284
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1311
1285
|
});
|
|
1312
1286
|
}
|
|
1313
1287
|
function getPositionCollateralTokenType(options) {
|
|
1314
1288
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1315
|
-
const argumentsTypes = [
|
|
1289
|
+
const argumentsTypes = [null];
|
|
1316
1290
|
const parameterNames = ["position"];
|
|
1317
1291
|
return (tx) => tx.moveCall({
|
|
1318
1292
|
package: packageAddress,
|
|
1319
1293
|
module: "position",
|
|
1320
1294
|
function: "get_position_collateral_token_type",
|
|
1321
|
-
arguments: (0,
|
|
1295
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1322
1296
|
});
|
|
1323
1297
|
}
|
|
1324
1298
|
function getPositionCollateralAmount(options) {
|
|
1325
1299
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1326
|
-
const argumentsTypes = [
|
|
1300
|
+
const argumentsTypes = [null];
|
|
1327
1301
|
const parameterNames = ["position"];
|
|
1328
1302
|
return (tx) => tx.moveCall({
|
|
1329
1303
|
package: packageAddress,
|
|
1330
1304
|
module: "position",
|
|
1331
1305
|
function: "get_position_collateral_amount",
|
|
1332
|
-
arguments: (0,
|
|
1306
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1333
1307
|
typeArguments: options.typeArguments,
|
|
1334
1308
|
});
|
|
1335
1309
|
}
|
|
1336
1310
|
function getOptionPositionCollateralAmount(options) {
|
|
1337
1311
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1338
|
-
const argumentsTypes = [
|
|
1339
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1340
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1341
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1342
|
-
`${packageAddress}::position::Position`,
|
|
1343
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1344
|
-
];
|
|
1312
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock"];
|
|
1345
1313
|
const parameterNames = ["dovRegistry", "typusOracleTradingSymbol", "typusOracleCToken", "position"];
|
|
1346
1314
|
return (tx) => tx.moveCall({
|
|
1347
1315
|
package: packageAddress,
|
|
1348
1316
|
module: "position",
|
|
1349
1317
|
function: "get_option_position_collateral_amount",
|
|
1350
|
-
arguments: (0,
|
|
1318
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1351
1319
|
typeArguments: options.typeArguments,
|
|
1352
1320
|
});
|
|
1353
1321
|
}
|
|
1354
1322
|
function optionPositionBidReceiptsExpired(options) {
|
|
1355
1323
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1356
|
-
const argumentsTypes = [
|
|
1357
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1358
|
-
`${packageAddress}::position::Position`,
|
|
1359
|
-
];
|
|
1324
|
+
const argumentsTypes = [null, null];
|
|
1360
1325
|
const parameterNames = ["dovRegistry", "position"];
|
|
1361
1326
|
return (tx) => tx.moveCall({
|
|
1362
1327
|
package: packageAddress,
|
|
1363
1328
|
module: "position",
|
|
1364
1329
|
function: "option_position_bid_receipts_expired",
|
|
1365
|
-
arguments: (0,
|
|
1330
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1366
1331
|
});
|
|
1367
1332
|
}
|
|
1368
1333
|
function getOptionPositionExerciseValue(options) {
|
|
1369
1334
|
const packageAddress = options.package ?? "@typus/perp";
|
|
1370
|
-
const argumentsTypes = [
|
|
1371
|
-
"0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::typus_dov_single::Registry",
|
|
1372
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1373
|
-
"0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle",
|
|
1374
|
-
`${packageAddress}::position::Position`,
|
|
1375
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
1376
|
-
];
|
|
1335
|
+
const argumentsTypes = [null, null, null, null, "0x2::clock::Clock"];
|
|
1377
1336
|
const parameterNames = ["dovRegistry", "typusOracleTradingSymbol", "typusOracleCToken", "position"];
|
|
1378
1337
|
return (tx) => tx.moveCall({
|
|
1379
1338
|
package: packageAddress,
|
|
1380
1339
|
module: "position",
|
|
1381
1340
|
function: "get_option_position_exercise_value",
|
|
1382
|
-
arguments: (0,
|
|
1341
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
1383
1342
|
typeArguments: options.typeArguments,
|
|
1384
1343
|
});
|
|
1385
1344
|
}
|