@waterx/predict-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +67 -0
- package/dist/src/account.d.ts +64 -0
- package/dist/src/account.js +134 -0
- package/dist/src/admin.d.ts +47 -0
- package/dist/src/admin.js +104 -0
- package/dist/src/bcs.d.ts +20 -0
- package/dist/src/bcs.js +209 -0
- package/dist/src/client.d.ts +60 -0
- package/dist/src/client.js +59 -0
- package/dist/src/constants.d.ts +61 -0
- package/dist/src/constants.js +62 -0
- package/dist/src/fetch.d.ts +53 -0
- package/dist/src/fetch.js +187 -0
- package/dist/src/generated/bucket_v2_framework/account.d.ts +100 -0
- package/dist/src/generated/bucket_v2_framework/account.js +129 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/bucket_v2_framework/double.d.ts +382 -0
- package/dist/src/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/generated/bucket_v2_framework/float.d.ts +362 -0
- package/dist/src/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +193 -0
- package/dist/src/generated/bucket_v2_framework/liability.js +205 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.js +382 -0
- package/dist/src/generated/bucket_v2_framework/sheet.d.ts +344 -0
- package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
- package/dist/src/generated/utils/index.d.ts +30 -0
- package/dist/src/generated/utils/index.js +157 -0
- package/dist/src/generated/waterx_account/account.d.ts +1326 -0
- package/dist/src/generated/waterx_account/account.js +1487 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +6 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_account/deps/sui/table.d.ts +24 -0
- package/dist/src/generated/waterx_account/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_account/direct_rule.d.ts +72 -0
- package/dist/src/generated/waterx_account/direct_rule.js +75 -0
- package/dist/src/generated/waterx_account/events.d.ts +30 -0
- package/dist/src/generated/waterx_account/events.js +145 -0
- package/dist/src/generated/waterx_account/version.d.ts +10 -0
- package/dist/src/generated/waterx_account/version.js +8 -0
- package/dist/src/generated/waterx_prediction/account_data.d.ts +321 -0
- package/dist/src/generated/waterx_prediction/account_data.js +399 -0
- package/dist/src/generated/waterx_prediction/admin.d.ts +5 -0
- package/dist/src/generated/waterx_prediction/admin.js +9 -0
- package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
- package/dist/src/generated/waterx_prediction/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
- package/dist/src/generated/waterx_prediction/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_prediction/events.d.ts +19 -0
- package/dist/src/generated/waterx_prediction/events.js +99 -0
- package/dist/src/generated/waterx_prediction/global_config.d.ts +68 -0
- package/dist/src/generated/waterx_prediction/global_config.js +83 -0
- package/dist/src/generated/waterx_prediction/order.d.ts +170 -0
- package/dist/src/generated/waterx_prediction/order.js +237 -0
- package/dist/src/generated/waterx_prediction/outcome.d.ts +58 -0
- package/dist/src/generated/waterx_prediction/outcome.js +73 -0
- package/dist/src/generated/waterx_prediction/position.d.ts +150 -0
- package/dist/src/generated/waterx_prediction/position.js +200 -0
- package/dist/src/generated/waterx_prediction/view.d.ts +353 -0
- package/dist/src/generated/waterx_prediction/view.js +426 -0
- package/dist/src/generated/waterx_prediction/waterx_prediction.d.ts +1520 -0
- package/dist/src/generated/waterx_prediction/waterx_prediction.js +1550 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.js +17 -0
- package/dist/src/prediction.d.ts +81 -0
- package/dist/src/prediction.js +220 -0
- package/dist/src/types.d.ts +81 -0
- package/dist/src/types.js +1 -0
- package/dist/src/user/account.d.ts +2 -0
- package/dist/src/user/account.js +1 -0
- package/dist/src/user/admin.d.ts +4 -0
- package/dist/src/user/admin.js +2 -0
- package/dist/src/user/index.d.ts +4 -0
- package/dist/src/user/index.js +2 -0
- package/dist/src/user/keeper.d.ts +2 -0
- package/dist/src/user/keeper.js +1 -0
- package/dist/src/user/order.d.ts +2 -0
- package/dist/src/user/order.js +1 -0
- package/dist/src/user/position.d.ts +2 -0
- package/dist/src/user/position.js +1 -0
- package/dist/src/utils/bcs.d.ts +1 -0
- package/dist/src/utils/bcs.js +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils.d.ts +29 -0
- package/dist/src/utils.js +170 -0
- package/package.json +62 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for managing Credit and Debt for DeFi protocol usage */
|
|
5
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
6
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
+
const $moduleName = '@bucket/framework::liability';
|
|
8
|
+
export const Credit = new MoveStruct({ name: `${$moduleName}::Credit<phantom T>`, fields: {
|
|
9
|
+
value: bcs.u64()
|
|
10
|
+
} });
|
|
11
|
+
export const Debt = new MoveStruct({ name: `${$moduleName}::Debt<phantom T>`, fields: {
|
|
12
|
+
value: bcs.u64()
|
|
13
|
+
} });
|
|
14
|
+
/** Public Funs */
|
|
15
|
+
export function _new(options) {
|
|
16
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
17
|
+
const argumentsTypes = [
|
|
18
|
+
'u64'
|
|
19
|
+
];
|
|
20
|
+
const parameterNames = ["value"];
|
|
21
|
+
return (tx) => tx.moveCall({
|
|
22
|
+
package: packageAddress,
|
|
23
|
+
module: 'liability',
|
|
24
|
+
function: 'new',
|
|
25
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
26
|
+
typeArguments: options.typeArguments
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export function zeroCredit(options) {
|
|
30
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
31
|
+
return (tx) => tx.moveCall({
|
|
32
|
+
package: packageAddress,
|
|
33
|
+
module: 'liability',
|
|
34
|
+
function: 'zero_credit',
|
|
35
|
+
typeArguments: options.typeArguments
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function zeroDebt(options) {
|
|
39
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
40
|
+
return (tx) => tx.moveCall({
|
|
41
|
+
package: packageAddress,
|
|
42
|
+
module: 'liability',
|
|
43
|
+
function: 'zero_debt',
|
|
44
|
+
typeArguments: options.typeArguments
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function destroyZeroCredit(options) {
|
|
48
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
49
|
+
const argumentsTypes = [
|
|
50
|
+
null
|
|
51
|
+
];
|
|
52
|
+
const parameterNames = ["credit"];
|
|
53
|
+
return (tx) => tx.moveCall({
|
|
54
|
+
package: packageAddress,
|
|
55
|
+
module: 'liability',
|
|
56
|
+
function: 'destroy_zero_credit',
|
|
57
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
58
|
+
typeArguments: options.typeArguments
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export function destroyZeroDebt(options) {
|
|
62
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
63
|
+
const argumentsTypes = [
|
|
64
|
+
null
|
|
65
|
+
];
|
|
66
|
+
const parameterNames = ["debt"];
|
|
67
|
+
return (tx) => tx.moveCall({
|
|
68
|
+
package: packageAddress,
|
|
69
|
+
module: 'liability',
|
|
70
|
+
function: 'destroy_zero_debt',
|
|
71
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
72
|
+
typeArguments: options.typeArguments
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export function addCredit(options) {
|
|
76
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
77
|
+
const argumentsTypes = [
|
|
78
|
+
null,
|
|
79
|
+
null
|
|
80
|
+
];
|
|
81
|
+
const parameterNames = ["self", "credit"];
|
|
82
|
+
return (tx) => tx.moveCall({
|
|
83
|
+
package: packageAddress,
|
|
84
|
+
module: 'liability',
|
|
85
|
+
function: 'add_credit',
|
|
86
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
87
|
+
typeArguments: options.typeArguments
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
export function addDebt(options) {
|
|
91
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
92
|
+
const argumentsTypes = [
|
|
93
|
+
null,
|
|
94
|
+
null
|
|
95
|
+
];
|
|
96
|
+
const parameterNames = ["self", "debt"];
|
|
97
|
+
return (tx) => tx.moveCall({
|
|
98
|
+
package: packageAddress,
|
|
99
|
+
module: 'liability',
|
|
100
|
+
function: 'add_debt',
|
|
101
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
102
|
+
typeArguments: options.typeArguments
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export function autoSettle(options) {
|
|
106
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
107
|
+
const argumentsTypes = [
|
|
108
|
+
null,
|
|
109
|
+
null
|
|
110
|
+
];
|
|
111
|
+
const parameterNames = ["credit", "debt"];
|
|
112
|
+
return (tx) => tx.moveCall({
|
|
113
|
+
package: packageAddress,
|
|
114
|
+
module: 'liability',
|
|
115
|
+
function: 'auto_settle',
|
|
116
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
117
|
+
typeArguments: options.typeArguments
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export function settleDebt(options) {
|
|
121
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
122
|
+
const argumentsTypes = [
|
|
123
|
+
null,
|
|
124
|
+
null
|
|
125
|
+
];
|
|
126
|
+
const parameterNames = ["credit", "debt"];
|
|
127
|
+
return (tx) => tx.moveCall({
|
|
128
|
+
package: packageAddress,
|
|
129
|
+
module: 'liability',
|
|
130
|
+
function: 'settle_debt',
|
|
131
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
132
|
+
typeArguments: options.typeArguments
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
export function settleCredit(options) {
|
|
136
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
137
|
+
const argumentsTypes = [
|
|
138
|
+
null,
|
|
139
|
+
null
|
|
140
|
+
];
|
|
141
|
+
const parameterNames = ["debt", "credit"];
|
|
142
|
+
return (tx) => tx.moveCall({
|
|
143
|
+
package: packageAddress,
|
|
144
|
+
module: 'liability',
|
|
145
|
+
function: 'settle_credit',
|
|
146
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
147
|
+
typeArguments: options.typeArguments
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
export function creditValue(options) {
|
|
151
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
152
|
+
const argumentsTypes = [
|
|
153
|
+
null
|
|
154
|
+
];
|
|
155
|
+
const parameterNames = ["credit"];
|
|
156
|
+
return (tx) => tx.moveCall({
|
|
157
|
+
package: packageAddress,
|
|
158
|
+
module: 'liability',
|
|
159
|
+
function: 'credit_value',
|
|
160
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
161
|
+
typeArguments: options.typeArguments
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export function debtValue(options) {
|
|
165
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
166
|
+
const argumentsTypes = [
|
|
167
|
+
null
|
|
168
|
+
];
|
|
169
|
+
const parameterNames = ["debt"];
|
|
170
|
+
return (tx) => tx.moveCall({
|
|
171
|
+
package: packageAddress,
|
|
172
|
+
module: 'liability',
|
|
173
|
+
function: 'debt_value',
|
|
174
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
175
|
+
typeArguments: options.typeArguments
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export function destroyCreditForTesting(options) {
|
|
179
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
180
|
+
const argumentsTypes = [
|
|
181
|
+
null
|
|
182
|
+
];
|
|
183
|
+
const parameterNames = ["credit"];
|
|
184
|
+
return (tx) => tx.moveCall({
|
|
185
|
+
package: packageAddress,
|
|
186
|
+
module: 'liability',
|
|
187
|
+
function: 'destroy_credit_for_testing',
|
|
188
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
189
|
+
typeArguments: options.typeArguments
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
export function destroyDebtForTesting(options) {
|
|
193
|
+
const packageAddress = options.package ?? '@bucket/framework';
|
|
194
|
+
const argumentsTypes = [
|
|
195
|
+
null
|
|
196
|
+
];
|
|
197
|
+
const parameterNames = ["debt"];
|
|
198
|
+
return (tx) => tx.moveCall({
|
|
199
|
+
package: packageAddress,
|
|
200
|
+
module: 'liability',
|
|
201
|
+
function: 'destroy_debt_for_testing',
|
|
202
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
203
|
+
typeArguments: options.typeArguments
|
|
204
|
+
});
|
|
205
|
+
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
6
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
7
|
+
export declare function LinkedTable<K extends BcsType<any>>(...typeParameters: [
|
|
8
|
+
K
|
|
9
|
+
]): MoveStruct<any, any>;
|
|
10
|
+
export declare function Node<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
11
|
+
K,
|
|
12
|
+
V
|
|
13
|
+
]): MoveStruct<any, any>;
|
|
14
|
+
export interface NewOptions {
|
|
15
|
+
package?: string;
|
|
16
|
+
arguments?: [
|
|
17
|
+
];
|
|
18
|
+
typeArguments: [
|
|
19
|
+
string,
|
|
20
|
+
string
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
/** Creates a new, empty table */
|
|
24
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
25
|
+
export interface FrontArguments {
|
|
26
|
+
table: RawTransactionArgument<string>;
|
|
27
|
+
}
|
|
28
|
+
export interface FrontOptions {
|
|
29
|
+
package?: string;
|
|
30
|
+
arguments: FrontArguments | [
|
|
31
|
+
table: RawTransactionArgument<string>
|
|
32
|
+
];
|
|
33
|
+
typeArguments: [
|
|
34
|
+
string,
|
|
35
|
+
string
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the key for the first element in the table, or None if the table is
|
|
40
|
+
* empty
|
|
41
|
+
*/
|
|
42
|
+
export declare function front(options: FrontOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
43
|
+
export interface BackArguments {
|
|
44
|
+
table: RawTransactionArgument<string>;
|
|
45
|
+
}
|
|
46
|
+
export interface BackOptions {
|
|
47
|
+
package?: string;
|
|
48
|
+
arguments: BackArguments | [
|
|
49
|
+
table: RawTransactionArgument<string>
|
|
50
|
+
];
|
|
51
|
+
typeArguments: [
|
|
52
|
+
string,
|
|
53
|
+
string
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/** Returns the key for the last element in the table, or None if the table is empty */
|
|
57
|
+
export declare function back(options: BackOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
58
|
+
export interface PushFrontArguments<K extends BcsType<any>, V extends BcsType<any>> {
|
|
59
|
+
table: RawTransactionArgument<string>;
|
|
60
|
+
k: RawTransactionArgument<K>;
|
|
61
|
+
value: RawTransactionArgument<V>;
|
|
62
|
+
}
|
|
63
|
+
export interface PushFrontOptions<K extends BcsType<any>, V extends BcsType<any>> {
|
|
64
|
+
package?: string;
|
|
65
|
+
arguments: PushFrontArguments<K, V> | [
|
|
66
|
+
table: RawTransactionArgument<string>,
|
|
67
|
+
k: RawTransactionArgument<K>,
|
|
68
|
+
value: RawTransactionArgument<V>
|
|
69
|
+
];
|
|
70
|
+
typeArguments: [
|
|
71
|
+
string,
|
|
72
|
+
string
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Inserts a key-value pair at the front of the table, i.e. the newly inserted pair
|
|
77
|
+
* will be the first element in the table Aborts with
|
|
78
|
+
* `sui::dynamic_df::EFieldAlreadyExists` if the table already has an entry with
|
|
79
|
+
* that key `k: K`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function pushFront<K extends BcsType<any>, V extends BcsType<any>>(options: PushFrontOptions<K, V>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
82
|
+
export interface PushBackArguments<K extends BcsType<any>, V extends BcsType<any>> {
|
|
83
|
+
table: RawTransactionArgument<string>;
|
|
84
|
+
k: RawTransactionArgument<K>;
|
|
85
|
+
value: RawTransactionArgument<V>;
|
|
86
|
+
}
|
|
87
|
+
export interface PushBackOptions<K extends BcsType<any>, V extends BcsType<any>> {
|
|
88
|
+
package?: string;
|
|
89
|
+
arguments: PushBackArguments<K, V> | [
|
|
90
|
+
table: RawTransactionArgument<string>,
|
|
91
|
+
k: RawTransactionArgument<K>,
|
|
92
|
+
value: RawTransactionArgument<V>
|
|
93
|
+
];
|
|
94
|
+
typeArguments: [
|
|
95
|
+
string,
|
|
96
|
+
string
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Inserts a key-value pair at the back of the table, i.e. the newly inserted pair
|
|
101
|
+
* will be the last element in the table Aborts with
|
|
102
|
+
* `sui::dynamic_df::EFieldAlreadyExists` if the table already has an entry with
|
|
103
|
+
* that key `k: K`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function pushBack<K extends BcsType<any>, V extends BcsType<any>>(options: PushBackOptions<K, V>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
106
|
+
export interface BorrowArguments<K extends BcsType<any>> {
|
|
107
|
+
table: RawTransactionArgument<string>;
|
|
108
|
+
k: RawTransactionArgument<K>;
|
|
109
|
+
}
|
|
110
|
+
export interface BorrowOptions<K extends BcsType<any>> {
|
|
111
|
+
package?: string;
|
|
112
|
+
arguments: BorrowArguments<K> | [
|
|
113
|
+
table: RawTransactionArgument<string>,
|
|
114
|
+
k: RawTransactionArgument<K>
|
|
115
|
+
];
|
|
116
|
+
typeArguments: [
|
|
117
|
+
string,
|
|
118
|
+
string
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Immutable borrows the value associated with the key in the table
|
|
123
|
+
* `table: &LinkedTable<K, V>`. Aborts with `sui::dynamic_df::EFieldDoesNotExist`
|
|
124
|
+
* if the table does not have an entry with that key `k: K`.
|
|
125
|
+
*/
|
|
126
|
+
export declare function borrow<K extends BcsType<any>>(options: BorrowOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
127
|
+
export interface BorrowMutArguments<K extends BcsType<any>> {
|
|
128
|
+
table: RawTransactionArgument<string>;
|
|
129
|
+
k: RawTransactionArgument<K>;
|
|
130
|
+
}
|
|
131
|
+
export interface BorrowMutOptions<K extends BcsType<any>> {
|
|
132
|
+
package?: string;
|
|
133
|
+
arguments: BorrowMutArguments<K> | [
|
|
134
|
+
table: RawTransactionArgument<string>,
|
|
135
|
+
k: RawTransactionArgument<K>
|
|
136
|
+
];
|
|
137
|
+
typeArguments: [
|
|
138
|
+
string,
|
|
139
|
+
string
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Mutably borrows the value associated with the key in the table
|
|
144
|
+
* `table: &mut LinkedTable<K, V>`. Aborts with
|
|
145
|
+
* `sui::dynamic_df::EFieldDoesNotExist` if the table does not have an entry with
|
|
146
|
+
* that key `k: K`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function borrowMut<K extends BcsType<any>>(options: BorrowMutOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
149
|
+
export interface PrevArguments<K extends BcsType<any>> {
|
|
150
|
+
table: RawTransactionArgument<string>;
|
|
151
|
+
k: RawTransactionArgument<K>;
|
|
152
|
+
}
|
|
153
|
+
export interface PrevOptions<K extends BcsType<any>> {
|
|
154
|
+
package?: string;
|
|
155
|
+
arguments: PrevArguments<K> | [
|
|
156
|
+
table: RawTransactionArgument<string>,
|
|
157
|
+
k: RawTransactionArgument<K>
|
|
158
|
+
];
|
|
159
|
+
typeArguments: [
|
|
160
|
+
string,
|
|
161
|
+
string
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Borrows the key for the previous entry of the specified key `k: K` in the table
|
|
166
|
+
* `table: &LinkedTable<K, V>`. Returns None if the entry does not have a
|
|
167
|
+
* predecessor. Aborts with `sui::dynamic_df::EFieldDoesNotExist` if the table does
|
|
168
|
+
* not have an entry with that key `k: K`
|
|
169
|
+
*/
|
|
170
|
+
export declare function prev<K extends BcsType<any>>(options: PrevOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
171
|
+
export interface NextArguments<K extends BcsType<any>> {
|
|
172
|
+
table: RawTransactionArgument<string>;
|
|
173
|
+
k: RawTransactionArgument<K>;
|
|
174
|
+
}
|
|
175
|
+
export interface NextOptions<K extends BcsType<any>> {
|
|
176
|
+
package?: string;
|
|
177
|
+
arguments: NextArguments<K> | [
|
|
178
|
+
table: RawTransactionArgument<string>,
|
|
179
|
+
k: RawTransactionArgument<K>
|
|
180
|
+
];
|
|
181
|
+
typeArguments: [
|
|
182
|
+
string,
|
|
183
|
+
string
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Borrows the key for the next entry of the specified key `k: K` in the table
|
|
188
|
+
* `table: &LinkedTable<K, V>`. Returns None if the entry does not have a
|
|
189
|
+
* predecessor. Aborts with `sui::dynamic_df::EFieldDoesNotExist` if the table does
|
|
190
|
+
* not have an entry with that key `k: K`
|
|
191
|
+
*/
|
|
192
|
+
export declare function next<K extends BcsType<any>>(options: NextOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
193
|
+
export interface RemoveArguments<K extends BcsType<any>> {
|
|
194
|
+
table: RawTransactionArgument<string>;
|
|
195
|
+
k: RawTransactionArgument<K>;
|
|
196
|
+
}
|
|
197
|
+
export interface RemoveOptions<K extends BcsType<any>> {
|
|
198
|
+
package?: string;
|
|
199
|
+
arguments: RemoveArguments<K> | [
|
|
200
|
+
table: RawTransactionArgument<string>,
|
|
201
|
+
k: RawTransactionArgument<K>
|
|
202
|
+
];
|
|
203
|
+
typeArguments: [
|
|
204
|
+
string,
|
|
205
|
+
string
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Removes the key-value pair in the table `table: &mut LinkedTable<K, V>` and
|
|
210
|
+
* returns the value. This splices the element out of the ordering. Aborts with
|
|
211
|
+
* `sui::dynamic_df::EFieldDoesNotExist` if the table does not have an entry with
|
|
212
|
+
* that key `k: K`. Note: this is also what happens when the table is empty.
|
|
213
|
+
*/
|
|
214
|
+
export declare function remove<K extends BcsType<any>>(options: RemoveOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
215
|
+
export interface PopFrontArguments {
|
|
216
|
+
table: RawTransactionArgument<string>;
|
|
217
|
+
}
|
|
218
|
+
export interface PopFrontOptions {
|
|
219
|
+
package?: string;
|
|
220
|
+
arguments: PopFrontArguments | [
|
|
221
|
+
table: RawTransactionArgument<string>
|
|
222
|
+
];
|
|
223
|
+
typeArguments: [
|
|
224
|
+
string,
|
|
225
|
+
string
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Removes the front of the table `table: &mut LinkedTable<K, V>` and returns the
|
|
230
|
+
* value. Aborts with `ETableIsEmpty` if the table is empty
|
|
231
|
+
*/
|
|
232
|
+
export declare function popFront(options: PopFrontOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
233
|
+
export interface PopBackArguments {
|
|
234
|
+
table: RawTransactionArgument<string>;
|
|
235
|
+
}
|
|
236
|
+
export interface PopBackOptions {
|
|
237
|
+
package?: string;
|
|
238
|
+
arguments: PopBackArguments | [
|
|
239
|
+
table: RawTransactionArgument<string>
|
|
240
|
+
];
|
|
241
|
+
typeArguments: [
|
|
242
|
+
string,
|
|
243
|
+
string
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Removes the back of the table `table: &mut LinkedTable<K, V>` and returns the
|
|
248
|
+
* value. Aborts with `ETableIsEmpty` if the table is empty
|
|
249
|
+
*/
|
|
250
|
+
export declare function popBack(options: PopBackOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
251
|
+
export interface ContainsArguments<K extends BcsType<any>> {
|
|
252
|
+
table: RawTransactionArgument<string>;
|
|
253
|
+
k: RawTransactionArgument<K>;
|
|
254
|
+
}
|
|
255
|
+
export interface ContainsOptions<K extends BcsType<any>> {
|
|
256
|
+
package?: string;
|
|
257
|
+
arguments: ContainsArguments<K> | [
|
|
258
|
+
table: RawTransactionArgument<string>,
|
|
259
|
+
k: RawTransactionArgument<K>
|
|
260
|
+
];
|
|
261
|
+
typeArguments: [
|
|
262
|
+
string,
|
|
263
|
+
string
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Returns true iff there is a value associated with the key `k: K` in table
|
|
268
|
+
* `table: &LinkedTable<K, V>`
|
|
269
|
+
*/
|
|
270
|
+
export declare function contains<K extends BcsType<any>>(options: ContainsOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
271
|
+
export interface LengthArguments {
|
|
272
|
+
table: RawTransactionArgument<string>;
|
|
273
|
+
}
|
|
274
|
+
export interface LengthOptions {
|
|
275
|
+
package?: string;
|
|
276
|
+
arguments: LengthArguments | [
|
|
277
|
+
table: RawTransactionArgument<string>
|
|
278
|
+
];
|
|
279
|
+
typeArguments: [
|
|
280
|
+
string,
|
|
281
|
+
string
|
|
282
|
+
];
|
|
283
|
+
}
|
|
284
|
+
/** Returns the size of the table, the number of key-value pairs */
|
|
285
|
+
export declare function length(options: LengthOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
286
|
+
export interface IsEmptyArguments {
|
|
287
|
+
table: RawTransactionArgument<string>;
|
|
288
|
+
}
|
|
289
|
+
export interface IsEmptyOptions {
|
|
290
|
+
package?: string;
|
|
291
|
+
arguments: IsEmptyArguments | [
|
|
292
|
+
table: RawTransactionArgument<string>
|
|
293
|
+
];
|
|
294
|
+
typeArguments: [
|
|
295
|
+
string,
|
|
296
|
+
string
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
/** Returns true iff the table is empty (if `length` returns `0`) */
|
|
300
|
+
export declare function isEmpty(options: IsEmptyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
301
|
+
export interface DestroyEmptyArguments {
|
|
302
|
+
table: RawTransactionArgument<string>;
|
|
303
|
+
}
|
|
304
|
+
export interface DestroyEmptyOptions {
|
|
305
|
+
package?: string;
|
|
306
|
+
arguments: DestroyEmptyArguments | [
|
|
307
|
+
table: RawTransactionArgument<string>
|
|
308
|
+
];
|
|
309
|
+
typeArguments: [
|
|
310
|
+
string,
|
|
311
|
+
string
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Destroys an empty table Aborts with `ETableNotEmpty` if the table still contains
|
|
316
|
+
* values
|
|
317
|
+
*/
|
|
318
|
+
export declare function destroyEmpty(options: DestroyEmptyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
319
|
+
export interface DropArguments {
|
|
320
|
+
table: RawTransactionArgument<string>;
|
|
321
|
+
}
|
|
322
|
+
export interface DropOptions {
|
|
323
|
+
package?: string;
|
|
324
|
+
arguments: DropArguments | [
|
|
325
|
+
table: RawTransactionArgument<string>
|
|
326
|
+
];
|
|
327
|
+
typeArguments: [
|
|
328
|
+
string,
|
|
329
|
+
string
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Drop a possibly non-empty table. Usable only if the value type `V` has the
|
|
334
|
+
* `drop` ability
|
|
335
|
+
*/
|
|
336
|
+
export declare function drop(options: DropOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
337
|
+
export interface InsertFrontArguments<K extends BcsType<any>, V extends BcsType<any>> {
|
|
338
|
+
table: RawTransactionArgument<string>;
|
|
339
|
+
nextK: RawTransactionArgument<K | null>;
|
|
340
|
+
k: RawTransactionArgument<K>;
|
|
341
|
+
value: RawTransactionArgument<V>;
|
|
342
|
+
}
|
|
343
|
+
export interface InsertFrontOptions<K extends BcsType<any>, V extends BcsType<any>> {
|
|
344
|
+
package?: string;
|
|
345
|
+
arguments: InsertFrontArguments<K, V> | [
|
|
346
|
+
table: RawTransactionArgument<string>,
|
|
347
|
+
nextK: RawTransactionArgument<K | null>,
|
|
348
|
+
k: RawTransactionArgument<K>,
|
|
349
|
+
value: RawTransactionArgument<V>
|
|
350
|
+
];
|
|
351
|
+
typeArguments: [
|
|
352
|
+
string,
|
|
353
|
+
string
|
|
354
|
+
];
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Insert a key-value pair in front of the given key If the given key is none, then
|
|
358
|
+
* set the key-value pair as back
|
|
359
|
+
*/
|
|
360
|
+
export declare function insertFront<K extends BcsType<any>, V extends BcsType<any>>(options: InsertFrontOptions<K, V>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
361
|
+
export interface InsertBackArguments<K extends BcsType<any>, V extends BcsType<any>> {
|
|
362
|
+
table: RawTransactionArgument<string>;
|
|
363
|
+
prevK: RawTransactionArgument<K | null>;
|
|
364
|
+
k: RawTransactionArgument<K>;
|
|
365
|
+
value: RawTransactionArgument<V>;
|
|
366
|
+
}
|
|
367
|
+
export interface InsertBackOptions<K extends BcsType<any>, V extends BcsType<any>> {
|
|
368
|
+
package?: string;
|
|
369
|
+
arguments: InsertBackArguments<K, V> | [
|
|
370
|
+
table: RawTransactionArgument<string>,
|
|
371
|
+
prevK: RawTransactionArgument<K | null>,
|
|
372
|
+
k: RawTransactionArgument<K>,
|
|
373
|
+
value: RawTransactionArgument<V>
|
|
374
|
+
];
|
|
375
|
+
typeArguments: [
|
|
376
|
+
string,
|
|
377
|
+
string
|
|
378
|
+
];
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Insert a key-value pair behind the given key If the given key is none, then set
|
|
382
|
+
* the key-value pair as front
|
|
383
|
+
*/
|
|
384
|
+
export declare function insertBack<K extends BcsType<any>, V extends BcsType<any>>(options: InsertBackOptions<K, V>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|