@waterx/sdk 2.1.0 → 2.3.1-dev.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/README.md +75 -169
- package/dist/src/client.d.ts +52 -2
- package/dist/src/client.js +76 -6
- package/dist/src/config.d.ts +57 -3
- package/dist/src/config.js +10 -4
- package/dist/src/constants.d.ts +6 -0
- package/dist/src/constants.js +6 -0
- package/dist/src/core/waterx-account.d.ts +31 -0
- package/dist/src/core/waterx-account.js +26 -0
- package/dist/src/fetch.d.ts +110 -0
- package/dist/src/fetch.js +149 -4
- package/dist/src/generated/bucket_v2_framework/account.d.ts +5 -5
- package/dist/src/generated/bucket_v2_framework/double.d.ts +77 -77
- package/dist/src/generated/bucket_v2_framework/float.d.ts +73 -73
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +33 -33
- package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +5 -5
- package/dist/src/generated/bucket_v2_framework/linked_table.js +2 -2
- package/dist/src/generated/bucket_v2_framework/sheet.d.ts +57 -57
- package/dist/src/generated/bucket_v2_framework/sheet.js +5 -11
- package/dist/src/generated/native_custody/custody_vault.d.ts +46 -32
- package/dist/src/generated/native_custody/custody_vault.js +19 -10
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/native_custody/events.js +1 -2
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +7 -7
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +1 -2
- package/dist/src/generated/utils/index.d.ts +7 -7
- package/dist/src/generated/utils/index.js +9 -6
- package/dist/src/generated/waterx_account/account.d.ts +124 -71
- package/dist/src/generated/waterx_account/account.js +64 -29
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/waterx_account/direct_rule.d.ts +5 -5
- package/dist/src/generated/waterx_account/events.d.ts +10 -0
- package/dist/src/generated/waterx_account/events.js +31 -50
- package/dist/src/generated/waterx_constant_rule/constant_rule.d.ts +68 -0
- package/dist/src/generated/waterx_constant_rule/constant_rule.js +59 -0
- package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_credit/credit_registry.d.ts +9 -9
- package/dist/src/generated/waterx_credit/credit_registry.js +1 -2
- package/dist/src/generated/waterx_credit/limited_supply.d.ts +17 -17
- package/dist/src/generated/waterx_oracle/aggregator.js +1 -2
- package/dist/src/generated/waterx_oracle/collector.d.ts +17 -17
- package/dist/src/generated/waterx_oracle/collector.js +1 -1
- package/dist/src/generated/waterx_oracle/oracle.d.ts +5 -5
- package/dist/src/generated/waterx_perp/account_data.d.ts +5 -5
- package/dist/src/generated/waterx_perp/account_data.js +1 -2
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/waterx_perp/events.d.ts +181 -181
- package/dist/src/generated/waterx_perp/events.js +87 -173
- package/dist/src/generated/waterx_perp/global_config.d.ts +3 -3
- package/dist/src/generated/waterx_perp/global_config.js +6 -12
- package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +9 -9
- package/dist/src/generated/waterx_perp/keyed_big_vector.js +1 -2
- package/dist/src/generated/waterx_perp/lp_pool.d.ts +115 -115
- package/dist/src/generated/waterx_perp/lp_pool.js +11 -22
- package/dist/src/generated/waterx_perp/market_config.d.ts +61 -43
- package/dist/src/generated/waterx_perp/market_config.js +29 -22
- package/dist/src/generated/waterx_perp/math.d.ts +7 -7
- package/dist/src/generated/waterx_perp/order_book.d.ts +47 -47
- package/dist/src/generated/waterx_perp/position.d.ts +99 -99
- package/dist/src/generated/waterx_perp/position.js +6 -12
- package/dist/src/generated/waterx_perp/request.d.ts +67 -67
- package/dist/src/generated/waterx_perp/request.js +2 -3
- package/dist/src/generated/waterx_perp/response.d.ts +35 -35
- package/dist/src/generated/waterx_perp/response.js +1 -2
- package/dist/src/generated/waterx_perp/trading.d.ts +303 -179
- package/dist/src/generated/waterx_perp/trading.js +99 -14
- package/dist/src/generated/waterx_perp_view/view.js +5 -10
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +5 -5
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +1 -2
- package/dist/src/generated/waterx_referral/referral_table.d.ts +5 -5
- package/dist/src/generated/waterx_referral/referral_table.js +1 -2
- package/dist/src/generated/waterx_staking/waterx_staking.d.ts +19 -19
- package/dist/src/generated/waterx_staking/waterx_staking.js +10 -20
- package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_supra_rule/supra_rule.d.ts +158 -0
- package/dist/src/generated/waterx_supra_rule/supra_rule.js +148 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +444 -4
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +417 -4
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +214 -74
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +158 -29
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.js +3 -2
- package/dist/src/prediction/account.d.ts +96 -0
- package/dist/src/prediction/account.js +230 -0
- package/dist/src/prediction/admin.d.ts +47 -0
- package/dist/src/prediction/admin.js +105 -0
- package/dist/src/prediction/bcs.d.ts +22 -0
- package/dist/src/prediction/bcs.js +240 -0
- package/dist/src/prediction/client.d.ts +75 -0
- package/dist/src/prediction/client.js +164 -0
- package/dist/src/prediction/config.d.ts +60 -0
- package/dist/src/prediction/config.js +75 -0
- package/dist/src/prediction/constants.d.ts +44 -0
- package/dist/src/prediction/constants.js +46 -0
- package/dist/src/prediction/fetch.d.ts +82 -0
- package/dist/src/prediction/fetch.js +270 -0
- package/dist/src/prediction/generated/bucket_v2_framework/account.d.ts +100 -0
- package/dist/src/prediction/generated/bucket_v2_framework/account.js +129 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/bucket_v2_framework/double.d.ts +382 -0
- package/dist/src/prediction/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/prediction/generated/bucket_v2_framework/float.d.ts +362 -0
- package/dist/src/prediction/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/prediction/generated/bucket_v2_framework/liability.d.ts +193 -0
- package/dist/src/prediction/generated/bucket_v2_framework/liability.js +205 -0
- package/dist/src/prediction/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/src/prediction/generated/bucket_v2_framework/linked_table.js +382 -0
- package/dist/src/prediction/generated/bucket_v2_framework/sheet.d.ts +344 -0
- package/dist/src/prediction/generated/bucket_v2_framework/sheet.js +338 -0
- package/dist/src/prediction/generated/utils/index.d.ts +30 -0
- package/dist/src/prediction/generated/utils/index.js +160 -0
- package/dist/src/prediction/generated/waterx_account/account.d.ts +1589 -0
- package/dist/src/prediction/generated/waterx_account/account.js +1758 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +7 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +7 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.js +16 -0
- package/dist/src/prediction/generated/waterx_account/deps/std/type_name.d.ts +6 -0
- package/dist/src/prediction/generated/waterx_account/deps/std/type_name.js +19 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.d.ts +12 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.js +19 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/table.d.ts +24 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/table.js +31 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.js +27 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/waterx_account/direct_rule.d.ts +75 -0
- package/dist/src/prediction/generated/waterx_account/direct_rule.js +78 -0
- package/dist/src/prediction/generated/waterx_account/events.d.ts +33 -0
- package/dist/src/prediction/generated/waterx_account/events.js +137 -0
- package/dist/src/prediction/generated/waterx_account/version.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_account/version.js +8 -0
- package/dist/src/prediction/generated/waterx_prediction/account_data.d.ts +327 -0
- package/dist/src/prediction/generated/waterx_prediction/account_data.js +405 -0
- package/dist/src/prediction/generated/waterx_prediction/admin.d.ts +5 -0
- package/dist/src/prediction/generated/waterx_prediction/admin.js +9 -0
- package/dist/src/prediction/generated/waterx_prediction/bet_sharing.d.ts +60 -0
- package/dist/src/prediction/generated/waterx_prediction/bet_sharing.js +83 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.js +31 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/waterx_prediction/events.d.ts +22 -0
- package/dist/src/prediction/generated/waterx_prediction/events.js +179 -0
- package/dist/src/prediction/generated/waterx_prediction/global_config.d.ts +116 -0
- package/dist/src/prediction/generated/waterx_prediction/global_config.js +141 -0
- package/dist/src/prediction/generated/waterx_prediction/order.d.ts +200 -0
- package/dist/src/prediction/generated/waterx_prediction/order.js +284 -0
- package/dist/src/prediction/generated/waterx_prediction/outcome.d.ts +58 -0
- package/dist/src/prediction/generated/waterx_prediction/outcome.js +73 -0
- package/dist/src/prediction/generated/waterx_prediction/position.d.ts +160 -0
- package/dist/src/prediction/generated/waterx_prediction/position.js +214 -0
- package/dist/src/prediction/generated/waterx_prediction/version.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_prediction/version.js +8 -0
- package/dist/src/prediction/generated/waterx_prediction/view.d.ts +353 -0
- package/dist/src/prediction/generated/waterx_prediction/view.js +432 -0
- package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.d.ts +1698 -0
- package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.js +1733 -0
- package/dist/src/prediction/gift-link.d.ts +6 -0
- package/dist/src/prediction/gift-link.js +5 -0
- package/dist/src/prediction/gift.d.ts +223 -0
- package/dist/src/prediction/gift.js +451 -0
- package/dist/src/prediction/index.d.ts +29 -0
- package/dist/src/prediction/index.js +21 -0
- package/dist/src/prediction/prediction.d.ts +104 -0
- package/dist/src/prediction/prediction.js +317 -0
- package/dist/src/prediction/tx-builders.d.ts +44 -0
- package/dist/src/prediction/tx-builders.js +52 -0
- package/dist/src/prediction/types.d.ts +93 -0
- package/dist/src/prediction/types.js +1 -0
- package/dist/src/prediction/user/account.d.ts +2 -0
- package/dist/src/prediction/user/account.js +1 -0
- package/dist/src/prediction/user/admin.d.ts +6 -0
- package/dist/src/prediction/user/admin.js +3 -0
- package/dist/src/prediction/user/gift.d.ts +2 -0
- package/dist/src/prediction/user/gift.js +1 -0
- package/dist/src/prediction/user/index.d.ts +5 -0
- package/dist/src/prediction/user/index.js +3 -0
- package/dist/src/prediction/user/keeper.d.ts +2 -0
- package/dist/src/prediction/user/keeper.js +1 -0
- package/dist/src/prediction/user/order.d.ts +2 -0
- package/dist/src/prediction/user/order.js +1 -0
- package/dist/src/prediction/user/position.d.ts +2 -0
- package/dist/src/prediction/user/position.js +1 -0
- package/dist/src/prediction/utils/bcs.d.ts +1 -0
- package/dist/src/prediction/utils/bcs.js +1 -0
- package/dist/src/prediction/utils/index.d.ts +1 -0
- package/dist/src/prediction/utils/index.js +1 -0
- package/dist/src/prediction/utils.d.ts +30 -0
- package/dist/src/prediction/utils.js +177 -0
- package/dist/src/sdk.d.ts +18 -0
- package/dist/src/sdk.js +17 -0
- package/dist/src/tx-builders.d.ts +54 -0
- package/dist/src/tx-builders.js +141 -0
- package/dist/src/unified-client.d.ts +407 -0
- package/dist/src/unified-client.js +123 -0
- package/dist/src/user/account.d.ts +27 -0
- package/dist/src/user/account.js +34 -8
- package/dist/src/user/credit.d.ts +8 -14
- package/dist/src/user/credit.js +9 -23
- package/dist/src/user/custody.d.ts +4 -18
- package/dist/src/user/custody.js +14 -25
- package/dist/src/utils/consolidate-balance.d.ts +37 -0
- package/dist/src/utils/consolidate-balance.js +89 -0
- package/dist/src/utils/math.d.ts +86 -0
- package/dist/src/utils/math.js +100 -0
- package/dist/src/utils/pyth.d.ts +35 -3
- package/dist/src/utils/pyth.js +145 -14
- package/package.json +129 -34
|
@@ -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,22 @@
|
|
|
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 MarketCreated: MoveStruct<any, any>;
|
|
8
|
+
export declare const OrderPlaced: MoveStruct<any, any>;
|
|
9
|
+
export declare const OrderFilled: MoveStruct<any, any>;
|
|
10
|
+
export declare const OrderCancelled: MoveStruct<any, any>;
|
|
11
|
+
export declare const MarketResolved: MoveStruct<any, any>;
|
|
12
|
+
export declare const PositionClaimed: MoveStruct<any, any>;
|
|
13
|
+
export declare const PositionTransferred: MoveStruct<any, any>;
|
|
14
|
+
export declare const PositionSplit: MoveStruct<any, any>;
|
|
15
|
+
export declare const CloseRequested: MoveStruct<any, any>;
|
|
16
|
+
export declare const CloseConfirmed: MoveStruct<any, any>;
|
|
17
|
+
export declare const CloseCancelled: MoveStruct<any, any>;
|
|
18
|
+
export declare const MarketPaused: MoveStruct<any, any>;
|
|
19
|
+
export declare const MarketUnpaused: MoveStruct<any, any>;
|
|
20
|
+
export declare const MarketRegistryWithdrawn: MoveStruct<any, any>;
|
|
21
|
+
export declare const MinReserveUpdated: MoveStruct<any, any>;
|
|
22
|
+
export declare const OrderCancelCooldownUpdated: MoveStruct<any, any>;
|
|
@@ -0,0 +1,179 @@
|
|
|
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 MarketCreated = new MoveStruct({ name: `${$moduleName}::MarketCreated`, fields: {
|
|
18
|
+
market_registry_id: bcs.Address,
|
|
19
|
+
market_key: bcs.u64(),
|
|
20
|
+
market_id: bcs.vector(bcs.u8()),
|
|
21
|
+
by_admin: bcs.bool(),
|
|
22
|
+
event_ts: bcs.u64()
|
|
23
|
+
} });
|
|
24
|
+
export const OrderPlaced = new MoveStruct({ name: `${$moduleName}::OrderPlaced`, fields: {
|
|
25
|
+
market_registry_id: bcs.Address,
|
|
26
|
+
order_id: bcs.u64(),
|
|
27
|
+
/** Funding/refund account for the pending order. */
|
|
28
|
+
account_id: bcs.Address,
|
|
29
|
+
/** Account that receives the position after fill. */
|
|
30
|
+
receiver_account_id: bcs.Address,
|
|
31
|
+
market_key: bcs.u64(),
|
|
32
|
+
market_id: bcs.vector(bcs.u8()),
|
|
33
|
+
selection: position.Selection,
|
|
34
|
+
max_spend: bcs.u64(),
|
|
35
|
+
min_shares: bcs.u64(),
|
|
36
|
+
price_cap: bcs.u64(),
|
|
37
|
+
expiry_ts: bcs.u64(),
|
|
38
|
+
self_cancel_after_ts: bcs.u64(),
|
|
39
|
+
created_ts: bcs.u64(),
|
|
40
|
+
/** True if this order was placed by an admin (Track A campaign etc.). */
|
|
41
|
+
by_admin: bcs.bool(),
|
|
42
|
+
event_ts: bcs.u64()
|
|
43
|
+
} });
|
|
44
|
+
export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`, fields: {
|
|
45
|
+
market_registry_id: bcs.Address,
|
|
46
|
+
order_id: bcs.u64(),
|
|
47
|
+
account_id: bcs.Address,
|
|
48
|
+
position_id: bcs.u64(),
|
|
49
|
+
market_key: bcs.u64(),
|
|
50
|
+
market_id: bcs.vector(bcs.u8()),
|
|
51
|
+
selection: position.Selection,
|
|
52
|
+
filled_shares: bcs.u64(),
|
|
53
|
+
filled_cost: bcs.u64(),
|
|
54
|
+
event_ts: bcs.u64()
|
|
55
|
+
} });
|
|
56
|
+
export const OrderCancelled = new MoveStruct({ name: `${$moduleName}::OrderCancelled`, fields: {
|
|
57
|
+
market_registry_id: bcs.Address,
|
|
58
|
+
order_id: bcs.u64(),
|
|
59
|
+
account_id: bcs.Address,
|
|
60
|
+
market_key: bcs.u64(),
|
|
61
|
+
market_id: bcs.vector(bcs.u8()),
|
|
62
|
+
selection: position.Selection,
|
|
63
|
+
refund_amount: bcs.u64(),
|
|
64
|
+
by_self: bcs.bool(),
|
|
65
|
+
event_ts: bcs.u64()
|
|
66
|
+
} });
|
|
67
|
+
export const MarketResolved = new MoveStruct({ name: `${$moduleName}::MarketResolved`, fields: {
|
|
68
|
+
market_registry_id: bcs.Address,
|
|
69
|
+
market_key: bcs.u64(),
|
|
70
|
+
market_id: bcs.vector(bcs.u8()),
|
|
71
|
+
outcome: outcome.Outcome,
|
|
72
|
+
unclaimed_count: bcs.u64(),
|
|
73
|
+
event_ts: bcs.u64()
|
|
74
|
+
} });
|
|
75
|
+
export const PositionClaimed = new MoveStruct({ name: `${$moduleName}::PositionClaimed`, fields: {
|
|
76
|
+
market_registry_id: bcs.Address,
|
|
77
|
+
account_id: bcs.Address,
|
|
78
|
+
position_id: bcs.u64(),
|
|
79
|
+
market_key: bcs.u64(),
|
|
80
|
+
market_id: bcs.vector(bcs.u8()),
|
|
81
|
+
selection: position.Selection,
|
|
82
|
+
outcome: outcome.Outcome,
|
|
83
|
+
filled_shares: bcs.u64(),
|
|
84
|
+
filled_cost: bcs.u64(),
|
|
85
|
+
payout: bcs.u64(),
|
|
86
|
+
event_ts: bcs.u64()
|
|
87
|
+
} });
|
|
88
|
+
export const PositionTransferred = new MoveStruct({ name: `${$moduleName}::PositionTransferred`, fields: {
|
|
89
|
+
market_registry_id: bcs.Address,
|
|
90
|
+
position_id: bcs.u64(),
|
|
91
|
+
from_account_id: bcs.Address,
|
|
92
|
+
to_account_id: bcs.Address,
|
|
93
|
+
market_key: bcs.u64(),
|
|
94
|
+
market_id: bcs.vector(bcs.u8()),
|
|
95
|
+
selection: position.Selection,
|
|
96
|
+
filled_shares: bcs.u64(),
|
|
97
|
+
filled_cost: bcs.u64(),
|
|
98
|
+
event_ts: bcs.u64()
|
|
99
|
+
} });
|
|
100
|
+
export const PositionSplit = new MoveStruct({ name: `${$moduleName}::PositionSplit`, fields: {
|
|
101
|
+
market_registry_id: bcs.Address,
|
|
102
|
+
source_position_id: bcs.u64(),
|
|
103
|
+
split_position_id: bcs.u64(),
|
|
104
|
+
from_account_id: bcs.Address,
|
|
105
|
+
to_account_id: bcs.Address,
|
|
106
|
+
market_key: bcs.u64(),
|
|
107
|
+
market_id: bcs.vector(bcs.u8()),
|
|
108
|
+
selection: position.Selection,
|
|
109
|
+
split_shares: bcs.u64(),
|
|
110
|
+
split_cost: bcs.u64(),
|
|
111
|
+
remaining_shares: bcs.u64(),
|
|
112
|
+
remaining_cost: bcs.u64(),
|
|
113
|
+
event_ts: bcs.u64()
|
|
114
|
+
} });
|
|
115
|
+
export const CloseRequested = new MoveStruct({ name: `${$moduleName}::CloseRequested`, fields: {
|
|
116
|
+
market_registry_id: bcs.Address,
|
|
117
|
+
order_id: bcs.u64(),
|
|
118
|
+
account_id: bcs.Address,
|
|
119
|
+
position_id: bcs.u64(),
|
|
120
|
+
market_key: bcs.u64(),
|
|
121
|
+
market_id: bcs.vector(bcs.u8()),
|
|
122
|
+
selection: position.Selection,
|
|
123
|
+
min_proceeds: bcs.u64(),
|
|
124
|
+
expiry_ts: bcs.u64(),
|
|
125
|
+
self_cancel_after_ts: bcs.u64(),
|
|
126
|
+
created_ts: bcs.u64(),
|
|
127
|
+
event_ts: bcs.u64()
|
|
128
|
+
} });
|
|
129
|
+
export const CloseConfirmed = new MoveStruct({ name: `${$moduleName}::CloseConfirmed`, fields: {
|
|
130
|
+
market_registry_id: bcs.Address,
|
|
131
|
+
order_id: bcs.u64(),
|
|
132
|
+
account_id: bcs.Address,
|
|
133
|
+
position_id: bcs.u64(),
|
|
134
|
+
market_key: bcs.u64(),
|
|
135
|
+
market_id: bcs.vector(bcs.u8()),
|
|
136
|
+
selection: position.Selection,
|
|
137
|
+
filled_shares: bcs.u64(),
|
|
138
|
+
filled_cost: bcs.u64(),
|
|
139
|
+
proceeds: bcs.u64(),
|
|
140
|
+
event_ts: bcs.u64()
|
|
141
|
+
} });
|
|
142
|
+
export const CloseCancelled = new MoveStruct({ name: `${$moduleName}::CloseCancelled`, fields: {
|
|
143
|
+
market_registry_id: bcs.Address,
|
|
144
|
+
order_id: bcs.u64(),
|
|
145
|
+
account_id: bcs.Address,
|
|
146
|
+
position_id: bcs.u64(),
|
|
147
|
+
market_key: bcs.u64(),
|
|
148
|
+
market_id: bcs.vector(bcs.u8()),
|
|
149
|
+
selection: position.Selection,
|
|
150
|
+
/** True if the user initiated the cancel via self_cancel_close. */
|
|
151
|
+
by_self: bcs.bool(),
|
|
152
|
+
event_ts: bcs.u64()
|
|
153
|
+
} });
|
|
154
|
+
export const MarketPaused = new MoveStruct({ name: `${$moduleName}::MarketPaused`, fields: {
|
|
155
|
+
market_registry_id: bcs.Address,
|
|
156
|
+
market_key: bcs.u64(),
|
|
157
|
+
market_id: bcs.vector(bcs.u8())
|
|
158
|
+
} });
|
|
159
|
+
export const MarketUnpaused = new MoveStruct({ name: `${$moduleName}::MarketUnpaused`, fields: {
|
|
160
|
+
market_registry_id: bcs.Address,
|
|
161
|
+
market_key: bcs.u64(),
|
|
162
|
+
market_id: bcs.vector(bcs.u8())
|
|
163
|
+
} });
|
|
164
|
+
export const MarketRegistryWithdrawn = new MoveStruct({ name: `${$moduleName}::MarketRegistryWithdrawn`, fields: {
|
|
165
|
+
market_registry_id: bcs.Address,
|
|
166
|
+
amount: bcs.u64(),
|
|
167
|
+
recipient: bcs.Address,
|
|
168
|
+
new_balance: bcs.u64()
|
|
169
|
+
} });
|
|
170
|
+
export const MinReserveUpdated = new MoveStruct({ name: `${$moduleName}::MinReserveUpdated`, fields: {
|
|
171
|
+
market_registry_id: bcs.Address,
|
|
172
|
+
old_reserve: bcs.u64(),
|
|
173
|
+
new_reserve: bcs.u64()
|
|
174
|
+
} });
|
|
175
|
+
export const OrderCancelCooldownUpdated = new MoveStruct({ name: `${$moduleName}::OrderCancelCooldownUpdated`, fields: {
|
|
176
|
+
market_registry_id: bcs.Address,
|
|
177
|
+
old_cooldown_ms: bcs.u64(),
|
|
178
|
+
new_cooldown_ms: bcs.u64()
|
|
179
|
+
} });
|
|
@@ -0,0 +1,116 @@
|
|
|
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 AssertVersionArguments {
|
|
8
|
+
globalConfig: RawTransactionArgument<string>;
|
|
9
|
+
}
|
|
10
|
+
export interface AssertVersionOptions {
|
|
11
|
+
package?: string;
|
|
12
|
+
arguments: AssertVersionArguments | [
|
|
13
|
+
globalConfig: RawTransactionArgument<string>
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
export declare function assertVersion(options: AssertVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
17
|
+
export interface AllowVersionArguments {
|
|
18
|
+
globalConfig: RawTransactionArgument<string>;
|
|
19
|
+
_: RawTransactionArgument<string>;
|
|
20
|
+
v: RawTransactionArgument<number>;
|
|
21
|
+
}
|
|
22
|
+
export interface AllowVersionOptions {
|
|
23
|
+
package?: string;
|
|
24
|
+
arguments: AllowVersionArguments | [
|
|
25
|
+
globalConfig: RawTransactionArgument<string>,
|
|
26
|
+
_: RawTransactionArgument<string>,
|
|
27
|
+
v: RawTransactionArgument<number>
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
export declare function allowVersion(options: AllowVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
31
|
+
export interface DisallowVersionArguments {
|
|
32
|
+
globalConfig: RawTransactionArgument<string>;
|
|
33
|
+
_: RawTransactionArgument<string>;
|
|
34
|
+
v: RawTransactionArgument<number>;
|
|
35
|
+
}
|
|
36
|
+
export interface DisallowVersionOptions {
|
|
37
|
+
package?: string;
|
|
38
|
+
arguments: DisallowVersionArguments | [
|
|
39
|
+
globalConfig: RawTransactionArgument<string>,
|
|
40
|
+
_: RawTransactionArgument<string>,
|
|
41
|
+
v: RawTransactionArgument<number>
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
export declare function disallowVersion(options: DisallowVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
45
|
+
export interface AllowedVersionsArguments {
|
|
46
|
+
globalConfig: RawTransactionArgument<string>;
|
|
47
|
+
}
|
|
48
|
+
export interface AllowedVersionsOptions {
|
|
49
|
+
package?: string;
|
|
50
|
+
arguments: AllowedVersionsArguments | [
|
|
51
|
+
globalConfig: RawTransactionArgument<string>
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
export declare function allowedVersions(options: AllowedVersionsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
55
|
+
export interface AddKeeperArguments {
|
|
56
|
+
globalConfig: RawTransactionArgument<string>;
|
|
57
|
+
_: RawTransactionArgument<string>;
|
|
58
|
+
keeper: RawTransactionArgument<string>;
|
|
59
|
+
}
|
|
60
|
+
export interface AddKeeperOptions {
|
|
61
|
+
package?: string;
|
|
62
|
+
arguments: AddKeeperArguments | [
|
|
63
|
+
globalConfig: RawTransactionArgument<string>,
|
|
64
|
+
_: RawTransactionArgument<string>,
|
|
65
|
+
keeper: RawTransactionArgument<string>
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
/** Admin configures which backend addresses may settle external order work. */
|
|
69
|
+
export declare function addKeeper(options: AddKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
70
|
+
export interface RemoveKeeperArguments {
|
|
71
|
+
globalConfig: RawTransactionArgument<string>;
|
|
72
|
+
_: RawTransactionArgument<string>;
|
|
73
|
+
keeper: RawTransactionArgument<string>;
|
|
74
|
+
}
|
|
75
|
+
export interface RemoveKeeperOptions {
|
|
76
|
+
package?: string;
|
|
77
|
+
arguments: RemoveKeeperArguments | [
|
|
78
|
+
globalConfig: RawTransactionArgument<string>,
|
|
79
|
+
_: RawTransactionArgument<string>,
|
|
80
|
+
keeper: RawTransactionArgument<string>
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/** Admin removes a backend keeper. */
|
|
84
|
+
export declare function removeKeeper(options: RemoveKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
85
|
+
export interface IsKeeperArguments {
|
|
86
|
+
globalConfig: RawTransactionArgument<string>;
|
|
87
|
+
keeper: RawTransactionArgument<string>;
|
|
88
|
+
}
|
|
89
|
+
export interface IsKeeperOptions {
|
|
90
|
+
package?: string;
|
|
91
|
+
arguments: IsKeeperArguments | [
|
|
92
|
+
globalConfig: RawTransactionArgument<string>,
|
|
93
|
+
keeper: RawTransactionArgument<string>
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
export declare function isKeeper(options: IsKeeperOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
97
|
+
export interface KeeperCountArguments {
|
|
98
|
+
globalConfig: RawTransactionArgument<string>;
|
|
99
|
+
}
|
|
100
|
+
export interface KeeperCountOptions {
|
|
101
|
+
package?: string;
|
|
102
|
+
arguments: KeeperCountArguments | [
|
|
103
|
+
globalConfig: RawTransactionArgument<string>
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
export declare function keeperCount(options: KeeperCountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
107
|
+
export interface KeeperAddressesArguments {
|
|
108
|
+
globalConfig: RawTransactionArgument<string>;
|
|
109
|
+
}
|
|
110
|
+
export interface KeeperAddressesOptions {
|
|
111
|
+
package?: string;
|
|
112
|
+
arguments: KeeperAddressesArguments | [
|
|
113
|
+
globalConfig: RawTransactionArgument<string>
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
export declare function keeperAddresses(options: KeeperAddressesOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
/** Allowed package versions for keeper-gated operations. */
|
|
11
|
+
allowed_versions: vec_set.VecSet(bcs.u16()),
|
|
12
|
+
keepers: vec_set.VecSet(bcs.Address)
|
|
13
|
+
} });
|
|
14
|
+
export function assertVersion(options) {
|
|
15
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
16
|
+
const argumentsTypes = [
|
|
17
|
+
null
|
|
18
|
+
];
|
|
19
|
+
const parameterNames = ["globalConfig"];
|
|
20
|
+
return (tx) => tx.moveCall({
|
|
21
|
+
package: packageAddress,
|
|
22
|
+
module: 'global_config',
|
|
23
|
+
function: 'assert_version',
|
|
24
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function allowVersion(options) {
|
|
28
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
29
|
+
const argumentsTypes = [
|
|
30
|
+
null,
|
|
31
|
+
null,
|
|
32
|
+
'u16'
|
|
33
|
+
];
|
|
34
|
+
const parameterNames = ["globalConfig", "_", "v"];
|
|
35
|
+
return (tx) => tx.moveCall({
|
|
36
|
+
package: packageAddress,
|
|
37
|
+
module: 'global_config',
|
|
38
|
+
function: 'allow_version',
|
|
39
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function disallowVersion(options) {
|
|
43
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
44
|
+
const argumentsTypes = [
|
|
45
|
+
null,
|
|
46
|
+
null,
|
|
47
|
+
'u16'
|
|
48
|
+
];
|
|
49
|
+
const parameterNames = ["globalConfig", "_", "v"];
|
|
50
|
+
return (tx) => tx.moveCall({
|
|
51
|
+
package: packageAddress,
|
|
52
|
+
module: 'global_config',
|
|
53
|
+
function: 'disallow_version',
|
|
54
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export function allowedVersions(options) {
|
|
58
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
59
|
+
const argumentsTypes = [
|
|
60
|
+
null
|
|
61
|
+
];
|
|
62
|
+
const parameterNames = ["globalConfig"];
|
|
63
|
+
return (tx) => tx.moveCall({
|
|
64
|
+
package: packageAddress,
|
|
65
|
+
module: 'global_config',
|
|
66
|
+
function: 'allowed_versions',
|
|
67
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** Admin configures which backend addresses may settle external order work. */
|
|
71
|
+
export function addKeeper(options) {
|
|
72
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
73
|
+
const argumentsTypes = [
|
|
74
|
+
null,
|
|
75
|
+
null,
|
|
76
|
+
'address'
|
|
77
|
+
];
|
|
78
|
+
const parameterNames = ["globalConfig", "_", "keeper"];
|
|
79
|
+
return (tx) => tx.moveCall({
|
|
80
|
+
package: packageAddress,
|
|
81
|
+
module: 'global_config',
|
|
82
|
+
function: 'add_keeper',
|
|
83
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/** Admin removes a backend keeper. */
|
|
87
|
+
export function removeKeeper(options) {
|
|
88
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
89
|
+
const argumentsTypes = [
|
|
90
|
+
null,
|
|
91
|
+
null,
|
|
92
|
+
'address'
|
|
93
|
+
];
|
|
94
|
+
const parameterNames = ["globalConfig", "_", "keeper"];
|
|
95
|
+
return (tx) => tx.moveCall({
|
|
96
|
+
package: packageAddress,
|
|
97
|
+
module: 'global_config',
|
|
98
|
+
function: 'remove_keeper',
|
|
99
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
export function isKeeper(options) {
|
|
103
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
104
|
+
const argumentsTypes = [
|
|
105
|
+
null,
|
|
106
|
+
'address'
|
|
107
|
+
];
|
|
108
|
+
const parameterNames = ["globalConfig", "keeper"];
|
|
109
|
+
return (tx) => tx.moveCall({
|
|
110
|
+
package: packageAddress,
|
|
111
|
+
module: 'global_config',
|
|
112
|
+
function: 'is_keeper',
|
|
113
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function keeperCount(options) {
|
|
117
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
118
|
+
const argumentsTypes = [
|
|
119
|
+
null
|
|
120
|
+
];
|
|
121
|
+
const parameterNames = ["globalConfig"];
|
|
122
|
+
return (tx) => tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'global_config',
|
|
125
|
+
function: 'keeper_count',
|
|
126
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export function keeperAddresses(options) {
|
|
130
|
+
const packageAddress = options.package ?? '@waterx/prediction';
|
|
131
|
+
const argumentsTypes = [
|
|
132
|
+
null
|
|
133
|
+
];
|
|
134
|
+
const parameterNames = ["globalConfig"];
|
|
135
|
+
return (tx) => tx.moveCall({
|
|
136
|
+
package: packageAddress,
|
|
137
|
+
module: 'global_config',
|
|
138
|
+
function: 'keeper_addresses',
|
|
139
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
140
|
+
});
|
|
141
|
+
}
|