@typus/typus-perp-sdk 1.2.2 → 1.3.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.
Files changed (71) hide show
  1. package/dist/src/client.d.ts +22 -3
  2. package/dist/src/client.js +66 -8
  3. package/dist/src/fetch.d.ts +61 -17
  4. package/dist/src/fetch.js +20 -14
  5. package/dist/src/generated/typus_perp/admin.d.ts +65 -21
  6. package/dist/src/generated/typus_perp/admin.js +139 -123
  7. package/dist/src/generated/typus_perp/competition.d.ts +5 -17
  8. package/dist/src/generated/typus_perp/competition.js +63 -39
  9. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +9 -9
  10. package/dist/src/generated/typus_perp/deps/std/type_name.js +13 -16
  11. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +2 -2
  12. package/dist/src/generated/typus_perp/deps/sui/balance.js +5 -8
  13. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
  14. package/dist/src/generated/typus_perp/deps/sui/object.js +13 -0
  15. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +5 -3
  16. package/dist/src/generated/typus_perp/deps/sui/object_table.js +40 -9
  17. package/dist/src/generated/typus_perp/deps/sui/table.d.ts +5 -3
  18. package/dist/src/generated/typus_perp/deps/sui/table.js +40 -9
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +5 -3
  20. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +5 -8
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +4 -2
  22. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +9 -12
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +12 -6
  24. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +41 -10
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +4 -2
  26. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +40 -9
  27. package/dist/src/generated/typus_perp/error.d.ts +201 -94
  28. package/dist/src/generated/typus_perp/error.js +300 -273
  29. package/dist/src/generated/typus_perp/escrow.d.ts +14 -6
  30. package/dist/src/generated/typus_perp/escrow.js +38 -37
  31. package/dist/src/generated/typus_perp/lending.d.ts +1 -1
  32. package/dist/src/generated/typus_perp/lending.js +3 -3
  33. package/dist/src/generated/typus_perp/lp_pool.d.ts +438 -392
  34. package/dist/src/generated/typus_perp/lp_pool.js +987 -934
  35. package/dist/src/generated/typus_perp/math.d.ts +13 -16
  36. package/dist/src/generated/typus_perp/math.js +51 -50
  37. package/dist/src/generated/typus_perp/position.d.ts +194 -104
  38. package/dist/src/generated/typus_perp/position.js +714 -731
  39. package/dist/src/generated/typus_perp/profit_vault.d.ts +62 -20
  40. package/dist/src/generated/typus_perp/profit_vault.js +162 -148
  41. package/dist/src/generated/typus_perp/symbol.d.ts +12 -5
  42. package/dist/src/generated/typus_perp/symbol.js +28 -25
  43. package/dist/src/generated/typus_perp/trading.d.ts +955 -133
  44. package/dist/src/generated/typus_perp/trading.js +1575 -1146
  45. package/dist/src/generated/typus_perp/treasury_caps.d.ts +16 -7
  46. package/dist/src/generated/typus_perp/treasury_caps.js +60 -24
  47. package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
  48. package/dist/src/generated/typus_perp/user_account.js +66 -0
  49. package/dist/src/generated/typus_stake_pool/admin.d.ts +144 -10
  50. package/dist/src/generated/typus_stake_pool/admin.js +132 -49
  51. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +9 -9
  52. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +13 -16
  53. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
  54. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +13 -0
  55. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +36 -0
  56. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +31 -0
  57. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +5 -3
  58. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +5 -8
  59. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +180 -79
  60. package/dist/src/generated/typus_stake_pool/stake_pool.js +446 -414
  61. package/dist/src/generated/utils/index.d.ts +4 -23
  62. package/dist/src/generated/utils/index.js +34 -54
  63. package/dist/src/index.d.ts +5 -0
  64. package/dist/src/index.js +35 -13
  65. package/dist/src/user/order.d.ts +0 -4
  66. package/dist/src/user/order.js +31 -74
  67. package/dist/src/user/orderWithBidReceipt.d.ts +0 -3
  68. package/dist/src/user/orderWithBidReceipt.js +24 -45
  69. package/dist/src/user/tlp.d.ts +0 -5
  70. package/dist/src/user/tlp.js +28 -73
  71. package/package.json +47 -40
@@ -48,7 +48,6 @@ exports.notOptionCollateralOrder = notOptionCollateralOrder;
48
48
  exports.notOptionCollateralPosition = notOptionCollateralPosition;
49
49
  exports.notTokenCollateralPosition = notTokenCollateralPosition;
50
50
  exports.tooManyLinkedOrders = tooManyLinkedOrders;
51
- exports.positionCoolDownThreshold = positionCoolDownThreshold;
52
51
  exports.tradingSymbolExisted = tradingSymbolExisted;
53
52
  exports.tradingSymbolNotExisted = tradingSymbolNotExisted;
54
53
  exports.marketsInactive = marketsInactive;
@@ -92,715 +91,743 @@ exports.invalidBoostBpArrayLength = invalidBoostBpArrayLength;
92
91
  exports.invalidIdx = invalidIdx;
93
92
  exports.whitelistAlreadyExisted = whitelistAlreadyExisted;
94
93
  exports.whitelistNotExisted = whitelistNotExisted;
94
+ exports.invalidReferralCode = invalidReferralCode;
95
+ exports.referralCodeAlreadySet = referralCodeAlreadySet;
96
+ exports.invalidUser = invalidUser;
97
+ exports.deprecated = deprecated;
95
98
  function poolInactive(options = {}) {
96
- const packageAddress = options.package ?? "@typus/perp";
99
+ const packageAddress = options.package ?? '@typus/perp';
97
100
  return (tx) => tx.moveCall({
98
101
  package: packageAddress,
99
- module: "error",
100
- function: "pool_inactive",
102
+ module: 'error',
103
+ function: 'pool_inactive',
101
104
  });
102
105
  }
