@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,554 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* This module implements a `KeyedBigVector`, a data structure that combines the
|
|
6
|
+
* features of a `BigVector` and a `Table`. It allows for both indexed and keyed
|
|
7
|
+
* access to a large number of elements by storing them in slices, while
|
|
8
|
+
* maintaining a mapping from keys to indices in a `Table`.
|
|
9
|
+
*/
|
|
10
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
11
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
12
|
+
import * as type_name from "./deps/std/type_name.js";
|
|
13
|
+
import * as type_name_1 from "./deps/std/type_name.js";
|
|
14
|
+
const $moduleName = '@waterx/perp::keyed_big_vector';
|
|
15
|
+
export const KeyedBigVector = new MoveStruct({ name: `${$moduleName}::KeyedBigVector`, fields: {
|
|
16
|
+
/** The unique identifier of the KeyedBigVector object. */
|
|
17
|
+
id: bcs.Address,
|
|
18
|
+
/** The type name of the keys. */
|
|
19
|
+
key_type: type_name.TypeName,
|
|
20
|
+
/** The type name of the values. */
|
|
21
|
+
value_type: type_name_1.TypeName,
|
|
22
|
+
/** The index of the latest slice. */
|
|
23
|
+
slice_idx: bcs.u16(),
|
|
24
|
+
/** The maximum size of each slice. */
|
|
25
|
+
slice_size: bcs.u32(),
|
|
26
|
+
/** The total number of elements in the KeyedBigVector. */
|
|
27
|
+
length: bcs.u64()
|
|
28
|
+
} });
|
|
29
|
+
/** An element in the KeyedBigVector, containing a key-value pair. */
|
|
30
|
+
export function Element(...typeParameters) {
|
|
31
|
+
return new MoveStruct({ name: `${$moduleName}::Element<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
32
|
+
/** The key of the element. */
|
|
33
|
+
key: typeParameters[0],
|
|
34
|
+
/** The value of the element. */
|
|
35
|
+
value: typeParameters[1]
|
|
36
|
+
} });
|
|
37
|
+
}
|
|
38
|
+
/** A slice of the KeyedBigVector, containing a vector of elements. */
|
|
39
|
+
export function Slice(...typeParameters) {
|
|
40
|
+
return new MoveStruct({ name: `${$moduleName}::Slice<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
41
|
+
/** The index of the slice. */
|
|
42
|
+
idx: bcs.u16(),
|
|
43
|
+
/** The vector that stores the elements. */
|
|
44
|
+
vector: bcs.vector(Element(typeParameters[0], typeParameters[1]))
|
|
45
|
+
} });
|
|
46
|
+
}
|
|
47
|
+
/** Error for a duplicate key. */
|
|
48
|
+
export function duplicateKey(options = {}) {
|
|
49
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
50
|
+
return (tx) => tx.moveCall({
|
|
51
|
+
package: packageAddress,
|
|
52
|
+
module: 'keyed_big_vector',
|
|
53
|
+
function: 'duplicate_key',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** Error for an out-of-bounds index. */
|
|
57
|
+
export function indexOutOfBounds(options = {}) {
|
|
58
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
59
|
+
return (tx) => tx.moveCall({
|
|
60
|
+
package: packageAddress,
|
|
61
|
+
module: 'keyed_big_vector',
|
|
62
|
+
function: 'index_out_of_bounds',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** Error for an invalid slice size. */
|
|
66
|
+
export function invalidSliceSize(options = {}) {
|
|
67
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
68
|
+
return (tx) => tx.moveCall({
|
|
69
|
+
package: packageAddress,
|
|
70
|
+
module: 'keyed_big_vector',
|
|
71
|
+
function: 'invalid_slice_size',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** Error when a key is not found. */
|
|
75
|
+
export function keyNotFound(options = {}) {
|
|
76
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
77
|
+
return (tx) => tx.moveCall({
|
|
78
|
+
package: packageAddress,
|
|
79
|
+
module: 'keyed_big_vector',
|
|
80
|
+
function: 'key_not_found',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Error when the maximum number of slices is reached. */
|
|
84
|
+
export function maxSliceAmountReached(options = {}) {
|
|
85
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
86
|
+
return (tx) => tx.moveCall({
|
|
87
|
+
package: packageAddress,
|
|
88
|
+
module: 'keyed_big_vector',
|
|
89
|
+
function: 'max_slice_amount_reached',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** Error when trying to destroy a non-empty KeyedBigVector. */
|
|
93
|
+
export function notEmpty(options = {}) {
|
|
94
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
95
|
+
return (tx) => tx.moveCall({
|
|
96
|
+
package: packageAddress,
|
|
97
|
+
module: 'keyed_big_vector',
|
|
98
|
+
function: 'not_empty',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Creates a new `KeyedBigVector`. The `slice_size` determines the maximum number
|
|
103
|
+
* of elements in each slice.
|
|
104
|
+
*/
|
|
105
|
+
export function _new(options) {
|
|
106
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
107
|
+
const argumentsTypes = [
|
|
108
|
+
'u32'
|
|
109
|
+
];
|
|
110
|
+
const parameterNames = ["sliceSize"];
|
|
111
|
+
return (tx) => tx.moveCall({
|
|
112
|
+
package: packageAddress,
|
|
113
|
+
module: 'keyed_big_vector',
|
|
114
|
+
function: 'new',
|
|
115
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
116
|
+
typeArguments: options.typeArguments
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/** Returns the index of the latest slice in the KeyedBigVector. */
|
|
120
|
+
export function sliceIdx(options) {
|
|
121
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
122
|
+
const argumentsTypes = [
|
|
123
|
+
null
|
|
124
|
+
];
|
|
125
|
+
const parameterNames = ["kbv"];
|
|
126
|
+
return (tx) => tx.moveCall({
|
|
127
|
+
package: packageAddress,
|
|
128
|
+
module: 'keyed_big_vector',
|
|
129
|
+
function: 'slice_idx',
|
|
130
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/** Returns the maximum size of each slice in the KeyedBigVector. */
|
|
134
|
+
export function sliceSize(options) {
|
|
135
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
136
|
+
const argumentsTypes = [
|
|
137
|
+
null
|
|
138
|
+
];
|
|
139
|
+
const parameterNames = ["kbv"];
|
|
140
|
+
return (tx) => tx.moveCall({
|
|
141
|
+
package: packageAddress,
|
|
142
|
+
module: 'keyed_big_vector',
|
|
143
|
+
function: 'slice_size',
|
|
144
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** Returns the total number of elements in the KeyedBigVector. */
|
|
148
|
+
export function length(options) {
|
|
149
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
150
|
+
const argumentsTypes = [
|
|
151
|
+
null
|
|
152
|
+
];
|
|
153
|
+
const parameterNames = ["kbv"];
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: 'keyed_big_vector',
|
|
157
|
+
function: 'length',
|
|
158
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/** Returns `true` if the KeyedBigVector is empty. */
|
|
162
|
+
export function isEmpty(options) {
|
|
163
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
164
|
+
const argumentsTypes = [
|
|
165
|
+
null
|
|
166
|
+
];
|
|
167
|
+
const parameterNames = ["kbv"];
|
|
168
|
+
return (tx) => tx.moveCall({
|
|
169
|
+
package: packageAddress,
|
|
170
|
+
module: 'keyed_big_vector',
|
|
171
|
+
function: 'is_empty',
|
|
172
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns `true` if there is a value associated with the key `key` in the
|
|
177
|
+
* KeyedBigVector.
|
|
178
|
+
*/
|
|
179
|
+
export function contains(options) {
|
|
180
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
181
|
+
const argumentsTypes = [
|
|
182
|
+
null,
|
|
183
|
+
`${options.typeArguments[0]}`
|
|
184
|
+
];
|
|
185
|
+
const parameterNames = ["kbv", "key"];
|
|
186
|
+
return (tx) => tx.moveCall({
|
|
187
|
+
package: packageAddress,
|
|
188
|
+
module: 'keyed_big_vector',
|
|
189
|
+
function: 'contains',
|
|
190
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
191
|
+
typeArguments: options.typeArguments
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/** Returns the index of the slice. */
|
|
195
|
+
export function getSliceIdx(options) {
|
|
196
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
197
|
+
const argumentsTypes = [
|
|
198
|
+
null
|
|
199
|
+
];
|
|
200
|
+
const parameterNames = ["slice"];
|
|
201
|
+
return (tx) => tx.moveCall({
|
|
202
|
+
package: packageAddress,
|
|
203
|
+
module: 'keyed_big_vector',
|
|
204
|
+
function: 'get_slice_idx',
|
|
205
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
206
|
+
typeArguments: options.typeArguments
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** Returns the number of elements in the slice. */
|
|
210
|
+
export function getSliceLength(options) {
|
|
211
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
212
|
+
const argumentsTypes = [
|
|
213
|
+
null
|
|
214
|
+
];
|
|
215
|
+
const parameterNames = ["slice"];
|
|
216
|
+
return (tx) => tx.moveCall({
|
|
217
|
+
package: packageAddress,
|
|
218
|
+
module: 'keyed_big_vector',
|
|
219
|
+
function: 'get_slice_length',
|
|
220
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
221
|
+
typeArguments: options.typeArguments
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Pushes a new element to the end of the KeyedBigVector. Aborts if the key already
|
|
226
|
+
* exists or if the maximum number of slices is reached.
|
|
227
|
+
*/
|
|
228
|
+
export function pushBack(options) {
|
|
229
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
230
|
+
const argumentsTypes = [
|
|
231
|
+
null,
|
|
232
|
+
`${options.typeArguments[0]}`,
|
|
233
|
+
`${options.typeArguments[1]}`
|
|
234
|
+
];
|
|
235
|
+
const parameterNames = ["kbv", "key", "value"];
|
|
236
|
+
return (tx) => tx.moveCall({
|
|
237
|
+
package: packageAddress,
|
|
238
|
+
module: 'keyed_big_vector',
|
|
239
|
+
function: 'push_back',
|
|
240
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
241
|
+
typeArguments: options.typeArguments
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Pops an element from the end of the KeyedBigVector and returns its key and
|
|
246
|
+
* value. Aborts if the KeyedBigVector is empty.
|
|
247
|
+
*/
|
|
248
|
+
export function popBack(options) {
|
|
249
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
250
|
+
const argumentsTypes = [
|
|
251
|
+
null
|
|
252
|
+
];
|
|
253
|
+
const parameterNames = ["kbv"];
|
|
254
|
+
return (tx) => tx.moveCall({
|
|
255
|
+
package: packageAddress,
|
|
256
|
+
module: 'keyed_big_vector',
|
|
257
|
+
function: 'pop_back',
|
|
258
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
259
|
+
typeArguments: options.typeArguments
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
/** Borrows a slice from the KeyedBigVector at `slice_idx`. */
|
|
263
|
+
export function borrowSlice(options) {
|
|
264
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
265
|
+
const argumentsTypes = [
|
|
266
|
+
null,
|
|
267
|
+
'u16'
|
|
268
|
+
];
|
|
269
|
+
const parameterNames = ["kbv", "sliceIdx"];
|
|
270
|
+
return (tx) => tx.moveCall({
|
|
271
|
+
package: packageAddress,
|
|
272
|
+
module: 'keyed_big_vector',
|
|
273
|
+
function: 'borrow_slice',
|
|
274
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
275
|
+
typeArguments: options.typeArguments
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
export function borrowSlice_(options) {
|
|
279
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
280
|
+
const argumentsTypes = [
|
|
281
|
+
'0x2::object::ID',
|
|
282
|
+
'u16'
|
|
283
|
+
];
|
|
284
|
+
const parameterNames = ["id", "sliceIdx"];
|
|
285
|
+
return (tx) => tx.moveCall({
|
|
286
|
+
package: packageAddress,
|
|
287
|
+
module: 'keyed_big_vector',
|
|
288
|
+
function: 'borrow_slice_',
|
|
289
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
290
|
+
typeArguments: options.typeArguments
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/** Borrows a mutable slice from the KeyedBigVector at `slice_idx`. */
|
|
294
|
+
export function borrowSliceMut(options) {
|
|
295
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
296
|
+
const argumentsTypes = [
|
|
297
|
+
null,
|
|
298
|
+
'u16'
|
|
299
|
+
];
|
|
300
|
+
const parameterNames = ["kbv", "sliceIdx"];
|
|
301
|
+
return (tx) => tx.moveCall({
|
|
302
|
+
package: packageAddress,
|
|
303
|
+
module: 'keyed_big_vector',
|
|
304
|
+
function: 'borrow_slice_mut',
|
|
305
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
306
|
+
typeArguments: options.typeArguments
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
export function borrowSliceMut_(options) {
|
|
310
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
311
|
+
const argumentsTypes = [
|
|
312
|
+
'0x2::object::ID',
|
|
313
|
+
'u16'
|
|
314
|
+
];
|
|
315
|
+
const parameterNames = ["id", "sliceIdx"];
|
|
316
|
+
return (tx) => tx.moveCall({
|
|
317
|
+
package: packageAddress,
|
|
318
|
+
module: 'keyed_big_vector',
|
|
319
|
+
function: 'borrow_slice_mut_',
|
|
320
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
321
|
+
typeArguments: options.typeArguments
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/** Borrows an element at index `i` from the KeyedBigVector. */
|
|
325
|
+
export function borrow(options) {
|
|
326
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
327
|
+
const argumentsTypes = [
|
|
328
|
+
null,
|
|
329
|
+
'u64'
|
|
330
|
+
];
|
|
331
|
+
const parameterNames = ["kbv", "i"];
|
|
332
|
+
return (tx) => tx.moveCall({
|
|
333
|
+
package: packageAddress,
|
|
334
|
+
module: 'keyed_big_vector',
|
|
335
|
+
function: 'borrow',
|
|
336
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
337
|
+
typeArguments: options.typeArguments
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
export function borrow_(options) {
|
|
341
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
342
|
+
const argumentsTypes = [
|
|
343
|
+
null,
|
|
344
|
+
'u64'
|
|
345
|
+
];
|
|
346
|
+
const parameterNames = ["kbv", "i"];
|
|
347
|
+
return (tx) => tx.moveCall({
|
|
348
|
+
package: packageAddress,
|
|
349
|
+
module: 'keyed_big_vector',
|
|
350
|
+
function: 'borrow_',
|
|
351
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
352
|
+
typeArguments: options.typeArguments
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
/** Borrows a mutable element at index `i` from the KeyedBigVector. */
|
|
356
|
+
export function borrowMut(options) {
|
|
357
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
358
|
+
const argumentsTypes = [
|
|
359
|
+
null,
|
|
360
|
+
'u64'
|
|
361
|
+
];
|
|
362
|
+
const parameterNames = ["kbv", "i"];
|
|
363
|
+
return (tx) => tx.moveCall({
|
|
364
|
+
package: packageAddress,
|
|
365
|
+
module: 'keyed_big_vector',
|
|
366
|
+
function: 'borrow_mut',
|
|
367
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
368
|
+
typeArguments: options.typeArguments
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
export function borrowMut_(options) {
|
|
372
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
373
|
+
const argumentsTypes = [
|
|
374
|
+
null,
|
|
375
|
+
'u64'
|
|
376
|
+
];
|
|
377
|
+
const parameterNames = ["kbv", "i"];
|
|
378
|
+
return (tx) => tx.moveCall({
|
|
379
|
+
package: packageAddress,
|
|
380
|
+
module: 'keyed_big_vector',
|
|
381
|
+
function: 'borrow_mut_',
|
|
382
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
383
|
+
typeArguments: options.typeArguments
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/** Borrows an element by its key from the KeyedBigVector. */
|
|
387
|
+
export function borrowByKey(options) {
|
|
388
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
389
|
+
const argumentsTypes = [
|
|
390
|
+
null,
|
|
391
|
+
`${options.typeArguments[0]}`
|
|
392
|
+
];
|
|
393
|
+
const parameterNames = ["kbv", "key"];
|
|
394
|
+
return (tx) => tx.moveCall({
|
|
395
|
+
package: packageAddress,
|
|
396
|
+
module: 'keyed_big_vector',
|
|
397
|
+
function: 'borrow_by_key',
|
|
398
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
399
|
+
typeArguments: options.typeArguments
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/** Borrows a mutable element by its key from the KeyedBigVector. */
|
|
403
|
+
export function borrowByKeyMut(options) {
|
|
404
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
405
|
+
const argumentsTypes = [
|
|
406
|
+
null,
|
|
407
|
+
`${options.typeArguments[0]}`
|
|
408
|
+
];
|
|
409
|
+
const parameterNames = ["kbv", "key"];
|
|
410
|
+
return (tx) => tx.moveCall({
|
|
411
|
+
package: packageAddress,
|
|
412
|
+
module: 'keyed_big_vector',
|
|
413
|
+
function: 'borrow_by_key_mut',
|
|
414
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
415
|
+
typeArguments: options.typeArguments
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
/** Borrows an element at index `i` from a slice. */
|
|
419
|
+
export function borrowFromSlice(options) {
|
|
420
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
421
|
+
const argumentsTypes = [
|
|
422
|
+
null,
|
|
423
|
+
'u64'
|
|
424
|
+
];
|
|
425
|
+
const parameterNames = ["slice", "i"];
|
|
426
|
+
return (tx) => tx.moveCall({
|
|
427
|
+
package: packageAddress,
|
|
428
|
+
module: 'keyed_big_vector',
|
|
429
|
+
function: 'borrow_from_slice',
|
|
430
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
431
|
+
typeArguments: options.typeArguments
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/** Borrows a mutable element at index `i` from a slice. */
|
|
435
|
+
export function borrowFromSliceMut(options) {
|
|
436
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
437
|
+
const argumentsTypes = [
|
|
438
|
+
null,
|
|
439
|
+
'u64'
|
|
440
|
+
];
|
|
441
|
+
const parameterNames = ["slice", "i"];
|
|
442
|
+
return (tx) => tx.moveCall({
|
|
443
|
+
package: packageAddress,
|
|
444
|
+
module: 'keyed_big_vector',
|
|
445
|
+
function: 'borrow_from_slice_mut',
|
|
446
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
447
|
+
typeArguments: options.typeArguments
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
/** Swaps the element at index `i` with the last element and removes it. */
|
|
451
|
+
export function swapRemove(options) {
|
|
452
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
453
|
+
const argumentsTypes = [
|
|
454
|
+
null,
|
|
455
|
+
'u64'
|
|
456
|
+
];
|
|
457
|
+
const parameterNames = ["kbv", "i"];
|
|
458
|
+
return (tx) => tx.moveCall({
|
|
459
|
+
package: packageAddress,
|
|
460
|
+
module: 'keyed_big_vector',
|
|
461
|
+
function: 'swap_remove',
|
|
462
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
463
|
+
typeArguments: options.typeArguments
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
export function swapRemove_(options) {
|
|
467
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
468
|
+
const argumentsTypes = [
|
|
469
|
+
null,
|
|
470
|
+
'u64'
|
|
471
|
+
];
|
|
472
|
+
const parameterNames = ["kbv", "i"];
|
|
473
|
+
return (tx) => tx.moveCall({
|
|
474
|
+
package: packageAddress,
|
|
475
|
+
module: 'keyed_big_vector',
|
|
476
|
+
function: 'swap_remove_',
|
|
477
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
478
|
+
typeArguments: options.typeArguments
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
/** Swaps the element with the given key with the last element and removes it. */
|
|
482
|
+
export function swapRemoveByKey(options) {
|
|
483
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
484
|
+
const argumentsTypes = [
|
|
485
|
+
null,
|
|
486
|
+
`${options.typeArguments[0]}`
|
|
487
|
+
];
|
|
488
|
+
const parameterNames = ["kbv", "key"];
|
|
489
|
+
return (tx) => tx.moveCall({
|
|
490
|
+
package: packageAddress,
|
|
491
|
+
module: 'keyed_big_vector',
|
|
492
|
+
function: 'swap_remove_by_key',
|
|
493
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
494
|
+
typeArguments: options.typeArguments
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
/** Destroys an empty KeyedBigVector. Aborts if the KeyedBigVector is not empty. */
|
|
498
|
+
export function destroyEmpty(options) {
|
|
499
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
500
|
+
const argumentsTypes = [
|
|
501
|
+
null
|
|
502
|
+
];
|
|
503
|
+
const parameterNames = ["kbv"];
|
|
504
|
+
return (tx) => tx.moveCall({
|
|
505
|
+
package: packageAddress,
|
|
506
|
+
module: 'keyed_big_vector',
|
|
507
|
+
function: 'destroy_empty',
|
|
508
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
/** Destroys a KeyedBigVector. */
|
|
512
|
+
export function drop(options) {
|
|
513
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
514
|
+
const argumentsTypes = [
|
|
515
|
+
null
|
|
516
|
+
];
|
|
517
|
+
const parameterNames = ["kbv"];
|
|
518
|
+
return (tx) => tx.moveCall({
|
|
519
|
+
package: packageAddress,
|
|
520
|
+
module: 'keyed_big_vector',
|
|
521
|
+
function: 'drop',
|
|
522
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
/** Destroys a KeyedBigVector and its elements completely. */
|
|
526
|
+
export function completelyDrop(options) {
|
|
527
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
528
|
+
const argumentsTypes = [
|
|
529
|
+
null
|
|
530
|
+
];
|
|
531
|
+
const parameterNames = ["kbv"];
|
|
532
|
+
return (tx) => tx.moveCall({
|
|
533
|
+
package: packageAddress,
|
|
534
|
+
module: 'keyed_big_vector',
|
|
535
|
+
function: 'completely_drop',
|
|
536
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
537
|
+
typeArguments: options.typeArguments
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/** Removes an empty slice after an element has been removed from it. */
|
|
541
|
+
export function trimSlice(options) {
|
|
542
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
543
|
+
const argumentsTypes = [
|
|
544
|
+
null
|
|
545
|
+
];
|
|
546
|
+
const parameterNames = ["kbv"];
|
|
547
|
+
return (tx) => tx.moveCall({
|
|
548
|
+
package: packageAddress,
|
|
549
|
+
module: 'keyed_big_vector',
|
|
550
|
+
function: 'trim_slice',
|
|
551
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
552
|
+
typeArguments: options.typeArguments
|
|
553
|
+
});
|
|
554
|
+
}
|