@typus/typus-perp-sdk 1.1.54 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/src/api/sentio.js +2 -2
  2. package/dist/src/client.d.ts +13 -12
  3. package/dist/src/client.js +24 -49
  4. package/dist/src/fetch.d.ts +15 -61
  5. package/dist/src/fetch.js +63 -163
  6. package/dist/src/generated/typus_perp/admin.d.ts +32 -42
  7. package/dist/src/generated/typus_perp/admin.js +41 -67
  8. package/dist/src/generated/typus_perp/competition.d.ts +22 -10
  9. package/dist/src/generated/typus_perp/competition.js +19 -54
  10. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +2 -2
  11. package/dist/src/generated/typus_perp/deps/std/type_name.js +2 -2
  12. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +3 -3
  13. package/dist/src/generated/typus_perp/deps/sui/balance.js +3 -3
  14. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +4 -6
  15. package/dist/src/generated/typus_perp/deps/sui/object_table.js +4 -38
  16. package/dist/src/generated/typus_perp/deps/sui/table.d.ts +4 -6
  17. package/dist/src/generated/typus_perp/deps/sui/table.js +4 -38
  18. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +2 -2
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +2 -2
  20. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +7 -9
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +6 -6
  22. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +6 -10
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +5 -39
  24. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +14 -8
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +13 -39
  26. package/dist/src/generated/typus_perp/error.d.ts +97 -87
  27. package/dist/src/generated/typus_perp/error.js +18 -0
  28. package/dist/src/generated/typus_perp/escrow.d.ts +17 -21
  29. package/dist/src/generated/typus_perp/escrow.js +10 -22
  30. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  31. package/dist/src/generated/typus_perp/lending.js +40 -0
  32. package/dist/src/generated/typus_perp/lp_pool.d.ts +718 -397
  33. package/dist/src/generated/typus_perp/lp_pool.js +485 -365
  34. package/dist/src/generated/typus_perp/math.d.ts +18 -8
  35. package/dist/src/generated/typus_perp/math.js +24 -6
  36. package/dist/src/generated/typus_perp/position.d.ts +207 -185
  37. package/dist/src/generated/typus_perp/position.js +236 -277
  38. package/dist/src/generated/typus_perp/profit_vault.d.ts +64 -72
  39. package/dist/src/generated/typus_perp/profit_vault.js +48 -86
  40. package/dist/src/generated/typus_perp/symbol.d.ts +6 -6
  41. package/dist/src/generated/typus_perp/symbol.js +11 -13
  42. package/dist/src/generated/typus_perp/trading.d.ts +451 -558
  43. package/dist/src/generated/typus_perp/trading.js +429 -681
  44. package/dist/src/generated/typus_perp/treasury_caps.d.ts +5 -7
  45. package/dist/src/generated/typus_perp/treasury_caps.js +8 -45
  46. package/dist/src/generated/typus_stake_pool/admin.d.ts +13 -122
  47. package/dist/src/generated/typus_stake_pool/admin.js +19 -103
  48. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +2 -2
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +2 -2
  50. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +2 -2
  51. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +2 -2
  52. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +249 -240
  53. package/dist/src/generated/typus_stake_pool/stake_pool.js +159 -246
  54. package/dist/src/generated/utils/index.d.ts +21 -2
  55. package/dist/src/generated/utils/index.js +34 -10
  56. package/dist/src/index.js +4 -4
  57. package/dist/src/user/history.js +13 -12
  58. package/dist/src/user/order.d.ts +1 -1
  59. package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
  60. package/package.json +7 -13
  61. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
  62. package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
  63. package/dist/src/generated/typus_perp/user_account.d.ts +0 -146
  64. package/dist/src/generated/typus_perp/user_account.js +0 -221
  65. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
  66. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
  67. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
  68. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
  69. package/dist/src/grpc/graphql.d.ts +0 -26
  70. package/dist/src/grpc/graphql.js +0 -126
  71. package/dist/src/grpc/grpc.d.ts +0 -1
  72. package/dist/src/grpc/grpc.js +0 -38
  73. package/dist/src/grpc/ledgerService.d.ts +0 -0
  74. package/dist/src/grpc/ledgerService.js +0 -64
  75. package/dist/src/grpc/liveDataService.d.ts +0 -0
  76. package/dist/src/grpc/liveDataService.js +0 -49