103
106
  function poolAlreadyActive(options = {}) {
104
- const packageAddress = options.package ?? "@typus/perp";
107
+ const packageAddress = options.package ?? '@typus/perp';
105
108
  return (tx) => tx.moveCall({
106
109
  package: packageAddress,
107
- module: "error",
108
- function: "pool_already_active",
110
+ module: 'error',
111
+ function: 'pool_already_active',
109
112
  });
110
113
  }
111
114
  function tokenPoolInactive(options = {}) {
112
- const packageAddress = options.package ?? "@typus/perp";
115
+ const packageAddress = options.package ?? '@typus/perp';
113
116
  return (tx) => tx.moveCall({
114
117
  package: packageAddress,
115
- module: "error",
116
- function: "token_pool_inactive",
118
+ module: 'error',
119
+ function: 'token_pool_inactive',
117
120
  });
118
121
  }
119
122
  function tokenPoolAlreadyActive(options = {}) {
120
- const packageAddress = options.package ?? "@typus/perp";
123
+ const packageAddress = options.package ?? '@typus/perp';
121
124
  return (tx) => tx.moveCall({
122
125
  package: packageAddress,
123
- module: "error",
124
- function: "token_pool_already_active",
126
+ module: 'error',
127
+ function: 'token_pool_already_active',
125
128
  });
126
129
  }
127
130
  function lpTokenTypeMismatched(options = {}) {
128
- const packageAddress = options.package ?? "@typus/perp";
131
+ const packageAddress = options.package ?? '@typus/perp';
129
132
  return (tx) => tx.moveCall({
130
133
  package: packageAddress,
131
- module: "error",
132
- function: "lp_token_type_mismatched",
134
+ module: 'error',
135
+ function: 'lp_token_type_mismatched',
133
136
  });
134
137
  }
135
138
  function liquidityTokenNotExisted(options = {}) {
136
- const packageAddress = options.package ?? "@typus/perp";
139
+ const packageAddress = options.package ?? '@typus/perp';
137
140
  return (tx) => tx.moveCall({
138
141
  package: packageAddress,
139
- module: "error",
140
- function: "liquidity_token_not_existed",
142
+ module: 'error',
143
+ function: 'liquidity_token_not_existed',
141
144
  });
142
145
  }
143
146
  function depositAmountInsufficient(options = {}) {
144
- const packageAddress = options.package ?? "@typus/perp";
147
+ const packageAddress = options.package ?? '@typus/perp';
145
148
  return (tx) => tx.moveCall({
146
149
  package: packageAddress,
147
- module: "error",
148
- function: "deposit_amount_insufficient",
150
+ module: 'error',
151
+ function: 'deposit_amount_insufficient',
149
152
  });
150
153
  }
151
154
  function oracleMismatched(options = {}) {
152
- const packageAddress = options.package ?? "@typus/perp";
155
+ const packageAddress = options.package ?? '@typus/perp';
153
156
  return (tx) => tx.moveCall({
154
157
  package: packageAddress,
155
- module: "error",
156
- function: "oracle_mismatched",
158
+ module: 'error',
159
+ function: 'oracle_mismatched',
157
160
  });
158
161
  }
159
162
  function insufficientAmountForMintFee(options = {}) {
160
- const packageAddress = options.package ?? "@typus/perp";
163
+ const packageAddress = options.package ?? '@typus/perp';
161
164
  return (tx) => tx.moveCall({
162
165
  package: packageAddress,
163
- module: "error",
164
- function: "insufficient_amount_for_mint_fee",
166
+ module: 'error',
167
+ function: 'insufficient_amount_for_mint_fee',
165
168
  });
166
169
  }
167
170
  function zeroTotalSupply(options = {}) {
168
- const packageAddress = options.package ?? "@typus/perp";
171
+ const packageAddress = options.package ?? '@typus/perp';
169
172
  return (tx) => tx.moveCall({
170
173
  package: packageAddress,
171
- module: "error",
172
- function: "zero_total_supply",
174
+ module: 'error',
175
+ function: 'zero_total_supply',
173
176
  });
174
177
  }
175
178
  function tvlNotYetUpdated(options = {}) {
176
- const packageAddress = options.package ?? "@typus/perp";
179
+ const packageAddress = options.package ?? '@typus/perp';
177
180
  return (tx) => tx.moveCall({
178
181
  package: packageAddress,
179
- module: "error",
180
- function: "tvl_not_yet_updated",
182
+ module: 'error',
183
+ function: 'tvl_not_yet_updated',
181
184
  });
182
185
  }
183
186
  function liquidityNotEnough(options = {}) {
184
- const packageAddress = options.package ?? "@typus/perp";
187
+ const packageAddress = options.package ?? '@typus/perp';
185
188
  return (tx) => tx.moveCall({
186
189
  package: packageAddress,
187
- module: "error",
188
- function: "liquidity_not_enough",
190
+ module: 'error',
191
+ function: 'liquidity_not_enough',
189
192
  });
190
193
  }
191
194
  function reachMaxCapacity(options = {}) {
192
- const packageAddress = options.package ?? "@typus/perp";
195
+ const packageAddress = options.package ?? '@typus/perp';
193
196
  return (tx) => tx.moveCall({
194
197
  package: packageAddress,
195
- module: "error",
196
- function: "reach_max_capacity",
198
+ module: 'error',
199
+ function: 'reach_max_capacity',
197
200
  });
198
201
  }
199
202
  function reachSlippageThreshold(options = {}) {
200
- const packageAddress = options.package ?? "@typus/perp";
203
+ const packageAddress = options.package ?? '@typus/perp';
201
204
  return (tx) => tx.moveCall({
202
205
  package: packageAddress,
203
- module: "error",
204
- function: "reach_slippage_threshold",
206
+ module: 'error',
207
+ function: 'reach_slippage_threshold',
205
208
  });
206
209
  }
