@waterx/sdk 2.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 +21 -0
- package/README.md +204 -0
- package/dist/src/client.d.ts +109 -0
- package/dist/src/client.js +197 -0
- package/dist/src/config.d.ts +229 -0
- package/dist/src/config.js +107 -0
- package/dist/src/constants.d.ts +64 -0
- package/dist/src/constants.js +71 -0
- package/dist/src/fetch.d.ts +144 -0
- package/dist/src/fetch.js +419 -0
- package/dist/src/generated/bucket_v2_framework/account.d.ts +107 -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 +17 -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 +12 -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 +384 -0
- package/dist/src/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/generated/bucket_v2_framework/float.d.ts +364 -0
- package/dist/src/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +197 -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 +424 -0
- package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
- package/dist/src/generated/native_custody/custody_vault.d.ts +572 -0
- package/dist/src/generated/native_custody/custody_vault.js +483 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/native_custody/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/native_custody/deps/std/type_name.js +19 -0
- package/dist/src/generated/native_custody/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/native_custody/deps/sui/balance.js +14 -0
- package/dist/src/generated/native_custody/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/native_custody/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/native_custody/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/native_custody/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/native_custody/events.d.ts +36 -0
- package/dist/src/generated/native_custody/events.js +36 -0
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.js +14 -0
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +68 -0
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +74 -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 +1818 -0
- package/dist/src/generated/waterx_account/account.js +1723 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +17 -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 +12 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_account/deps/sui/object_table.d.ts +17 -0
- package/dist/src/generated/waterx_account/deps/sui/object_table.js +19 -0
- package/dist/src/generated/waterx_account/deps/sui/table.d.ts +29 -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 +77 -0
- package/dist/src/generated/waterx_account/direct_rule.js +78 -0
- package/dist/src/generated/waterx_account/events.d.ts +180 -0
- package/dist/src/generated/waterx_account/events.js +156 -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_credit/credit_registry.d.ts +708 -0
- package/dist/src/generated/waterx_credit/credit_registry.js +658 -0
- package/dist/src/generated/waterx_credit/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_credit/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_credit/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_credit/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_credit/limited_supply.d.ts +107 -0
- package/dist/src/generated/waterx_credit/limited_supply.js +131 -0
- package/dist/src/generated/waterx_oracle/aggregator.d.ts +211 -0
- package/dist/src/generated/waterx_oracle/aggregator.js +213 -0
- package/dist/src/generated/waterx_oracle/collector.d.ts +119 -0
- package/dist/src/generated/waterx_oracle/collector.js +105 -0
- package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_oracle/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_oracle/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_oracle/oracle.d.ts +298 -0
- package/dist/src/generated/waterx_oracle/oracle.js +323 -0
- package/dist/src/generated/waterx_oracle/version.d.ts +10 -0
- package/dist/src/generated/waterx_oracle/version.js +8 -0
- package/dist/src/generated/waterx_perp/account_data.d.ts +269 -0
- package/dist/src/generated/waterx_perp/account_data.js +284 -0
- package/dist/src/generated/waterx_perp/admin.d.ts +19 -0
- package/dist/src/generated/waterx_perp/admin.js +22 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.js +10 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/waterx_perp/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_perp/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_perp/deps/sui/balance.d.ts +15 -0
- package/dist/src/generated/waterx_perp/deps/sui/balance.js +17 -0
- package/dist/src/generated/waterx_perp/deps/sui/coin.d.ts +14 -0
- package/dist/src/generated/waterx_perp/deps/sui/coin.js +15 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_perp/events.d.ts +1283 -0
- package/dist/src/generated/waterx_perp/events.js +1018 -0
- package/dist/src/generated/waterx_perp/global_config.d.ts +775 -0
- package/dist/src/generated/waterx_perp/global_config.js +836 -0
- package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +553 -0
- package/dist/src/generated/waterx_perp/keyed_big_vector.js +554 -0
- package/dist/src/generated/waterx_perp/lp_pool.d.ts +1648 -0
- package/dist/src/generated/waterx_perp/lp_pool.js +1521 -0
- package/dist/src/generated/waterx_perp/market_config.d.ts +715 -0
- package/dist/src/generated/waterx_perp/market_config.js +780 -0
- package/dist/src/generated/waterx_perp/math.d.ts +63 -0
- package/dist/src/generated/waterx_perp/math.js +64 -0
- package/dist/src/generated/waterx_perp/memo.d.ts +251 -0
- package/dist/src/generated/waterx_perp/memo.js +323 -0
- package/dist/src/generated/waterx_perp/order_book.d.ts +290 -0
- package/dist/src/generated/waterx_perp/order_book.js +329 -0
- package/dist/src/generated/waterx_perp/position.d.ts +1005 -0
- package/dist/src/generated/waterx_perp/position.js +1103 -0
- package/dist/src/generated/waterx_perp/request.d.ts +544 -0
- package/dist/src/generated/waterx_perp/request.js +541 -0
- package/dist/src/generated/waterx_perp/response.d.ts +247 -0
- package/dist/src/generated/waterx_perp/response.js +280 -0
- package/dist/src/generated/waterx_perp/trading.d.ts +2821 -0
- package/dist/src/generated/waterx_perp/trading.js +2372 -0
- package/dist/src/generated/waterx_perp/version.d.ts +10 -0
- package/dist/src/generated/waterx_perp/version.js +8 -0
- package/dist/src/generated/waterx_perp/witness.d.ts +18 -0
- package/dist/src/generated/waterx_perp/witness.js +21 -0
- package/dist/src/generated/waterx_perp_view/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_perp_view/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_perp_view/view.d.ts +447 -0
- package/dist/src/generated/waterx_perp_view/view.js +414 -0
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +90 -0
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +72 -0
- package/dist/src/generated/waterx_referral/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_referral/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_referral/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_referral/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_referral/referral_table.d.ts +171 -0
- package/dist/src/generated/waterx_referral/referral_table.js +192 -0
- package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.js +10 -0
- package/dist/src/generated/waterx_staking/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/waterx_staking/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_staking/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_staking/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_staking/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_staking/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_staking/waterx_staking.d.ts +746 -0
- package/dist/src/generated/waterx_staking/waterx_staking.js +731 -0
- package/dist/src/generated/waterx_staking/witness.d.ts +16 -0
- package/dist/src/generated/waterx_staking/witness.js +18 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/withdrawal_queue/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/withdrawal_queue/deps/std/type_name.js +19 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/balance.js +14 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +483 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +480 -0
- package/dist/src/generated/wlp/wlp.d.ts +28 -0
- package/dist/src/generated/wlp/wlp.js +32 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/table.js +31 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.d.ts +12 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.js +9 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.d.ts +14 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.js +16 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.d.ts +16 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.js +15 -0
- package/dist/src/generated/wormhole_bridge/events.d.ts +32 -0
- package/dist/src/generated/wormhole_bridge/events.js +28 -0
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +498 -0
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +494 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/index.js +34 -0
- package/dist/src/tx-builders.d.ts +242 -0
- package/dist/src/tx-builders.js +320 -0
- package/dist/src/user/account.d.ts +129 -0
- package/dist/src/user/account.js +166 -0
- package/dist/src/user/credit.d.ts +135 -0
- package/dist/src/user/credit.js +255 -0
- package/dist/src/user/custody.d.ts +71 -0
- package/dist/src/user/custody.js +112 -0
- package/dist/src/user/index.d.ts +8 -0
- package/dist/src/user/index.js +8 -0
- package/dist/src/user/order.d.ts +89 -0
- package/dist/src/user/order.js +134 -0
- package/dist/src/user/referral.d.ts +21 -0
- package/dist/src/user/referral.js +41 -0
- package/dist/src/user/staking.d.ts +54 -0
- package/dist/src/user/staking.js +109 -0
- package/dist/src/user/trading.d.ts +119 -0
- package/dist/src/user/trading.js +262 -0
- package/dist/src/user/wlp.d.ts +58 -0
- package/dist/src/user/wlp.js +99 -0
- package/dist/src/utils/account-request.d.ts +9 -0
- package/dist/src/utils/account-request.js +17 -0
- package/dist/src/utils/config.d.ts +11 -0
- package/dist/src/utils/config.js +15 -0
- package/dist/src/utils/math.d.ts +201 -0
- package/dist/src/utils/math.js +343 -0
- package/dist/src/utils/pyth.d.ts +89 -0
- package/dist/src/utils/pyth.js +316 -0
- package/dist/src/utils/wormhole.d.ts +86 -0
- package/dist/src/utils/wormhole.js +154 -0
- package/package.json +66 -0
|
@@ -0,0 +1,480 @@
|
|
|
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 type_name from "./deps/std/type_name.js";
|
|
7
|
+
import * as balance from "./deps/sui/balance.js";
|
|
8
|
+
import * as linked_table from "./deps/bucket_v2_framework/linked_table.js";
|
|
9
|
+
import * as vec_set from "./deps/sui/vec_set.js";
|
|
10
|
+
import * as vec_set_1 from "./deps/sui/vec_set.js";
|
|
11
|
+
const $moduleName = '@waterx/withdrawal-queue::withdrawal_queue';
|
|
12
|
+
export const WithdrawQueue = new MoveStruct({ name: `${$moduleName}::WithdrawQueue`, fields: {
|
|
13
|
+
dummy_field: bcs.bool()
|
|
14
|
+
} });
|
|
15
|
+
export const WormholeRoute = new MoveStruct({ name: `${$moduleName}::WormholeRoute`, fields: {
|
|
16
|
+
evm_destination_chain: bcs.u16(),
|
|
17
|
+
evm_recipient: bcs.vector(bcs.u8()),
|
|
18
|
+
evm_token: bcs.vector(bcs.u8())
|
|
19
|
+
} });
|
|
20
|
+
export const NativeRoute = new MoveStruct({ name: `${$moduleName}::NativeRoute`, fields: {
|
|
21
|
+
asset_type: type_name.TypeName
|
|
22
|
+
} });
|
|
23
|
+
export const Entry = new MoveStruct({ name: `${$moduleName}::Entry<phantom CREDIT>`, fields: {
|
|
24
|
+
balance: balance.Balance,
|
|
25
|
+
/**
|
|
26
|
+
* Originating wxa Account whose stored `Balance<CREDIT>` produced this entry.
|
|
27
|
+
* Threaded into `vault.burn` / `bridge.burn_for_withdrawal` so the burner identity
|
|
28
|
+
* on the credit registry's personal cap, the EVM-side withdrawal id, and the
|
|
29
|
+
* partner-fee lookup all bind to the source account — not whoever calls
|
|
30
|
+
* `execute_*` (audit finding #3).
|
|
31
|
+
*/
|
|
32
|
+
account_id: bcs.Address,
|
|
33
|
+
/**
|
|
34
|
+
* Sui-side recipient from `WithdrawRequest`. Honored for Native payouts; ignored
|
|
35
|
+
* for Wormhole (EVM recipient lives in extra_data).
|
|
36
|
+
*/
|
|
37
|
+
recipient: bcs.Address,
|
|
38
|
+
extra_data: bcs.vector(bcs.u8())
|
|
39
|
+
} });
|
|
40
|
+
export const Queue = new MoveStruct({ name: `${$moduleName}::Queue<phantom CREDIT>`, fields: {
|
|
41
|
+
id: bcs.Address,
|
|
42
|
+
next_key: bcs.u64(),
|
|
43
|
+
entries: linked_table.LinkedTable(bcs.u64()),
|
|
44
|
+
/**
|
|
45
|
+
* Admin-managed allowlist of addresses authorized to call `execute_wormhole` /
|
|
46
|
+
* `execute_native`. Without this gate any caller could route any user's queue
|
|
47
|
+
* entry through the burn path (audit finding #3).
|
|
48
|
+
*/
|
|
49
|
+
executors: vec_set.VecSet(bcs.Address),
|
|
50
|
+
/**
|
|
51
|
+
* Admin-managed package-version allowlist. Every mutating public entry asserts
|
|
52
|
+
* `PACKAGE_VERSION ∈ allowed_versions`; admin uses `add_version` /
|
|
53
|
+
* `remove_version` to kill-switch a deprecated package after a contract upgrade.
|
|
54
|
+
*/
|
|
55
|
+
allowed_versions: vec_set_1.VecSet(bcs.u16())
|
|
56
|
+
} });
|
|
57
|
+
export const Enqueued = new MoveStruct({ name: `${$moduleName}::Enqueued<phantom CREDIT>`, fields: {
|
|
58
|
+
key: bcs.u64(),
|
|
59
|
+
account_id: bcs.Address,
|
|
60
|
+
recipient: bcs.Address,
|
|
61
|
+
amount: bcs.u64(),
|
|
62
|
+
route_tag: bcs.u8()
|
|
63
|
+
} });
|
|
64
|
+
export const ExecutedWormhole = new MoveStruct({ name: `${$moduleName}::ExecutedWormhole<phantom CREDIT>`, fields: {
|
|
65
|
+
key: bcs.u64(),
|
|
66
|
+
evm_destination_chain: bcs.u16(),
|
|
67
|
+
amount: bcs.u64()
|
|
68
|
+
} });
|
|
69
|
+
export const ExecutedNative = new MoveStruct({ name: `${$moduleName}::ExecutedNative<phantom CREDIT, phantom T>`, fields: {
|
|
70
|
+
key: bcs.u64(),
|
|
71
|
+
recipient: bcs.Address,
|
|
72
|
+
amount: bcs.u64()
|
|
73
|
+
} });
|
|
74
|
+
export const EntryCancelled = new MoveStruct({ name: `${$moduleName}::EntryCancelled<phantom CREDIT>`, fields: {
|
|
75
|
+
key: bcs.u64(),
|
|
76
|
+
account_id: bcs.Address,
|
|
77
|
+
amount: bcs.u64(),
|
|
78
|
+
route_tag: bcs.u8()
|
|
79
|
+
} });
|
|
80
|
+
export const ExecutorUpdated = new MoveStruct({ name: `${$moduleName}::ExecutorUpdated<phantom CREDIT>`, fields: {
|
|
81
|
+
executor: bcs.Address,
|
|
82
|
+
added: bcs.bool()
|
|
83
|
+
} });
|
|
84
|
+
export function packageVersion(options = {}) {
|
|
85
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
86
|
+
return (tx) => tx.moveCall({
|
|
87
|
+
package: packageAddress,
|
|
88
|
+
module: 'withdrawal_queue',
|
|
89
|
+
function: 'package_version',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** User helper: encode a Wormhole-bound route as `extra_data` bytes. */
|
|
93
|
+
export function routeWormhole(options) {
|
|
94
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
95
|
+
const argumentsTypes = [
|
|
96
|
+
'u16',
|
|
97
|
+
'vector<u8>',
|
|
98
|
+
'vector<u8>'
|
|
99
|
+
];
|
|
100
|
+
const parameterNames = ["evmDestinationChain", "evmRecipient", "evmToken"];
|
|
101
|
+
return (tx) => tx.moveCall({
|
|
102
|
+
package: packageAddress,
|
|
103
|
+
module: 'withdrawal_queue',
|
|
104
|
+
function: 'route_wormhole',
|
|
105
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* User helper: encode a Native-bound route as `extra_data` bytes. `T` is the
|
|
110
|
+
* backing asset of the destination `SingleVault<T>`.
|
|
111
|
+
*/
|
|
112
|
+
export function routeNative(options) {
|
|
113
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
114
|
+
return (tx) => tx.moveCall({
|
|
115
|
+
package: packageAddress,
|
|
116
|
+
module: 'withdrawal_queue',
|
|
117
|
+
function: 'route_native',
|
|
118
|
+
typeArguments: options.typeArguments
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** Create + share a `Queue<CREDIT>`. Call once per credit type. */
|
|
122
|
+
export function createQueue(options) {
|
|
123
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
124
|
+
const argumentsTypes = [
|
|
125
|
+
null
|
|
126
|
+
];
|
|
127
|
+
const parameterNames = ["_"];
|
|
128
|
+
return (tx) => tx.moveCall({
|
|
129
|
+
package: packageAddress,
|
|
130
|
+
module: 'withdrawal_queue',
|
|
131
|
+
function: 'create_queue',
|
|
132
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
133
|
+
typeArguments: options.typeArguments
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
export function addExecutor(options) {
|
|
137
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
138
|
+
const argumentsTypes = [
|
|
139
|
+
null,
|
|
140
|
+
null,
|
|
141
|
+
'address'
|
|
142
|
+
];
|
|
143
|
+
const parameterNames = ["queue", "_", "executor"];
|
|
144
|
+
return (tx) => tx.moveCall({
|
|
145
|
+
package: packageAddress,
|
|
146
|
+
module: 'withdrawal_queue',
|
|
147
|
+
function: 'add_executor',
|
|
148
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
149
|
+
typeArguments: options.typeArguments
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
export function removeExecutor(options) {
|
|
153
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
154
|
+
const argumentsTypes = [
|
|
155
|
+
null,
|
|
156
|
+
null,
|
|
157
|
+
'address'
|
|
158
|
+
];
|
|
159
|
+
const parameterNames = ["queue", "_", "executor"];
|
|
160
|
+
return (tx) => tx.moveCall({
|
|
161
|
+
package: packageAddress,
|
|
162
|
+
module: 'withdrawal_queue',
|
|
163
|
+
function: 'remove_executor',
|
|
164
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
165
|
+
typeArguments: options.typeArguments
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
export function isExecutor(options) {
|
|
169
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
170
|
+
const argumentsTypes = [
|
|
171
|
+
null,
|
|
172
|
+
'address'
|
|
173
|
+
];
|
|
174
|
+
const parameterNames = ["queue", "executor"];
|
|
175
|
+
return (tx) => tx.moveCall({
|
|
176
|
+
package: packageAddress,
|
|
177
|
+
module: 'withdrawal_queue',
|
|
178
|
+
function: 'is_executor',
|
|
179
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
180
|
+
typeArguments: options.typeArguments
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Admin: whitelist a package version. New deployments add their own version here
|
|
185
|
+
* before the upgrade so in-flight calls don't abort during the rollover window.
|
|
186
|
+
* Skips the version check itself so admin can recover from a stuck state.
|
|
187
|
+
*/
|
|
188
|
+
export function addVersion(options) {
|
|
189
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
190
|
+
const argumentsTypes = [
|
|
191
|
+
null,
|
|
192
|
+
null,
|
|
193
|
+
'u16'
|
|
194
|
+
];
|
|
195
|
+
const parameterNames = ["queue", "_", "version"];
|
|
196
|
+
return (tx) => tx.moveCall({
|
|
197
|
+
package: packageAddress,
|
|
198
|
+
module: 'withdrawal_queue',
|
|
199
|
+
function: 'add_version',
|
|
200
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
201
|
+
typeArguments: options.typeArguments
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Admin: remove a package version from the allowlist. Kill-switches the prior
|
|
206
|
+
* version after an upgrade. Skips the version check itself so admin can recover
|
|
207
|
+
* from a stuck state.
|
|
208
|
+
*/
|
|
209
|
+
export function removeVersion(options) {
|
|
210
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
211
|
+
const argumentsTypes = [
|
|
212
|
+
null,
|
|
213
|
+
null,
|
|
214
|
+
'u16'
|
|
215
|
+
];
|
|
216
|
+
const parameterNames = ["queue", "_", "version"];
|
|
217
|
+
return (tx) => tx.moveCall({
|
|
218
|
+
package: packageAddress,
|
|
219
|
+
module: 'withdrawal_queue',
|
|
220
|
+
function: 'remove_version',
|
|
221
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
222
|
+
typeArguments: options.typeArguments
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Refund a parked entry's `Balance<CREDIT>` back to the **originating wxa
|
|
227
|
+
* account** when the entry can no longer be executed — e.g. the `extra_data` body
|
|
228
|
+
* is malformed (handcrafted by the caller instead of via `route_*`), or admin has
|
|
229
|
+
* since `remove_trusted_emitter`'d the destination chain or
|
|
230
|
+
* `set_asset_deprecated`'d the native asset. Without this, such entries
|
|
231
|
+
* permanently lock both the balance and the queue slot (audit finding #5).
|
|
232
|
+
*
|
|
233
|
+
* Auth: either a registered queue keeper (`request.address() ∈ queue.executors`)
|
|
234
|
+
* OR an address authorized on the originating wxa account
|
|
235
|
+
* (`account_registry.is_account_authorized(entry.account_id, caller, now)` —
|
|
236
|
+
* owner or non-expired delegate). The user can self-cancel without waiting for the
|
|
237
|
+
* keeper, and the keeper can clean up stale entries proactively.
|
|
238
|
+
*
|
|
239
|
+
* The refund goes to `Entry.account_id` (the originating wxa account), not
|
|
240
|
+
* `Entry.recipient` (the external destination the user picked) —
|
|
241
|
+
* `request_withdraw<CREDIT>` debited the user's account on enqueue, so the
|
|
242
|
+
* symmetric cancel re-credits that same account. The user can re-issue
|
|
243
|
+
* `request_withdraw` from the restored stored balance once the route is fixed.
|
|
244
|
+
*/
|
|
245
|
+
export function cancelEntry(options) {
|
|
246
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
247
|
+
const argumentsTypes = [
|
|
248
|
+
null,
|
|
249
|
+
null,
|
|
250
|
+
null,
|
|
251
|
+
'u64',
|
|
252
|
+
'0x2::clock::Clock'
|
|
253
|
+
];
|
|
254
|
+
const parameterNames = ["queue", "accountRegistry", "request", "key"];
|
|
255
|
+
return (tx) => tx.moveCall({
|
|
256
|
+
package: packageAddress,
|
|
257
|
+
module: 'withdrawal_queue',
|
|
258
|
+
function: 'cancel_entry',
|
|
259
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
260
|
+
typeArguments: options.typeArguments
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Consume a `WithdrawRequest<CREDIT>` registered to `WithdrawQueue` and park its
|
|
265
|
+
* balance + extra_data. Returns the assigned key. Aborts with `EUnknownRoute` if
|
|
266
|
+
* `extra_data`'s leading tag byte is not a known route.
|
|
267
|
+
*/
|
|
268
|
+
export function enqueue(options) {
|
|
269
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
270
|
+
const argumentsTypes = [
|
|
271
|
+
null,
|
|
272
|
+
null,
|
|
273
|
+
null
|
|
274
|
+
];
|
|
275
|
+
const parameterNames = ["queue", "registry", "req"];
|
|
276
|
+
return (tx) => tx.moveCall({
|
|
277
|
+
package: packageAddress,
|
|
278
|
+
module: 'withdrawal_queue',
|
|
279
|
+
function: 'enqueue',
|
|
280
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
281
|
+
typeArguments: options.typeArguments
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Execute a queued entry via `wormhole_bridge::burn_for_withdrawal`. Peels the
|
|
286
|
+
* Wormhole route fields out of `extra_data`. Aborts with `ERouteMismatch` if the
|
|
287
|
+
* entry was not Wormhole-routed. `request.address()` must be on the queue's
|
|
288
|
+
* executor allowlist (audit finding #3); the originating `Entry.account_id` is
|
|
289
|
+
* what the burn path uses for cap accounting / withdrawal id.
|
|
290
|
+
*/
|
|
291
|
+
export function executeWormhole(options) {
|
|
292
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
293
|
+
const argumentsTypes = [
|
|
294
|
+
null,
|
|
295
|
+
'u64',
|
|
296
|
+
null,
|
|
297
|
+
null,
|
|
298
|
+
null,
|
|
299
|
+
null,
|
|
300
|
+
null,
|
|
301
|
+
'0x2::clock::Clock'
|
|
302
|
+
];
|
|
303
|
+
const parameterNames = ["queue", "key", "request", "bridge", "creditRegistry", "wormholeState", "wormholeFee"];
|
|
304
|
+
return (tx) => tx.moveCall({
|
|
305
|
+
package: packageAddress,
|
|
306
|
+
module: 'withdrawal_queue',
|
|
307
|
+
function: 'execute_wormhole',
|
|
308
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
309
|
+
typeArguments: options.typeArguments
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Execute a queued entry via `native_custody::custody_vault::burn<T>`. Verifies
|
|
314
|
+
* that `extra_data` byte-equals `route_native<T>()` — if `T` was not the
|
|
315
|
+
* asset_type the user specified, aborts with `ERouteMismatch`.
|
|
316
|
+
*/
|
|
317
|
+
export function executeNative(options) {
|
|
318
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
319
|
+
const argumentsTypes = [
|
|
320
|
+
null,
|
|
321
|
+
'u64',
|
|
322
|
+
null,
|
|
323
|
+
null,
|
|
324
|
+
null,
|
|
325
|
+
'0x2::clock::Clock'
|
|
326
|
+
];
|
|
327
|
+
const parameterNames = ["queue", "key", "request", "vault", "creditRegistry"];
|
|
328
|
+
return (tx) => tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: 'withdrawal_queue',
|
|
331
|
+
function: 'execute_native',
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
333
|
+
typeArguments: options.typeArguments
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
export function length(options) {
|
|
337
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
338
|
+
const argumentsTypes = [
|
|
339
|
+
null
|
|
340
|
+
];
|
|
341
|
+
const parameterNames = ["queue"];
|
|
342
|
+
return (tx) => tx.moveCall({
|
|
343
|
+
package: packageAddress,
|
|
344
|
+
module: 'withdrawal_queue',
|
|
345
|
+
function: 'length',
|
|
346
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
347
|
+
typeArguments: options.typeArguments
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
export function isEmpty(options) {
|
|
351
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
352
|
+
const argumentsTypes = [
|
|
353
|
+
null
|
|
354
|
+
];
|
|
355
|
+
const parameterNames = ["queue"];
|
|
356
|
+
return (tx) => tx.moveCall({
|
|
357
|
+
package: packageAddress,
|
|
358
|
+
module: 'withdrawal_queue',
|
|
359
|
+
function: 'is_empty',
|
|
360
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
361
|
+
typeArguments: options.typeArguments
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
export function front(options) {
|
|
365
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
366
|
+
const argumentsTypes = [
|
|
367
|
+
null
|
|
368
|
+
];
|
|
369
|
+
const parameterNames = ["queue"];
|
|
370
|
+
return (tx) => tx.moveCall({
|
|
371
|
+
package: packageAddress,
|
|
372
|
+
module: 'withdrawal_queue',
|
|
373
|
+
function: 'front',
|
|
374
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
375
|
+
typeArguments: options.typeArguments
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
export function contains(options) {
|
|
379
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
380
|
+
const argumentsTypes = [
|
|
381
|
+
null,
|
|
382
|
+
'u64'
|
|
383
|
+
];
|
|
384
|
+
const parameterNames = ["queue", "key"];
|
|
385
|
+
return (tx) => tx.moveCall({
|
|
386
|
+
package: packageAddress,
|
|
387
|
+
module: 'withdrawal_queue',
|
|
388
|
+
function: 'contains',
|
|
389
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
390
|
+
typeArguments: options.typeArguments
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
export function entry(options) {
|
|
394
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
395
|
+
const argumentsTypes = [
|
|
396
|
+
null,
|
|
397
|
+
'u64'
|
|
398
|
+
];
|
|
399
|
+
const parameterNames = ["queue", "key"];
|
|
400
|
+
return (tx) => tx.moveCall({
|
|
401
|
+
package: packageAddress,
|
|
402
|
+
module: 'withdrawal_queue',
|
|
403
|
+
function: 'entry',
|
|
404
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
405
|
+
typeArguments: options.typeArguments
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
export function entryAmount(options) {
|
|
409
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
410
|
+
const argumentsTypes = [
|
|
411
|
+
null
|
|
412
|
+
];
|
|
413
|
+
const parameterNames = ["entry"];
|
|
414
|
+
return (tx) => tx.moveCall({
|
|
415
|
+
package: packageAddress,
|
|
416
|
+
module: 'withdrawal_queue',
|
|
417
|
+
function: 'entry_amount',
|
|
418
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
419
|
+
typeArguments: options.typeArguments
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
export function entryAccountId(options) {
|
|
423
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
424
|
+
const argumentsTypes = [
|
|
425
|
+
null
|
|
426
|
+
];
|
|
427
|
+
const parameterNames = ["entry"];
|
|
428
|
+
return (tx) => tx.moveCall({
|
|
429
|
+
package: packageAddress,
|
|
430
|
+
module: 'withdrawal_queue',
|
|
431
|
+
function: 'entry_account_id',
|
|
432
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
433
|
+
typeArguments: options.typeArguments
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
export function entryRecipient(options) {
|
|
437
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
438
|
+
const argumentsTypes = [
|
|
439
|
+
null
|
|
440
|
+
];
|
|
441
|
+
const parameterNames = ["entry"];
|
|
442
|
+
return (tx) => tx.moveCall({
|
|
443
|
+
package: packageAddress,
|
|
444
|
+
module: 'withdrawal_queue',
|
|
445
|
+
function: 'entry_recipient',
|
|
446
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
447
|
+
typeArguments: options.typeArguments
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
export function entryExtraData(options) {
|
|
451
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
452
|
+
const argumentsTypes = [
|
|
453
|
+
null
|
|
454
|
+
];
|
|
455
|
+
const parameterNames = ["entry"];
|
|
456
|
+
return (tx) => tx.moveCall({
|
|
457
|
+
package: packageAddress,
|
|
458
|
+
module: 'withdrawal_queue',
|
|
459
|
+
function: 'entry_extra_data',
|
|
460
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
461
|
+
typeArguments: options.typeArguments
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Returns the leading route tag byte; aborts if `extra_data` is empty or carries
|
|
466
|
+
* an unknown tag.
|
|
467
|
+
*/
|
|
468
|
+
export function routeTag(options) {
|
|
469
|
+
const packageAddress = options.package ?? '@waterx/withdrawal-queue';
|
|
470
|
+
const argumentsTypes = [
|
|
471
|
+
'vector<u8>'
|
|
472
|
+
];
|
|
473
|
+
const parameterNames = ["extraData"];
|
|
474
|
+
return (tx) => tx.moveCall({
|
|
475
|
+
package: packageAddress,
|
|
476
|
+
module: 'withdrawal_queue',
|
|
477
|
+
function: 'route_tag',
|
|
478
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
479
|
+
});
|
|
480
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 WLP: MoveStruct<{
|
|
7
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
+
}, "@waterx/wlp::wlp::WLP">;
|
|
9
|
+
export interface CreateWlpPoolArguments {
|
|
10
|
+
coinRegistry: RawTransactionArgument<string>;
|
|
11
|
+
adminCap: RawTransactionArgument<string>;
|
|
12
|
+
proof: RawTransactionArgument<string>;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateWlpPoolOptions {
|
|
15
|
+
package?: string;
|
|
16
|
+
arguments: CreateWlpPoolArguments | [
|
|
17
|
+
coinRegistry: RawTransactionArgument<string>,
|
|
18
|
+
adminCap: RawTransactionArgument<string>,
|
|
19
|
+
proof: RawTransactionArgument<string>
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
export declare function createWlpPool(options: CreateWlpPoolOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
23
|
+
export interface DecimalsOptions {
|
|
24
|
+
package?: string;
|
|
25
|
+
arguments?: [
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
export declare function decimals(options?: DecimalsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
const $moduleName = '@waterx/wlp::wlp';
|
|
7
|
+
export const WLP = new MoveStruct({ name: `${$moduleName}::WLP`, fields: {
|
|
8
|
+
id: bcs.Address
|
|
9
|
+
} });
|
|
10
|
+
export function createWlpPool(options) {
|
|
11
|
+
const packageAddress = options.package ?? '@waterx/wlp';
|
|
12
|
+
const argumentsTypes = [
|
|
13
|
+
null,
|
|
14
|
+
null,
|
|
15
|
+
null
|
|
16
|
+
];
|
|
17
|
+
const parameterNames = ["coinRegistry", "adminCap", "proof"];
|
|
18
|
+
return (tx) => tx.moveCall({
|
|
19
|
+
package: packageAddress,
|
|
20
|
+
module: 'wlp',
|
|
21
|
+
function: 'create_wlp_pool',
|
|
22
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function decimals(options = {}) {
|
|
26
|
+
const packageAddress = options.package ?? '@waterx/wlp';
|
|
27
|
+
return (tx) => tx.moveCall({
|
|
28
|
+
package: packageAddress,
|
|
29
|
+
module: 'wlp',
|
|
30
|
+
function: 'decimals',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
24
|
+
export declare const Table: MoveStruct<{
|
|
25
|
+
/** the ID of this table */
|
|
26
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
27
|
+
/** the number of key-value pairs in the table */
|
|
28
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
29
|
+
}, "0x2::table::Table<phantom K, phantom V>">;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
24
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
+
const $moduleName = '0x2::table';
|
|
26
|
+
export const Table = new MoveStruct({ name: `${$moduleName}::Table<phantom K, phantom V>`, fields: {
|
|
27
|
+
/** the ID of this table */
|
|
28
|
+
id: bcs.Address,
|
|
29
|
+
/** the number of key-value pairs in the table */
|
|
30
|
+
size: bcs.u64()
|
|
31
|
+
} });
|
|
@@ -0,0 +1,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
|
+
}
|
|
@@ -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>;
|