@typus/typus-perp-sdk 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 -20
  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 -106
  38. package/dist/src/generated/typus_perp/position.js +714 -733
  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 +956 -139
  44. package/dist/src/generated/typus_perp/trading.js +1577 -1151
  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 +42 -40
@@ -55,35 +55,25 @@ exports.chargeLiquidatorFee = chargeLiquidatorFee;
55
55
  * Perpetual Protocol. It includes version management, authority control, and fee
56
56
  * handling.
57
57
  */
58
- const index_js_1 = require("../utils/index.js");
58
+ const index_1 = require("../utils/index");
59
59
  const bcs_1 = require("@mysten/sui/bcs");
60
- const type_name = __importStar(require("./deps/std/type_name.js"));
61
- const vec_set = __importStar(require("./deps/sui/vec_set.js"));
62
- const type_name_1 = __importStar(require("./deps/std/type_name.js"));
63
- const type_name_2 = __importStar(require("./deps/std/type_name.js"));
64
- const type_name_3 = __importStar(require("./deps/std/type_name.js"));
65
- const $moduleName = "@typus/perp::admin";
66
- exports.FeeInfo = new index_js_1.MoveStruct({
67
- name: `${$moduleName}::FeeInfo`,
68
- fields: {
60
+ const type_name = __importStar(require("./deps/std/type_name"));
61
+ const object = __importStar(require("./deps/sui/object"));
62
+ const vec_set = __importStar(require("./deps/sui/vec_set"));
63
+ const $moduleName = '@typus/perp::admin';
64
+ exports.FeeInfo = new index_1.MoveStruct({ name: `${$moduleName}::FeeInfo`, fields: {
69
65
  /** The type name of the token. */
70
66
  token: type_name.TypeName,
71
67
  /** The amount of fees collected. */
72
- value: bcs_1.bcs.u64(),
73
- },
74
- });
75
- exports.FeePool = new index_js_1.MoveStruct({
76
- name: `${$moduleName}::FeePool`,
77
- fields: {
78
- id: bcs_1.bcs.Address,
68
+ value: bcs_1.bcs.u64()
69
+ } });
70
+ exports.FeePool = new index_1.MoveStruct({ name: `${$moduleName}::FeePool`, fields: {
71
+ id: object.UID,
79
72
  /** A vector of `FeeInfo` structs. */
80
- fee_infos: bcs_1.bcs.vector(exports.FeeInfo),
81
- },
82
- });
83
- exports.Version = new index_js_1.MoveStruct({
84
- name: `${$moduleName}::Version`,
85
- fields: {
86
- id: bcs_1.bcs.Address,
73
+ fee_infos: bcs_1.bcs.vector(exports.FeeInfo)
74
+ } });
75
+ exports.Version = new index_1.MoveStruct({ name: `${$moduleName}::Version`, fields: {
76
+ id: object.UID,
87
77
  /** The version number. */
88
78
  value: bcs_1.bcs.u64(),
89
79
  /** The fee pool for protocol fees. */
@@ -93,100 +83,104 @@ exports.Version = new index_js_1.MoveStruct({
93
83
  /** The list of authorized addresses. */
94
84
  authority: vec_set.VecSet(bcs_1.bcs.Address),
95
85
  /** Padding for future use. */
96
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
97
- },
98
- });
99
- exports.SendFeeEvent = new index_js_1.MoveStruct({
100
- name: `${$moduleName}::SendFeeEvent`,
101
- fields: {
86
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64())
87
+ } });
88
+ exports.SendFeeEvent = new index_1.MoveStruct({ name: `${$moduleName}::SendFeeEvent`, fields: {
102
89
  /** The type name of the token. */
103
- token: type_name_1.TypeName,
90
+ token: type_name.TypeName,
104
91
  /** The amount of fees sent. */
105
- amount: bcs_1.bcs.u64(),
106
- },
107
- });
108
- exports.ProtocolFeeEvent = new index_js_1.MoveStruct({
109
- name: `${$moduleName}::ProtocolFeeEvent`,
110
- fields: {
92
+ amount: bcs_1.bcs.u64()
93
+ } });
94
+ exports.ProtocolFeeEvent = new index_1.MoveStruct({ name: `${$moduleName}::ProtocolFeeEvent`, fields: {
111
95
  /** The type name of the token. */
112
- token: type_name_2.TypeName,
96
+ token: type_name.TypeName,
113
97
  /** The amount of fees charged. */
114
- amount: bcs_1.bcs.u64(),
115
- },
116
- });
117
- exports.PutInsuranceFundEvent = new index_js_1.MoveStruct({
118
- name: `${$moduleName}::PutInsuranceFundEvent`,
119
- fields: {
98
+ amount: bcs_1.bcs.u64()
99
+ } });
100
+ exports.PutInsuranceFundEvent = new index_1.MoveStruct({ name: `${$moduleName}::PutInsuranceFundEvent`, fields: {
120
101
  /** The type name of the token. */
121
- token: type_name_3.TypeName,
102
+ token: type_name.TypeName,
122
103
  /** The amount of funds put into the insurance fund. */
123
- amount: bcs_1.bcs.u64(),
124
- },
125
- });
104
+ amount: bcs_1.bcs.u64()
105
+ } });
126
106
  /** Checks if the contract version is valid. */
127
107
  function versionCheck(options) {
128
- const packageAddress = options.package ?? "@typus/perp";
129
- const argumentsTypes = [null];
108
+ const packageAddress = options.package ?? '@typus/perp';
109
+ const argumentsTypes = [
110
+ `${packageAddress}::admin::Version`
111
+ ];
130
112
  const parameterNames = ["version"];
131
113
  return (tx) => tx.moveCall({
132
114
  package: packageAddress,
133
- module: "admin",
134
- function: "version_check",
135
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
115
+ module: 'admin',
116
+ function: 'version_check',
117
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
136
118
  });
137
119
  }
138
120
  /** Upgrades the contract version. WARNING: no authority check inside */
139
121
  function upgrade(options) {
140
- const packageAddress = options.package ?? "@typus/perp";
141
- const argumentsTypes = [null];
122
+ const packageAddress = options.package ?? '@typus/perp';
123
+ const argumentsTypes = [
124
+ `${packageAddress}::admin::Version`
125
+ ];
142
126
  const parameterNames = ["version"];
143
127
  return (tx) => tx.moveCall({
144
128
  package: packageAddress,
145
- module: "admin",
146
- function: "upgrade",
147
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
129
+ module: 'admin',
130
+ function: 'upgrade',
131
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
148
132
  });
149
133
  }
150
134
  function init(options = {}) {
151
- const packageAddress = options.package ?? "@typus/perp";
135
+ const packageAddress = options.package ?? '@typus/perp';
152
136
  return (tx) => tx.moveCall({
153
137
  package: packageAddress,
154
- module: "admin",
155
- function: "init",
138
+ module: 'admin',
139
+ function: 'init',
156
140
  });
157
141
  }
158
142
  /** [Authorized Function] Verifies if the sender is an authorized user. */
159
143
  function verify(options) {
160
- const packageAddress = options.package ?? "@typus/perp";
161
- const argumentsTypes = [null];
144
+ const packageAddress = options.package ?? '@typus/perp';
145
+ const argumentsTypes = [
146
+ `${packageAddress}::admin::Version`
147
+ ];
162
148
  const parameterNames = ["version"];
163
149
  return (tx) => tx.moveCall({
164
150
  package: packageAddress,
165
- module: "admin",
166
- function: "verify",
167
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
151
+ module: 'admin',
152
+ function: 'verify',
153
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
168
154
  });
169
155
  }
156
+ /** [Authorized Function] Adds an authorized user. */
170
157
  function addAuthorizedUser(options) {
171
- const packageAddress = options.package ?? "@typus/perp";
172
- const argumentsTypes = [null, "address"];
158
+ const packageAddress = options.package ?? '@typus/perp';
159
+ const argumentsTypes = [
160
+ `${packageAddress}::admin::Version`,
161
+ 'address'
162
+ ];
173
163
  const parameterNames = ["version", "userAddress"];
174
164
  return (tx) => tx.moveCall({
175
165
  package: packageAddress,
176
- module: "admin",
177
- function: "add_authorized_user",
178
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
166
+ module: 'admin',
167
+ function: 'add_authorized_user',
168
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
179
169
  });
180
170
  }
171
+ /** [Authorized Function] Removes an authorized user. */
181
172
  function removeAuthorizedUser(options) {
182
- const packageAddress = options.package ?? "@typus/perp";
183
- const argumentsTypes = [null, "address"];
173
+ const packageAddress = options.package ?? '@typus/perp';
174
+ const argumentsTypes = [
175
+ `${packageAddress}::admin::Version`,
176
+ 'address'
177
+ ];
184
178
  const parameterNames = ["version", "userAddress"];
185
179
  return (tx) => tx.moveCall({
186
180
  package: packageAddress,
187
- module: "admin",
188
- function: "remove_authorized_user",
189
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
181
+ module: 'admin',
182
+ function: 'remove_authorized_user',
183
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
190
184
  });
191
185
  }
192
186
  /**
@@ -194,45 +188,57 @@ function removeAuthorizedUser(options) {
194
188
  * after install
195
189
  */
196
190
  function installEcosystemManagerCapEntry(options) {
197
- const packageAddress = options.package ?? "@typus/perp";
198
- const argumentsTypes = [null, null];
191
+ const packageAddress = options.package ?? '@typus/perp';
192
+ const argumentsTypes = [
193
+ `${packageAddress}::admin::Version`,
194
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version'
195
+ ];
199
196
  const parameterNames = ["version", "typusEcosystemVersion"];
200
197
  return (tx) => tx.moveCall({
201
198
  package: packageAddress,
202
- module: "admin",
203
- function: "install_ecosystem_manager_cap_entry",
204
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
199
+ module: 'admin',
200
+ function: 'install_ecosystem_manager_cap_entry',
201
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
205
202
  });
206
203
  }
207
204
  function addTailsExpAndLeaderboard(options) {
208
- const packageAddress = options.package ?? "@typus/perp";
209
- const argumentsTypes = [null, null, null, null, "address", "u64", "u64", "0x2::clock::Clock"];
210
- const parameterNames = [
211
- "version",
212
- "typusEcosystemVersion",
213
- "typusUserRegistry",
214
- "typusLeaderboardRegistry",
215
- "user",
216
- "tradingFeeUsd",
217
- "expMultiplier",
205
+ const packageAddress = options.package ?? '@typus/perp';
206
+ const argumentsTypes = [
207
+ `${packageAddress}::admin::Version`,
208
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version',
209
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::user::TypusUserRegistry',
210
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry',
211
+ 'address',
212
+ 'u64',
213
+ 'u64',
214
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
218
215
  ];
216
+ const parameterNames = ["version", "typusEcosystemVersion", "typusUserRegistry", "typusLeaderboardRegistry", "user", "tradingFeeUsd", "expMultiplier"];
219
217
  return (tx) => tx.moveCall({
220
218
  package: packageAddress,
221
- module: "admin",
222
- function: "add_tails_exp_and_leaderboard",
223
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
219
+ module: 'admin',
220
+ function: 'add_tails_exp_and_leaderboard',
221
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
224
222
  });
225
223
  }
226
224
  /** Adds a score to the competition leaderboard. */
227
225
  function addCompetitionLeaderboard(options) {
228
- const packageAddress = options.package ?? "@typus/perp";
229
- const argumentsTypes = [null, null, null, "0x1::string::String", "address", "u64", "0x2::clock::Clock"];
226
+ const packageAddress = options.package ?? '@typus/perp';
227
+ const argumentsTypes = [
228
+ `${packageAddress}::admin::Version`,
229
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version',
230
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry',
231
+ '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String',
232
+ 'address',
233
+ 'u64',
234
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
235
+ ];
230
236
  const parameterNames = ["version", "typusEcosystemVersion", "typusLeaderboardRegistry", "leaderboardKey", "user", "score"];
231
237
  return (tx) => tx.moveCall({
232
238
  package: packageAddress,
233
- module: "admin",
234
- function: "add_competition_leaderboard",
235
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
239
+ module: 'admin',
240
+ function: 'add_competition_leaderboard',
241
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
236
242
  });
237
243
  }
238
244
  /**
@@ -240,28 +246,33 @@ function addCompetitionLeaderboard(options) {
240
246
  * receiver
241
247
  */
242
248
  function sendFee(options) {
243
- const packageAddress = options.package ?? "@typus/perp";
244
- const argumentsTypes = [null];
249
+ const packageAddress = options.package ?? '@typus/perp';
250
+ const argumentsTypes = [
251
+ `${packageAddress}::admin::Version`
252
+ ];
245
253
  const parameterNames = ["version"];
246
254
  return (tx) => tx.moveCall({
247
255
  package: packageAddress,
248
- module: "admin",
249
- function: "send_fee",
250
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
251
- typeArguments: options.typeArguments,
256
+ module: 'admin',
257
+ function: 'send_fee',
258
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
259
+ typeArguments: options.typeArguments
252
260
  });
253
261
  }
254
262
  /** Charges a protocol fee. */
255
263
  function chargeFee(options) {
256
- const packageAddress = options.package ?? "@typus/perp";
257
- const argumentsTypes = [null, null];
264
+ const packageAddress = options.package ?? '@typus/perp';
265
+ const argumentsTypes = [
266
+ `${packageAddress}::admin::Version`,
267
+ `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`
268
+ ];
258
269
  const parameterNames = ["version", "balance"];
259
270
  return (tx) => tx.moveCall({
260
271
  package: packageAddress,
261
- module: "admin",
262
- function: "charge_fee",
263
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
264
- typeArguments: options.typeArguments,
272
+ module: 'admin',
273
+ function: 'charge_fee',
274
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
275
+ typeArguments: options.typeArguments
265
276
  });
266
277
  }
267
278
  /**
@@ -269,27 +280,32 @@ function chargeFee(options) {
269
280
  * receiver
270
281
  */
271
282
  function sendLiquidatorFee(options) {
272
- const packageAddress = options.package ?? "@typus/perp";
273
- const argumentsTypes = [null];
283
+ const packageAddress = options.package ?? '@typus/perp';
284
+ const argumentsTypes = [
285
+ `${packageAddress}::admin::Version`
286
+ ];
274
287
  const parameterNames = ["version"];
275
288
  return (tx) => tx.moveCall({
276
289
  package: packageAddress,
277
- module: "admin",
278
- function: "send_liquidator_fee",
279
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
280
- typeArguments: options.typeArguments,
290
+ module: 'admin',
291
+ function: 'send_liquidator_fee',
292
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
293
+ typeArguments: options.typeArguments
281
294
  });
282
295
  }
283
296
  /** Charges a liquidator fee. */
284
297
  function chargeLiquidatorFee(options) {
285
- const packageAddress = options.package ?? "@typus/perp";
286
- const argumentsTypes = [null, null];
298
+ const packageAddress = options.package ?? '@typus/perp';
299
+ const argumentsTypes = [
300
+ `${packageAddress}::admin::Version`,
301
+ `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`
302
+ ];
287
303
  const parameterNames = ["version", "balance"];
288
304
  return (tx) => tx.moveCall({
289
305
  package: packageAddress,
290
- module: "admin",
291
- function: "charge_liquidator_fee",
292
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
293
- typeArguments: options.typeArguments,
306
+ module: 'admin',
307
+ function: 'charge_liquidator_fee',
308
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
309
+ typeArguments: options.typeArguments
294
310
  });
295
311
  }
@@ -2,10 +2,12 @@
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
4
  /** The `competition` module defines the logic for trading competitions. */
5
- import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
6
- import { type Transaction } from "@mysten/sui/transactions";
5
+ import { MoveStruct, type RawTransactionArgument } from '../utils/index';
6
+ import { type Transaction } from '@mysten/sui/transactions';
7
7
  export declare const CompetitionConfig: MoveStruct<{
8
- id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
8
+ id: MoveStruct<{
9
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
+ }, "0x2::object::UID">;
9
11
  /** The boost in basis points for each staking level. */
10
12
  boost_bp: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
11
13
  length: number;
@@ -33,20 +35,6 @@ export interface NewCompetitionConfigOptions {
33
35
  ];
34
36
  }
35
37
  export declare function newCompetitionConfig(options: NewCompetitionConfigOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
36
- export interface SetBoostBpArguments {
37
- version: RawTransactionArgument<string>;
38
- competitionConfig: RawTransactionArgument<string>;
39
- boostBp: RawTransactionArgument<number | bigint[]>;
40
- }
41
- export interface SetBoostBpOptions {
42
- package?: string;
43
- arguments: SetBoostBpArguments | [
44
- version: RawTransactionArgument<string>,
45
- competitionConfig: RawTransactionArgument<string>,
46
- boostBp: RawTransactionArgument<number | bigint[]>
47
- ];
48
- }
49
- export declare function setBoostBp(options: SetBoostBpOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
50
38
  export interface AddScoreArguments {
51
39
  version: RawTransactionArgument<string>;
52
40
  ecosystemVersion: RawTransactionArgument<string>;
@@ -2,19 +2,50 @@
2
2
  /**************************************************************
3
3
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
4
4
  **************************************************************/
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.CompetitionConfig = void 0;
7
40
  exports.newCompetitionConfig = newCompetitionConfig;
8
- exports.setBoostBp = setBoostBp;
9
41
  exports.addScore = addScore;
10
42
  /** The `competition` module defines the logic for trading competitions. */
11
- const index_js_1 = require("../utils/index.js");
43
+ const index_1 = require("../utils/index");
12
44
  const bcs_1 = require("@mysten/sui/bcs");
13
- const $moduleName = "@typus/perp::competition";
14
- exports.CompetitionConfig = new index_js_1.MoveStruct({
15
- name: `${$moduleName}::CompetitionConfig`,
16
- fields: {
17
- id: bcs_1.bcs.Address,
45
+ const object = __importStar(require("./deps/sui/object"));
46
+ const $moduleName = '@typus/perp::competition';
47
+ exports.CompetitionConfig = new index_1.MoveStruct({ name: `${$moduleName}::CompetitionConfig`, fields: {
48
+ id: object.UID,
18
49
  /** The boost in basis points for each staking level. */
19
50
  boost_bp: bcs_1.bcs.vector(bcs_1.bcs.u64()),
20
51
  /** Whether the competition is active. */
@@ -22,48 +53,41 @@ exports.CompetitionConfig = new index_js_1.MoveStruct({
22
53
  /** The name of the program. */
23
54
  program_name: bcs_1.bcs.string(),
24
55
  /** Padding for future use. */
25
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
26
- },
27
- });
56
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64())
57
+ } });
28
58
  function newCompetitionConfig(options) {
29
- const packageAddress = options.package ?? "@typus/perp";
30
- const argumentsTypes = [null, "vector<u64>", "0x1::string::String"];
59
+ const packageAddress = options.package ?? '@typus/perp';
60
+ const argumentsTypes = [
61
+ `${packageAddress}::admin::Version`,
62
+ 'vector<u64>',
63
+ '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String'
64
+ ];
31
65
  const parameterNames = ["version", "boostBp", "programName"];
32
66
  return (tx) => tx.moveCall({
33
67
  package: packageAddress,
34
- module: "competition",
35
- function: "new_competition_config",
36
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
37
- });
38
- }
39
- function setBoostBp(options) {
40
- const packageAddress = options.package ?? "@typus/perp";
41
- const argumentsTypes = [null, null, "vector<u64>"];
42
- const parameterNames = ["version", "competitionConfig", "boostBp"];
43
- return (tx) => tx.moveCall({
44
- package: packageAddress,
45
- module: "competition",
46
- function: "set_boost_bp",
47
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
68
+ module: 'competition',
69
+ function: 'new_competition_config',
70
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
48
71
  });
49
72
  }
50
73
  /** Adds a score to the competition leaderboard. WARNING: no authority check inside */
51
74
  function addScore(options) {
52
- const packageAddress = options.package ?? "@typus/perp";
53
- const argumentsTypes = [null, null, null, null, null, "u64", "address", "0x2::clock::Clock"];
54
- const parameterNames = [
55
- "version",
56
- "ecosystemVersion",
57
- "typusLeaderboardRegistry",
58
- "tailsStakingRegistry",
59
- "competitionConfig",
60
- "volumeUsd",
61
- "user",
75
+ const packageAddress = options.package ?? '@typus/perp';
76
+ const argumentsTypes = [
77
+ `${packageAddress}::admin::Version`,
78
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version',
79
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry',
80
+ '0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tails_staking::TailsStakingRegistry',
81
+ `${packageAddress}::competition::CompetitionConfig`,
82
+ 'u64',
83
+ 'address',
84
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
62
85
  ];
86
+ const parameterNames = ["version", "ecosystemVersion", "typusLeaderboardRegistry", "tailsStakingRegistry", "competitionConfig", "volumeUsd", "user"];
63
87
  return (tx) => tx.moveCall({
64
88
  package: packageAddress,
65
- module: "competition",
66
- function: "add_score",
67
- arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
89
+ module: 'competition',
90
+ function: 'add_score',
91
+ arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
68
92
  });
69
93
  }
@@ -2,16 +2,16 @@
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
4
  /** Functionality for converting Move types into values. Use with care! */
5
- import { MoveStruct } from "../../../utils/index.js";
5
+ import { MoveStruct } from '../../../utils/index';
6
6
  export declare const TypeName: MoveStruct<{
7
7
  /**
8
- * String representation of the type. All types are represented using their source
9
- * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
10
- * Struct types are represented as fully qualified type names; e.g.
11
- * `00000000000000000000000000000001::string::String` or
12
- * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
13
- * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
14
- * 32 depending on the Move platform)
15
- */
8
+ * String representation of the type. All types are represented using their source
9
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
10
+ * Struct types are represented as fully qualified type names; e.g.
11
+ * `00000000000000000000000000000001::string::String` or
12
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
13
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
14
+ * 32 depending on the Move platform)
15
+ */
16
16
  name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
17
17
  }, "std::type_name::TypeName">;
@@ -5,21 +5,18 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TypeName = void 0;
7
7
  /** Functionality for converting Move types into values. Use with care! */
8
- const index_js_1 = require("../../../utils/index.js");
8
+ const index_1 = require("../../../utils/index");
9
9
  const bcs_1 = require("@mysten/sui/bcs");
10
- const $moduleName = "std::type_name";
11
- exports.TypeName = new index_js_1.MoveStruct({
12
- name: `${$moduleName}::TypeName`,
13
- fields: {
10
+ const $moduleName = 'std::type_name';
11
+ exports.TypeName = new index_1.MoveStruct({ name: `${$moduleName}::TypeName`, fields: {
14
12
  /**
15
- * String representation of the type. All types are represented using their source
16
- * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
17
- * Struct types are represented as fully qualified type names; e.g.
18
- * `00000000000000000000000000000001::string::String` or
19
- * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
20
- * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
21
- * 32 depending on the Move platform)
22
- */
23
- name: bcs_1.bcs.string(),
24
- },
25
- });
13
+ * String representation of the type. All types are represented using their source
14
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
15
+ * Struct types are represented as fully qualified type names; e.g.
16
+ * `00000000000000000000000000000001::string::String` or
17
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
18
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
19
+ * 32 depending on the Move platform)
20
+ */
21
+ name: bcs_1.bcs.string()
22
+ } });
@@ -6,7 +6,7 @@
6
6
  * allow balance operations and can be used to implement custom coins with `Supply`
7
7
  * and `Balance`s.
8
8
  */
9
- import { MoveStruct } from "../../../utils/index.js";
9
+ import { MoveStruct } from '../../../utils/index';
10
10
  export declare const Balance: MoveStruct<{
11
11
  value: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
12
- }, "0x2::balance::Balance<phantom T>">;
12
+ }, "0x2::balance::Balance">;
@@ -9,12 +9,9 @@ exports.Balance = void 0;
9
9
  * allow balance operations and can be used to implement custom coins with `Supply`
10
10
  * and `Balance`s.
11
11
  */
12
- const index_js_1 = require("../../../utils/index.js");
12
+ const index_1 = require("../../../utils/index");
13
13
  const bcs_1 = require("@mysten/sui/bcs");
14
- const $moduleName = "0x2::balance";
15
- exports.Balance = new index_js_1.MoveStruct({
16
- name: `${$moduleName}::Balance<phantom T>`,
17
- fields: {
18
- value: bcs_1.bcs.u64(),
19
- },
20
- });
14
+ const $moduleName = '0x2::balance';
15
+ exports.Balance = new index_1.MoveStruct({ name: `${$moduleName}::Balance`, fields: {
16
+ value: bcs_1.bcs.u64()
17
+ } });