207
210
  function frictionTooLarge(options = {}) {
208
- const packageAddress = options.package ?? "@typus/perp";
211
+ const packageAddress = options.package ?? '@typus/perp';
209
212
  return (tx) => tx.moveCall({
210
213
  package: packageAddress,
211
- module: "error",
212
- function: "friction_too_large",
214
+ module: 'error',
215
+ function: 'friction_too_large',
213
216
  });
214
217
  }
215
218
  function invalidTokenType(options = {}) {
216
- const packageAddress = options.package ?? "@typus/perp";
219
+ const packageAddress = options.package ?? '@typus/perp';
217
220
  return (tx) => tx.moveCall({
218
221
  package: packageAddress,
219
- module: "error",
220
- function: "invalid_token_type",
222
+ module: 'error',
223
+ function: 'invalid_token_type',
221
224
  });
222
225
  }
223
226
  function deactivatingSharesAlreadyExisted(options = {}) {
224
- const packageAddress = options.package ?? "@typus/perp";
227
+ const packageAddress = options.package ?? '@typus/perp';
225
228
  return (tx) => tx.moveCall({
226
229
  package: packageAddress,
227
- module: "error",
228
- function: "deactivating_shares_already_existed",
230
+ module: 'error',
231
+ function: 'deactivating_shares_already_existed',
229
232
  });
230
233
  }
231
234
  function userDeactivatingSharesNotExisted(options = {}) {
232
- const packageAddress = options.package ?? "@typus/perp";
235
+ const packageAddress = options.package ?? '@typus/perp';
233
236
  return (tx) => tx.moveCall({
234
237
  package: packageAddress,
235
- module: "error",
236
- function: "user_deactivating_shares_not_existed",
238
+ module: 'error',
239
+ function: 'user_deactivating_shares_not_existed',
237
240
  });
238
241
  }
239
242
  function liquidityTokenExisted(options = {}) {
240
- const packageAddress = options.package ?? "@typus/perp";
243
+ const packageAddress = options.package ?? '@typus/perp';
241
244
  return (tx) => tx.moveCall({
242
245
  package: packageAddress,
243
- module: "error",
244
- function: "liquidity_token_existed",
246
+ module: 'error',
247
+ function: 'liquidity_token_existed',
245
248
  });
246
249
  }
247
250
  function invalidConfigRange(options = {}) {
248
- const packageAddress = options.package ?? "@typus/perp";
251
+ const packageAddress = options.package ?? '@typus/perp';
249
252
  return (tx) => tx.moveCall({
250
253
  package: packageAddress,
251
- module: "error",
252
- function: "invalid_config_range",
254
+ module: 'error',
255
+ function: 'invalid_config_range',
253
256
  });
254
257
  }
255
258
  function poolIndexMismatched(options = {}) {
256
- const packageAddress = options.package ?? "@typus/perp";
259
+ const packageAddress = options.package ?? '@typus/perp';
257
260
  return (tx) => tx.moveCall({
258
261
  package: packageAddress,
259
- module: "error",
260
- function: "pool_index_mismatched",
262
+ module: 'error',
263
+ function: 'pool_index_mismatched',
261
264
  });
262
265
  }
263
266
  function reserveBookkeepingError(options = {}) {
264
- const packageAddress = options.package ?? "@typus/perp";
267
+ const packageAddress = options.package ?? '@typus/perp';
265
268
  return (tx) => tx.moveCall({
266
269
  package: packageAddress,
267
- module: "error",
268
- function: "reserve_bookkeeping_error",
270
+ module: 'error',
271
+ function: 'reserve_bookkeeping_error',
269
272
  });
270
273
  }
271
274
  function rebalanceProcessFieldMismatched(options = {}) {
272
- const packageAddress = options.package ?? "@typus/perp";
275
+ const packageAddress = options.package ?? '@typus/perp';
273
276
  return (tx) => tx.moveCall({
274
277
  package: packageAddress,
275
- module: "error",
276
- function: "rebalance_process_field_mismatched",
278
+ module: 'error',
279
+ function: 'rebalance_process_field_mismatched',
277
280
  });
278
281
  }
279
282
  function exceedRebalanceCostThreshold(options = {}) {
280
- const packageAddress = options.package ?? "@typus/perp";
283
+ const packageAddress = options.package ?? '@typus/perp';
281
284
  return (tx) => tx.moveCall({
282
285
  package: packageAddress,
283
- module: "error",
284
- function: "exceed_rebalance_cost_threshold",
286
+ module: 'error',
287
+ function: 'exceed_rebalance_cost_threshold',
285
288
  });
286
289
  }
287
290
  function processShouldRemovePosition(options = {}) {
288
- const packageAddress = options.package ?? "@typus/perp";
291
+ const packageAddress = options.package ?? '@typus/perp';
289
292
  return (tx) => tx.moveCall({
290
293
  package: packageAddress,
291
- module: "error",
292
- function: "process_should_remove_position",
294
+ module: 'error',
295
+ function: 'process_should_remove_position',
293
296
  });
294
297
  }
295
298
  function processShouldRemoveOrder(options = {}) {
296
- const packageAddress = options.package ?? "@typus/perp";
299
+ const packageAddress = options.package ?? '@typus/perp';
297
300
  return (tx) => tx.moveCall({
298
301
  package: packageAddress,
299
- module: "error",
300
- function: "process_should_remove_order",
302
+ module: 'error',
303
+ function: 'process_should_remove_order',
301
304
  });
302
305
  }
303
306
  function processShouldSwap(options = {}) {
304
- const packageAddress = options.package ?? "@typus/perp";
307
+ const packageAddress = options.package ?? '@typus/perp';
305
308
  return (tx) => tx.moveCall({
306
309
  package: packageAddress,
307
- module: "error",
308
- function: "process_should_swap",
310
+ module: 'error',
311
+ function: 'process_should_swap',
309
312
  });
310
313
  }