@@ -55,13 +55,15 @@ exports.chargeLiquidatorFee = chargeLiquidatorFee;
55
55
  * Perpetual Protocol. It includes version management, authority control, and fee
56
56
  * handling.
57
57
  */
58
- const index_1 = require("../utils/index");
58
+ const index_js_1 = require("../utils/index.js");
59
59
  const bcs_1 = require("@mysten/sui/bcs");
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"));
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"));
63
65
  const $moduleName = "@typus/perp::admin";
64
- exports.FeeInfo = new index_1.MoveStruct({
66
+ exports.FeeInfo = new index_js_1.MoveStruct({
65
67
  name: `${$moduleName}::FeeInfo`,
66
68
  fields: {
67
69
  /** The type name of the token. */
@@ -70,18 +72,18 @@ exports.FeeInfo = new index_1.MoveStruct({
70
72
  value: bcs_1.bcs.u64(),
71
73
  },
72
74
  });
73
- exports.FeePool = new index_1.MoveStruct({
75
+ exports.FeePool = new index_js_1.MoveStruct({
74
76
  name: `${$moduleName}::FeePool`,
75
77
  fields: {
76
- id: object.UID,
78
+ id: bcs_1.bcs.Address,
77
79
  /** A vector of `FeeInfo` structs. */
78
80
  fee_infos: bcs_1.bcs.vector(exports.FeeInfo),
79
81
  },
80
82
  });
81
- exports.Version = new index_1.MoveStruct({
83
+ exports.Version = new index_js_1.MoveStruct({
82
84
  name: `${$moduleName}::Version`,
83
85
  fields: {
84
- id: object.UID,
86
+ id: bcs_1.bcs.Address,
85
87
  /** The version number. */
86
88
  value: bcs_1.bcs.u64(),
87
89
  /** The fee pool for protocol fees. */
@@ -94,29 +96,29 @@ exports.Version = new index_1.MoveStruct({
94
96
  u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
95
97
  },
96
98
  });
97
- exports.SendFeeEvent = new index_1.MoveStruct({
99
+ exports.SendFeeEvent = new index_js_1.MoveStruct({
98
100
  name: `${$moduleName}::SendFeeEvent`,
99
101
  fields: {
100
102
  /** The type name of the token. */
101
- token: type_name.TypeName,
103
+ token: type_name_1.TypeName,
102
104
  /** The amount of fees sent. */
103
105
  amount: bcs_1.bcs.u64(),
104
106
  },
105
107
  });
106
- exports.ProtocolFeeEvent = new index_1.MoveStruct({
108
+ exports.ProtocolFeeEvent = new index_js_1.MoveStruct({
107
109
  name: `${$moduleName}::ProtocolFeeEvent`,
108
110
  fields: {
109
111
  /** The type name of the token. */
110
- token: type_name.TypeName,
112
+ token: type_name_2.TypeName,
111
113
  /** The amount of fees charged. */
112
114
  amount: bcs_1.bcs.u64(),
113
115
  },
114
116
  });
115
- exports.PutInsuranceFundEvent = new index_1.MoveStruct({
117
+ exports.PutInsuranceFundEvent = new index_js_1.MoveStruct({
116
118
  name: `${$moduleName}::PutInsuranceFundEvent`,
117
119
  fields: {
118
120
  /** The type name of the token. */
119
- token: type_name.TypeName,
121
+ token: type_name_3.TypeName,
120
122
  /** The amount of funds put into the insurance fund. */
121
123
  amount: bcs_1.bcs.u64(),
122
124
  },
@@ -124,25 +126,25 @@ exports.PutInsuranceFundEvent = new index_1.MoveStruct({
124
126
  /** Checks if the contract version is valid. */
125
127
  function versionCheck(options) {
126
128
  const packageAddress = options.package ?? "@typus/perp";
127
- const argumentsTypes = [`${packageAddress}::admin::Version`];
129
+ const argumentsTypes = [null];
128
130
  const parameterNames = ["version"];
129
131
  return (tx) => tx.moveCall({
130
132
  package: packageAddress,
131
133
  module: "admin",
132
134
  function: "version_check",
133
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
135
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
134
136
  });
135
137
  }
136
138
  /** Upgrades the contract version. WARNING: no authority check inside */
137
139
  function upgrade(options) {
138
140
  const packageAddress = options.package ?? "@typus/perp";
139
- const argumentsTypes = [`${packageAddress}::admin::Version`];
141
+ const argumentsTypes = [null];
140
142
  const parameterNames = ["version"];
141
143
  return (tx) => tx.moveCall({
142
144
  package: packageAddress,
143
145
  module: "admin",
144
146
  function: "upgrade",
145
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
147
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
146
148
  });
147
149
  }
148
150
  function init(options = {}) {
@@ -156,37 +158,35 @@ function init(options = {}) {
156
158
  /** [Authorized Function] Verifies if the sender is an authorized user. */
157
159
  function verify(options) {
158
160
  const packageAddress = options.package ?? "@typus/perp";
159
- const argumentsTypes = [`${packageAddress}::admin::Version`];
161
+ const argumentsTypes = [null];
160
162
  const parameterNames = ["version"];
161
163
  return (tx) => tx.moveCall({
162
164
  package: packageAddress,
163
165
  module: "admin",
164
166
  function: "verify",
165
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
167
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
166
168
  });
167
169
  }
168
- /** [Authorized Function] Adds an authorized user. */
169
170
  function addAuthorizedUser(options) {
170
171
  const packageAddress = options.package ?? "@typus/perp";
171
- const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
172
+ const argumentsTypes = [null, "address"];
172
173
  const parameterNames = ["version", "userAddress"];
173
174
  return (tx) => tx.moveCall({
174
175
  package: packageAddress,
175
176
  module: "admin",
176
177
  function: "add_authorized_user",
177
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
178
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
178
179
  });
179
180
  }
180
- /** [Authorized Function] Removes an authorized user. */
181
181
  function removeAuthorizedUser(options) {
182
182
  const packageAddress = options.package ?? "@typus/perp";
183
- const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
183
+ const argumentsTypes = [null, "address"];
184
184
  const parameterNames = ["version", "userAddress"];
185
185
  return (tx) => tx.moveCall({
186
186
  package: packageAddress,
187
187
  module: "admin",
188
188
  function: "remove_authorized_user",
189
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
189
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
190
190
  });
191
191
  }
192
192
  /**
@@ -195,30 +195,18 @@ function removeAuthorizedUser(options) {
195
195
  */
196
196
  function installEcosystemManagerCapEntry(options) {
197
197
  const packageAddress = options.package ?? "@typus/perp";
198
- const argumentsTypes = [
199
- `${packageAddress}::admin::Version`,
200
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
201
- ];
198
+ const argumentsTypes = [null, null];
202
199
  const parameterNames = ["version", "typusEcosystemVersion"];
203
200
  return (tx) => tx.moveCall({
204
201
  package: packageAddress,
205
202
  module: "admin",
206
203
  function: "install_ecosystem_manager_cap_entry",
207
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
204
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
208
205
  });
209
206
  }
210
207
  function addTailsExpAndLeaderboard(options) {
211
208
  const packageAddress = options.package ?? "@typus/perp";
212
- const argumentsTypes = [
213
- `${packageAddress}::admin::Version`,
214
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
215
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::user::TypusUserRegistry",
216
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
217
- "address",
218
- "u64",
219
- "u64",
220
- "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
221
- ];
209
+ const argumentsTypes = [null, null, null, null, "address", "u64", "u64", "0x2::clock::Clock"];
222
210
  const parameterNames = [
223
211
  "version",
224
212
  "typusEcosystemVersion",
@@ -232,27 +220,19 @@ function addTailsExpAndLeaderboard(options) {
232
220
  package: packageAddress,
233
221
  module: "admin",
234
222
  function: "add_tails_exp_and_leaderboard",
235
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
223
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
236
224
  });
237
225
  }
238
226
  /** Adds a score to the competition leaderboard. */
239
227
  function addCompetitionLeaderboard(options) {
240
228
  const packageAddress = options.package ?? "@typus/perp";
241
- const argumentsTypes = [
242
- `${packageAddress}::admin::Version`,
243
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
244
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
245
- "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
246
- "address",
247
- "u64",
248
- "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
249
- ];
229
+ const argumentsTypes = [null, null, null, "0x1::string::String", "address", "u64", "0x2::clock::Clock"];
250
230
  const parameterNames = ["version", "typusEcosystemVersion", "typusLeaderboardRegistry", "leaderboardKey", "user", "score"];
251
231
  return (tx) => tx.moveCall({
252
232
  package: packageAddress,
253
233
  module: "admin",
254
234
  function: "add_competition_leaderboard",
255
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
235
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
256
236
  });
257
237
  }
258
238
  /**
@@ -261,29 +241,26 @@ function addCompetitionLeaderboard(options) {
261
241
  */
262
242
  function sendFee(options) {
263
243
  const packageAddress = options.package ?? "@typus/perp";
264
- const argumentsTypes = [`${packageAddress}::admin::Version`];
244
+ const argumentsTypes = [null];
265
245
  const parameterNames = ["version"];
266
246
  return (tx) => tx.moveCall({
267
247
  package: packageAddress,
268
248
  module: "admin",
269
249
  function: "send_fee",
270
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
250
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
271
251
  typeArguments: options.typeArguments,
272
252
  });
273
253
  }
274
254
  /** Charges a protocol fee. */
275
255
  function chargeFee(options) {
276
256
  const packageAddress = options.package ?? "@typus/perp";
277
- const argumentsTypes = [
278
- `${packageAddress}::admin::Version`,
279
- `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
280
- ];
257
+ const argumentsTypes = [null, null];
281
258
  const parameterNames = ["version", "balance"];
282
259
  return (tx) => tx.moveCall({
283
260
  package: packageAddress,
284
261
  module: "admin",
285
262
  function: "charge_fee",
286
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
263
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
287
264
  typeArguments: options.typeArguments,
288
265
  });
289
266
  }
@@ -293,29 +270,26 @@ function chargeFee(options) {
293
270
  */
294
271
  function sendLiquidatorFee(options) {
295
272
  const packageAddress = options.package ?? "@typus/perp";
296
- const argumentsTypes = [`${packageAddress}::admin::Version`];
273
+ const argumentsTypes = [null];
297
274
  const parameterNames = ["version"];
298
275
  return (tx) => tx.moveCall({
299
276
  package: packageAddress,
300
277
  module: "admin",
301
278
  function: "send_liquidator_fee",
302
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
279
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
303
280
  typeArguments: options.typeArguments,
304
281
  });
305
282
  }
306
283
  /** Charges a liquidator fee. */
307
284
  function chargeLiquidatorFee(options) {
308
285
  const packageAddress = options.package ?? "@typus/perp";
309
- const argumentsTypes = [
310
- `${packageAddress}::admin::Version`,
311
- `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
312
- ];
286
+ const argumentsTypes = [null, null];
313
287
  const parameterNames = ["version", "balance"];
314
288
  return (tx) => tx.moveCall({
315
289
  package: packageAddress,
316
290
  module: "admin",
317
291
  function: "charge_liquidator_fee",
318
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
292
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
319
293
  typeArguments: options.typeArguments,
320
294
  });
321
295
  }
@@ -2,22 +2,20 @@
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";
5
+ import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
6
6
  import { type Transaction } from "@mysten/sui/transactions";
7
7
  export declare const CompetitionConfig: MoveStruct<{
8
- id: MoveStruct<{
9
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
- }, "0x2::object::UID">;
8
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
11
9
  /** The boost in basis points for each staking level. */
12
- boost_bp: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
10
+ boost_bp: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
13
11
  length: number;
14
12
  }, string>;
15
13
  /** Whether the competition is active. */
16
- is_active: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
14
+ is_active: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<boolean, boolean, "bool">;
17
15
  /** The name of the program. */
18
- program_name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
16
+ program_name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
19
17
  /** Padding for future use. */
20
- u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
18
+ u64_padding: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
21
19
  length: number;
22
20
  }, string>;
23
21
  }, "@typus/perp::competition::CompetitionConfig">;
@@ -34,7 +32,21 @@ export interface NewCompetitionConfigOptions {
34
32
  programName: RawTransactionArgument<string>
35
33
  ];
36
34
  }
37
- export declare function newCompetitionConfig(options: NewCompetitionConfigOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
35
+ 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;
38
50
  export interface AddScoreArguments {
39
51
  version: RawTransactionArgument<string>;
40
52
  ecosystemVersion: RawTransactionArgument<string>;
@@ -57,4 +69,4 @@ export interface AddScoreOptions {
57
69
  ];
58
70
  }
59
71
  /** Adds a score to the competition leaderboard. WARNING: no authority check inside */
60
- export declare function addScore(options: AddScoreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
72
+ export declare function addScore(options: AddScoreOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -2,52 +2,19 @@
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
- })();
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.CompetitionConfig = void 0;
40
7
  exports.newCompetitionConfig = newCompetitionConfig;
8
+ exports.setBoostBp = setBoostBp;
41
9
  exports.addScore = addScore;
42
10
  /** The `competition` module defines the logic for trading competitions. */
43
- const index_1 = require("../utils/index");
11
+ const index_js_1 = require("../utils/index.js");
44
12
  const bcs_1 = require("@mysten/sui/bcs");
45
- const object = __importStar(require("./deps/sui/object"));
46
13
  const $moduleName = "@typus/perp::competition";
47
- exports.CompetitionConfig = new index_1.MoveStruct({
14
+ exports.CompetitionConfig = new index_js_1.MoveStruct({
48
15
  name: `${$moduleName}::CompetitionConfig`,
49
16
  fields: {
50
- id: object.UID,
17
+ id: bcs_1.bcs.Address,
51
18
  /** The boost in basis points for each staking level. */
52
19
  boost_bp: bcs_1.bcs.vector(bcs_1.bcs.u64()),
53
20
  /** Whether the competition is active. */
@@ -60,32 +27,30 @@ exports.CompetitionConfig = new index_1.MoveStruct({
60
27
  });
61
28
  function newCompetitionConfig(options) {
62
29
  const packageAddress = options.package ?? "@typus/perp";
63
- const argumentsTypes = [
64
- `${packageAddress}::admin::Version`,
65
- "vector<u64>",
66
- "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
67
- ];
30
+ const argumentsTypes = [null, "vector<u64>", "0x1::string::String"];
68
31
  const parameterNames = ["version", "boostBp", "programName"];
69
32
  return (tx) => tx.moveCall({
70
33
  package: packageAddress,
71
34
  module: "competition",
72
35
  function: "new_competition_config",
73
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
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),
74
48
  });
75
49
  }
76
50
  /** Adds a score to the competition leaderboard. WARNING: no authority check inside */
77
51
  function addScore(options) {
78
52
  const packageAddress = options.package ?? "@typus/perp";
79
- const argumentsTypes = [
80
- `${packageAddress}::admin::Version`,
81
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
82
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
83
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tails_staking::TailsStakingRegistry",
84
- `${packageAddress}::competition::CompetitionConfig`,
85
- "u64",
86
- "address",
87
- "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
88
- ];
53
+ const argumentsTypes = [null, null, null, null, null, "u64", "address", "0x2::clock::Clock"];
89
54
  const parameterNames = [
90
55
  "version",
91
56
  "ecosystemVersion",
@@ -99,6 +64,6 @@ function addScore(options) {
99
64
  package: packageAddress,
100
65
  module: "competition",
101
66
  function: "add_score",
102
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
67
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
103
68
  });
104
69
  }
@@ -2,7 +2,7 @@
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";
5
+ import { MoveStruct } from "../../../utils/index.js";
6
6
  export declare const TypeName: MoveStruct<{
7
7
  /**
8
8
  * String representation of the type. All types are represented using their source
@@ -13,5 +13,5 @@ export declare const TypeName: MoveStruct<{
13
13
  * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
14
14
  * 32 depending on the Move platform)
15
15
  */
16
- name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
16
+ name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
17
17
  }, "std::type_name::TypeName">;
@@ -5,10 +5,10 @@
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_1 = require("../../../utils/index");
8
+ const index_js_1 = require("../../../utils/index.js");
9
9
  const bcs_1 = require("@mysten/sui/bcs");
10
10
  const $moduleName = "std::type_name";
11
- exports.TypeName = new index_1.MoveStruct({
11
+ exports.TypeName = new index_js_1.MoveStruct({
12
12
  name: `${$moduleName}::TypeName`,
13
13
  fields: {
14
14
  /**
@@ -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";
9
+ import { MoveStruct } from "../../../utils/index.js";
10
10
  export declare const Balance: MoveStruct<{
11
- value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
- }, "0x2::balance::Balance">;
11
+ value: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
12
+ }, "0x2::balance::Balance<phantom T>">;
@@ -9,11 +9,11 @@ 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_1 = require("../../../utils/index");
12
+ const index_js_1 = require("../../../utils/index.js");
13
13
  const bcs_1 = require("@mysten/sui/bcs");
14
14
  const $moduleName = "0x2::balance";
15
- exports.Balance = new index_1.MoveStruct({
16
- name: `${$moduleName}::Balance`,
15
+ exports.Balance = new index_js_1.MoveStruct({
16
+ name: `${$moduleName}::Balance<phantom T>`,
17
17
  fields: {
18
18
  value: bcs_1.bcs.u64(),
19
19
  },
@@ -8,12 +8,10 @@
8
8
  * may be important for external tools. The difference is otherwise not observable
9
9
  * from within Move.
10
10
  */
11
- import { MoveStruct } from "../../../utils/index";
11
+ import { MoveStruct } from "../../../utils/index.js";
12
12
  export declare const ObjectTable: MoveStruct<{
13
13
  /** the ID of this table */
14
- id: MoveStruct<{
15
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
16
- }, "0x2::object::UID">;
14
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
17
15
  /** the number of key-value pairs in the table */
18
- size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
19
- }, "0x2::object_table::ObjectTable">;
16
+ size: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
17
+ }, "0x2::object_table::ObjectTable<phantom K, phantom V>">;
@@ -2,39 +2,6 @@
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
- })();
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.ObjectTable = void 0;
40
7
  /**
@@ -44,15 +11,14 @@ exports.ObjectTable = void 0;
44
11
  * may be important for external tools. The difference is otherwise not observable
45
12
  * from within Move.
46
13
  */
47
- const index_1 = require("../../../utils/index");
14
+ const index_js_1 = require("../../../utils/index.js");
48
15
  const bcs_1 = require("@mysten/sui/bcs");
49
- const object = __importStar(require("./object"));
50
16
  const $moduleName = "0x2::object_table";
51
- exports.ObjectTable = new index_1.MoveStruct({
52
- name: `${$moduleName}::ObjectTable`,
17
+ exports.ObjectTable = new index_js_1.MoveStruct({
18
+ name: `${$moduleName}::ObjectTable<phantom K, phantom V>`,
53
19
  fields: {
54
20
  /** the ID of this table */
55
- id: object.UID,
21
+ id: bcs_1.bcs.Address,
56
22
  /** the number of key-value pairs in the table */
57
23
  size: bcs_1.bcs.u64(),
58
24
  },
@@ -20,12 +20,10 @@
20
20
  * assert!(&table1 != &table2);
21
21
  * ```
22
22
  */
23
- import { MoveStruct } from "../../../utils/index";
23
+ import { MoveStruct } from "../../../utils/index.js";
24
24
  export declare const Table: MoveStruct<{
25
25
  /** the ID of this table */
26
- id: MoveStruct<{
27
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
28
- }, "0x2::object::UID">;
26
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
29
27
  /** the number of key-value pairs in the table */
30
- size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
31
- }, "0x2::table::Table">;
28
+ size: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
29
+ }, "0x2::table::Table<phantom K, phantom V>">;