@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,99 @@
|
|
|
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
|
+
import * as position from "./position.js";
|
|
7
|
+
import * as outcome from "./outcome.js";
|
|
8
|
+
const $moduleName = '@waterx/prediction::events';
|
|
9
|
+
export const KeeperAdded = new MoveStruct({ name: `${$moduleName}::KeeperAdded`, fields: {
|
|
10
|
+
global_config_id: bcs.Address,
|
|
11
|
+
keeper: bcs.Address
|
|
12
|
+
} });
|
|
13
|
+
export const KeeperRemoved = new MoveStruct({ name: `${$moduleName}::KeeperRemoved`, fields: {
|
|
14
|
+
global_config_id: bcs.Address,
|
|
15
|
+
keeper: bcs.Address
|
|
16
|
+
} });
|
|
17
|
+
export const OrderPlaced = new MoveStruct({ name: `${$moduleName}::OrderPlaced`, fields: {
|
|
18
|
+
market_registry_id: bcs.Address,
|
|
19
|
+
order_id: bcs.u64(),
|
|
20
|
+
account_id: bcs.Address,
|
|
21
|
+
market_id: bcs.vector(bcs.u8()),
|
|
22
|
+
selection: position.Selection,
|
|
23
|
+
max_spend: bcs.u64(),
|
|
24
|
+
min_shares: bcs.u64(),
|
|
25
|
+
price_cap: bcs.u64(),
|
|
26
|
+
expiry_ts: bcs.u64(),
|
|
27
|
+
self_cancel_after_ts: bcs.u64(),
|
|
28
|
+
/** True if this order was placed by an admin (Track A campaign etc.). */
|
|
29
|
+
by_admin: bcs.bool()
|
|
30
|
+
} });
|
|
31
|
+
export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`, fields: {
|
|
32
|
+
market_registry_id: bcs.Address,
|
|
33
|
+
order_id: bcs.u64(),
|
|
34
|
+
position_id: bcs.u64(),
|
|
35
|
+
filled_shares: bcs.u64(),
|
|
36
|
+
filled_cost: bcs.u64()
|
|
37
|
+
} });
|
|
38
|
+
export const OrderCancelled = new MoveStruct({ name: `${$moduleName}::OrderCancelled`, fields: {
|
|
39
|
+
market_registry_id: bcs.Address,
|
|
40
|
+
order_id: bcs.u64(),
|
|
41
|
+
refund_amount: bcs.u64()
|
|
42
|
+
} });
|
|
43
|
+
export const MarketResolved = new MoveStruct({ name: `${$moduleName}::MarketResolved`, fields: {
|
|
44
|
+
market_registry_id: bcs.Address,
|
|
45
|
+
market_id: bcs.vector(bcs.u8()),
|
|
46
|
+
outcome: outcome.Outcome
|
|
47
|
+
} });
|
|
48
|
+
export const PositionClaimed = new MoveStruct({ name: `${$moduleName}::PositionClaimed`, fields: {
|
|
49
|
+
market_registry_id: bcs.Address,
|
|
50
|
+
position_id: bcs.u64(),
|
|
51
|
+
payout: bcs.u64()
|
|
52
|
+
} });
|
|
53
|
+
export const CloseRequested = new MoveStruct({ name: `${$moduleName}::CloseRequested`, fields: {
|
|
54
|
+
market_registry_id: bcs.Address,
|
|
55
|
+
order_id: bcs.u64(),
|
|
56
|
+
position_id: bcs.u64(),
|
|
57
|
+
min_proceeds: bcs.u64(),
|
|
58
|
+
expiry_ts: bcs.u64(),
|
|
59
|
+
self_cancel_after_ts: bcs.u64()
|
|
60
|
+
} });
|
|
61
|
+
export const CloseConfirmed = new MoveStruct({ name: `${$moduleName}::CloseConfirmed`, fields: {
|
|
62
|
+
market_registry_id: bcs.Address,
|
|
63
|
+
order_id: bcs.u64(),
|
|
64
|
+
position_id: bcs.u64(),
|
|
65
|
+
proceeds: bcs.u64()
|
|
66
|
+
} });
|
|
67
|
+
export const CloseCancelled = new MoveStruct({ name: `${$moduleName}::CloseCancelled`, fields: {
|
|
68
|
+
market_registry_id: bcs.Address,
|
|
69
|
+
order_id: bcs.u64(),
|
|
70
|
+
position_id: bcs.u64(),
|
|
71
|
+
/** True if the user (not admin) initiated the cancel via self_cancel_close. */
|
|
72
|
+
by_self: bcs.bool()
|
|
73
|
+
} });
|
|
74
|
+
export const MarketPaused = new MoveStruct({ name: `${$moduleName}::MarketPaused`, fields: {
|
|
75
|
+
market_registry_id: bcs.Address,
|
|
76
|
+
market_key: bcs.u64(),
|
|
77
|
+
market_id: bcs.vector(bcs.u8())
|
|
78
|
+
} });
|
|
79
|
+
export const MarketUnpaused = new MoveStruct({ name: `${$moduleName}::MarketUnpaused`, fields: {
|
|
80
|
+
market_registry_id: bcs.Address,
|
|
81
|
+
market_key: bcs.u64(),
|
|
82
|
+
market_id: bcs.vector(bcs.u8())
|
|
83
|
+
} });
|
|
84
|
+
export const MarketRegistryWithdrawn = new MoveStruct({ name: `${$moduleName}::MarketRegistryWithdrawn`, fields: {
|
|
85
|
+
market_registry_id: bcs.Address,
|
|
86
|
+
amount: bcs.u64(),
|
|
87
|
+
recipient: bcs.Address,
|
|
88
|
+
new_balance: bcs.u64()
|
|
89
|
+
} });
|
|
90
|
+
export const MinReserveUpdated = new MoveStruct({ name: `${$moduleName}::MinReserveUpdated`, fields: {
|
|
91
|
+
market_registry_id: bcs.Address,
|
|
92
|
+
old_reserve: bcs.u64(),
|
|
93
|
+
new_reserve: bcs.u64()
|
|
94
|
+
} });
|
|
95
|
+
export const OrderCancelCooldownUpdated = new MoveStruct({ name: `${$moduleName}::OrderCancelCooldownUpdated`, fields: {
|
|
96
|
+
market_registry_id: bcs.Address,
|
|
97
|
+
old_cooldown_ms: bcs.u64(),
|
|
98
|
+
new_cooldown_ms: bcs.u64()
|
|
99
|
+
} });
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
|
+
export declare const GlobalConfig: MoveStruct<any, any>;
|
|
7
|
+
export interface AddKeeperArguments {
|
|
8
|
+
globalConfig: RawTransactionArgument<string>;
|
|
9
|
+
_: RawTransactionArgument<string>;
|
|
10
|
+
keeper: RawTransactionArgument<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface AddKeeperOptions {
|
|
13
|
+
package?: string;
|
|
14
|
+
arguments: AddKeeperArguments | [
|
|
15
|
+
globalConfig: RawTransactionArgument<string>,
|
|
16
|
+
_: RawTransactionArgument<string>,
|
|
17
|
+
keeper: RawTransactionArgument<string>
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
/** Admin configures which backend addresses may settle external order work. */
|
|
21
|
+
export declare function addKeeper(options: AddKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
22
|
+
export interface RemoveKeeperArguments {
|
|
23
|
+
globalConfig: RawTransactionArgument<string>;
|
|
24
|
+
_: RawTransactionArgument<string>;
|
|
25
|
+
keeper: RawTransactionArgument<string>;
|
|
26
|
+
}
|
|
27
|
+
export interface RemoveKeeperOptions {
|
|
28
|
+
package?: string;
|
|
29
|
+
arguments: RemoveKeeperArguments | [
|
|
30
|
+
globalConfig: RawTransactionArgument<string>,
|
|
31
|
+
_: RawTransactionArgument<string>,
|
|
32
|
+
keeper: RawTransactionArgument<string>
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
/** Admin removes a backend keeper. */
|
|
36
|
+
export declare function removeKeeper(options: RemoveKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
37
|
+
export interface IsKeeperArguments {
|
|
38
|
+
globalConfig: RawTransactionArgument<string>;
|
|
39
|
+
keeper: RawTransactionArgument<string>;
|
|
40
|
+
}
|
|
41
|
+
export interface IsKeeperOptions {
|
|
42
|
+
package?: string;
|
|
43
|
+
arguments: IsKeeperArguments | [
|
|
44
|
+
globalConfig: RawTransactionArgument<string>,
|
|
45
|
+
keeper: RawTransactionArgument<string>
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
export declare function isKeeper(options: IsKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
49
|
+
export interface KeeperCountArguments {
|
|
50
|
+
globalConfig: RawTransactionArgument<string>;
|
|
51
|
+
}
|
|
52
|
+
export interface KeeperCountOptions {
|
|
53
|
+
package?: string;
|
|
54
|
+
arguments: KeeperCountArguments | [
|
|
55
|
+
globalConfig: RawTransactionArgument<string>
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
export declare function keeperCount(options: KeeperCountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
59
|
+
export interface KeeperAddressesArguments {
|
|
60
|
+
globalConfig: RawTransactionArgument<string>;
|
|
61
|
+
}
|
|
62
|
+
export interface KeeperAddressesOptions {
|
|
63
|
+
package?: string;
|
|
64
|
+
arguments: KeeperAddressesArguments | [
|
|
65
|
+
globalConfig: RawTransactionArgument<string>
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
export declare function keeperAddresses(options: KeeperAddressesOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 vec_set from "./deps/sui/vec_set.js";
|
|
7
|
+
const $moduleName = '@waterx/prediction::global_config';
|
|
8
|
+
export const GlobalConfig = new MoveStruct({ name: `${$moduleName}::GlobalConfig`, fields: {
|
|
9
|
+
id: bcs.Address,
|
|
10
|
+
keepers: vec_set.VecSet(bcs.Address)
|
|
11
|
+
} });
|
|
12
|
+
/** Admin configures which backend addresses may settle external order work. */
|
|
13
|
+
export function addKeeper(options) {
|
|
14
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
15
|
+
const argumentsTypes = [
|
|
16
|
+
null,
|
|
17
|
+
null,
|
|
18
|
+
'address'
|
|
19
|
+
];
|
|
20
|
+
const parameterNames = ["globalConfig", "_", "keeper"];
|
|
21
|
+
return (tx) => tx.moveCall({
|
|
22
|
+
package: packageAddress,
|
|
23
|
+
module: 'global_config',
|
|
24
|
+
function: 'add_keeper',
|
|
25
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** Admin removes a backend keeper. */
|
|
29
|
+
export function removeKeeper(options) {
|
|
30
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
31
|
+
const argumentsTypes = [
|
|
32
|
+
null,
|
|
33
|
+
null,
|
|
34
|
+
'address'
|
|
35
|
+
];
|
|
36
|
+
const parameterNames = ["globalConfig", "_", "keeper"];
|
|
37
|
+
return (tx) => tx.moveCall({
|
|
38
|
+
package: packageAddress,
|
|
39
|
+
module: 'global_config',
|
|
40
|
+
function: 'remove_keeper',
|
|
41
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export function isKeeper(options) {
|
|
45
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
46
|
+
const argumentsTypes = [
|
|
47
|
+
null,
|
|
48
|
+
'address'
|
|
49
|
+
];
|
|
50
|
+
const parameterNames = ["globalConfig", "keeper"];
|
|
51
|
+
return (tx) => tx.moveCall({
|
|
52
|
+
package: packageAddress,
|
|
53
|
+
module: 'global_config',
|
|
54
|
+
function: 'is_keeper',
|
|
55
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function keeperCount(options) {
|
|
59
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
60
|
+
const argumentsTypes = [
|
|
61
|
+
null
|
|
62
|
+
];
|
|
63
|
+
const parameterNames = ["globalConfig"];
|
|
64
|
+
return (tx) => tx.moveCall({
|
|
65
|
+
package: packageAddress,
|
|
66
|
+
module: 'global_config',
|
|
67
|
+
function: 'keeper_count',
|
|
68
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export function keeperAddresses(options) {
|
|
72
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
73
|
+
const argumentsTypes = [
|
|
74
|
+
null
|
|
75
|
+
];
|
|
76
|
+
const parameterNames = ["globalConfig"];
|
|
77
|
+
return (tx) => tx.moveCall({
|
|
78
|
+
package: packageAddress,
|
|
79
|
+
module: 'global_config',
|
|
80
|
+
function: 'keeper_addresses',
|
|
81
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
|
+
export declare const OrderKind: MoveEnum<{
|
|
7
|
+
Open: null;
|
|
8
|
+
Close: null;
|
|
9
|
+
}, "@waterx/prediction::order::OrderKind">;
|
|
10
|
+
export declare const Order: MoveStruct<any, any>;
|
|
11
|
+
export interface KindArguments {
|
|
12
|
+
order: RawTransactionArgument<string>;
|
|
13
|
+
}
|
|
14
|
+
export interface KindOptions {
|
|
15
|
+
package?: string;
|
|
16
|
+
arguments: KindArguments | [
|
|
17
|
+
order: RawTransactionArgument<string>
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
export declare function kind(options: KindOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
21
|
+
export interface AccountIdArguments {
|
|
22
|
+
order: RawTransactionArgument<string>;
|
|
23
|
+
}
|
|
24
|
+
export interface AccountIdOptions {
|
|
25
|
+
package?: string;
|
|
26
|
+
arguments: AccountIdArguments | [
|
|
27
|
+
order: RawTransactionArgument<string>
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
export declare function accountId(options: AccountIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
31
|
+
export interface MarketIdArguments {
|
|
32
|
+
order: RawTransactionArgument<string>;
|
|
33
|
+
}
|
|
34
|
+
export interface MarketIdOptions {
|
|
35
|
+
package?: string;
|
|
36
|
+
arguments: MarketIdArguments | [
|
|
37
|
+
order: RawTransactionArgument<string>
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
export declare function marketId(options: MarketIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
41
|
+
export interface SelectionArguments {
|
|
42
|
+
order: RawTransactionArgument<string>;
|
|
43
|
+
}
|
|
44
|
+
export interface SelectionOptions {
|
|
45
|
+
package?: string;
|
|
46
|
+
arguments: SelectionArguments | [
|
|
47
|
+
order: RawTransactionArgument<string>
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
export declare function selection(options: SelectionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
51
|
+
export interface PositionIdArguments {
|
|
52
|
+
order: RawTransactionArgument<string>;
|
|
53
|
+
}
|
|
54
|
+
export interface PositionIdOptions {
|
|
55
|
+
package?: string;
|
|
56
|
+
arguments: PositionIdArguments | [
|
|
57
|
+
order: RawTransactionArgument<string>
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export declare function positionId(options: PositionIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
61
|
+
export interface MaxSpendArguments {
|
|
62
|
+
order: RawTransactionArgument<string>;
|
|
63
|
+
}
|
|
64
|
+
export interface MaxSpendOptions {
|
|
65
|
+
package?: string;
|
|
66
|
+
arguments: MaxSpendArguments | [
|
|
67
|
+
order: RawTransactionArgument<string>
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
export declare function maxSpend(options: MaxSpendOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
71
|
+
export interface MinSharesArguments {
|
|
72
|
+
order: RawTransactionArgument<string>;
|
|
73
|
+
}
|
|
74
|
+
export interface MinSharesOptions {
|
|
75
|
+
package?: string;
|
|
76
|
+
arguments: MinSharesArguments | [
|
|
77
|
+
order: RawTransactionArgument<string>
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
export declare function minShares(options: MinSharesOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
81
|
+
export interface PriceCapArguments {
|
|
82
|
+
order: RawTransactionArgument<string>;
|
|
83
|
+
}
|
|
84
|
+
export interface PriceCapOptions {
|
|
85
|
+
package?: string;
|
|
86
|
+
arguments: PriceCapArguments | [
|
|
87
|
+
order: RawTransactionArgument<string>
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
export declare function priceCap(options: PriceCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
91
|
+
export interface MinProceedsArguments {
|
|
92
|
+
order: RawTransactionArgument<string>;
|
|
93
|
+
}
|
|
94
|
+
export interface MinProceedsOptions {
|
|
95
|
+
package?: string;
|
|
96
|
+
arguments: MinProceedsArguments | [
|
|
97
|
+
order: RawTransactionArgument<string>
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
export declare function minProceeds(options: MinProceedsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
101
|
+
export interface ExpiryTsArguments {
|
|
102
|
+
order: RawTransactionArgument<string>;
|
|
103
|
+
}
|
|
104
|
+
export interface ExpiryTsOptions {
|
|
105
|
+
package?: string;
|
|
106
|
+
arguments: ExpiryTsArguments | [
|
|
107
|
+
order: RawTransactionArgument<string>
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
export declare function expiryTs(options: ExpiryTsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
111
|
+
export interface SelfCancelAfterTsArguments {
|
|
112
|
+
order: RawTransactionArgument<string>;
|
|
113
|
+
}
|
|
114
|
+
export interface SelfCancelAfterTsOptions {
|
|
115
|
+
package?: string;
|
|
116
|
+
arguments: SelfCancelAfterTsArguments | [
|
|
117
|
+
order: RawTransactionArgument<string>
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
export declare function selfCancelAfterTs(options: SelfCancelAfterTsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
121
|
+
export interface ByAdminArguments {
|
|
122
|
+
order: RawTransactionArgument<string>;
|
|
123
|
+
}
|
|
124
|
+
export interface ByAdminOptions {
|
|
125
|
+
package?: string;
|
|
126
|
+
arguments: ByAdminArguments | [
|
|
127
|
+
order: RawTransactionArgument<string>
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
export declare function byAdmin(options: ByAdminOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
131
|
+
export interface IsOpenArguments {
|
|
132
|
+
order: RawTransactionArgument<string>;
|
|
133
|
+
}
|
|
134
|
+
export interface IsOpenOptions {
|
|
135
|
+
package?: string;
|
|
136
|
+
arguments: IsOpenArguments | [
|
|
137
|
+
order: RawTransactionArgument<string>
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
export declare function isOpen(options: IsOpenOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
141
|
+
export interface IsCloseArguments {
|
|
142
|
+
order: RawTransactionArgument<string>;
|
|
143
|
+
}
|
|
144
|
+
export interface IsCloseOptions {
|
|
145
|
+
package?: string;
|
|
146
|
+
arguments: IsCloseArguments | [
|
|
147
|
+
order: RawTransactionArgument<string>
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
export declare function isClose(options: IsCloseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
151
|
+
export interface KindIsOpenArguments {
|
|
152
|
+
kind: RawTransactionArgument<string>;
|
|
153
|
+
}
|
|
154
|
+
export interface KindIsOpenOptions {
|
|
155
|
+
package?: string;
|
|
156
|
+
arguments: KindIsOpenArguments | [
|
|
157
|
+
kind: RawTransactionArgument<string>
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
export declare function kindIsOpen(options: KindIsOpenOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
161
|
+
export interface KindIsCloseArguments {
|
|
162
|
+
kind: RawTransactionArgument<string>;
|
|
163
|
+
}
|
|
164
|
+
export interface KindIsCloseOptions {
|
|
165
|
+
package?: string;
|
|
166
|
+
arguments: KindIsCloseArguments | [
|
|
167
|
+
kind: RawTransactionArgument<string>
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
export declare function kindIsClose(options: KindIsCloseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveEnum, MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
import * as position from "./position.js";
|
|
7
|
+
const $moduleName = '@waterx/prediction::order';
|
|
8
|
+
export const OrderKind = new MoveEnum({ name: `${$moduleName}::OrderKind`, fields: {
|
|
9
|
+
Open: null,
|
|
10
|
+
Close: null
|
|
11
|
+
} });
|
|
12
|
+
export const Order = new MoveStruct({ name: `${$moduleName}::Order`, fields: {
|
|
13
|
+
kind: OrderKind,
|
|
14
|
+
account_id: bcs.Address,
|
|
15
|
+
market_id: bcs.vector(bcs.u8()),
|
|
16
|
+
selection: position.Selection,
|
|
17
|
+
/** `Some(position_id)` only for close orders. */
|
|
18
|
+
position_id: bcs.option(bcs.u64()),
|
|
19
|
+
/** Open-order spend escrowed in `MarketRegistry.balance`. */
|
|
20
|
+
max_spend: bcs.u64(),
|
|
21
|
+
min_shares: bcs.u64(),
|
|
22
|
+
price_cap: bcs.u64(),
|
|
23
|
+
/** Close-order slippage floor. */
|
|
24
|
+
min_proceeds: bcs.u64(),
|
|
25
|
+
expiry_ts: bcs.u64(),
|
|
26
|
+
/** Earliest timestamp at which the account owner may self-cancel. */
|
|
27
|
+
self_cancel_after_ts: bcs.u64(),
|
|
28
|
+
by_admin: bcs.bool()
|
|
29
|
+
} });
|
|
30
|
+
export function kind(options) {
|
|
31
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
32
|
+
const argumentsTypes = [
|
|
33
|
+
null
|
|
34
|
+
];
|
|
35
|
+
const parameterNames = ["order"];
|
|
36
|
+
return (tx) => tx.moveCall({
|
|
37
|
+
package: packageAddress,
|
|
38
|
+
module: 'order',
|
|
39
|
+
function: 'kind',
|
|
40
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function accountId(options) {
|
|
44
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
45
|
+
const argumentsTypes = [
|
|
46
|
+
null
|
|
47
|
+
];
|
|
48
|
+
const parameterNames = ["order"];
|
|
49
|
+
return (tx) => tx.moveCall({
|
|
50
|
+
package: packageAddress,
|
|
51
|
+
module: 'order',
|
|
52
|
+
function: 'account_id',
|
|
53
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function marketId(options) {
|
|
57
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
58
|
+
const argumentsTypes = [
|
|
59
|
+
null
|
|
60
|
+
];
|
|
61
|
+
const parameterNames = ["order"];
|
|
62
|
+
return (tx) => tx.moveCall({
|
|
63
|
+
package: packageAddress,
|
|
64
|
+
module: 'order',
|
|
65
|
+
function: 'market_id',
|
|
66
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export function selection(options) {
|
|
70
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
71
|
+
const argumentsTypes = [
|
|
72
|
+
null
|
|
73
|
+
];
|
|
74
|
+
const parameterNames = ["order"];
|
|
75
|
+
return (tx) => tx.moveCall({
|
|
76
|
+
package: packageAddress,
|
|
77
|
+
module: 'order',
|
|
78
|
+
function: 'selection',
|
|
79
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export function positionId(options) {
|
|
83
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
84
|
+
const argumentsTypes = [
|
|
85
|
+
null
|
|
86
|
+
];
|
|
87
|
+
const parameterNames = ["order"];
|
|
88
|
+
return (tx) => tx.moveCall({
|
|
89
|
+
package: packageAddress,
|
|
90
|
+
module: 'order',
|
|
91
|
+
function: 'position_id',
|
|
92
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export function maxSpend(options) {
|
|
96
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
97
|
+
const argumentsTypes = [
|
|
98
|
+
null
|
|
99
|
+
];
|
|
100
|
+
const parameterNames = ["order"];
|
|
101
|
+
return (tx) => tx.moveCall({
|
|
102
|
+
package: packageAddress,
|
|
103
|
+
module: 'order',
|
|
104
|
+
function: 'max_spend',
|
|
105
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export function minShares(options) {
|
|
109
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
110
|
+
const argumentsTypes = [
|
|
111
|
+
null
|
|
112
|
+
];
|
|
113
|
+
const parameterNames = ["order"];
|
|
114
|
+
return (tx) => tx.moveCall({
|
|
115
|
+
package: packageAddress,
|
|
116
|
+
module: 'order',
|
|
117
|
+
function: 'min_shares',
|
|
118
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export function priceCap(options) {
|
|
122
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
123
|
+
const argumentsTypes = [
|
|
124
|
+
null
|
|
125
|
+
];
|
|
126
|
+
const parameterNames = ["order"];
|
|
127
|
+
return (tx) => tx.moveCall({
|
|
128
|
+
package: packageAddress,
|
|
129
|
+
module: 'order',
|
|
130
|
+
function: 'price_cap',
|
|
131
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
export function minProceeds(options) {
|
|
135
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
136
|
+
const argumentsTypes = [
|
|
137
|
+
null
|
|
138
|
+
];
|
|
139
|
+
const parameterNames = ["order"];
|
|
140
|
+
return (tx) => tx.moveCall({
|
|
141
|
+
package: packageAddress,
|
|
142
|
+
module: 'order',
|
|
143
|
+
function: 'min_proceeds',
|
|
144
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
export function expiryTs(options) {
|
|
148
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
149
|
+
const argumentsTypes = [
|
|
150
|
+
null
|
|
151
|
+
];
|
|
152
|
+
const parameterNames = ["order"];
|
|
153
|
+
return (tx) => tx.moveCall({
|
|
154
|
+
package: packageAddress,
|
|
155
|
+
module: 'order',
|
|
156
|
+
function: 'expiry_ts',
|
|
157
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
export function selfCancelAfterTs(options) {
|
|
161
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
162
|
+
const argumentsTypes = [
|
|
163
|
+
null
|
|
164
|
+
];
|
|
165
|
+
const parameterNames = ["order"];
|
|
166
|
+
return (tx) => tx.moveCall({
|
|
167
|
+
package: packageAddress,
|
|
168
|
+
module: 'order',
|
|
169
|
+
function: 'self_cancel_after_ts',
|
|
170
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
export function byAdmin(options) {
|
|
174
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
175
|
+
const argumentsTypes = [
|
|
176
|
+
null
|
|
177
|
+
];
|
|
178
|
+
const parameterNames = ["order"];
|
|
179
|
+
return (tx) => tx.moveCall({
|
|
180
|
+
package: packageAddress,
|
|
181
|
+
module: 'order',
|
|
182
|
+
function: 'by_admin',
|
|
183
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
export function isOpen(options) {
|
|
187
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
188
|
+
const argumentsTypes = [
|
|
189
|
+
null
|
|
190
|
+
];
|
|
191
|
+
const parameterNames = ["order"];
|
|
192
|
+
return (tx) => tx.moveCall({
|
|
193
|
+
package: packageAddress,
|
|
194
|
+
module: 'order',
|
|
195
|
+
function: 'is_open',
|
|
196
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
export function isClose(options) {
|
|
200
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
201
|
+
const argumentsTypes = [
|
|
202
|
+
null
|
|
203
|
+
];
|
|
204
|
+
const parameterNames = ["order"];
|
|
205
|
+
return (tx) => tx.moveCall({
|
|
206
|
+
package: packageAddress,
|
|
207
|
+
module: 'order',
|
|
208
|
+
function: 'is_close',
|
|
209
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
export function kindIsOpen(options) {
|
|
213
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
214
|
+
const argumentsTypes = [
|
|
215
|
+
null
|
|
216
|
+
];
|
|
217
|
+
const parameterNames = ["kind"];
|
|
218
|
+
return (tx) => tx.moveCall({
|
|
219
|
+
package: packageAddress,
|
|
220
|
+
module: 'order',
|
|
221
|
+
function: 'kind_is_open',
|
|
222
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
export function kindIsClose(options) {
|
|
226
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
227
|
+
const argumentsTypes = [
|
|
228
|
+
null
|
|
229
|
+
];
|
|
230
|
+
const parameterNames = ["kind"];
|
|
231
|
+
return (tx) => tx.moveCall({
|
|
232
|
+
package: packageAddress,
|
|
233
|
+
module: 'order',
|
|
234
|
+
function: 'kind_is_close',
|
|
235
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
236
|
+
});
|
|
237
|
+
}
|