311
314
  function processShouldRepayLiquidity(options = {}) {
312
- const packageAddress = options.package ?? "@typus/perp";
315
+ const packageAddress = options.package ?? '@typus/perp';
313
316
  return (tx) => tx.moveCall({
314
317
  package: packageAddress,
315
- module: "error",
316
- function: "process_should_repay_liquidity",
318
+ module: 'error',
319
+ function: 'process_should_repay_liquidity',
317
320
  });
318
321
  }
319
322
  function unsupportedProcessStatusCode(options = {}) {
320
- const packageAddress = options.package ?? "@typus/perp";
323
+ const packageAddress = options.package ?? '@typus/perp';
321
324
  return (tx) => tx.moveCall({
322
325
  package: packageAddress,
323
- module: "error",
324
- function: "unsupported_process_status_code",
326
+ module: 'error',
327
+ function: 'unsupported_process_status_code',
325
328
  });
326
329
  }
327
330
  function zeroPrice(options = {}) {
328
- const packageAddress = options.package ?? "@typus/perp";
331
+ const packageAddress = options.package ?? '@typus/perp';
329
332
  return (tx) => tx.moveCall({
330
333
  package: packageAddress,
331
- module: "error",
332
- function: "zero_price",
334
+ module: 'error',
335
+ function: 'zero_price',
333
336
  });
334
337
  }
335
338
  function authorityAlreadyExisted(options = {}) {
336
- const packageAddress = options.package ?? "@typus/perp";
339
+ const packageAddress = options.package ?? '@typus/perp';
337
340
  return (tx) => tx.moveCall({
338
341
  package: packageAddress,
339
- module: "error",
340
- function: "authority_already_existed",
342
+ module: 'error',
343
+ function: 'authority_already_existed',
341
344
  });
342
345
  }
343
346
  function authorityDoestNotExist(options = {}) {
344
- const packageAddress = options.package ?? "@typus/perp";
347
+ const packageAddress = options.package ?? '@typus/perp';
345
348
  return (tx) => tx.moveCall({
346
349
  package: packageAddress,
347
- module: "error",
348
- function: "authority_doest_not_exist",
350
+ module: 'error',
351
+ function: 'authority_doest_not_exist',
349
352
  });
350
353
  }
351
354
  function authorityEmpty(options = {}) {
352
- const packageAddress = options.package ?? "@typus/perp";
355
+ const packageAddress = options.package ?? '@typus/perp';
353
356
  return (tx) => tx.moveCall({
354
357
  package: packageAddress,
355
- module: "error",
356
- function: "authority_empty",
358
+ module: 'error',
359
+ function: 'authority_empty',
357
360
  });
358
361
  }
359
362
  function invalidVersion(options = {}) {
360
- const packageAddress = options.package ?? "@typus/perp";
363
+ const packageAddress = options.package ?? '@typus/perp';
361
364
  return (tx) => tx.moveCall({
362
365
  package: packageAddress,
363
- module: "error",
364
- function: "invalid_version",
366
+ module: 'error',
367
+ function: 'invalid_version',
365
368
  });
366
369
  }
367
370
  function unauthorized(options = {}) {
368
- const packageAddress = options.package ?? "@typus/perp";
371
+ const packageAddress = options.package ?? '@typus/perp';
369
372
  return (tx) => tx.moveCall({
370
373
  package: packageAddress,
371
- module: "error",
372
- function: "unauthorized",
374
+ module: 'error',
375
+ function: 'unauthorized',
373
376
  });
374
377
  }
375
378
  function notReduceOnlyExecution(options = {}) {
376
- const packageAddress = options.package ?? "@typus/perp";
379
+ const packageAddress = options.package ?? '@typus/perp';
377
380
  return (tx) => tx.moveCall({
378
381
  package: packageAddress,
379
- module: "error",
380
- function: "not_reduce_only_execution",
382
+ module: 'error',
383
+ function: 'not_reduce_only_execution',
381
384
  });
382
385
  }
383
386
  function wrongCollateralType(options = {}) {
384
- const packageAddress = options.package ?? "@typus/perp";
387
+ const packageAddress = options.package ?? '@typus/perp';
385
388
  return (tx) => tx.moveCall({
386
389
  package: packageAddress,
387
- module: "error",
388
- function: "wrong_collateral_type",
390
+ module: 'error',
391
+ function: 'wrong_collateral_type',
389
392
  });
390
393
  }
391
394
  function invalidBidReceiptsInput(options = {}) {
392
- const packageAddress = options.package ?? "@typus/perp";
395
+ const packageAddress = options.package ?? '@typus/perp';
393
396
  return (tx) => tx.moveCall({
394
397
  package: packageAddress,
395
- module: "error",
396
- function: "invalid_bid_receipts_input",
398
+ module: 'error',
399
+ function: 'invalid_bid_receipts_input',
397
400
  });
398
401
  }
399
402
  function depositTokenMismatched(options = {}) {
400
- const packageAddress = options.package ?? "@typus/perp";
403
+ const packageAddress = options.package ?? '@typus/perp';
401
404
  return (tx) => tx.moveCall({
402
405
  package: packageAddress,
403
- module: "error",
404
- function: "deposit_token_mismatched",
406
+ module: 'error',
407
+ function: 'deposit_token_mismatched',
405
408
  });
406
409
  }
407
410
  function linkedOrderIdNotExisted(options = {}) {
408
- const packageAddress = options.package ?? "@typus/perp";
411
+ const packageAddress = options.package ?? '@typus/perp';
409
412
  return (tx) => tx.moveCall({
410
413
  package: packageAddress,
411
- module: "error",
412
- function: "linked_order_id_not_existed",
414
+ module: 'error',
415
+ function: 'linked_order_id_not_existed',
413
416
  });
414
417
  }
