@waterx/sdk 2.1.0 → 2.4.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 +40 -2
- package/dist/src/client.js +55 -6
- package/dist/src/config.d.ts +66 -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 +42 -7
- package/dist/src/utils/pyth.js +107 -31
- package/package.json +129 -34
|
@@ -21,11 +21,6 @@ import { bcs } from '@mysten/sui/bcs';
|
|
|
21
21
|
import * as market_config from "./market_config.js";
|
|
22
22
|
import * as keyed_big_vector from "./keyed_big_vector.js";
|
|
23
23
|
import * as order_book from "./order_book.js";
|
|
24
|
-
import * as order_book_1 from "./order_book.js";
|
|
25
|
-
import * as order_book_2 from "./order_book.js";
|
|
26
|
-
import * as order_book_3 from "./order_book.js";
|
|
27
|
-
import * as keyed_big_vector_1 from "./keyed_big_vector.js";
|
|
28
|
-
import * as keyed_big_vector_2 from "./keyed_big_vector.js";
|
|
29
24
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
30
25
|
const $moduleName = '@waterx/perp::trading';
|
|
31
26
|
export const Market = new MoveStruct({ name: `${$moduleName}::Market<phantom LP_TOKEN>`, fields: {
|
|
@@ -37,24 +32,24 @@ export const Market = new MoveStruct({ name: `${$moduleName}::Market<phantom LP_
|
|
|
37
32
|
/** Limit buy orders: price_key → vector<Order> */
|
|
38
33
|
limit_buys: order_book.OrderBook,
|
|
39
34
|
/** Limit sell orders: price_key → vector<Order> */
|
|
40
|
-
limit_sells:
|
|
35
|
+
limit_sells: order_book.OrderBook,
|
|
41
36
|
/** Stop buy orders: price_key → vector<Order> */
|
|
42
|
-
stop_buys:
|
|
37
|
+
stop_buys: order_book.OrderBook,
|
|
43
38
|
/** Stop sell orders: price_key → vector<Order> */
|
|
44
|
-
stop_sells:
|
|
39
|
+
stop_sells: order_book.OrderBook,
|
|
45
40
|
/**
|
|
46
41
|
* Reserved TP / SL pre-orders, keyed by the **pre-order's own `order_id`** (not
|
|
47
42
|
* the main order's id). Each entry is a single fully-formed reduce-only `Order`
|
|
48
43
|
* with `linked_position_id = None`; on main fill `activate_pending_pre_orders`
|
|
49
44
|
* stamps in the new position id and moves the order onto the live book.
|
|
50
45
|
*/
|
|
51
|
-
pending_pre_orders:
|
|
46
|
+
pending_pre_orders: keyed_big_vector.KeyedBigVector,
|
|
52
47
|
/**
|
|
53
48
|
* Secondary index: `main_order_id → vector<pre_order_id>` listing the pre-orders
|
|
54
49
|
* reserved against each unfilled main. Used by activation / cancellation to
|
|
55
50
|
* enumerate the pre-orders that belong to a given main.
|
|
56
51
|
*/
|
|
57
|
-
pending_pre_order_index:
|
|
52
|
+
pending_pre_order_index: keyed_big_vector.KeyedBigVector
|
|
58
53
|
} });
|
|
59
54
|
export const MarketRegistry = new MoveStruct({ name: `${$moduleName}::MarketRegistry<phantom LP_TOKEN>`, fields: {
|
|
60
55
|
id: bcs.Address,
|
|
@@ -1444,6 +1439,94 @@ export function calculateLossAdjustedEffectiveCollateralAmount(options) {
|
|
|
1444
1439
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1445
1440
|
});
|
|
1446
1441
|
}
|
|
1442
|
+
export function settleLossToBalance(options) {
|
|
1443
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
1444
|
+
const argumentsTypes = [
|
|
1445
|
+
null,
|
|
1446
|
+
null,
|
|
1447
|
+
null,
|
|
1448
|
+
null,
|
|
1449
|
+
null,
|
|
1450
|
+
'u64',
|
|
1451
|
+
null,
|
|
1452
|
+
'u128'
|
|
1453
|
+
];
|
|
1454
|
+
const parameterNames = ["globalConfig", "pool", "market", "collateral", "collateralToken", "lossAmount", "collateralPrice", "deficit"];
|
|
1455
|
+
return (tx) => tx.moveCall({
|
|
1456
|
+
package: packageAddress,
|
|
1457
|
+
module: 'trading',
|
|
1458
|
+
function: 'settle_loss_to_balance',
|
|
1459
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1460
|
+
typeArguments: options.typeArguments
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
export function settleLossToPosition(options) {
|
|
1464
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
1465
|
+
const argumentsTypes = [
|
|
1466
|
+
null,
|
|
1467
|
+
null,
|
|
1468
|
+
null,
|
|
1469
|
+
null,
|
|
1470
|
+
null,
|
|
1471
|
+
'u64',
|
|
1472
|
+
null,
|
|
1473
|
+
'u128'
|
|
1474
|
+
];
|
|
1475
|
+
const parameterNames = ["globalConfig", "pool", "market", "position", "collateralToken", "lossAmount", "collateralPrice", "deficit"];
|
|
1476
|
+
return (tx) => tx.moveCall({
|
|
1477
|
+
package: packageAddress,
|
|
1478
|
+
module: 'trading',
|
|
1479
|
+
function: 'settle_loss_to_position',
|
|
1480
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1481
|
+
typeArguments: options.typeArguments
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
export function settleFeesToBalance(options) {
|
|
1485
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
1486
|
+
const argumentsTypes = [
|
|
1487
|
+
null,
|
|
1488
|
+
null,
|
|
1489
|
+
null,
|
|
1490
|
+
null,
|
|
1491
|
+
'u64',
|
|
1492
|
+
'0x2::object::ID',
|
|
1493
|
+
null,
|
|
1494
|
+
null,
|
|
1495
|
+
'u64',
|
|
1496
|
+
'u128'
|
|
1497
|
+
];
|
|
1498
|
+
const parameterNames = ["globalConfig", "pool", "market", "collateral", "protocolShareBps", "marketId", "collateralToken", "collateralPrice", "feeAmount", "deficit"];
|
|
1499
|
+
return (tx) => tx.moveCall({
|
|
1500
|
+
package: packageAddress,
|
|
1501
|
+
module: 'trading',
|
|
1502
|
+
function: 'settle_fees_to_balance',
|
|
1503
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1504
|
+
typeArguments: options.typeArguments
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
export function settleFeesToPosition(options) {
|
|
1508
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
1509
|
+
const argumentsTypes = [
|
|
1510
|
+
null,
|
|
1511
|
+
null,
|
|
1512
|
+
null,
|
|
1513
|
+
null,
|
|
1514
|
+
'u64',
|
|
1515
|
+
'0x2::object::ID',
|
|
1516
|
+
null,
|
|
1517
|
+
null,
|
|
1518
|
+
'u64',
|
|
1519
|
+
'u128'
|
|
1520
|
+
];
|
|
1521
|
+
const parameterNames = ["globalConfig", "pool", "market", "position", "protocolShareBps", "marketId", "collateralToken", "collateralPrice", "feeAmount", "deficit"];
|
|
1522
|
+
return (tx) => tx.moveCall({
|
|
1523
|
+
package: packageAddress,
|
|
1524
|
+
module: 'trading',
|
|
1525
|
+
function: 'settle_fees_to_position',
|
|
1526
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1527
|
+
typeArguments: options.typeArguments
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1447
1530
|
export function settleFundingToBalance(options) {
|
|
1448
1531
|
const packageAddress = options.package ?? '@waterx/perp';
|
|
1449
1532
|
const argumentsTypes = [
|
|
@@ -1453,9 +1536,10 @@ export function settleFundingToBalance(options) {
|
|
|
1453
1536
|
'bool',
|
|
1454
1537
|
'u64',
|
|
1455
1538
|
null,
|
|
1456
|
-
'0x1::string::String'
|
|
1539
|
+
'0x1::string::String',
|
|
1540
|
+
'u128'
|
|
1457
1541
|
];
|
|
1458
|
-
const parameterNames = ["globalConfig", "pool", "collateral", "fundingSign", "fundingFee", "collateralPrice", "marketTicker"];
|
|
1542
|
+
const parameterNames = ["globalConfig", "pool", "collateral", "fundingSign", "fundingFee", "collateralPrice", "marketTicker", "deficit"];
|
|
1459
1543
|
return (tx) => tx.moveCall({
|
|
1460
1544
|
package: packageAddress,
|
|
1461
1545
|
module: 'trading',
|
|
@@ -1473,9 +1557,10 @@ export function settleFundingToPosition(options) {
|
|
|
1473
1557
|
'bool',
|
|
1474
1558
|
'u64',
|
|
1475
1559
|
null,
|
|
1476
|
-
'0x1::string::String'
|
|
1560
|
+
'0x1::string::String',
|
|
1561
|
+
'u128'
|
|
1477
1562
|
];
|
|
1478
|
-
const parameterNames = ["globalConfig", "pool", "position", "fundingSign", "fundingFee", "collateralPrice", "marketTicker"];
|
|
1563
|
+
const parameterNames = ["globalConfig", "pool", "position", "fundingSign", "fundingFee", "collateralPrice", "marketTicker", "deficit"];
|
|
1479
1564
|
return (tx) => tx.moveCall({
|
|
1480
1565
|
package: packageAddress,
|
|
1481
1566
|
module: 'trading',
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
9
9
|
import { bcs } from '@mysten/sui/bcs';
|
|
10
10
|
import * as type_name from "./deps/std/type_name.js";
|
|
11
|
-
import * as type_name_1 from "./deps/std/type_name.js";
|
|
12
|
-
import * as type_name_2 from "./deps/std/type_name.js";
|
|
13
|
-
import * as type_name_3 from "./deps/std/type_name.js";
|
|
14
|
-
import * as type_name_4 from "./deps/std/type_name.js";
|
|
15
|
-
import * as type_name_5 from "./deps/std/type_name.js";
|
|
16
11
|
const $moduleName = '@waterx/perp-view::view';
|
|
17
12
|
export const AccountData = new MoveStruct({ name: `${$moduleName}::AccountData`, fields: {
|
|
18
13
|
account_id: bcs.Address,
|
|
@@ -48,7 +43,7 @@ export const MarketData = new MoveStruct({ name: `${$moduleName}::MarketData`, f
|
|
|
48
43
|
next_order_id: bcs.u64()
|
|
49
44
|
} });
|
|
50
45
|
export const PoolData = new MoveStruct({ name: `${$moduleName}::PoolData`, fields: {
|
|
51
|
-
lp_token:
|
|
46
|
+
lp_token: type_name.TypeName,
|
|
52
47
|
is_active: bcs.bool(),
|
|
53
48
|
lp_decimal: bcs.u8(),
|
|
54
49
|
total_lp_supply: bcs.u64(),
|
|
@@ -56,7 +51,7 @@ export const PoolData = new MoveStruct({ name: `${$moduleName}::PoolData`, field
|
|
|
56
51
|
token_count: bcs.u64()
|
|
57
52
|
} });
|
|
58
53
|
export const TokenPoolData = new MoveStruct({ name: `${$moduleName}::TokenPoolData`, fields: {
|
|
59
|
-
token_type:
|
|
54
|
+
token_type: type_name.TypeName,
|
|
60
55
|
token_decimal: bcs.u8(),
|
|
61
56
|
liquidity_amount: bcs.u64(),
|
|
62
57
|
reserved_amount: bcs.u64(),
|
|
@@ -71,7 +66,7 @@ export const RedeemRequestData = new MoveStruct({ name: `${$moduleName}::RedeemR
|
|
|
71
66
|
request_id: bcs.u64(),
|
|
72
67
|
recipient_account_id: bcs.Address,
|
|
73
68
|
lp_amount: bcs.u64(),
|
|
74
|
-
token_type:
|
|
69
|
+
token_type: type_name.TypeName,
|
|
75
70
|
request_timestamp: bcs.u64()
|
|
76
71
|
} });
|
|
77
72
|
export const GlobalConfigData = new MoveStruct({ name: `${$moduleName}::GlobalConfigData`, fields: {
|
|
@@ -91,7 +86,7 @@ export const PositionData = new MoveStruct({ name: `${$moduleName}::PositionData
|
|
|
91
86
|
market_id: bcs.Address,
|
|
92
87
|
is_long: bcs.bool(),
|
|
93
88
|
size: bcs.u128(),
|
|
94
|
-
collateral_type:
|
|
89
|
+
collateral_type: type_name.TypeName,
|
|
95
90
|
collateral_amount: bcs.u64(),
|
|
96
91
|
collateral_decimal: bcs.u8(),
|
|
97
92
|
average_price: bcs.u128(),
|
|
@@ -125,7 +120,7 @@ export const OrderData = new MoveStruct({ name: `${$moduleName}::OrderData`, fie
|
|
|
125
120
|
reduce_only: bcs.bool(),
|
|
126
121
|
is_stop_order: bcs.bool(),
|
|
127
122
|
size: bcs.u128(),
|
|
128
|
-
collateral_type:
|
|
123
|
+
collateral_type: type_name.TypeName,
|
|
129
124
|
collateral_amount: bcs.u64(),
|
|
130
125
|
collateral_decimal: bcs.u8(),
|
|
131
126
|
trigger_price: bcs.u128(),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
5
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
6
6
|
export declare const PythRule: MoveStruct<{
|
|
7
7
|
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
8
8
|
}, "@waterx/pyth-rule::pyth_rule::PythRule">;
|
|
@@ -36,7 +36,7 @@ export declare const Config: MoveStruct<{
|
|
|
36
36
|
}, "0x2::vec_map::VecMap<string, u64>">;
|
|
37
37
|
}, "@waterx/pyth-rule::pyth_rule::Config">;
|
|
38
38
|
export interface FeedArguments {
|
|
39
|
-
collector:
|
|
39
|
+
collector: TransactionArgument;
|
|
40
40
|
config: RawTransactionArgument<string>;
|
|
41
41
|
pythState: RawTransactionArgument<string>;
|
|
42
42
|
pythPriceInfo: RawTransactionArgument<string>;
|
|
@@ -44,7 +44,7 @@ export interface FeedArguments {
|
|
|
44
44
|
export interface FeedOptions {
|
|
45
45
|
package?: string;
|
|
46
46
|
arguments: FeedArguments | [
|
|
47
|
-
collector:
|
|
47
|
+
collector: TransactionArgument,
|
|
48
48
|
config: RawTransactionArgument<string>,
|
|
49
49
|
pythState: RawTransactionArgument<string>,
|
|
50
50
|
pythPriceInfo: RawTransactionArgument<string>
|
|
@@ -60,7 +60,7 @@ export interface SetIdentifierArguments {
|
|
|
60
60
|
config: RawTransactionArgument<string>;
|
|
61
61
|
Cap: RawTransactionArgument<string>;
|
|
62
62
|
symbol: RawTransactionArgument<string>;
|
|
63
|
-
identifier: RawTransactionArgument<number
|
|
63
|
+
identifier: RawTransactionArgument<Array<number>>;
|
|
64
64
|
}
|
|
65
65
|
export interface SetIdentifierOptions {
|
|
66
66
|
package?: string;
|
|
@@ -68,7 +68,7 @@ export interface SetIdentifierOptions {
|
|
|
68
68
|
config: RawTransactionArgument<string>,
|
|
69
69
|
Cap: RawTransactionArgument<string>,
|
|
70
70
|
symbol: RawTransactionArgument<string>,
|
|
71
|
-
identifier: RawTransactionArgument<number
|
|
71
|
+
identifier: RawTransactionArgument<Array<number>>
|
|
72
72
|
];
|
|
73
73
|
}
|
|
74
74
|
export declare function setIdentifier(options: SetIdentifierOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
5
5
|
import { bcs } from '@mysten/sui/bcs';
|
|
6
6
|
import * as vec_map from "./deps/sui/vec_map.js";
|
|
7
|
-
import * as vec_map_1 from "./deps/sui/vec_map.js";
|
|
8
7
|
const $moduleName = '@waterx/pyth-rule::pyth_rule';
|
|
9
8
|
export const PythRule = new MoveStruct({ name: `${$moduleName}::PythRule`, fields: {
|
|
10
9
|
dummy_field: bcs.bool()
|
|
@@ -14,7 +13,7 @@ export const Config = new MoveStruct({ name: `${$moduleName}::Config`, fields: {
|
|
|
14
13
|
/** Ticker (e.g. `b"BTC_USD".to_string()`) → Pyth feed identifier bytes. */
|
|
15
14
|
identifier_map: vec_map.VecMap(bcs.string(), bcs.vector(bcs.u8())),
|
|
16
15
|
/** Per-ticker timestamp tolerance in seconds. Falls back to DEFAULT_TOLERANCE_SEC. */
|
|
17
|
-
tolerance_sec_map:
|
|
16
|
+
tolerance_sec_map: vec_map.VecMap(bcs.string(), bcs.u64())
|
|
18
17
|
} });
|
|
19
18
|
/**
|
|
20
19
|
* Reads a Pyth price for `collector.symbol()` and feeds it. Drops the value
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
5
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
6
6
|
export declare const SetReferralCode: MoveStruct<{
|
|
7
7
|
refer: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
8
|
code: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
@@ -63,14 +63,14 @@ export interface RemoveVersionOptions {
|
|
|
63
63
|
export declare function removeVersion(options: RemoveVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
64
64
|
export interface SetReferralCodeArguments {
|
|
65
65
|
table: RawTransactionArgument<string>;
|
|
66
|
-
req:
|
|
66
|
+
req: TransactionArgument;
|
|
67
67
|
code: RawTransactionArgument<string>;
|
|
68
68
|
}
|
|
69
69
|
export interface SetReferralCodeOptions {
|
|
70
70
|
package?: string;
|
|
71
71
|
arguments: SetReferralCodeArguments | [
|
|
72
72
|
table: RawTransactionArgument<string>,
|
|
73
|
-
req:
|
|
73
|
+
req: TransactionArgument,
|
|
74
74
|
code: RawTransactionArgument<string>
|
|
75
75
|
];
|
|
76
76
|
}
|
|
@@ -78,14 +78,14 @@ export interface SetReferralCodeOptions {
|
|
|
78
78
|
export declare function setReferralCode(options: SetReferralCodeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
79
|
export interface UseReferralCodeArguments {
|
|
80
80
|
table: RawTransactionArgument<string>;
|
|
81
|
-
req:
|
|
81
|
+
req: TransactionArgument;
|
|
82
82
|
code: RawTransactionArgument<string>;
|
|
83
83
|
}
|
|
84
84
|
export interface UseReferralCodeOptions {
|
|
85
85
|
package?: string;
|
|
86
86
|
arguments: UseReferralCodeArguments | [
|
|
87
87
|
table: RawTransactionArgument<string>,
|
|
88
|
-
req:
|
|
88
|
+
req: TransactionArgument,
|
|
89
89
|
code: RawTransactionArgument<string>
|
|
90
90
|
];
|
|
91
91
|
}
|
|
@@ -5,7 +5,6 @@ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
|
5
5
|
import { bcs } from '@mysten/sui/bcs';
|
|
6
6
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
7
7
|
import * as table from "./deps/sui/table.js";
|
|
8
|
-
import * as table_1 from "./deps/sui/table.js";
|
|
9
8
|
const $moduleName = '@waterx/referral::referral_table';
|
|
10
9
|
export const SetReferralCode = new MoveStruct({ name: `${$moduleName}::SetReferralCode`, fields: {
|
|
11
10
|
refer: bcs.Address,
|
|
@@ -19,7 +18,7 @@ export const ReferralTable = new MoveStruct({ name: `${$moduleName}::ReferralTab
|
|
|
19
18
|
id: bcs.Address,
|
|
20
19
|
versions: vec_set.VecSet(bcs.u16()),
|
|
21
20
|
code_to_refer: table.Table,
|
|
22
|
-
referee_to_code:
|
|
21
|
+
referee_to_code: table.Table
|
|
23
22
|
} });
|
|
24
23
|
export const AdminCap = new MoveStruct({ name: `${$moduleName}::AdminCap`, fields: {
|
|
25
24
|
id: bcs.Address
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
5
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
6
6
|
export declare const Create: MoveStruct<{
|
|
7
7
|
vault_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
8
|
asset_type: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
@@ -303,7 +303,7 @@ export interface UpdateFlowRateArguments {
|
|
|
303
303
|
self: RawTransactionArgument<string>;
|
|
304
304
|
flowAmount: RawTransactionArgument<number | bigint>;
|
|
305
305
|
flowInterval: RawTransactionArgument<number | bigint>;
|
|
306
|
-
request:
|
|
306
|
+
request: TransactionArgument;
|
|
307
307
|
}
|
|
308
308
|
export interface UpdateFlowRateOptions {
|
|
309
309
|
package?: string;
|
|
@@ -311,7 +311,7 @@ export interface UpdateFlowRateOptions {
|
|
|
311
311
|
self: RawTransactionArgument<string>,
|
|
312
312
|
flowAmount: RawTransactionArgument<number | bigint>,
|
|
313
313
|
flowInterval: RawTransactionArgument<number | bigint>,
|
|
314
|
-
request:
|
|
314
|
+
request: TransactionArgument
|
|
315
315
|
];
|
|
316
316
|
typeArguments: [
|
|
317
317
|
string,
|
|
@@ -324,7 +324,7 @@ export interface DepositToSourceByManagerArguments {
|
|
|
324
324
|
self: RawTransactionArgument<string>;
|
|
325
325
|
coin: RawTransactionArgument<string>;
|
|
326
326
|
flowInterval: RawTransactionArgument<number | bigint>;
|
|
327
|
-
managerReq:
|
|
327
|
+
managerReq: TransactionArgument;
|
|
328
328
|
}
|
|
329
329
|
export interface DepositToSourceByManagerOptions {
|
|
330
330
|
package?: string;
|
|
@@ -332,7 +332,7 @@ export interface DepositToSourceByManagerOptions {
|
|
|
332
332
|
self: RawTransactionArgument<string>,
|
|
333
333
|
coin: RawTransactionArgument<string>,
|
|
334
334
|
flowInterval: RawTransactionArgument<number | bigint>,
|
|
335
|
-
managerReq:
|
|
335
|
+
managerReq: TransactionArgument
|
|
336
336
|
];
|
|
337
337
|
typeArguments: [
|
|
338
338
|
string,
|
|
@@ -393,7 +393,7 @@ export interface DepositArguments {
|
|
|
393
393
|
self: RawTransactionArgument<string>;
|
|
394
394
|
wxaRegistry: RawTransactionArgument<string>;
|
|
395
395
|
accountId: RawTransactionArgument<string>;
|
|
396
|
-
accReq:
|
|
396
|
+
accReq: TransactionArgument;
|
|
397
397
|
stakeAmount: RawTransactionArgument<number | bigint>;
|
|
398
398
|
}
|
|
399
399
|
export interface DepositOptions {
|
|
@@ -402,7 +402,7 @@ export interface DepositOptions {
|
|
|
402
402
|
self: RawTransactionArgument<string>,
|
|
403
403
|
wxaRegistry: RawTransactionArgument<string>,
|
|
404
404
|
accountId: RawTransactionArgument<string>,
|
|
405
|
-
accReq:
|
|
405
|
+
accReq: TransactionArgument,
|
|
406
406
|
stakeAmount: RawTransactionArgument<number | bigint>
|
|
407
407
|
];
|
|
408
408
|
typeArguments: [
|
|
@@ -418,13 +418,13 @@ export interface DepositOptions {
|
|
|
418
418
|
*/
|
|
419
419
|
export declare function deposit(options: DepositOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
420
420
|
export interface SettleRewarderOnDepositArguments {
|
|
421
|
-
checker:
|
|
421
|
+
checker: TransactionArgument;
|
|
422
422
|
self: RawTransactionArgument<string>;
|
|
423
423
|
}
|
|
424
424
|
export interface SettleRewarderOnDepositOptions {
|
|
425
425
|
package?: string;
|
|
426
426
|
arguments: SettleRewarderOnDepositArguments | [
|
|
427
|
-
checker:
|
|
427
|
+
checker: TransactionArgument,
|
|
428
428
|
self: RawTransactionArgument<string>
|
|
429
429
|
];
|
|
430
430
|
typeArguments: [
|
|
@@ -434,12 +434,12 @@ export interface SettleRewarderOnDepositOptions {
|
|
|
434
434
|
}
|
|
435
435
|
export declare function settleRewarderOnDeposit(options: SettleRewarderOnDepositOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
436
436
|
export interface DestroyDepositCheckerArguments {
|
|
437
|
-
checker:
|
|
437
|
+
checker: TransactionArgument;
|
|
438
438
|
}
|
|
439
439
|
export interface DestroyDepositCheckerOptions {
|
|
440
440
|
package?: string;
|
|
441
441
|
arguments: DestroyDepositCheckerArguments | [
|
|
442
|
-
checker:
|
|
442
|
+
checker: TransactionArgument
|
|
443
443
|
];
|
|
444
444
|
typeArguments: [
|
|
445
445
|
string
|
|
@@ -450,7 +450,7 @@ export interface RedeemArguments {
|
|
|
450
450
|
self: RawTransactionArgument<string>;
|
|
451
451
|
wxaRegistry: RawTransactionArgument<string>;
|
|
452
452
|
accountId: RawTransactionArgument<string>;
|
|
453
|
-
accReq:
|
|
453
|
+
accReq: TransactionArgument;
|
|
454
454
|
withdrawalAmount: RawTransactionArgument<number | bigint>;
|
|
455
455
|
}
|
|
456
456
|
export interface RedeemOptions {
|
|
@@ -459,7 +459,7 @@ export interface RedeemOptions {
|
|
|
459
459
|
self: RawTransactionArgument<string>,
|
|
460
460
|
wxaRegistry: RawTransactionArgument<string>,
|
|
461
461
|
accountId: RawTransactionArgument<string>,
|
|
462
|
-
accReq:
|
|
462
|
+
accReq: TransactionArgument,
|
|
463
463
|
withdrawalAmount: RawTransactionArgument<number | bigint>
|
|
464
464
|
];
|
|
465
465
|
typeArguments: [
|
|
@@ -474,13 +474,13 @@ export interface RedeemOptions {
|
|
|
474
474
|
*/
|
|
475
475
|
export declare function redeem(options: RedeemOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
476
476
|
export interface SettleRewarderOnWithdrawArguments {
|
|
477
|
-
checker:
|
|
477
|
+
checker: TransactionArgument;
|
|
478
478
|
self: RawTransactionArgument<string>;
|
|
479
479
|
}
|
|
480
480
|
export interface SettleRewarderOnWithdrawOptions {
|
|
481
481
|
package?: string;
|
|
482
482
|
arguments: SettleRewarderOnWithdrawArguments | [
|
|
483
|
-
checker:
|
|
483
|
+
checker: TransactionArgument,
|
|
484
484
|
self: RawTransactionArgument<string>
|
|
485
485
|
];
|
|
486
486
|
typeArguments: [
|
|
@@ -490,12 +490,12 @@ export interface SettleRewarderOnWithdrawOptions {
|
|
|
490
490
|
}
|
|
491
491
|
export declare function settleRewarderOnWithdraw(options: SettleRewarderOnWithdrawOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
492
492
|
export interface DestroyWithdrawCheckerArguments {
|
|
493
|
-
checker:
|
|
493
|
+
checker: TransactionArgument;
|
|
494
494
|
}
|
|
495
495
|
export interface DestroyWithdrawCheckerOptions {
|
|
496
496
|
package?: string;
|
|
497
497
|
arguments: DestroyWithdrawCheckerArguments | [
|
|
498
|
-
checker:
|
|
498
|
+
checker: TransactionArgument
|
|
499
499
|
];
|
|
500
500
|
typeArguments: [
|
|
501
501
|
string
|
|
@@ -506,7 +506,7 @@ export interface ClaimArguments {
|
|
|
506
506
|
self: RawTransactionArgument<string>;
|
|
507
507
|
wxaRegistry: RawTransactionArgument<string>;
|
|
508
508
|
accountId: RawTransactionArgument<string>;
|
|
509
|
-
request:
|
|
509
|
+
request: TransactionArgument;
|
|
510
510
|
}
|
|
511
511
|
export interface ClaimOptions {
|
|
512
512
|
package?: string;
|
|
@@ -514,7 +514,7 @@ export interface ClaimOptions {
|
|
|
514
514
|
self: RawTransactionArgument<string>,
|
|
515
515
|
wxaRegistry: RawTransactionArgument<string>,
|
|
516
516
|
accountId: RawTransactionArgument<string>,
|
|
517
|
-
request:
|
|
517
|
+
request: TransactionArgument
|
|
518
518
|
];
|
|
519
519
|
typeArguments: [
|
|
520
520
|
string,
|
|
@@ -5,18 +5,8 @@ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
|
5
5
|
import { bcs } from '@mysten/sui/bcs';
|
|
6
6
|
import * as double from "./deps/bucket_v2_framework/double.js";
|
|
7
7
|
import * as balance from "./deps/sui/balance.js";
|
|
8
|
-
import * as balance_1 from "./deps/sui/balance.js";
|
|
9
|
-
import * as balance_2 from "./deps/sui/balance.js";
|
|
10
|
-
import * as double_1 from "./deps/bucket_v2_framework/double.js";
|
|
11
|
-
import * as double_2 from "./deps/bucket_v2_framework/double.js";
|
|
12
8
|
import * as table from "./deps/sui/table.js";
|
|
13
9
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
14
|
-
import * as vec_set_1 from "./deps/sui/vec_set.js";
|
|
15
|
-
import * as vec_set_2 from "./deps/sui/vec_set.js";
|
|
16
|
-
import * as balance_3 from "./deps/sui/balance.js";
|
|
17
|
-
import * as table_1 from "./deps/sui/table.js";
|
|
18
|
-
import * as vec_set_3 from "./deps/sui/vec_set.js";
|
|
19
|
-
import * as vec_set_4 from "./deps/sui/vec_set.js";
|
|
20
10
|
const $moduleName = '@waterx/staking::waterx_staking';
|
|
21
11
|
export const Create = new MoveStruct({ name: `${$moduleName}::Create`, fields: {
|
|
22
12
|
vault_id: bcs.Address,
|
|
@@ -77,10 +67,10 @@ export const RewardData = new MoveStruct({ name: `${$moduleName}::RewardData<pha
|
|
|
77
67
|
} });
|
|
78
68
|
export const Rewarder = new MoveStruct({ name: `${$moduleName}::Rewarder<phantom STAKE, phantom R>`, fields: {
|
|
79
69
|
id: bcs.Address,
|
|
80
|
-
source:
|
|
81
|
-
pool:
|
|
82
|
-
flow_rate:
|
|
83
|
-
unit:
|
|
70
|
+
source: balance.Balance,
|
|
71
|
+
pool: balance.Balance,
|
|
72
|
+
flow_rate: double.Double,
|
|
73
|
+
unit: double.Double,
|
|
84
74
|
timestamp: bcs.u64(),
|
|
85
75
|
total_stake_snapshot: bcs.u64(),
|
|
86
76
|
reward_table: table.Table
|
|
@@ -100,19 +90,19 @@ export const DepositChecker = new MoveStruct({ name: `${$moduleName}::DepositChe
|
|
|
100
90
|
export const WithdrawChecker = new MoveStruct({ name: `${$moduleName}::WithdrawChecker<phantom STAKE>`, fields: {
|
|
101
91
|
account: bcs.Address,
|
|
102
92
|
prev_stake_amount: bcs.u64(),
|
|
103
|
-
rewarder_ids:
|
|
93
|
+
rewarder_ids: vec_set.VecSet(bcs.Address)
|
|
104
94
|
} });
|
|
105
95
|
export const AdminCap = new MoveStruct({ name: `${$moduleName}::AdminCap`, fields: {
|
|
106
96
|
id: bcs.Address
|
|
107
97
|
} });
|
|
108
98
|
export const StakingPool = new MoveStruct({ name: `${$moduleName}::StakingPool<phantom STAKE>`, fields: {
|
|
109
99
|
id: bcs.Address,
|
|
110
|
-
versions:
|
|
111
|
-
stake:
|
|
112
|
-
stake_table:
|
|
113
|
-
managers:
|
|
100
|
+
versions: vec_set.VecSet(bcs.u16()),
|
|
101
|
+
stake: balance.Balance,
|
|
102
|
+
stake_table: table.Table,
|
|
103
|
+
managers: vec_set.VecSet(bcs.Address),
|
|
114
104
|
stake_cap: bcs.u64(),
|
|
115
|
-
rewarder_ids:
|
|
105
|
+
rewarder_ids: vec_set.VecSet(bcs.Address)
|
|
116
106
|
} });
|
|
117
107
|
export function packageVersion(options = {}) {
|
|
118
108
|
const packageAddress = options.package ?? '@waterx/staking';
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/** An entry in the map */
|
|
7
|
+
export declare function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
8
|
+
K,
|
|
9
|
+
V
|
|
10
|
+
]): MoveStruct<{
|
|
11
|
+
key: K;
|
|
12
|
+
value: V;
|
|
13
|
+
}, `0x2::vec_map::Entry<${K["name"]}, ${V["name"]}>`>;
|
|
14
|
+
/**
|
|
15
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
16
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
17
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
18
|
+
* of this data structure is only to provide the convenience of programming against
|
|
19
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
20
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
21
|
+
* also be handwritten.
|
|
22
|
+
*/
|
|
23
|
+
export declare function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
24
|
+
K,
|
|
25
|
+
V
|
|
26
|
+
]): MoveStruct<{
|
|
27
|
+
contents: BcsType<{
|
|
28
|
+
key: K extends BcsType<infer U, any, string> ? U : never;
|
|
29
|
+
value: V extends BcsType<infer U, any, string> ? U : never;
|
|
30
|
+
}[], Iterable<{
|
|
31
|
+
key: K extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
32
|
+
value: V extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
33
|
+
}> & {
|
|
34
|
+
length: number;
|
|
35
|
+
}, string>;
|
|
36
|
+
}, `0x2::vec_map::VecMap<${K["name"]}, ${V["name"]}>`>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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_map';
|
|
7
|
+
/** An entry in the map */
|
|
8
|
+
export function Entry(...typeParameters) {
|
|
9
|
+
return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
10
|
+
key: typeParameters[0],
|
|
11
|
+
value: typeParameters[1]
|
|
12
|
+
} });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
16
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
17
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
18
|
+
* of this data structure is only to provide the convenience of programming against
|
|
19
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
20
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
21
|
+
* also be handwritten.
|
|
22
|
+
*/
|
|
23
|
+
export function VecMap(...typeParameters) {
|
|
24
|
+
return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
25
|
+
contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
|
|
26
|
+
} });
|
|
27
|
+
}
|