@waterx/predict-sdk 0.1.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 (105) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +67 -0
  3. package/dist/src/account.d.ts +64 -0
  4. package/dist/src/account.js +134 -0
  5. package/dist/src/admin.d.ts +47 -0
  6. package/dist/src/admin.js +104 -0
  7. package/dist/src/bcs.d.ts +20 -0
  8. package/dist/src/bcs.js +209 -0
  9. package/dist/src/client.d.ts +60 -0
  10. package/dist/src/client.js +59 -0
  11. package/dist/src/constants.d.ts +61 -0
  12. package/dist/src/constants.js +62 -0
  13. package/dist/src/fetch.d.ts +53 -0
  14. package/dist/src/fetch.js +187 -0
  15. package/dist/src/generated/bucket_v2_framework/account.d.ts +100 -0
  16. package/dist/src/generated/bucket_v2_framework/account.js +129 -0
  17. package/dist/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
  18. package/dist/src/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
  19. package/dist/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
  20. package/dist/src/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
  21. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
  22. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
  23. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
  24. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
  25. package/dist/src/generated/bucket_v2_framework/double.d.ts +382 -0
  26. package/dist/src/generated/bucket_v2_framework/double.js +466 -0
  27. package/dist/src/generated/bucket_v2_framework/float.d.ts +362 -0
  28. package/dist/src/generated/bucket_v2_framework/float.js +440 -0
  29. package/dist/src/generated/bucket_v2_framework/liability.d.ts +193 -0
  30. package/dist/src/generated/bucket_v2_framework/liability.js +205 -0
  31. package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
  32. package/dist/src/generated/bucket_v2_framework/linked_table.js +382 -0
  33. package/dist/src/generated/bucket_v2_framework/sheet.d.ts +344 -0
  34. package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
  35. package/dist/src/generated/utils/index.d.ts +30 -0
  36. package/dist/src/generated/utils/index.js +157 -0
  37. package/dist/src/generated/waterx_account/account.d.ts +1326 -0
  38. package/dist/src/generated/waterx_account/account.js +1487 -0
  39. package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +6 -0
  40. package/dist/src/generated/waterx_account/deps/std/type_name.js +19 -0
  41. package/dist/src/generated/waterx_account/deps/sui/balance.d.ts +10 -0
  42. package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
  43. package/dist/src/generated/waterx_account/deps/sui/table.d.ts +24 -0
  44. package/dist/src/generated/waterx_account/deps/sui/table.js +31 -0
  45. package/dist/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
  46. package/dist/src/generated/waterx_account/deps/sui/vec_map.js +27 -0
  47. package/dist/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
  48. package/dist/src/generated/waterx_account/deps/sui/vec_set.js +19 -0
  49. package/dist/src/generated/waterx_account/direct_rule.d.ts +72 -0
  50. package/dist/src/generated/waterx_account/direct_rule.js +75 -0
  51. package/dist/src/generated/waterx_account/events.d.ts +30 -0
  52. package/dist/src/generated/waterx_account/events.js +145 -0
  53. package/dist/src/generated/waterx_account/version.d.ts +10 -0
  54. package/dist/src/generated/waterx_account/version.js +8 -0
  55. package/dist/src/generated/waterx_prediction/account_data.d.ts +321 -0
  56. package/dist/src/generated/waterx_prediction/account_data.js +399 -0
  57. package/dist/src/generated/waterx_prediction/admin.d.ts +5 -0
  58. package/dist/src/generated/waterx_prediction/admin.js +9 -0
  59. package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
  60. package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
  61. package/dist/src/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
  62. package/dist/src/generated/waterx_prediction/deps/sui/balance.js +14 -0
  63. package/dist/src/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
  64. package/dist/src/generated/waterx_prediction/deps/sui/table.js +31 -0
  65. package/dist/src/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
  66. package/dist/src/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
  67. package/dist/src/generated/waterx_prediction/events.d.ts +19 -0
  68. package/dist/src/generated/waterx_prediction/events.js +99 -0
  69. package/dist/src/generated/waterx_prediction/global_config.d.ts +68 -0
  70. package/dist/src/generated/waterx_prediction/global_config.js +83 -0
  71. package/dist/src/generated/waterx_prediction/order.d.ts +170 -0
  72. package/dist/src/generated/waterx_prediction/order.js +237 -0
  73. package/dist/src/generated/waterx_prediction/outcome.d.ts +58 -0
  74. package/dist/src/generated/waterx_prediction/outcome.js +73 -0
  75. package/dist/src/generated/waterx_prediction/position.d.ts +150 -0
  76. package/dist/src/generated/waterx_prediction/position.js +200 -0
  77. package/dist/src/generated/waterx_prediction/view.d.ts +353 -0
  78. package/dist/src/generated/waterx_prediction/view.js +426 -0
  79. package/dist/src/generated/waterx_prediction/waterx_prediction.d.ts +1520 -0
  80. package/dist/src/generated/waterx_prediction/waterx_prediction.js +1550 -0
  81. package/dist/src/index.d.ts +22 -0
  82. package/dist/src/index.js +17 -0
  83. package/dist/src/prediction.d.ts +81 -0
  84. package/dist/src/prediction.js +220 -0
  85. package/dist/src/types.d.ts +81 -0
  86. package/dist/src/types.js +1 -0
  87. package/dist/src/user/account.d.ts +2 -0
  88. package/dist/src/user/account.js +1 -0
  89. package/dist/src/user/admin.d.ts +4 -0
  90. package/dist/src/user/admin.js +2 -0
  91. package/dist/src/user/index.d.ts +4 -0
  92. package/dist/src/user/index.js +2 -0
  93. package/dist/src/user/keeper.d.ts +2 -0
  94. package/dist/src/user/keeper.js +1 -0
  95. package/dist/src/user/order.d.ts +2 -0
  96. package/dist/src/user/order.js +1 -0
  97. package/dist/src/user/position.d.ts +2 -0
  98. package/dist/src/user/position.js +1 -0
  99. package/dist/src/utils/bcs.d.ts +1 -0
  100. package/dist/src/utils/bcs.js +1 -0
  101. package/dist/src/utils/index.d.ts +1 -0
  102. package/dist/src/utils/index.js +1 -0
  103. package/dist/src/utils.d.ts +29 -0
  104. package/dist/src/utils.js +170 -0
  105. package/package.json +62 -0