415
418
  function portfolioIndexMismatched(options = {}) {
416
- const packageAddress = options.package ?? "@typus/perp";
419
+ const packageAddress = options.package ?? '@typus/perp';
417
420
  return (tx) => tx.moveCall({
418
421
  package: packageAddress,
419
- module: "error",
420
- function: "portfolio_index_mismatched",
422
+ module: 'error',
423
+ function: 'portfolio_index_mismatched',
421
424
  });
422
425
  }
423
426
  function notOptionCollateralOrder(options = {}) {
424
- const packageAddress = options.package ?? "@typus/perp";
427
+ const packageAddress = options.package ?? '@typus/perp';
425
428
  return (tx) => tx.moveCall({
426
429
  package: packageAddress,
427
- module: "error",
428
- function: "not_option_collateral_order",
430
+ module: 'error',
431
+ function: 'not_option_collateral_order',
429
432
  });
430
433
  }
431
434
  function notOptionCollateralPosition(options = {}) {
432
- const packageAddress = options.package ?? "@typus/perp";
435
+ const packageAddress = options.package ?? '@typus/perp';
433
436
  return (tx) => tx.moveCall({
434
437
  package: packageAddress,
435
- module: "error",
436
- function: "not_option_collateral_position",
438
+ module: 'error',
439
+ function: 'not_option_collateral_position',
437
440
  });
438
441
  }
439
442
  function notTokenCollateralPosition(options = {}) {
440
- const packageAddress = options.package ?? "@typus/perp";
443
+ const packageAddress = options.package ?? '@typus/perp';
441
444
  return (tx) => tx.moveCall({
442
445
  package: packageAddress,
443
- module: "error",
444
- function: "not_token_collateral_position",
446
+ module: 'error',
447
+ function: 'not_token_collateral_position',
445
448
  });
446
449
  }
447
450
  function tooManyLinkedOrders(options = {}) {
448
- const packageAddress = options.package ?? "@typus/perp";
451
+ const packageAddress = options.package ?? '@typus/perp';
449
452
  return (tx) => tx.moveCall({
450
453
  package: packageAddress,
451
- module: "error",
452
- function: "too_many_linked_orders",
453
- });
454
- }
455
- function positionCoolDownThreshold(options = {}) {
456
- const packageAddress = options.package ?? "@typus/perp";
457
- return (tx) => tx.moveCall({
458
- package: packageAddress,
459
- module: "error",
460
- function: "position_cool_down_threshold",
454
+ module: 'error',
455
+ function: 'too_many_linked_orders',
461
456
  });
462
457
  }
463
458
  function tradingSymbolExisted(options = {}) {
464
- const packageAddress = options.package ?? "@typus/perp";
459
+ const packageAddress = options.package ?? '@typus/perp';
465
460
  return (tx) => tx.moveCall({
466
461
  package: packageAddress,
467
- module: "error",
468
- function: "trading_symbol_existed",
462
+ module: 'error',
463
+ function: 'trading_symbol_existed',
469
464
  });
470
465
  }
471
466
  function tradingSymbolNotExisted(options = {}) {
472
- const packageAddress = options.package ?? "@typus/perp";
467
+ const packageAddress = options.package ?? '@typus/perp';
473
468
  return (tx) => tx.moveCall({
474
469
  package: packageAddress,
475
- module: "error",
476
- function: "trading_symbol_not_existed",
470
+ module: 'error',
471
+ function: 'trading_symbol_not_existed',
477
472
  });
478
473
  }
479
474
  function marketsInactive(options = {}) {
480
- const packageAddress = options.package ?? "@typus/perp";
475
+ const packageAddress = options.package ?? '@typus/perp';
481
476
  return (tx) => tx.moveCall({
482
477
  package: packageAddress,
483
- module: "error",
484
- function: "markets_inactive",
478
+ module: 'error',
479
+ function: 'markets_inactive',
485
480
  });
486
481
  }
487
482
  function tradingSymbolInactive(options = {}) {
488
- const packageAddress = options.package ?? "@typus/perp";
483
+ const packageAddress = options.package ?? '@typus/perp';
489
484
  return (tx) => tx.moveCall({
490
485
  package: packageAddress,
491
- module: "error",
492
- function: "trading_symbol_inactive",
486
+ module: 'error',
487
+ function: 'trading_symbol_inactive',
493
488
  });
494
489
  }
495
490
  function activeTradingSymbol(options = {}) {
496
- const packageAddress = options.package ?? "@typus/perp";
491
+ const packageAddress = options.package ?? '@typus/perp';
497
492
  return (tx) => tx.moveCall({
498
493
  package: packageAddress,
499
- module: "error",
500
- function: "active_trading_symbol",
494
+ module: 'error',
495
+ function: 'active_trading_symbol',
501
496
  });
502
497
  }
503
498
  function orderNotFound(options = {}) {
504
- const packageAddress = options.package ?? "@typus/perp";
499
+ const packageAddress = options.package ?? '@typus/perp';
505
500
  return (tx) => tx.moveCall({
506
501
  package: packageAddress,
507
- module: "error",
508
- function: "order_not_found",
502
+ module: 'error',
503
+ function: 'order_not_found',
509
504
  });
510
505
  }
511
506
  function unsupportedOrderTypeTag(options = {}) {
512
- const packageAddress = options.package ?? "@typus/perp";
507
+ const packageAddress = options.package ?? '@typus/perp';
513
508
  return (tx) => tx.moveCall({
514
509
  package: packageAddress,
515
- module: "error",
516
- function: "unsupported_order_type_tag",
510
+ module: 'error',
511
+ function: 'unsupported_order_type_tag',
517
512
  });
518
513
  }
