@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.
- package/LICENSE +22 -0
- package/README.md +67 -0
- package/dist/src/account.d.ts +64 -0
- package/dist/src/account.js +134 -0
- package/dist/src/admin.d.ts +47 -0
- package/dist/src/admin.js +104 -0
- package/dist/src/bcs.d.ts +20 -0
- package/dist/src/bcs.js +209 -0
- package/dist/src/client.d.ts +60 -0
- package/dist/src/client.js +59 -0
- package/dist/src/constants.d.ts +61 -0
- package/dist/src/constants.js +62 -0
- package/dist/src/fetch.d.ts +53 -0
- package/dist/src/fetch.js +187 -0
- package/dist/src/generated/bucket_v2_framework/account.d.ts +100 -0
- package/dist/src/generated/bucket_v2_framework/account.js +129 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/bucket_v2_framework/double.d.ts +382 -0
- package/dist/src/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/generated/bucket_v2_framework/float.d.ts +362 -0
- package/dist/src/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +193 -0
- package/dist/src/generated/bucket_v2_framework/liability.js +205 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.js +382 -0
- package/dist/src/generated/bucket_v2_framework/sheet.d.ts +344 -0
- package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
- package/dist/src/generated/utils/index.d.ts +30 -0
- package/dist/src/generated/utils/index.js +157 -0
- package/dist/src/generated/waterx_account/account.d.ts +1326 -0
- package/dist/src/generated/waterx_account/account.js +1487 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +6 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_account/deps/sui/table.d.ts +24 -0
- package/dist/src/generated/waterx_account/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_account/direct_rule.d.ts +72 -0
- package/dist/src/generated/waterx_account/direct_rule.js +75 -0
- package/dist/src/generated/waterx_account/events.d.ts +30 -0
- package/dist/src/generated/waterx_account/events.js +145 -0
- package/dist/src/generated/waterx_account/version.d.ts +10 -0
- package/dist/src/generated/waterx_account/version.js +8 -0
- package/dist/src/generated/waterx_prediction/account_data.d.ts +321 -0
- package/dist/src/generated/waterx_prediction/account_data.js +399 -0
- package/dist/src/generated/waterx_prediction/admin.d.ts +5 -0
- package/dist/src/generated/waterx_prediction/admin.js +9 -0
- package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/waterx_prediction/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
- package/dist/src/generated/waterx_prediction/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_prediction/events.d.ts +19 -0
- package/dist/src/generated/waterx_prediction/events.js +99 -0
- package/dist/src/generated/waterx_prediction/global_config.d.ts +68 -0
- package/dist/src/generated/waterx_prediction/global_config.js +83 -0
- package/dist/src/generated/waterx_prediction/order.d.ts +170 -0
- package/dist/src/generated/waterx_prediction/order.js +237 -0
- package/dist/src/generated/waterx_prediction/outcome.d.ts +58 -0
- package/dist/src/generated/waterx_prediction/outcome.js +73 -0
- package/dist/src/generated/waterx_prediction/position.d.ts +150 -0
- package/dist/src/generated/waterx_prediction/position.js +200 -0
- package/dist/src/generated/waterx_prediction/view.d.ts +353 -0
- package/dist/src/generated/waterx_prediction/view.js +426 -0
- package/dist/src/generated/waterx_prediction/waterx_prediction.d.ts +1520 -0
- package/dist/src/generated/waterx_prediction/waterx_prediction.js +1550 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.js +17 -0
- package/dist/src/prediction.d.ts +81 -0
- package/dist/src/prediction.js +220 -0
- package/dist/src/types.d.ts +81 -0
- package/dist/src/types.js +1 -0
- package/dist/src/user/account.d.ts +2 -0
- package/dist/src/user/account.js +1 -0
- package/dist/src/user/admin.d.ts +4 -0
- package/dist/src/user/admin.js +2 -0
- package/dist/src/user/index.d.ts +4 -0
- package/dist/src/user/index.js +2 -0
- package/dist/src/user/keeper.d.ts +2 -0
- package/dist/src/user/keeper.js +1 -0
- package/dist/src/user/order.d.ts +2 -0
- package/dist/src/user/order.js +1 -0
- package/dist/src/user/position.d.ts +2 -0
- package/dist/src/user/position.js +1 -0
- package/dist/src/utils/bcs.d.ts +1 -0
- package/dist/src/utils/bcs.js +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils.d.ts +29 -0
- package/dist/src/utils.js +170 -0
- package/package.json +62 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Per-account prediction broker index, stored as a `WaterXPredictionData` blob on
|
|
6
|
+
* the shared `waterx_account::Account` object via `wxa::new_data` /
|
|
7
|
+
* `wxa::borrow_data` / `wxa::borrow_data_mut`.
|
|
8
|
+
*
|
|
9
|
+
* `MarketRegistry` remains the canonical storage for orders and positions. This
|
|
10
|
+
* slot is an account-centric index for wallet UX and indexers: account ->
|
|
11
|
+
* order_ids / position_ids, plus account -> market_key -> ids.
|
|
12
|
+
*/
|
|
13
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
14
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
15
|
+
import * as linked_table from "./deps/bucket_v2_framework/linked_table.js";
|
|
16
|
+
import * as linked_table_1 from "./deps/bucket_v2_framework/linked_table.js";
|
|
17
|
+
import * as table from "./deps/sui/table.js";
|
|
18
|
+
import * as table_1 from "./deps/sui/table.js";
|
|
19
|
+
const $moduleName = '@waterx/prediction::account_data';
|
|
20
|
+
export const WaterXPrediction = new MoveStruct({ name: `${$moduleName}::WaterXPrediction`, fields: {
|
|
21
|
+
dummy_field: bcs.bool()
|
|
22
|
+
} });
|
|
23
|
+
export const WaterXPredictionData = new MoveStruct({ name: `${$moduleName}::WaterXPredictionData`, fields: {
|
|
24
|
+
/** Pending open/close order IDs for this account. Value = market key. */
|
|
25
|
+
orders: linked_table.LinkedTable(bcs.u64()),
|
|
26
|
+
/** Active position IDs for this account. Value = market key. */
|
|
27
|
+
positions: linked_table_1.LinkedTable(bcs.u64()),
|
|
28
|
+
/** Per-market pending order ID sets. Key = market key. */
|
|
29
|
+
orders_by_market: table.Table,
|
|
30
|
+
/** Per-market active position ID sets. Key = market key. */
|
|
31
|
+
positions_by_market: table_1.Table
|
|
32
|
+
} });
|
|
33
|
+
export function permPlaceOrder(options = {}) {
|
|
34
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
35
|
+
return (tx) => tx.moveCall({
|
|
36
|
+
package: packageAddress,
|
|
37
|
+
module: 'account_data',
|
|
38
|
+
function: 'perm_place_order',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export function permCancelOrder(options = {}) {
|
|
42
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
43
|
+
return (tx) => tx.moveCall({
|
|
44
|
+
package: packageAddress,
|
|
45
|
+
module: 'account_data',
|
|
46
|
+
function: 'perm_cancel_order',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function permClaim(options = {}) {
|
|
50
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
51
|
+
return (tx) => tx.moveCall({
|
|
52
|
+
package: packageAddress,
|
|
53
|
+
module: 'account_data',
|
|
54
|
+
function: 'perm_claim',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export function permRequestClose(options = {}) {
|
|
58
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
59
|
+
return (tx) => tx.moveCall({
|
|
60
|
+
package: packageAddress,
|
|
61
|
+
module: 'account_data',
|
|
62
|
+
function: 'perm_request_close',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export function accountOrders(options) {
|
|
66
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
67
|
+
const argumentsTypes = [
|
|
68
|
+
null
|
|
69
|
+
];
|
|
70
|
+
const parameterNames = ["data"];
|
|
71
|
+
return (tx) => tx.moveCall({
|
|
72
|
+
package: packageAddress,
|
|
73
|
+
module: 'account_data',
|
|
74
|
+
function: 'account_orders',
|
|
75
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export function accountPositions(options) {
|
|
79
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
80
|
+
const argumentsTypes = [
|
|
81
|
+
null
|
|
82
|
+
];
|
|
83
|
+
const parameterNames = ["data"];
|
|
84
|
+
return (tx) => tx.moveCall({
|
|
85
|
+
package: packageAddress,
|
|
86
|
+
module: 'account_data',
|
|
87
|
+
function: 'account_positions',
|
|
88
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export function orderCount(options) {
|
|
92
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
93
|
+
const argumentsTypes = [
|
|
94
|
+
null
|
|
95
|
+
];
|
|
96
|
+
const parameterNames = ["data"];
|
|
97
|
+
return (tx) => tx.moveCall({
|
|
98
|
+
package: packageAddress,
|
|
99
|
+
module: 'account_data',
|
|
100
|
+
function: 'order_count',
|
|
101
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
export function positionCount(options) {
|
|
105
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
106
|
+
const argumentsTypes = [
|
|
107
|
+
null
|
|
108
|
+
];
|
|
109
|
+
const parameterNames = ["data"];
|
|
110
|
+
return (tx) => tx.moveCall({
|
|
111
|
+
package: packageAddress,
|
|
112
|
+
module: 'account_data',
|
|
113
|
+
function: 'position_count',
|
|
114
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export function orderFront(options) {
|
|
118
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
119
|
+
const argumentsTypes = [
|
|
120
|
+
null
|
|
121
|
+
];
|
|
122
|
+
const parameterNames = ["data"];
|
|
123
|
+
return (tx) => tx.moveCall({
|
|
124
|
+
package: packageAddress,
|
|
125
|
+
module: 'account_data',
|
|
126
|
+
function: 'order_front',
|
|
127
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export function orderBack(options) {
|
|
131
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
132
|
+
const argumentsTypes = [
|
|
133
|
+
null
|
|
134
|
+
];
|
|
135
|
+
const parameterNames = ["data"];
|
|
136
|
+
return (tx) => tx.moveCall({
|
|
137
|
+
package: packageAddress,
|
|
138
|
+
module: 'account_data',
|
|
139
|
+
function: 'order_back',
|
|
140
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
export function orderNext(options) {
|
|
144
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
145
|
+
const argumentsTypes = [
|
|
146
|
+
null,
|
|
147
|
+
'u64'
|
|
148
|
+
];
|
|
149
|
+
const parameterNames = ["data", "orderId"];
|
|
150
|
+
return (tx) => tx.moveCall({
|
|
151
|
+
package: packageAddress,
|
|
152
|
+
module: 'account_data',
|
|
153
|
+
function: 'order_next',
|
|
154
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export function positionFront(options) {
|
|
158
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
159
|
+
const argumentsTypes = [
|
|
160
|
+
null
|
|
161
|
+
];
|
|
162
|
+
const parameterNames = ["data"];
|
|
163
|
+
return (tx) => tx.moveCall({
|
|
164
|
+
package: packageAddress,
|
|
165
|
+
module: 'account_data',
|
|
166
|
+
function: 'position_front',
|
|
167
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export function positionBack(options) {
|
|
171
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
172
|
+
const argumentsTypes = [
|
|
173
|
+
null
|
|
174
|
+
];
|
|
175
|
+
const parameterNames = ["data"];
|
|
176
|
+
return (tx) => tx.moveCall({
|
|
177
|
+
package: packageAddress,
|
|
178
|
+
module: 'account_data',
|
|
179
|
+
function: 'position_back',
|
|
180
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export function positionNext(options) {
|
|
184
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
185
|
+
const argumentsTypes = [
|
|
186
|
+
null,
|
|
187
|
+
'u64'
|
|
188
|
+
];
|
|
189
|
+
const parameterNames = ["data", "positionId"];
|
|
190
|
+
return (tx) => tx.moveCall({
|
|
191
|
+
package: packageAddress,
|
|
192
|
+
module: 'account_data',
|
|
193
|
+
function: 'position_next',
|
|
194
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
export function orderMarketKey(options) {
|
|
198
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
199
|
+
const argumentsTypes = [
|
|
200
|
+
null,
|
|
201
|
+
'u64'
|
|
202
|
+
];
|
|
203
|
+
const parameterNames = ["data", "orderId"];
|
|
204
|
+
return (tx) => tx.moveCall({
|
|
205
|
+
package: packageAddress,
|
|
206
|
+
module: 'account_data',
|
|
207
|
+
function: 'order_market_key',
|
|
208
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
export function positionMarketKey(options) {
|
|
212
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
213
|
+
const argumentsTypes = [
|
|
214
|
+
null,
|
|
215
|
+
'u64'
|
|
216
|
+
];
|
|
217
|
+
const parameterNames = ["data", "positionId"];
|
|
218
|
+
return (tx) => tx.moveCall({
|
|
219
|
+
package: packageAddress,
|
|
220
|
+
module: 'account_data',
|
|
221
|
+
function: 'position_market_key',
|
|
222
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
export function marketOrderCount(options) {
|
|
226
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
227
|
+
const argumentsTypes = [
|
|
228
|
+
null,
|
|
229
|
+
'u64'
|
|
230
|
+
];
|
|
231
|
+
const parameterNames = ["data", "marketKey"];
|
|
232
|
+
return (tx) => tx.moveCall({
|
|
233
|
+
package: packageAddress,
|
|
234
|
+
module: 'account_data',
|
|
235
|
+
function: 'market_order_count',
|
|
236
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
export function marketPositionCount(options) {
|
|
240
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
241
|
+
const argumentsTypes = [
|
|
242
|
+
null,
|
|
243
|
+
'u64'
|
|
244
|
+
];
|
|
245
|
+
const parameterNames = ["data", "marketKey"];
|
|
246
|
+
return (tx) => tx.moveCall({
|
|
247
|
+
package: packageAddress,
|
|
248
|
+
module: 'account_data',
|
|
249
|
+
function: 'market_position_count',
|
|
250
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
export function marketOrderFront(options) {
|
|
254
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
255
|
+
const argumentsTypes = [
|
|
256
|
+
null,
|
|
257
|
+
'u64'
|
|
258
|
+
];
|
|
259
|
+
const parameterNames = ["data", "marketKey"];
|
|
260
|
+
return (tx) => tx.moveCall({
|
|
261
|
+
package: packageAddress,
|
|
262
|
+
module: 'account_data',
|
|
263
|
+
function: 'market_order_front',
|
|
264
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
export function marketOrderBack(options) {
|
|
268
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
269
|
+
const argumentsTypes = [
|
|
270
|
+
null,
|
|
271
|
+
'u64'
|
|
272
|
+
];
|
|
273
|
+
const parameterNames = ["data", "marketKey"];
|
|
274
|
+
return (tx) => tx.moveCall({
|
|
275
|
+
package: packageAddress,
|
|
276
|
+
module: 'account_data',
|
|
277
|
+
function: 'market_order_back',
|
|
278
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
export function marketOrderNext(options) {
|
|
282
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
283
|
+
const argumentsTypes = [
|
|
284
|
+
null,
|
|
285
|
+
'u64',
|
|
286
|
+
'u64'
|
|
287
|
+
];
|
|
288
|
+
const parameterNames = ["data", "marketKey", "orderId"];
|
|
289
|
+
return (tx) => tx.moveCall({
|
|
290
|
+
package: packageAddress,
|
|
291
|
+
module: 'account_data',
|
|
292
|
+
function: 'market_order_next',
|
|
293
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
export function marketPositionFront(options) {
|
|
297
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
298
|
+
const argumentsTypes = [
|
|
299
|
+
null,
|
|
300
|
+
'u64'
|
|
301
|
+
];
|
|
302
|
+
const parameterNames = ["data", "marketKey"];
|
|
303
|
+
return (tx) => tx.moveCall({
|
|
304
|
+
package: packageAddress,
|
|
305
|
+
module: 'account_data',
|
|
306
|
+
function: 'market_position_front',
|
|
307
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
export function marketPositionBack(options) {
|
|
311
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
312
|
+
const argumentsTypes = [
|
|
313
|
+
null,
|
|
314
|
+
'u64'
|
|
315
|
+
];
|
|
316
|
+
const parameterNames = ["data", "marketKey"];
|
|
317
|
+
return (tx) => tx.moveCall({
|
|
318
|
+
package: packageAddress,
|
|
319
|
+
module: 'account_data',
|
|
320
|
+
function: 'market_position_back',
|
|
321
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
export function marketPositionNext(options) {
|
|
325
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
326
|
+
const argumentsTypes = [
|
|
327
|
+
null,
|
|
328
|
+
'u64',
|
|
329
|
+
'u64'
|
|
330
|
+
];
|
|
331
|
+
const parameterNames = ["data", "marketKey", "positionId"];
|
|
332
|
+
return (tx) => tx.moveCall({
|
|
333
|
+
package: packageAddress,
|
|
334
|
+
module: 'account_data',
|
|
335
|
+
function: 'market_position_next',
|
|
336
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
export function orderIdsByMarket(options) {
|
|
340
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
341
|
+
const argumentsTypes = [
|
|
342
|
+
null,
|
|
343
|
+
'u64'
|
|
344
|
+
];
|
|
345
|
+
const parameterNames = ["data", "marketKey"];
|
|
346
|
+
return (tx) => tx.moveCall({
|
|
347
|
+
package: packageAddress,
|
|
348
|
+
module: 'account_data',
|
|
349
|
+
function: 'order_ids_by_market',
|
|
350
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
export function positionIdsByMarket(options) {
|
|
354
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
355
|
+
const argumentsTypes = [
|
|
356
|
+
null,
|
|
357
|
+
'u64'
|
|
358
|
+
];
|
|
359
|
+
const parameterNames = ["data", "marketKey"];
|
|
360
|
+
return (tx) => tx.moveCall({
|
|
361
|
+
package: packageAddress,
|
|
362
|
+
module: 'account_data',
|
|
363
|
+
function: 'position_ids_by_market',
|
|
364
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* True if a `WaterXPredictionData` slot exists on the wxa account. The slot
|
|
369
|
+
* auto-installs on first order/position add.
|
|
370
|
+
*/
|
|
371
|
+
export function hasAccount(options) {
|
|
372
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
373
|
+
const argumentsTypes = [
|
|
374
|
+
null,
|
|
375
|
+
'0x2::object::ID'
|
|
376
|
+
];
|
|
377
|
+
const parameterNames = ["wxaRegistry", "accountId"];
|
|
378
|
+
return (tx) => tx.moveCall({
|
|
379
|
+
package: packageAddress,
|
|
380
|
+
module: 'account_data',
|
|
381
|
+
function: 'has_account',
|
|
382
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/** Borrow the prediction data blob. Aborts if the account has not traded yet. */
|
|
386
|
+
export function borrowAccount(options) {
|
|
387
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
388
|
+
const argumentsTypes = [
|
|
389
|
+
null,
|
|
390
|
+
'0x2::object::ID'
|
|
391
|
+
];
|
|
392
|
+
const parameterNames = ["wxaRegistry", "accountId"];
|
|
393
|
+
return (tx) => tx.moveCall({
|
|
394
|
+
package: packageAddress,
|
|
395
|
+
module: 'account_data',
|
|
396
|
+
function: 'borrow_account',
|
|
397
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct } from '../utils/index.ts';
|
|
5
|
+
export declare const AdminCap: MoveStruct<any, any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct } from "../utils/index.js";
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = '@waterx/prediction::admin';
|
|
7
|
+
export const AdminCap = new MoveStruct({ name: `${$moduleName}::AdminCap`, fields: {
|
|
8
|
+
id: bcs.Address
|
|
9
|
+
} });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
export declare function LinkedTable<K extends BcsType<any>>(...typeParameters: [
|
|
7
|
+
K
|
|
8
|
+
]): MoveStruct<any, any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
+
const $moduleName = 'bucket_v2_framework::linked_table';
|
|
7
|
+
export function LinkedTable(...typeParameters) {
|
|
8
|
+
return new MoveStruct({ name: `${$moduleName}::LinkedTable<${typeParameters[0].name}, phantom V>`, fields: {
|
|
9
|
+
/** the ID of this table */
|
|
10
|
+
id: bcs.Address,
|
|
11
|
+
/** the number of key-value pairs in the table */
|
|
12
|
+
size: bcs.u64(),
|
|
13
|
+
/** the front of the table, i.e. the key of the first entry */
|
|
14
|
+
head: bcs.option(typeParameters[0]),
|
|
15
|
+
/** the back of the table, i.e. the key of the last entry */
|
|
16
|
+
tail: bcs.option(typeParameters[0])
|
|
17
|
+
} });
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
6
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
7
|
+
* and `Balance`s.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
10
|
+
export declare const Balance: MoveStruct<any, any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
6
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
7
|
+
* and `Balance`s.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
10
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
11
|
+
const $moduleName = '0x2::balance';
|
|
12
|
+
export const Balance = new MoveStruct({ name: `${$moduleName}::Balance<phantom T>`, fields: {
|
|
13
|
+
value: bcs.u64()
|
|
14
|
+
} });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
24
|
+
export declare const Table: MoveStruct<any, any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
24
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
+
const $moduleName = '0x2::table';
|
|
26
|
+
export const Table = new MoveStruct({ name: `${$moduleName}::Table<phantom K, phantom V>`, fields: {
|
|
27
|
+
/** the ID of this table */
|
|
28
|
+
id: bcs.Address,
|
|
29
|
+
/** the number of key-value pairs in the table */
|
|
30
|
+
size: bcs.u64()
|
|
31
|
+
} });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
/**
|
|
7
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
8
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
9
|
+
*
|
|
10
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
11
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
12
|
+
* insertion order iteration should be handwritten.
|
|
13
|
+
*/
|
|
14
|
+
export declare function VecSet<K extends BcsType<any>>(...typeParameters: [
|
|
15
|
+
K
|
|
16
|
+
]): MoveStruct<any, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
+
const $moduleName = '0x2::vec_set';
|
|
7
|
+
/**
|
|
8
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
9
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
10
|
+
*
|
|
11
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
12
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
13
|
+
* insertion order iteration should be handwritten.
|
|
14
|
+
*/
|
|
15
|
+
export function VecSet(...typeParameters) {
|
|
16
|
+
return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`, fields: {
|
|
17
|
+
contents: bcs.vector(typeParameters[0])
|
|
18
|
+
} });
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct } from '../utils/index.ts';
|
|
5
|
+
export declare const KeeperAdded: MoveStruct<any, any>;
|
|
6
|
+
export declare const KeeperRemoved: MoveStruct<any, any>;
|
|
7
|
+
export declare const OrderPlaced: MoveStruct<any, any>;
|
|
8
|
+
export declare const OrderFilled: MoveStruct<any, any>;
|
|
9
|
+
export declare const OrderCancelled: MoveStruct<any, any>;
|
|
10
|
+
export declare const MarketResolved: MoveStruct<any, any>;
|
|
11
|
+
export declare const PositionClaimed: MoveStruct<any, any>;
|
|
12
|
+
export declare const CloseRequested: MoveStruct<any, any>;
|
|
13
|
+
export declare const CloseConfirmed: MoveStruct<any, any>;
|
|
14
|
+
export declare const CloseCancelled: MoveStruct<any, any>;
|
|
15
|
+
export declare const MarketPaused: MoveStruct<any, any>;
|
|
16
|
+
export declare const MarketUnpaused: MoveStruct<any, any>;
|
|
17
|
+
export declare const MarketRegistryWithdrawn: MoveStruct<any, any>;
|
|
18
|
+
export declare const MinReserveUpdated: MoveStruct<any, any>;
|
|
19
|
+
export declare const OrderCancelCooldownUpdated: MoveStruct<any, any>;
|