@@ -0,0 +1,1550 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
5
+ import { bcs } from '@mysten/sui/bcs';
6
+ import * as balance from "./deps/sui/balance.js";
7
+ import * as table from "./deps/sui/table.js";
8
+ import * as linked_table from "./deps/bucket_v2_framework/linked_table.js";
9
+ import * as linked_table_1 from "./deps/bucket_v2_framework/linked_table.js";
10
+ import * as table_1 from "./deps/sui/table.js";
11
+ import * as linked_table_2 from "./deps/bucket_v2_framework/linked_table.js";
12
+ import * as linked_table_3 from "./deps/bucket_v2_framework/linked_table.js";
13
+ import * as outcome from "./outcome.js";
14
+ const $moduleName = '@waterx/prediction::waterx_prediction';
15
+ export const MarketRegistry = new MoveStruct({ name: `${$moduleName}::MarketRegistry<phantom T>`, fields: {
16
+ id: bcs.Address,
17
+ /** One shared settlement pool for all markets using coin type `T`. */
18
+ balance: balance.Balance,
19
+ /** Exact market lookup: external market id bytes -> linked-table key. */
20
+ market_id_map: table.Table,
21
+ unresolved_markets: linked_table.LinkedTable(bcs.u64()),
22
+ resolved_markets: linked_table_1.LinkedTable(bcs.u64()),
23
+ /** Set of market keys where new opens are blocked. Presence = paused. */
24
+ paused_markets: table_1.Table,
25
+ /** Pending open and close orders waiting for broker/keeper execution. */
26
+ orders: linked_table_2.LinkedTable(bcs.u64()),
27
+ /** Filled positions with active Polymarket exposure. */
28
+ positions: linked_table_3.LinkedTable(bcs.u64()),
29
+ next_order_id: bcs.u64(),
30
+ next_market_key: bcs.u64(),
31
+ /** Minimum time after order placement before user self-cancel is allowed. */
32
+ order_cancel_cooldown_ms: bcs.u64(),
33
+ /** Floor balance that `admin_withdraw` must respect. */
34
+ min_reserve: bcs.u64()
35
+ } });
36
+ export const Market = new MoveStruct({ name: `${$moduleName}::Market`, fields: {
37
+ market_id: bcs.vector(bcs.u8()),
38
+ outcome: bcs.option(outcome.Outcome),
39
+ /**
40
+ * Number of `Open` positions referencing this market. Incremented on `fill_order`;
41
+ * decremented on `claim` / `confirm_close`. The market entry remains queryable
42
+ * even after this reaches zero.
43
+ */
44
+ unclaimed_count: bcs.u64()
45
+ } });
46
+ export const MarketPointer = new MoveStruct({ name: `${$moduleName}::MarketPointer`, fields: {
47
+ key: bcs.u64(),
48
+ resolved: bcs.bool()
49
+ } });
50
+ /**
51
+ * Admin-only: spin up the shared market registry object for coin type `T`. All
52
+ * markets for this coin type should settle through this object.
53
+ */
54
+ export function createMarketRegistry(options) {
55
+ const packageAddress = options.package ?? '@waterx/prediction';
56
+ const argumentsTypes = [
57
+ null
58
+ ];
59
+ const parameterNames = ["_"];
60
+ return (tx) => tx.moveCall({
61
+ package: packageAddress,
62
+ module: 'waterx_prediction',
63
+ function: 'create_market_registry',
64
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
65
+ typeArguments: options.typeArguments
66
+ });
67
+ }
68
+ /**
69
+ * Account-backed variant: debits `max_spend` from `account_id` in
70
+ * `waterx_account`, opens the position, and records the account as the
71
+ * payout/refund target.
72
+ */
73
+ export function placeOrder(options) {
74
+ const packageAddress = options.package ?? '@waterx/prediction';
75
+ const argumentsTypes = [
76
+ null,
77
+ null,
78
+ null,
79
+ '0x2::object::ID',
80
+ 'u64',
81
+ 'vector<u8>',
82
+ null,
83
+ 'u64',
84
+ 'u64',
85
+ 'u64',
86
+ '0x2::clock::Clock'
87
+ ];
88
+ const parameterNames = ["marketRegistry", "wxaRegistry", "senderRequest", "accountId", "maxSpend", "marketId", "selection", "minShares", "priceCap", "expiryTs"];
89
+ return (tx) => tx.moveCall({
90
+ package: packageAddress,
91
+ module: 'waterx_prediction',
92
+ function: 'place_order',
93
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
94
+ typeArguments: options.typeArguments
95
+ });
96
+ }
97
+ /**
98
+ * Account-backed rescue for a stuck open order. Refunds go back into the
99
+ * waterx_account stored balance.
100
+ */
101
+ export function selfCancelOrder(options) {
102
+ const packageAddress = options.package ?? '@waterx/prediction';
103
+ const argumentsTypes = [
104
+ null,
105
+ null,
106
+ null,
107
+ 'u64',
108
+ '0x2::clock::Clock'
109
+ ];
110
+ const parameterNames = ["marketRegistry", "wxaRegistry", "senderRequest", "orderId"];
111
+ return (tx) => tx.moveCall({
112
+ package: packageAddress,
113
+ module: 'waterx_prediction',
114
+ function: 'self_cancel_order',
115
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
116
+ typeArguments: options.typeArguments
117
+ });
118
+ }
119
+ /** Account-backed claim. Payout is credited to the owning waterx_account balance. */
120
+ export function claim(options) {
121
+ const packageAddress = options.package ?? '@waterx/prediction';
122
+ const argumentsTypes = [
123
+ null,
124
+ null,
125
+ null,
126
+ 'u64',
127
+ '0x2::clock::Clock'
128
+ ];
129
+ const parameterNames = ["marketRegistry", "wxaRegistry", "senderRequest", "positionId"];
130
+ return (tx) => tx.moveCall({
131
+ package: packageAddress,
132
+ module: 'waterx_prediction',
133
+ function: 'claim',
134
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
135
+ typeArguments: options.typeArguments
136
+ });
137
+ }
138
+ /**
139
+ * Account-backed close request. Auth is checked against the owning waterx_account.
140
+ * The position is locked in PendingClose until a keeper confirms the sell, a
141
+ * keeper cancels it, or the user self-cancels past `self_cancel_after_ts`. Aborts
142
+ * if the market has already resolved.
143
+ */
144
+ export function requestClose(options) {
145
+ const packageAddress = options.package ?? '@waterx/prediction';
146
+ const argumentsTypes = [
147
+ null,
148
+ null,
149
+ null,
150
+ 'u64',
151
+ 'u64',
152
+ 'u64',
153
+ '0x2::clock::Clock'
154
+ ];
155
+ const parameterNames = ["marketRegistry", "wxaRegistry", "senderRequest", "positionId", "minProceeds", "expiryTs"];
156
+ return (tx) => tx.moveCall({
157
+ package: packageAddress,
158
+ module: 'waterx_prediction',
159
+ function: 'request_close',
160
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
161
+ typeArguments: options.typeArguments
162
+ });
163
+ }
164
+ /** Account-backed PendingClose rescue. Reverts the position to Open. */
165
+ export function selfCancelClose(options) {
166
+ const packageAddress = options.package ?? '@waterx/prediction';
167
+ const argumentsTypes = [
168
+ null,
169
+ null,
170
+ null,
171
+ 'u64',
172
+ '0x2::clock::Clock'
173
+ ];
174
+ const parameterNames = ["marketRegistry", "wxaRegistry", "senderRequest", "positionId"];
175
+ return (tx) => tx.moveCall({
176
+ package: packageAddress,
177
+ module: 'waterx_prediction',
178
+ function: 'self_cancel_close',
179
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
180
+ typeArguments: options.typeArguments
181
+ });
182
+ }
183
+ /**
184
+ * Admin-funded account position. The admin supplies the payment coin, while future
185
+ * user exits and admin refunds/claims return value to `account_id` in
186
+ * `waterx_account`.
187
+ */
188
+ export function adminPlaceOrderFor(options) {
189
+ const packageAddress = options.package ?? '@waterx/prediction';
190
+ const argumentsTypes = [
191
+ null,
192
+ null,
193
+ null,
194
+ null,
195
+ '0x2::object::ID',
196
+ 'vector<u8>',
197
+ null,
198
+ 'u64',
199
+ 'u64',
200
+ 'u64',
201
+ '0x2::clock::Clock'
202
+ ];
203
+ const parameterNames = ["_", "marketRegistry", "wxaRegistry", "payment", "accountId", "marketId", "selection", "minShares", "priceCap", "expiryTs"];
204
+ return (tx) => tx.moveCall({
205
+ package: packageAddress,
206
+ module: 'waterx_prediction',
207
+ function: 'admin_place_order_for',
208
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
209
+ typeArguments: options.typeArguments
210
+ });
211
+ }
212
+ /**
213
+ * Keeper reports the Polymarket fill back to chain. Account-backed fill
214
+ * confirmation. Any unspent max_spend is credited back to the order's
215
+ * waterx_account, then `position_id = order_id` is created.
216
+ */
217
+ export function fillOrder(options) {
218
+ const packageAddress = options.package ?? '@waterx/prediction';
219
+ const argumentsTypes = [
220
+ null,
221
+ null,
222
+ null,
223
+ null,
224
+ 'u64',
225
+ 'u64',
226
+ 'u64',
227
+ '0x2::clock::Clock'
228
+ ];
229
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "wxaRegistry", "orderId", "filledShares", "filledCost"];
230
+ return (tx) => tx.moveCall({
231
+ package: packageAddress,
232
+ module: 'waterx_prediction',
233
+ function: 'fill_order',
234
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
235
+ typeArguments: options.typeArguments
236
+ });
237
+ }
238
+ /**
239
+ * Keeper-initiated cancel. Used when Polymarket couldn't fill at all.
240
+ * Account-backed keeper cancel. Full refund is credited to the owning
241
+ * waterx_account.
242
+ */
243
+ export function cancelOrder(options) {
244
+ const packageAddress = options.package ?? '@waterx/prediction';
245
+ const argumentsTypes = [
246
+ null,
247
+ null,
248
+ null,
249
+ null,
250
+ 'u64'
251
+ ];
252
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "wxaRegistry", "orderId"];
253
+ return (tx) => tx.moveCall({
254
+ package: packageAddress,
255
+ module: 'waterx_prediction',
256
+ function: 'cancel_order',
257
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
258
+ typeArguments: options.typeArguments
259
+ });
260
+ }
261
+ /**
262
+ * Keeper reports the Polymarket sell back to chain. Pays user `proceeds` and
263
+ * closes the position. Aborts if `proceeds < close_min_proceeds`. Account-backed
264
+ * close confirmation. Proceeds are credited to the owning waterx_account.
265
+ */
266
+ export function confirmClose(options) {
267
+ const packageAddress = options.package ?? '@waterx/prediction';
268
+ const argumentsTypes = [
269
+ null,
270
+ null,
271
+ null,
272
+ null,
273
+ 'u64',
274
+ 'u64',
275
+ '0x2::clock::Clock'
276
+ ];
277
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "wxaRegistry", "positionId", "proceeds"];
278
+ return (tx) => tx.moveCall({
279
+ package: packageAddress,
280
+ module: 'waterx_prediction',
281
+ function: 'confirm_close',
282
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
283
+ typeArguments: options.typeArguments
284
+ });
285
+ }
286
+ /**
287
+ * Keeper-initiated cancel of a PendingClose request. Used when the
288
+ * waterx_prediction couldn't sell on Polymarket. Reverts position to Open — shares
289
+ * are intact.
290
+ */
291
+ export function cancelClose(options) {
292
+ const packageAddress = options.package ?? '@waterx/prediction';
293
+ const argumentsTypes = [
294
+ null,
295
+ null,
296
+ null,
297
+ null,
298
+ 'u64'
299
+ ];
300
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "wxaRegistry", "positionId"];
301
+ return (tx) => tx.moveCall({
302
+ package: packageAddress,
303
+ module: 'waterx_prediction',
304
+ function: 'cancel_close',
305
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
306
+ typeArguments: options.typeArguments
307
+ });
308
+ }
309
+ /**
310
+ * Keeper settles a position for the owning waterx_account. Same payout math as
311
+ * `claim`; keeper just pays the gas.
312
+ *
313
+ * Two main use cases:
314
+ *
315
+ * 1. **Batch payout distribution** — after `resolve_market`, chain multiple
316
+ * `force_claim` calls in one PTB to settle every position on that market in a
317
+ * single tx. Users get paid without spending gas.
318
+ * 2. **Zombie cleanup** - losing-side positions where payout = 0 give the account
319
+ * no incentive to call `claim`. Force-claim removes the position while leaving
320
+ * market metadata available for indexed queries.
321
+ *
322
+ * Only operates on open positions. Pending open orders and pending close orders
323
+ * have their own resolution paths (`fill_order` / `confirm_close`). Account-backed
324
+ * keeper claim. Used for gas-sponsored settlement and zombie cleanup when the
325
+ * position belongs to a waterx_account.
326
+ */
327
+ export function forceClaim(options) {
328
+ const packageAddress = options.package ?? '@waterx/prediction';
329
+ const argumentsTypes = [
330
+ null,
331
+ null,
332
+ null,
333
+ null,
334
+ 'u64'
335
+ ];
336
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "wxaRegistry", "positionId"];
337
+ return (tx) => tx.moveCall({
338
+ package: packageAddress,
339
+ module: 'waterx_prediction',
340
+ function: 'force_claim',
341
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
342
+ typeArguments: options.typeArguments
343
+ });
344
+ }
345
+ export function depositSettlement(options) {
346
+ const packageAddress = options.package ?? '@waterx/prediction';
347
+ const argumentsTypes = [
348
+ null,
349
+ null,
350
+ null
351
+ ];
352
+ const parameterNames = ["_", "marketRegistry", "payment"];
353
+ return (tx) => tx.moveCall({
354
+ package: packageAddress,
355
+ module: 'waterx_prediction',
356
+ function: 'deposit_settlement',
357
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
358
+ typeArguments: options.typeArguments
359
+ });
360
+ }
361
+ /**
362
+ * Admin pulls capital out of the market_registry — used to realise
363
+ * waterx_prediction spread/profit or rebalance working capital. Aborts if the
364
+ * post-balance would dip below `min_reserve`, providing a kill-switch against
365
+ * accidental drains.
366
+ */
367
+ export function adminWithdraw(options) {
368
+ const packageAddress = options.package ?? '@waterx/prediction';
369
+ const argumentsTypes = [
370
+ null,
371
+ null,
372
+ 'u64',
373
+ 'address'
374
+ ];
375
+ const parameterNames = ["_", "marketRegistry", "amount", "recipient"];
376
+ return (tx) => tx.moveCall({
377
+ package: packageAddress,
378
+ module: 'waterx_prediction',
379
+ function: 'admin_withdraw',
380
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
381
+ typeArguments: options.typeArguments
382
+ });
383
+ }
384
+ /**
385
+ * Admin sets the minimum reserve floor. Future `admin_withdraw` calls abort if
386
+ * they would leave `market_registry.balance` below this. Does NOT block user
387
+ * payouts — `claim` and refunds bypass `min_reserve` entirely (those are user
388
+ * funds).
389
+ */
390
+ export function setMinReserve(options) {
391
+ const packageAddress = options.package ?? '@waterx/prediction';
392
+ const argumentsTypes = [
393
+ null,
394
+ null,
395
+ 'u64'
396
+ ];
397
+ const parameterNames = ["_", "marketRegistry", "newReserve"];
398
+ return (tx) => tx.moveCall({
399
+ package: packageAddress,
400
+ module: 'waterx_prediction',
401
+ function: 'set_min_reserve',
402
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
403
+ typeArguments: options.typeArguments
404
+ });
405
+ }
406
+ /**
407
+ * Admin sets the minimum account-owner self-cancel cooldown for newly created open
408
+ * and close orders. Existing orders keep their stored self-cancel time.
409
+ */
410
+ export function setOrderCancelCooldownMs(options) {
411
+ const packageAddress = options.package ?? '@waterx/prediction';
412
+ const argumentsTypes = [
413
+ null,
414
+ null,
415
+ 'u64'
416
+ ];
417
+ const parameterNames = ["_", "marketRegistry", "newCooldownMs"];
418
+ return (tx) => tx.moveCall({
419
+ package: packageAddress,
420
+ module: 'waterx_prediction',
421
+ function: 'set_order_cancel_cooldown_ms',
422
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
423
+ typeArguments: options.typeArguments
424
+ });
425
+ }
426
+ /** Keeper records the market outcome. Aborts if already resolved. */
427
+ export function resolveMarket(options) {
428
+ const packageAddress = options.package ?? '@waterx/prediction';
429
+ const argumentsTypes = [
430
+ null,
431
+ null,
432
+ null,
433
+ 'vector<u8>',
434
+ null
435
+ ];
436
+ const parameterNames = ["globalConfig", "keeperRequest", "marketRegistry", "marketId", "outcome"];
437
+ return (tx) => tx.moveCall({
438
+ package: packageAddress,
439
+ module: 'waterx_prediction',
440
+ function: 'resolve_market',
441
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
442
+ typeArguments: options.typeArguments
443
+ });
444
+ }
445
+ /** Admin pauses new opens for a specific market. Existing positions unaffected. */
446
+ export function pauseMarket(options) {
447
+ const packageAddress = options.package ?? '@waterx/prediction';
448
+ const argumentsTypes = [
449
+ null,
450
+ null,
451
+ 'vector<u8>'
452
+ ];
453
+ const parameterNames = ["_", "marketRegistry", "marketId"];
454
+ return (tx) => tx.moveCall({
455
+ package: packageAddress,
456
+ module: 'waterx_prediction',
457
+ function: 'pause_market',
458
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
459
+ typeArguments: options.typeArguments
460
+ });
461
+ }
462
+ /** Admin re-enables opens for a previously paused market. */
463
+ export function unpauseMarket(options) {
464
+ const packageAddress = options.package ?? '@waterx/prediction';
465
+ const argumentsTypes = [
466
+ null,
467
+ null,
468
+ 'vector<u8>'
469
+ ];
470
+ const parameterNames = ["_", "marketRegistry", "marketId"];
471
+ return (tx) => tx.moveCall({
472
+ package: packageAddress,
473
+ module: 'waterx_prediction',
474
+ function: 'unpause_market',
475
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
476
+ typeArguments: options.typeArguments
477
+ });
478
+ }
479
+ export function positionStatus(options) {
480
+ const packageAddress = options.package ?? '@waterx/prediction';
481
+ const argumentsTypes = [
482
+ null,
483
+ 'u64'
484
+ ];
485
+ const parameterNames = ["marketRegistry", "positionId"];
486
+ return (tx) => tx.moveCall({
487
+ package: packageAddress,
488
+ module: 'waterx_prediction',
489
+ function: 'position_status',
490
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
491
+ typeArguments: options.typeArguments
492
+ });
493
+ }
494
+ export function positionAccountId(options) {
495
+ const packageAddress = options.package ?? '@waterx/prediction';
496
+ const argumentsTypes = [
497
+ null,
498
+ 'u64'
499
+ ];
500
+ const parameterNames = ["marketRegistry", "positionId"];
501
+ return (tx) => tx.moveCall({
502
+ package: packageAddress,
503
+ module: 'waterx_prediction',
504
+ function: 'position_account_id',
505
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
506
+ typeArguments: options.typeArguments
507
+ });
508
+ }
509
+ export function positionMarketId(options) {
510
+ const packageAddress = options.package ?? '@waterx/prediction';
511
+ const argumentsTypes = [
512
+ null,
513
+ 'u64'
514
+ ];
515
+ const parameterNames = ["marketRegistry", "positionId"];
516
+ return (tx) => tx.moveCall({
517
+ package: packageAddress,
518
+ module: 'waterx_prediction',
519
+ function: 'position_market_id',
520
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
521
+ typeArguments: options.typeArguments
522
+ });
523
+ }
524
+ export function positionSelection(options) {
525
+ const packageAddress = options.package ?? '@waterx/prediction';
526
+ const argumentsTypes = [
527
+ null,
528
+ 'u64'
529
+ ];
530
+ const parameterNames = ["marketRegistry", "positionId"];
531
+ return (tx) => tx.moveCall({
532
+ package: packageAddress,
533
+ module: 'waterx_prediction',
534
+ function: 'position_selection',
535
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
536
+ typeArguments: options.typeArguments
537
+ });
538
+ }
539
+ export function positionPayout(options) {
540
+ const packageAddress = options.package ?? '@waterx/prediction';
541
+ const argumentsTypes = [
542
+ null,
543
+ 'u64'
544
+ ];
545
+ const parameterNames = ["marketRegistry", "positionId"];
546
+ return (tx) => tx.moveCall({
547
+ package: packageAddress,
548
+ module: 'waterx_prediction',
549
+ function: 'position_payout',
550
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
551
+ typeArguments: options.typeArguments
552
+ });
553
+ }
554
+ export function positionFilled(options) {
555
+ const packageAddress = options.package ?? '@waterx/prediction';
556
+ const argumentsTypes = [
557
+ null,
558
+ 'u64'
559
+ ];
560
+ const parameterNames = ["marketRegistry", "positionId"];
561
+ return (tx) => tx.moveCall({
562
+ package: packageAddress,
563
+ module: 'waterx_prediction',
564
+ function: 'position_filled',
565
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
566
+ typeArguments: options.typeArguments
567
+ });
568
+ }
569
+ export function positionCloseExpiry(options) {
570
+ const packageAddress = options.package ?? '@waterx/prediction';
571
+ const argumentsTypes = [
572
+ null,
573
+ 'u64'
574
+ ];
575
+ const parameterNames = ["marketRegistry", "positionId"];
576
+ return (tx) => tx.moveCall({
577
+ package: packageAddress,
578
+ module: 'waterx_prediction',
579
+ function: 'position_close_expiry',
580
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
581
+ typeArguments: options.typeArguments
582
+ });
583
+ }
584
+ export function positionCloseOrderId(options) {
585
+ const packageAddress = options.package ?? '@waterx/prediction';
586
+ const argumentsTypes = [
587
+ null,
588
+ 'u64'
589
+ ];
590
+ const parameterNames = ["marketRegistry", "positionId"];
591
+ return (tx) => tx.moveCall({
592
+ package: packageAddress,
593
+ module: 'waterx_prediction',
594
+ function: 'position_close_order_id',
595
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
596
+ typeArguments: options.typeArguments
597
+ });
598
+ }
599
+ export function positionCloseSelfCancelAfterTs(options) {
600
+ const packageAddress = options.package ?? '@waterx/prediction';
601
+ const argumentsTypes = [
602
+ null,
603
+ 'u64'
604
+ ];
605
+ const parameterNames = ["marketRegistry", "positionId"];
606
+ return (tx) => tx.moveCall({
607
+ package: packageAddress,
608
+ module: 'waterx_prediction',
609
+ function: 'position_close_self_cancel_after_ts',
610
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
611
+ typeArguments: options.typeArguments
612
+ });
613
+ }
614
+ export function positionCloseMinProceeds(options) {
615
+ const packageAddress = options.package ?? '@waterx/prediction';
616
+ const argumentsTypes = [
617
+ null,
618
+ 'u64'
619
+ ];
620
+ const parameterNames = ["marketRegistry", "positionId"];
621
+ return (tx) => tx.moveCall({
622
+ package: packageAddress,
623
+ module: 'waterx_prediction',
624
+ function: 'position_close_min_proceeds',
625
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
626
+ typeArguments: options.typeArguments
627
+ });
628
+ }
629
+ export function positionExists(options) {
630
+ const packageAddress = options.package ?? '@waterx/prediction';
631
+ const argumentsTypes = [
632
+ null,
633
+ 'u64'
634
+ ];
635
+ const parameterNames = ["marketRegistry", "positionId"];
636
+ return (tx) => tx.moveCall({
637
+ package: packageAddress,
638
+ module: 'waterx_prediction',
639
+ function: 'position_exists',
640
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
641
+ typeArguments: options.typeArguments
642
+ });
643
+ }
644
+ export function marketRegistryBalance(options) {
645
+ const packageAddress = options.package ?? '@waterx/prediction';
646
+ const argumentsTypes = [
647
+ null
648
+ ];
649
+ const parameterNames = ["marketRegistry"];
650
+ return (tx) => tx.moveCall({
651
+ package: packageAddress,
652
+ module: 'waterx_prediction',
653
+ function: 'market_registry_balance',
654
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
655
+ typeArguments: options.typeArguments
656
+ });
657
+ }
658
+ export function marketRegistryMinReserve(options) {
659
+ const packageAddress = options.package ?? '@waterx/prediction';
660
+ const argumentsTypes = [
661
+ null
662
+ ];
663
+ const parameterNames = ["marketRegistry"];
664
+ return (tx) => tx.moveCall({
665
+ package: packageAddress,
666
+ module: 'waterx_prediction',
667
+ function: 'market_registry_min_reserve',
668
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
669
+ typeArguments: options.typeArguments
670
+ });
671
+ }
672
+ export function marketRegistryOrderCancelCooldownMs(options) {
673
+ const packageAddress = options.package ?? '@waterx/prediction';
674
+ const argumentsTypes = [
675
+ null
676
+ ];
677
+ const parameterNames = ["marketRegistry"];
678
+ return (tx) => tx.moveCall({
679
+ package: packageAddress,
680
+ module: 'waterx_prediction',
681
+ function: 'market_registry_order_cancel_cooldown_ms',
682
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
683
+ typeArguments: options.typeArguments
684
+ });
685
+ }
686
+ export function nextOrderId(options) {
687
+ const packageAddress = options.package ?? '@waterx/prediction';
688
+ const argumentsTypes = [
689
+ null
690
+ ];
691
+ const parameterNames = ["marketRegistry"];
692
+ return (tx) => tx.moveCall({
693
+ package: packageAddress,
694
+ module: 'waterx_prediction',
695
+ function: 'next_order_id',
696
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
697
+ typeArguments: options.typeArguments
698
+ });
699
+ }
700
+ /** Compatibility alias: open order ids become position ids after fill. */
701
+ export function nextPositionId(options) {
702
+ const packageAddress = options.package ?? '@waterx/prediction';
703
+ const argumentsTypes = [
704
+ null
705
+ ];
706
+ const parameterNames = ["marketRegistry"];
707
+ return (tx) => tx.moveCall({
708
+ package: packageAddress,
709
+ module: 'waterx_prediction',
710
+ function: 'next_position_id',
711
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
712
+ typeArguments: options.typeArguments
713
+ });
714
+ }
715
+ export function isMarketResolved(options) {
716
+ const packageAddress = options.package ?? '@waterx/prediction';
717
+ const argumentsTypes = [
718
+ null,
719
+ 'vector<u8>'
720
+ ];
721
+ const parameterNames = ["marketRegistry", "marketId"];
722
+ return (tx) => tx.moveCall({
723
+ package: packageAddress,
724
+ module: 'waterx_prediction',
725
+ function: 'is_market_resolved',
726
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
727
+ typeArguments: options.typeArguments
728
+ });
729
+ }
730
+ export function isMarketPaused(options) {
731
+ const packageAddress = options.package ?? '@waterx/prediction';
732
+ const argumentsTypes = [
733
+ null,
734
+ 'vector<u8>'
735
+ ];
736
+ const parameterNames = ["marketRegistry", "marketId"];
737
+ return (tx) => tx.moveCall({
738
+ package: packageAddress,
739
+ module: 'waterx_prediction',
740
+ function: 'is_market_paused',
741
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
742
+ typeArguments: options.typeArguments
743
+ });
744
+ }
745
+ export function isMarketPausedByKey(options) {
746
+ const packageAddress = options.package ?? '@waterx/prediction';
747
+ const argumentsTypes = [
748
+ null,
749
+ 'u64'
750
+ ];
751
+ const parameterNames = ["marketRegistry", "marketKey"];
752
+ return (tx) => tx.moveCall({
753
+ package: packageAddress,
754
+ module: 'waterx_prediction',
755
+ function: 'is_market_paused_by_key',
756
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
757
+ typeArguments: options.typeArguments
758
+ });
759
+ }
760
+ export function marketExists(options) {
761
+ const packageAddress = options.package ?? '@waterx/prediction';
762
+ const argumentsTypes = [
763
+ null,
764
+ 'vector<u8>'
765
+ ];
766
+ const parameterNames = ["marketRegistry", "marketId"];
767
+ return (tx) => tx.moveCall({
768
+ package: packageAddress,
769
+ module: 'waterx_prediction',
770
+ function: 'market_exists',
771
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
772
+ typeArguments: options.typeArguments
773
+ });
774
+ }
775
+ /** Aborts if the market is unresolved or doesn't exist. */
776
+ export function marketOutcome(options) {
777
+ const packageAddress = options.package ?? '@waterx/prediction';
778
+ const argumentsTypes = [
779
+ null,
780
+ 'vector<u8>'
781
+ ];
782
+ const parameterNames = ["marketRegistry", "marketId"];
783
+ return (tx) => tx.moveCall({
784
+ package: packageAddress,
785
+ module: 'waterx_prediction',
786
+ function: 'market_outcome',
787
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
788
+ typeArguments: options.typeArguments
789
+ });
790
+ }
791
+ export function marketOutcomeByKey(options) {
792
+ const packageAddress = options.package ?? '@waterx/prediction';
793
+ const argumentsTypes = [
794
+ null,
795
+ 'u64'
796
+ ];
797
+ const parameterNames = ["marketRegistry", "marketKey"];
798
+ return (tx) => tx.moveCall({
799
+ package: packageAddress,
800
+ module: 'waterx_prediction',
801
+ function: 'market_outcome_by_key',
802
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
803
+ typeArguments: options.typeArguments
804
+ });
805
+ }
806
+ export function marketUnclaimedCount(options) {
807
+ const packageAddress = options.package ?? '@waterx/prediction';
808
+ const argumentsTypes = [
809
+ null,
810
+ 'vector<u8>'
811
+ ];
812
+ const parameterNames = ["marketRegistry", "marketId"];
813
+ return (tx) => tx.moveCall({
814
+ package: packageAddress,
815
+ module: 'waterx_prediction',
816
+ function: 'market_unclaimed_count',
817
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
818
+ typeArguments: options.typeArguments
819
+ });
820
+ }
821
+ export function orders(options) {
822
+ const packageAddress = options.package ?? '@waterx/prediction';
823
+ const argumentsTypes = [
824
+ null
825
+ ];
826
+ const parameterNames = ["marketRegistry"];
827
+ return (tx) => tx.moveCall({
828
+ package: packageAddress,
829
+ module: 'waterx_prediction',
830
+ function: 'orders',
831
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
832
+ typeArguments: options.typeArguments
833
+ });
834
+ }
835
+ export function orderCount(options) {
836
+ const packageAddress = options.package ?? '@waterx/prediction';
837
+ const argumentsTypes = [
838
+ null
839
+ ];
840
+ const parameterNames = ["marketRegistry"];
841
+ return (tx) => tx.moveCall({
842
+ package: packageAddress,
843
+ module: 'waterx_prediction',
844
+ function: 'order_count',
845
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
846
+ typeArguments: options.typeArguments
847
+ });
848
+ }
849
+ export function orderKeyAt(options) {
850
+ const packageAddress = options.package ?? '@waterx/prediction';
851
+ const argumentsTypes = [
852
+ null,
853
+ 'u64'
854
+ ];
855
+ const parameterNames = ["marketRegistry", "index"];
856
+ return (tx) => tx.moveCall({
857
+ package: packageAddress,
858
+ module: 'waterx_prediction',
859
+ function: 'order_key_at',
860
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
861
+ typeArguments: options.typeArguments
862
+ });
863
+ }
864
+ export function orderFront(options) {
865
+ const packageAddress = options.package ?? '@waterx/prediction';
866
+ const argumentsTypes = [
867
+ null
868
+ ];
869
+ const parameterNames = ["marketRegistry"];
870
+ return (tx) => tx.moveCall({
871
+ package: packageAddress,
872
+ module: 'waterx_prediction',
873
+ function: 'order_front',
874
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
875
+ typeArguments: options.typeArguments
876
+ });
877
+ }
878
+ export function orderBack(options) {
879
+ const packageAddress = options.package ?? '@waterx/prediction';
880
+ const argumentsTypes = [
881
+ null
882
+ ];
883
+ const parameterNames = ["marketRegistry"];
884
+ return (tx) => tx.moveCall({
885
+ package: packageAddress,
886
+ module: 'waterx_prediction',
887
+ function: 'order_back',
888
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
889
+ typeArguments: options.typeArguments
890
+ });
891
+ }
892
+ export function orderNext(options) {
893
+ const packageAddress = options.package ?? '@waterx/prediction';
894
+ const argumentsTypes = [
895
+ null,
896
+ 'u64'
897
+ ];
898
+ const parameterNames = ["marketRegistry", "orderId"];
899
+ return (tx) => tx.moveCall({
900
+ package: packageAddress,
901
+ module: 'waterx_prediction',
902
+ function: 'order_next',
903
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
904
+ typeArguments: options.typeArguments
905
+ });
906
+ }
907
+ export function orderPrev(options) {
908
+ const packageAddress = options.package ?? '@waterx/prediction';
909
+ const argumentsTypes = [
910
+ null,
911
+ 'u64'
912
+ ];
913
+ const parameterNames = ["marketRegistry", "orderId"];
914
+ return (tx) => tx.moveCall({
915
+ package: packageAddress,
916
+ module: 'waterx_prediction',
917
+ function: 'order_prev',
918
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
919
+ typeArguments: options.typeArguments
920
+ });
921
+ }
922
+ export function orderExists(options) {
923
+ const packageAddress = options.package ?? '@waterx/prediction';
924
+ const argumentsTypes = [
925
+ null,
926
+ 'u64'
927
+ ];
928
+ const parameterNames = ["marketRegistry", "orderId"];
929
+ return (tx) => tx.moveCall({
930
+ package: packageAddress,
931
+ module: 'waterx_prediction',
932
+ function: 'order_exists',
933
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
934
+ typeArguments: options.typeArguments
935
+ });
936
+ }
937
+ export function orderKind(options) {
938
+ const packageAddress = options.package ?? '@waterx/prediction';
939
+ const argumentsTypes = [
940
+ null,
941
+ 'u64'
942
+ ];
943
+ const parameterNames = ["marketRegistry", "orderId"];
944
+ return (tx) => tx.moveCall({
945
+ package: packageAddress,
946
+ module: 'waterx_prediction',
947
+ function: 'order_kind',
948
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
949
+ typeArguments: options.typeArguments
950
+ });
951
+ }
952
+ export function orderAccountId(options) {
953
+ const packageAddress = options.package ?? '@waterx/prediction';
954
+ const argumentsTypes = [
955
+ null,
956
+ 'u64'
957
+ ];
958
+ const parameterNames = ["marketRegistry", "orderId"];
959
+ return (tx) => tx.moveCall({
960
+ package: packageAddress,
961
+ module: 'waterx_prediction',
962
+ function: 'order_account_id',
963
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
964
+ typeArguments: options.typeArguments
965
+ });
966
+ }
967
+ export function orderMarketId(options) {
968
+ const packageAddress = options.package ?? '@waterx/prediction';
969
+ const argumentsTypes = [
970
+ null,
971
+ 'u64'
972
+ ];
973
+ const parameterNames = ["marketRegistry", "orderId"];
974
+ return (tx) => tx.moveCall({
975
+ package: packageAddress,
976
+ module: 'waterx_prediction',
977
+ function: 'order_market_id',
978
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
979
+ typeArguments: options.typeArguments
980
+ });
981
+ }
982
+ export function orderSelection(options) {
983
+ const packageAddress = options.package ?? '@waterx/prediction';
984
+ const argumentsTypes = [
985
+ null,
986
+ 'u64'
987
+ ];
988
+ const parameterNames = ["marketRegistry", "orderId"];
989
+ return (tx) => tx.moveCall({
990
+ package: packageAddress,
991
+ module: 'waterx_prediction',
992
+ function: 'order_selection',
993
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
994
+ typeArguments: options.typeArguments
995
+ });
996
+ }
997
+ export function orderPositionId(options) {
998
+ const packageAddress = options.package ?? '@waterx/prediction';
999
+ const argumentsTypes = [
1000
+ null,
1001
+ 'u64'
1002
+ ];
1003
+ const parameterNames = ["marketRegistry", "orderId"];
1004
+ return (tx) => tx.moveCall({
1005
+ package: packageAddress,
1006
+ module: 'waterx_prediction',
1007
+ function: 'order_position_id',
1008
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1009
+ typeArguments: options.typeArguments
1010
+ });
1011
+ }
1012
+ export function orderMaxSpend(options) {
1013
+ const packageAddress = options.package ?? '@waterx/prediction';
1014
+ const argumentsTypes = [
1015
+ null,
1016
+ 'u64'
1017
+ ];
1018
+ const parameterNames = ["marketRegistry", "orderId"];
1019
+ return (tx) => tx.moveCall({
1020
+ package: packageAddress,
1021
+ module: 'waterx_prediction',
1022
+ function: 'order_max_spend',
1023
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1024
+ typeArguments: options.typeArguments
1025
+ });
1026
+ }
1027
+ export function orderMinShares(options) {
1028
+ const packageAddress = options.package ?? '@waterx/prediction';
1029
+ const argumentsTypes = [
1030
+ null,
1031
+ 'u64'
1032
+ ];
1033
+ const parameterNames = ["marketRegistry", "orderId"];
1034
+ return (tx) => tx.moveCall({
1035
+ package: packageAddress,
1036
+ module: 'waterx_prediction',
1037
+ function: 'order_min_shares',
1038
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1039
+ typeArguments: options.typeArguments
1040
+ });
1041
+ }
1042
+ export function orderPriceCap(options) {
1043
+ const packageAddress = options.package ?? '@waterx/prediction';
1044
+ const argumentsTypes = [
1045
+ null,
1046
+ 'u64'
1047
+ ];
1048
+ const parameterNames = ["marketRegistry", "orderId"];
1049
+ return (tx) => tx.moveCall({
1050
+ package: packageAddress,
1051
+ module: 'waterx_prediction',
1052
+ function: 'order_price_cap',
1053
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1054
+ typeArguments: options.typeArguments
1055
+ });
1056
+ }
1057
+ export function orderMinProceeds(options) {
1058
+ const packageAddress = options.package ?? '@waterx/prediction';
1059
+ const argumentsTypes = [
1060
+ null,
1061
+ 'u64'
1062
+ ];
1063
+ const parameterNames = ["marketRegistry", "orderId"];
1064
+ return (tx) => tx.moveCall({
1065
+ package: packageAddress,
1066
+ module: 'waterx_prediction',
1067
+ function: 'order_min_proceeds',
1068
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1069
+ typeArguments: options.typeArguments
1070
+ });
1071
+ }
1072
+ export function orderExpiry(options) {
1073
+ const packageAddress = options.package ?? '@waterx/prediction';
1074
+ const argumentsTypes = [
1075
+ null,
1076
+ 'u64'
1077
+ ];
1078
+ const parameterNames = ["marketRegistry", "orderId"];
1079
+ return (tx) => tx.moveCall({
1080
+ package: packageAddress,
1081
+ module: 'waterx_prediction',
1082
+ function: 'order_expiry',
1083
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1084
+ typeArguments: options.typeArguments
1085
+ });
1086
+ }
1087
+ export function orderSelfCancelAfterTs(options) {
1088
+ const packageAddress = options.package ?? '@waterx/prediction';
1089
+ const argumentsTypes = [
1090
+ null,
1091
+ 'u64'
1092
+ ];
1093
+ const parameterNames = ["marketRegistry", "orderId"];
1094
+ return (tx) => tx.moveCall({
1095
+ package: packageAddress,
1096
+ module: 'waterx_prediction',
1097
+ function: 'order_self_cancel_after_ts',
1098
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1099
+ typeArguments: options.typeArguments
1100
+ });
1101
+ }
1102
+ export function orderIsByAdmin(options) {
1103
+ const packageAddress = options.package ?? '@waterx/prediction';
1104
+ const argumentsTypes = [
1105
+ null,
1106
+ 'u64'
1107
+ ];
1108
+ const parameterNames = ["marketRegistry", "orderId"];
1109
+ return (tx) => tx.moveCall({
1110
+ package: packageAddress,
1111
+ module: 'waterx_prediction',
1112
+ function: 'order_is_by_admin',
1113
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1114
+ typeArguments: options.typeArguments
1115
+ });
1116
+ }
1117
+ export function positions(options) {
1118
+ const packageAddress = options.package ?? '@waterx/prediction';
1119
+ const argumentsTypes = [
1120
+ null
1121
+ ];
1122
+ const parameterNames = ["marketRegistry"];
1123
+ return (tx) => tx.moveCall({
1124
+ package: packageAddress,
1125
+ module: 'waterx_prediction',
1126
+ function: 'positions',
1127
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1128
+ typeArguments: options.typeArguments
1129
+ });
1130
+ }
1131
+ export function positionCount(options) {
1132
+ const packageAddress = options.package ?? '@waterx/prediction';
1133
+ const argumentsTypes = [
1134
+ null
1135
+ ];
1136
+ const parameterNames = ["marketRegistry"];
1137
+ return (tx) => tx.moveCall({
1138
+ package: packageAddress,
1139
+ module: 'waterx_prediction',
1140
+ function: 'position_count',
1141
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1142
+ typeArguments: options.typeArguments
1143
+ });
1144
+ }
1145
+ export function positionKeyAt(options) {
1146
+ const packageAddress = options.package ?? '@waterx/prediction';
1147
+ const argumentsTypes = [
1148
+ null,
1149
+ 'u64'
1150
+ ];
1151
+ const parameterNames = ["marketRegistry", "index"];
1152
+ return (tx) => tx.moveCall({
1153
+ package: packageAddress,
1154
+ module: 'waterx_prediction',
1155
+ function: 'position_key_at',
1156
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1157
+ typeArguments: options.typeArguments
1158
+ });
1159
+ }
1160
+ export function positionFront(options) {
1161
+ const packageAddress = options.package ?? '@waterx/prediction';
1162
+ const argumentsTypes = [
1163
+ null
1164
+ ];
1165
+ const parameterNames = ["marketRegistry"];
1166
+ return (tx) => tx.moveCall({
1167
+ package: packageAddress,
1168
+ module: 'waterx_prediction',
1169
+ function: 'position_front',
1170
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1171
+ typeArguments: options.typeArguments
1172
+ });
1173
+ }
1174
+ export function positionBack(options) {
1175
+ const packageAddress = options.package ?? '@waterx/prediction';
1176
+ const argumentsTypes = [
1177
+ null
1178
+ ];
1179
+ const parameterNames = ["marketRegistry"];
1180
+ return (tx) => tx.moveCall({
1181
+ package: packageAddress,
1182
+ module: 'waterx_prediction',
1183
+ function: 'position_back',
1184
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1185
+ typeArguments: options.typeArguments
1186
+ });
1187
+ }
1188
+ export function positionNext(options) {
1189
+ const packageAddress = options.package ?? '@waterx/prediction';
1190
+ const argumentsTypes = [
1191
+ null,
1192
+ 'u64'
1193
+ ];
1194
+ const parameterNames = ["marketRegistry", "positionId"];
1195
+ return (tx) => tx.moveCall({
1196
+ package: packageAddress,
1197
+ module: 'waterx_prediction',
1198
+ function: 'position_next',
1199
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1200
+ typeArguments: options.typeArguments
1201
+ });
1202
+ }
1203
+ export function positionPrev(options) {
1204
+ const packageAddress = options.package ?? '@waterx/prediction';
1205
+ const argumentsTypes = [
1206
+ null,
1207
+ 'u64'
1208
+ ];
1209
+ const parameterNames = ["marketRegistry", "positionId"];
1210
+ return (tx) => tx.moveCall({
1211
+ package: packageAddress,
1212
+ module: 'waterx_prediction',
1213
+ function: 'position_prev',
1214
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1215
+ typeArguments: options.typeArguments
1216
+ });
1217
+ }
1218
+ export function marketCount(options) {
1219
+ const packageAddress = options.package ?? '@waterx/prediction';
1220
+ const argumentsTypes = [
1221
+ null
1222
+ ];
1223
+ const parameterNames = ["marketRegistry"];
1224
+ return (tx) => tx.moveCall({
1225
+ package: packageAddress,
1226
+ module: 'waterx_prediction',
1227
+ function: 'market_count',
1228
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1229
+ typeArguments: options.typeArguments
1230
+ });
1231
+ }
1232
+ export function marketKey(options) {
1233
+ const packageAddress = options.package ?? '@waterx/prediction';
1234
+ const argumentsTypes = [
1235
+ null,
1236
+ 'vector<u8>'
1237
+ ];
1238
+ const parameterNames = ["marketRegistry", "marketId"];
1239
+ return (tx) => tx.moveCall({
1240
+ package: packageAddress,
1241
+ module: 'waterx_prediction',
1242
+ function: 'market_key',
1243
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1244
+ typeArguments: options.typeArguments
1245
+ });
1246
+ }
1247
+ /**
1248
+ * Compatibility helper for indexed reads. Returns unresolved market keys first,
1249
+ * then resolved market keys. Prefer the linked-table cursor helpers for canonical
1250
+ * traversal.
1251
+ */
1252
+ export function marketKeyAt(options) {
1253
+ const packageAddress = options.package ?? '@waterx/prediction';
1254
+ const argumentsTypes = [
1255
+ null,
1256
+ 'u64'
1257
+ ];
1258
+ const parameterNames = ["marketRegistry", "index"];
1259
+ return (tx) => tx.moveCall({
1260
+ package: packageAddress,
1261
+ module: 'waterx_prediction',
1262
+ function: 'market_key_at',
1263
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1264
+ typeArguments: options.typeArguments
1265
+ });
1266
+ }
1267
+ export function marketIdByKey(options) {
1268
+ const packageAddress = options.package ?? '@waterx/prediction';
1269
+ const argumentsTypes = [
1270
+ null,
1271
+ 'u64'
1272
+ ];
1273
+ const parameterNames = ["marketRegistry", "marketKey"];
1274
+ return (tx) => tx.moveCall({
1275
+ package: packageAddress,
1276
+ module: 'waterx_prediction',
1277
+ function: 'market_id_by_key',
1278
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1279
+ typeArguments: options.typeArguments
1280
+ });
1281
+ }
1282
+ export function marketExistsByKey(options) {
1283
+ const packageAddress = options.package ?? '@waterx/prediction';
1284
+ const argumentsTypes = [
1285
+ null,
1286
+ 'u64'
1287
+ ];
1288
+ const parameterNames = ["marketRegistry", "marketKey"];
1289
+ return (tx) => tx.moveCall({
1290
+ package: packageAddress,
1291
+ module: 'waterx_prediction',
1292
+ function: 'market_exists_by_key',
1293
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1294
+ typeArguments: options.typeArguments
1295
+ });
1296
+ }
1297
+ export function marketIsResolvedByKey(options) {
1298
+ const packageAddress = options.package ?? '@waterx/prediction';
1299
+ const argumentsTypes = [
1300
+ null,
1301
+ 'u64'
1302
+ ];
1303
+ const parameterNames = ["marketRegistry", "marketKey"];
1304
+ return (tx) => tx.moveCall({
1305
+ package: packageAddress,
1306
+ module: 'waterx_prediction',
1307
+ function: 'market_is_resolved_by_key',
1308
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1309
+ typeArguments: options.typeArguments
1310
+ });
1311
+ }
1312
+ export function marketUnclaimedCountByKey(options) {
1313
+ const packageAddress = options.package ?? '@waterx/prediction';
1314
+ const argumentsTypes = [
1315
+ null,
1316
+ 'u64'
1317
+ ];
1318
+ const parameterNames = ["marketRegistry", "marketKey"];
1319
+ return (tx) => tx.moveCall({
1320
+ package: packageAddress,
1321
+ module: 'waterx_prediction',
1322
+ function: 'market_unclaimed_count_by_key',
1323
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1324
+ typeArguments: options.typeArguments
1325
+ });
1326
+ }
1327
+ export function unresolvedMarkets(options) {
1328
+ const packageAddress = options.package ?? '@waterx/prediction';
1329
+ const argumentsTypes = [
1330
+ null
1331
+ ];
1332
+ const parameterNames = ["marketRegistry"];
1333
+ return (tx) => tx.moveCall({
1334
+ package: packageAddress,
1335
+ module: 'waterx_prediction',
1336
+ function: 'unresolved_markets',
1337
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1338
+ typeArguments: options.typeArguments
1339
+ });
1340
+ }
1341
+ export function resolvedMarkets(options) {
1342
+ const packageAddress = options.package ?? '@waterx/prediction';
1343
+ const argumentsTypes = [
1344
+ null
1345
+ ];
1346
+ const parameterNames = ["marketRegistry"];
1347
+ return (tx) => tx.moveCall({
1348
+ package: packageAddress,
1349
+ module: 'waterx_prediction',
1350
+ function: 'resolved_markets',
1351
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1352
+ typeArguments: options.typeArguments
1353
+ });
1354
+ }
1355
+ export function unresolvedMarketCount(options) {
1356
+ const packageAddress = options.package ?? '@waterx/prediction';
1357
+ const argumentsTypes = [
1358
+ null
1359
+ ];
1360
+ const parameterNames = ["marketRegistry"];
1361
+ return (tx) => tx.moveCall({
1362
+ package: packageAddress,
1363
+ module: 'waterx_prediction',
1364
+ function: 'unresolved_market_count',
1365
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1366
+ typeArguments: options.typeArguments
1367
+ });
1368
+ }
1369
+ export function resolvedMarketCount(options) {
1370
+ const packageAddress = options.package ?? '@waterx/prediction';
1371
+ const argumentsTypes = [
1372
+ null
1373
+ ];
1374
+ const parameterNames = ["marketRegistry"];
1375
+ return (tx) => tx.moveCall({
1376
+ package: packageAddress,
1377
+ module: 'waterx_prediction',
1378
+ function: 'resolved_market_count',
1379
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1380
+ typeArguments: options.typeArguments
1381
+ });
1382
+ }
1383
+ export function unresolvedMarketFront(options) {
1384
+ const packageAddress = options.package ?? '@waterx/prediction';
1385
+ const argumentsTypes = [
1386
+ null
1387
+ ];
1388
+ const parameterNames = ["marketRegistry"];
1389
+ return (tx) => tx.moveCall({
1390
+ package: packageAddress,
1391
+ module: 'waterx_prediction',
1392
+ function: 'unresolved_market_front',
1393
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1394
+ typeArguments: options.typeArguments
1395
+ });
1396
+ }
1397
+ export function unresolvedMarketBack(options) {
1398
+ const packageAddress = options.package ?? '@waterx/prediction';
1399
+ const argumentsTypes = [
1400
+ null
1401
+ ];
1402
+ const parameterNames = ["marketRegistry"];
1403
+ return (tx) => tx.moveCall({
1404
+ package: packageAddress,
1405
+ module: 'waterx_prediction',
1406
+ function: 'unresolved_market_back',
1407
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1408
+ typeArguments: options.typeArguments
1409
+ });
1410
+ }
1411
+ export function resolvedMarketFront(options) {
1412
+ const packageAddress = options.package ?? '@waterx/prediction';
1413
+ const argumentsTypes = [
1414
+ null
1415
+ ];
1416
+ const parameterNames = ["marketRegistry"];
1417
+ return (tx) => tx.moveCall({
1418
+ package: packageAddress,
1419
+ module: 'waterx_prediction',
1420
+ function: 'resolved_market_front',
1421
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1422
+ typeArguments: options.typeArguments
1423
+ });
1424
+ }
1425
+ export function resolvedMarketBack(options) {
1426
+ const packageAddress = options.package ?? '@waterx/prediction';
1427
+ const argumentsTypes = [
1428
+ null
1429
+ ];
1430
+ const parameterNames = ["marketRegistry"];
1431
+ return (tx) => tx.moveCall({
1432
+ package: packageAddress,
1433
+ module: 'waterx_prediction',
1434
+ function: 'resolved_market_back',
1435
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1436
+ typeArguments: options.typeArguments
1437
+ });
1438
+ }
1439
+ export function unresolvedMarketNext(options) {
1440
+ const packageAddress = options.package ?? '@waterx/prediction';
1441
+ const argumentsTypes = [
1442
+ null,
1443
+ 'u64'
1444
+ ];
1445
+ const parameterNames = ["marketRegistry", "marketKey"];
1446
+ return (tx) => tx.moveCall({
1447
+ package: packageAddress,
1448
+ module: 'waterx_prediction',
1449
+ function: 'unresolved_market_next',
1450
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1451
+ typeArguments: options.typeArguments
1452
+ });
1453
+ }
1454
+ export function unresolvedMarketPrev(options) {
1455
+ const packageAddress = options.package ?? '@waterx/prediction';
1456
+ const argumentsTypes = [
1457
+ null,
1458
+ 'u64'
1459
+ ];
1460
+ const parameterNames = ["marketRegistry", "marketKey"];
1461
+ return (tx) => tx.moveCall({
1462
+ package: packageAddress,
1463
+ module: 'waterx_prediction',
1464
+ function: 'unresolved_market_prev',
1465
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1466
+ typeArguments: options.typeArguments
1467
+ });
1468
+ }
1469
+ export function resolvedMarketNext(options) {
1470
+ const packageAddress = options.package ?? '@waterx/prediction';
1471
+ const argumentsTypes = [
1472
+ null,
1473
+ 'u64'
1474
+ ];
1475
+ const parameterNames = ["marketRegistry", "marketKey"];
1476
+ return (tx) => tx.moveCall({
1477
+ package: packageAddress,
1478
+ module: 'waterx_prediction',
1479
+ function: 'resolved_market_next',
1480
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1481
+ typeArguments: options.typeArguments
1482
+ });
1483
+ }
1484
+ export function resolvedMarketPrev(options) {
1485
+ const packageAddress = options.package ?? '@waterx/prediction';
1486
+ const argumentsTypes = [
1487
+ null,
1488
+ 'u64'
1489
+ ];
1490
+ const parameterNames = ["marketRegistry", "marketKey"];
1491
+ return (tx) => tx.moveCall({
1492
+ package: packageAddress,
1493
+ module: 'waterx_prediction',
1494
+ function: 'resolved_market_prev',
1495
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1496
+ typeArguments: options.typeArguments
1497
+ });
1498
+ }
1499
+ export function statusIsOpen(options) {
1500
+ const packageAddress = options.package ?? '@waterx/prediction';
1501
+ const argumentsTypes = [
1502
+ null
1503
+ ];
1504
+ const parameterNames = ["s"];
1505
+ return (tx) => tx.moveCall({
1506
+ package: packageAddress,
1507
+ module: 'waterx_prediction',
1508
+ function: 'status_is_open',
1509
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1510
+ });
1511
+ }
1512
+ export function statusIsPendingClose(options) {
1513
+ const packageAddress = options.package ?? '@waterx/prediction';
1514
+ const argumentsTypes = [
1515
+ null
1516
+ ];
1517
+ const parameterNames = ["s"];
1518
+ return (tx) => tx.moveCall({
1519
+ package: packageAddress,
1520
+ module: 'waterx_prediction',
1521
+ function: 'status_is_pending_close',
1522
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1523
+ });
1524
+ }
1525
+ export function orderKindIsOpen(options) {
1526
+ const packageAddress = options.package ?? '@waterx/prediction';
1527
+ const argumentsTypes = [
1528
+ null
1529
+ ];
1530
+ const parameterNames = ["kind"];
1531
+ return (tx) => tx.moveCall({
1532
+ package: packageAddress,
1533
+ module: 'waterx_prediction',
1534
+ function: 'order_kind_is_open',
1535
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1536
+ });
1537
+ }
1538
+ export function orderKindIsClose(options) {
1539
+ const packageAddress = options.package ?? '@waterx/prediction';
1540
+ const argumentsTypes = [
1541
+ null
1542
+ ];
1543
+ const parameterNames = ["kind"];
1544
+ return (tx) => tx.moveCall({
1545
+ package: packageAddress,
1546
+ module: 'waterx_prediction',
1547
+ function: 'order_kind_is_close',
1548
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
1549
+ });
1550
+ }