519
514
  function exceedMaxLeverage(options = {}) {
520
- const packageAddress = options.package ?? "@typus/perp";
515
+ const packageAddress = options.package ?? '@typus/perp';
521
516
  return (tx) => tx.moveCall({
522
517
  package: packageAddress,
523
- module: "error",
524
- function: "exceed_max_leverage",
518
+ module: 'error',
519
+ function: 'exceed_max_leverage',
525
520
  });
526
521
  }
527
522
  function collateralTokenTypeMismatched(options = {}) {
528
- const packageAddress = options.package ?? "@typus/perp";
523
+ const packageAddress = options.package ?? '@typus/perp';
529
524
  return (tx) => tx.moveCall({
530
525
  package: packageAddress,
531
- module: "error",
532
- function: "collateral_token_type_mismatched",
526
+ module: 'error',
527
+ function: 'collateral_token_type_mismatched',
533
528
  });
534
529
  }
535
530
  function bidReceiptHasBeenExpired(options = {}) {
536
- const packageAddress = options.package ?? "@typus/perp";
531
+ const packageAddress = options.package ?? '@typus/perp';
537
532
  return (tx) => tx.moveCall({
538
533
  package: packageAddress,
539
- module: "error",
540
- function: "bid_receipt_has_been_expired",
534
+ module: 'error',
535
+ function: 'bid_receipt_has_been_expired',
541
536
  });
542
537
  }
543
538
  function bidReceiptNotExpired(options = {}) {
544
- const packageAddress = options.package ?? "@typus/perp";
539
+ const packageAddress = options.package ?? '@typus/perp';
545
540
  return (tx) => tx.moveCall({
546
541
  package: packageAddress,
547
- module: "error",
548
- function: "bid_receipt_not_expired",
542
+ module: 'error',
543
+ function: 'bid_receipt_not_expired',
549
544
  });
550
545
  }
551
546
  function bidReceiptNotItm(options = {}) {
552
- const packageAddress = options.package ?? "@typus/perp";
547
+ const packageAddress = options.package ?? '@typus/perp';
553
548
  return (tx) => tx.moveCall({
554
549
  package: packageAddress,
555
- module: "error",
556
- function: "bid_receipt_not_itm",
550
+ module: 'error',
551
+ function: 'bid_receipt_not_itm',
557
552
  });
558
553
  }
559
554
  function invalidOrderSide(options = {}) {
560
- const packageAddress = options.package ?? "@typus/perp";
555
+ const packageAddress = options.package ?? '@typus/perp';
561
556
  return (tx) => tx.moveCall({
562
557
  package: packageAddress,
563
- module: "error",
564
- function: "invalid_order_side",
558
+ module: 'error',
559
+ function: 'invalid_order_side',
565
560
  });
566
561
  }
567
562
  function invalidOrderSize(options = {}) {
568
- const packageAddress = options.package ?? "@typus/perp";
563
+ const packageAddress = options.package ?? '@typus/perp';
569
564
  return (tx) => tx.moveCall({
570
565
  package: packageAddress,
571
- module: "error",
572
- function: "invalid_order_size",
566
+ module: 'error',
567
+ function: 'invalid_order_size',
573
568
  });
574
569
  }
575
570
  function addSizeNotAllowed(options = {}) {
576
- const packageAddress = options.package ?? "@typus/perp";
571
+ const packageAddress = options.package ?? '@typus/perp';
577
572
  return (tx) => tx.moveCall({
578
573
  package: packageAddress,
579
- module: "error",
580
- function: "add_size_not_allowed",
574
+ module: 'error',
575
+ function: 'add_size_not_allowed',
581
576
  });
582
577
  }
583
578
  function baseTokenMismatched(options = {}) {
584
- const packageAddress = options.package ?? "@typus/perp";
579
+ const packageAddress = options.package ?? '@typus/perp';
585
580
  return (tx) => tx.moveCall({
586
581
  package: packageAddress,
587
- module: "error",
588
- function: "base_token_mismatched",
582
+ module: 'error',
583
+ function: 'base_token_mismatched',
589
584
  });
590
585
  }
591
586
  function userMismatched(options = {}) {
592
- const packageAddress = options.package ?? "@typus/perp";
587
+ const packageAddress = options.package ?? '@typus/perp';
593
588
  return (tx) => tx.moveCall({
594
589
  package: packageAddress,
595
- module: "error",
596
- function: "user_mismatched",
590
+ module: 'error',
591
+ function: 'user_mismatched',
597
592
  });
598
593
  }
599
594
  function tokenCollateralNotEnough(options = {}) {
600
- const packageAddress = options.package ?? "@typus/perp";
595
+ const packageAddress = options.package ?? '@typus/perp';
601
596
  return (tx) => tx.moveCall({
602
597
  package: packageAddress,
603
- module: "error",
604
- function: "token_collateral_not_enough",
598
+ module: 'error',
599
+ function: 'token_collateral_not_enough',
605
600
  });
606
601
  }
607
602
  function optionCollateralNotEnough(options = {}) {
608
- const packageAddress = options.package ?? "@typus/perp";
603
+ const packageAddress = options.package ?? '@typus/perp';
609
604
  return (tx) => tx.moveCall({
610
605
  package: packageAddress,
611
- module: "error",
612
- function: "option_collateral_not_enough",
606
+ module: 'error',
607
+ function: 'option_collateral_not_enough',
613
608
  });
614
609
  }
615
610
  function remainingCollateralNotEnough(options = {}) {
616
- const packageAddress = options.package ?? "@typus/perp";
611
+ const packageAddress = options.package ?? '@typus/perp';
617
612
  return (tx) => tx.moveCall({
618
613
  package: packageAddress,
619
- module: "error",
620
- function: "remaining_collateral_not_enough",
614
+ module: 'error',
615
+ function: 'remaining_collateral_not_enough',
621
616
  });
622
617
  }
623
618
  function reachMaxSingleOrderReserveUsage(options = {}) {
624
- const packageAddress = options.package ?? "@typus/perp";
619
+ const packageAddress = options.package ?? '@typus/perp';
625
620
  return (tx) => tx.moveCall({
626
621
  package: packageAddress,
627
- module: "error",
628
- function: "reach_max_single_order_reserve_usage",
622
+ module: 'error',
623
+ function: 'reach_max_single_order_reserve_usage',
629
624
  });
630
625
  }
631
626
  function optionCollateralOrderNotFilled(options = {}) {
632
- const packageAddress = options.package ?? "@typus/perp";
627
+ const packageAddress = options.package ?? '@typus/perp';
633
628
  return (tx) => tx.moveCall({
634
629
  package: packageAddress,
635
- module: "error",
636
- function: "option_collateral_order_not_filled",
630
+ module: 'error',
631
+ function: 'option_collateral_order_not_filled',
637
632
  });
638
633
  }
639
634
  function orderNotFilledImmediately(options = {}) {
640
- const packageAddress = options.package ?? "@typus/perp";
635
+ const packageAddress = options.package ?? '@typus/perp';
641
636
  return (tx) => tx.moveCall({
642
637
  package: packageAddress,
643
- module: "error",
644
- function: "order_not_filled_immediately",
638
+ module: 'error',
639
+ function: 'order_not_filled_immediately',
645
640
  });
646
641
  }
647
642
  function lpPoolReserveNotEnough(options = {}) {
648
- const packageAddress = options.package ?? "@typus/perp";
643
+ const packageAddress = options.package ?? '@typus/perp';
649
644
  return (tx) => tx.moveCall({
650
645
  package: packageAddress,
651
- module: "error",
652
- function: "lp_pool_reserve_not_enough",
646
+ module: 'error',
647
+ function: 'lp_pool_reserve_not_enough',
653
648
  });
654
649
  }
655
650
  function perpPositionLosses(options = {}) {
656
- const packageAddress = options.package ?? "@typus/perp";
651
+ const packageAddress = options.package ?? '@typus/perp';
657
652
  return (tx) => tx.moveCall({
658
653
  package: packageAddress,
659
- module: "error",
660
- function: "perp_position_losses",
654
+ module: 'error',
655
+ function: 'perp_position_losses',
661
656
  });
662
657
  }
663
658
  function invalidTradingFeeConfig(options = {}) {
664
- const packageAddress = options.package ?? "@typus/perp";
659
+ const packageAddress = options.package ?? '@typus/perp';
665
660
  return (tx) => tx.moveCall({
666
661
  package: packageAddress,
667
- module: "error",
668
- function: "invalid_trading_fee_config",
662
+ module: 'error',
663
+ function: 'invalid_trading_fee_config',
669
664
  });
670
665
  }
671
666
  function orderOrPositionSizeNotZero(options = {}) {
672
- const packageAddress = options.package ?? "@typus/perp";
667
+ const packageAddress = options.package ?? '@typus/perp';
673
668
  return (tx) => tx.moveCall({
674
669
  package: packageAddress,
675
- module: "error",
676
- function: "order_or_position_size_not_zero",
670
+ module: 'error',
671
+ function: 'order_or_position_size_not_zero',
677
672
  });
678
673
  }
679
674
  function balanceNotEnoughForPayingFee(options = {}) {
680
- const packageAddress = options.package ?? "@typus/perp";
675
+ const packageAddress = options.package ?? '@typus/perp';
681
676
  return (tx) => tx.moveCall({
682
677
  package: packageAddress,
683
- module: "error",
684
- function: "balance_not_enough_for_paying_fee",
678
+ module: 'error',
679
+ function: 'balance_not_enough_for_paying_fee',
685
680
  });
686
681
  }
687
682
  function positionIdNeededWithReduceOnlyOrder(options = {}) {
688
- const packageAddress = options.package ?? "@typus/perp";
683
+ const packageAddress = options.package ?? '@typus/perp';
689
684
  return (tx) => tx.moveCall({
690
685
  package: packageAddress,
691
- module: "error",
692
- function: "position_id_needed_with_reduce_only_order",
686
+ module: 'error',
687
+ function: 'position_id_needed_with_reduce_only_order',
693
688
  });
694
689
  }
695
690
  function auctionNotYetEnded(options = {}) {
696
- const packageAddress = options.package ?? "@typus/perp";
691
+ const packageAddress = options.package ?? '@typus/perp';
697
692
  return (tx) => tx.moveCall({
698
693
  package: packageAddress,
699
- module: "error",
700
- function: "auction_not_yet_ended",
694
+ module: 'error',
695
+ function: 'auction_not_yet_ended',
701
696
  });
702
697
  }
703
698
  function bidTokenMismatched(options = {}) {
704
- const packageAddress = options.package ?? "@typus/perp";
699
+ const packageAddress = options.package ?? '@typus/perp';
705
700
  return (tx) => tx.moveCall({
706
701
  package: packageAddress,
707
- module: "error",
708
- function: "bid_token_mismatched",
702
+ module: 'error',
703
+ function: 'bid_token_mismatched',
709
704
  });
710
705
  }
711
706
  function exceedMaxOpenInterest(options = {}) {
712
- const packageAddress = options.package ?? "@typus/perp";
707
+ const packageAddress = options.package ?? '@typus/perp';
713
708
  return (tx) => tx.moveCall({
714
709
  package: packageAddress,
715
- module: "error",
716
- function: "exceed_max_open_interest",
710
+ module: 'error',
711
+ function: 'exceed_max_open_interest',
717
712
  });
718
713
  }
719
714
  function invalidOrderPrice(options = {}) {
720
- const packageAddress = options.package ?? "@typus/perp";
715
+ const packageAddress = options.package ?? '@typus/perp';
721
716
  return (tx) => tx.moveCall({
722
717
  package: packageAddress,
723
- module: "error",
724
- function: "invalid_order_price",
718
+ module: 'error',
719
+ function: 'invalid_order_price',
725
720
  });
726
721
  }
727
722
  function invalidUserAccount(options = {}) {
728
- const packageAddress = options.package ?? "@typus/perp";
723
+ const packageAddress = options.package ?? '@typus/perp';
729
724
  return (tx) => tx.moveCall({
730
725
  package: packageAddress,
731
- module: "error",
732
- function: "invalid_user_account",
726
+ module: 'error',
727
+ function: 'invalid_user_account',
733
728
  });
734
729
  }
735
730
  function optionCollateralPositionNotSupported(options = {}) {
736
- const packageAddress = options.package ?? "@typus/perp";
731
+ const packageAddress = options.package ?? '@typus/perp';
737
732
  return (tx) => tx.moveCall({
738
733
  package: packageAddress,
739
- module: "error",
740
- function: "option_collateral_position_not_supported",
734
+ module: 'error',
735
+ function: 'option_collateral_position_not_supported',
741
736
  });
742
737
  }
743
738
  function notUserAccountOwner(options = {}) {
744
- const packageAddress = options.package ?? "@typus/perp";
739
+ const packageAddress = options.package ?? '@typus/perp';
745
740
  return (tx) => tx.moveCall({
746
741
  package: packageAddress,
747
- module: "error",
748
- function: "not_user_account_owner",
742
+ module: 'error',
743
+ function: 'not_user_account_owner',
749
744
  });
750
745
  }
751
746
  function noBalance(options = {}) {
752
- const packageAddress = options.package ?? "@typus/perp";
747
+ const packageAddress = options.package ?? '@typus/perp';
753
748
  return (tx) => tx.moveCall({
754
749
  package: packageAddress,
755
- module: "error",
756
- function: "no_balance",
750
+ module: 'error',
751
+ function: 'no_balance',
757
752
  });
758
753
  }
759
754
  function notUserAccountCap(options = {}) {
760
- const packageAddress = options.package ?? "@typus/perp";
755
+ const packageAddress = options.package ?? '@typus/perp';
761
756
  return (tx) => tx.moveCall({
762
757
  package: packageAddress,
763
- module: "error",
764
- function: "not_user_account_cap",
758
+ module: 'error',
759
+ function: 'not_user_account_cap',
765
760
  });
766
761
  }
767
762
  function notEmptySymbols(options = {}) {
768
- const packageAddress = options.package ?? "@typus/perp";
763
+ const packageAddress = options.package ?? '@typus/perp';
769
764
  return (tx) => tx.moveCall({
770
765
  package: packageAddress,
771
- module: "error",
772
- function: "not_empty_symbols",
766
+ module: 'error',
767
+ function: 'not_empty_symbols',
773
768
  });
774
769
  }
775
770
  function invalidBoostBpArrayLength(options = {}) {
776
- const packageAddress = options.package ?? "@typus/perp";
771
+ const packageAddress = options.package ?? '@typus/perp';
777
772
  return (tx) => tx.moveCall({
778
773
  package: packageAddress,
779
- module: "error",
780
- function: "invalid_boost_bp_array_length",
774
+ module: 'error',
775
+ function: 'invalid_boost_bp_array_length',
781
776
  });
782
777
  }
783
778
  function invalidIdx(options = {}) {
784
- const packageAddress = options.package ?? "@typus/perp";
779
+ const packageAddress = options.package ?? '@typus/perp';
785
780
  return (tx) => tx.moveCall({
786
781
  package: packageAddress,
787
- module: "error",
788
- function: "invalid_idx",
782
+ module: 'error',
783
+ function: 'invalid_idx',
789
784
  });
790
785
  }
791
786
  function whitelistAlreadyExisted(options = {}) {
792
- const packageAddress = options.package ?? "@typus/perp";
787
+ const packageAddress = options.package ?? '@typus/perp';
793
788
  return (tx) => tx.moveCall({
794
789
  package: packageAddress,
795
- module: "error",
796
- function: "whitelist_already_existed",
790
+ module: 'error',
791
+ function: 'whitelist_already_existed',
797
792
  });
798
793
  }
799
794
  function whitelistNotExisted(options = {}) {
800
- const packageAddress = options.package ?? "@typus/perp";
795
+ const packageAddress = options.package ?? '@typus/perp';
796
+ return (tx) => tx.moveCall({
797
+ package: packageAddress,
798
+ module: 'error',
799
+ function: 'whitelist_not_existed',
800
+ });
801
+ }
802
+ function invalidReferralCode(options = {}) {
803
+ const packageAddress = options.package ?? '@typus/perp';
804
+ return (tx) => tx.moveCall({
805
+ package: packageAddress,
806
+ module: 'error',
807
+ function: 'invalid_referral_code',
808
+ });
809
+ }
810
+ function referralCodeAlreadySet(options = {}) {
811
+ const packageAddress = options.package ?? '@typus/perp';
812
+ return (tx) => tx.moveCall({
813
+ package: packageAddress,
814
+ module: 'error',
815
+ function: 'referral_code_already_set',
816
+ });
817
+ }
818
+ function invalidUser(options = {}) {
819
+ const packageAddress = options.package ?? '@typus/perp';
820
+ return (tx) => tx.moveCall({
821
+ package: packageAddress,
822
+ module: 'error',
823
+ function: 'invalid_user',
824
+ });
825
+ }
826
+ function deprecated(options = {}) {
827
+ const packageAddress = options.package ?? '@typus/perp';
801
828
  return (tx) => tx.moveCall({
802
829
  package: packageAddress,
803
- module: "error",
804
- function: "whitelist_not_existed",
830
+ module: 'error',
831
+ function: 'deprecated',
805
832
  });
806
833
  }