@typus/typus-perp-sdk 1.1.32-codegen-exp5 → 1.1.32-codegen-exp8
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/dist/src/client.d.ts +2 -1
- package/dist/src/client.js +41 -5
- package/dist/src/fetch.d.ts +3 -91
- package/dist/src/fetch.js +43 -41
- package/dist/src/generated/typus_perp/admin.d.ts +158 -1
- package/dist/src/generated/typus_perp/admin.js +211 -0
- package/dist/src/generated/typus_perp/competition.d.ts +39 -1
- package/dist/src/generated/typus_perp/competition.js +46 -0
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +31 -0
- package/dist/src/generated/typus_perp/{tlp.js → deps/sui/table.js} +28 -13
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +0 -8
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +3 -11
- package/dist/src/generated/typus_perp/error.d.ts +443 -0
- package/dist/src/generated/typus_perp/error.js +788 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +51 -1
- package/dist/src/generated/typus_perp/escrow.js +63 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +2 -476
- package/dist/src/generated/typus_perp/lp_pool.js +19 -492
- package/dist/src/generated/typus_perp/position.d.ts +1016 -1
- package/dist/src/generated/typus_perp/position.js +1187 -0
- package/dist/src/generated/typus_perp/profit_vault.d.ts +272 -0
- package/dist/src/generated/typus_perp/profit_vault.js +321 -0
- package/dist/src/generated/typus_perp/symbol.d.ts +30 -1
- package/dist/src/generated/typus_perp/symbol.js +42 -0
- package/dist/src/generated/typus_perp/trading.d.ts +56 -418
- package/dist/src/generated/typus_perp/trading.js +124 -552
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +32 -1
- package/dist/src/generated/typus_perp/treasury_caps.js +40 -0
- package/dist/src/generated/typus_perp/user_account.d.ts +107 -1
- package/dist/src/generated/typus_perp/user_account.js +149 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +9 -25
- package/dist/src/generated/typus_stake_pool/admin.js +11 -36
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +56 -4
- package/dist/src/generated/typus_stake_pool/stake_pool.js +68 -4
- package/dist/src/generated/utils/index.js +3 -0
- package/dist/src/grpc/graphql.d.ts +6 -6
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +13 -19
- package/dist/src/user/order.js +1 -6
- package/dist/src/user/orderWithBidReceipt.js +3 -3
- package/package.json +2 -2
- package/dist/src/generated/typus_perp/lending.d.ts +0 -47
- package/dist/src/generated/typus_perp/lending.js +0 -50
- package/dist/src/generated/typus_perp/tlp.d.ts +0 -13
|
@@ -37,6 +37,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.PutInsuranceFundEvent = exports.ProtocolFeeEvent = exports.SendFeeEvent = exports.Version = exports.FeePool = exports.FeeInfo = void 0;
|
|
40
|
+
exports.versionCheck = versionCheck;
|
|
41
|
+
exports.upgrade = upgrade;
|
|
42
|
+
exports.init = init;
|
|
43
|
+
exports.verify = verify;
|
|
44
|
+
exports.addAuthorizedUser = addAuthorizedUser;
|
|
45
|
+
exports.removeAuthorizedUser = removeAuthorizedUser;
|
|
46
|
+
exports.installEcosystemManagerCapEntry = installEcosystemManagerCapEntry;
|
|
47
|
+
exports.addTailsExpAndLeaderboard = addTailsExpAndLeaderboard;
|
|
48
|
+
exports.addCompetitionLeaderboard = addCompetitionLeaderboard;
|
|
49
|
+
exports.sendFee = sendFee;
|
|
50
|
+
exports.chargeFee = chargeFee;
|
|
51
|
+
exports.sendLiquidatorFee = sendLiquidatorFee;
|
|
52
|
+
exports.chargeLiquidatorFee = chargeLiquidatorFee;
|
|
40
53
|
/**
|
|
41
54
|
* The `admin` module provides administrative functionalities for the Typus
|
|
42
55
|
* Perpetual Protocol. It includes version management, authority control, and fee
|
|
@@ -108,3 +121,201 @@ exports.PutInsuranceFundEvent = new index_1.MoveStruct({
|
|
|
108
121
|
amount: bcs_1.bcs.u64(),
|
|
109
122
|
},
|
|
110
123
|
});
|
|
124
|
+
/** Checks if the contract version is valid. */
|
|
125
|
+
function versionCheck(options) {
|
|
126
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
127
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`];
|
|
128
|
+
const parameterNames = ["version"];
|
|
129
|
+
return (tx) => tx.moveCall({
|
|
130
|
+
package: packageAddress,
|
|
131
|
+
module: "admin",
|
|
132
|
+
function: "version_check",
|
|
133
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/** Upgrades the contract version. WARNING: no authority check inside */
|
|
137
|
+
function upgrade(options) {
|
|
138
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
139
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`];
|
|
140
|
+
const parameterNames = ["version"];
|
|
141
|
+
return (tx) => tx.moveCall({
|
|
142
|
+
package: packageAddress,
|
|
143
|
+
module: "admin",
|
|
144
|
+
function: "upgrade",
|
|
145
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function init(options = {}) {
|
|
149
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
150
|
+
return (tx) => tx.moveCall({
|
|
151
|
+
package: packageAddress,
|
|
152
|
+
module: "admin",
|
|
153
|
+
function: "init",
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/** [Authorized Function] Verifies if the sender is an authorized user. */
|
|
157
|
+
function verify(options) {
|
|
158
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
159
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`];
|
|
160
|
+
const parameterNames = ["version"];
|
|
161
|
+
return (tx) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: "admin",
|
|
164
|
+
function: "verify",
|
|
165
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/** [Authorized Function] Adds an authorized user. */
|
|
169
|
+
function addAuthorizedUser(options) {
|
|
170
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
171
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
|
|
172
|
+
const parameterNames = ["version", "userAddress"];
|
|
173
|
+
return (tx) => tx.moveCall({
|
|
174
|
+
package: packageAddress,
|
|
175
|
+
module: "admin",
|
|
176
|
+
function: "add_authorized_user",
|
|
177
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/** [Authorized Function] Removes an authorized user. */
|
|
181
|
+
function removeAuthorizedUser(options) {
|
|
182
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
183
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
|
|
184
|
+
const parameterNames = ["version", "userAddress"];
|
|
185
|
+
return (tx) => tx.moveCall({
|
|
186
|
+
package: packageAddress,
|
|
187
|
+
module: "admin",
|
|
188
|
+
function: "remove_authorized_user",
|
|
189
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* [Authorized Function] Installs the ecosystem manager cap. TODO: can be remove
|
|
194
|
+
* after install
|
|
195
|
+
*/
|
|
196
|
+
function installEcosystemManagerCapEntry(options) {
|
|
197
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
198
|
+
const argumentsTypes = [
|
|
199
|
+
`${packageAddress}::admin::Version`,
|
|
200
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
201
|
+
];
|
|
202
|
+
const parameterNames = ["version", "typusEcosystemVersion"];
|
|
203
|
+
return (tx) => tx.moveCall({
|
|
204
|
+
package: packageAddress,
|
|
205
|
+
module: "admin",
|
|
206
|
+
function: "install_ecosystem_manager_cap_entry",
|
|
207
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function addTailsExpAndLeaderboard(options) {
|
|
211
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
212
|
+
const argumentsTypes = [
|
|
213
|
+
`${packageAddress}::admin::Version`,
|
|
214
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
215
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::user::TypusUserRegistry",
|
|
216
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
|
|
217
|
+
"address",
|
|
218
|
+
"u64",
|
|
219
|
+
"u64",
|
|
220
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
221
|
+
];
|
|
222
|
+
const parameterNames = [
|
|
223
|
+
"version",
|
|
224
|
+
"typusEcosystemVersion",
|
|
225
|
+
"typusUserRegistry",
|
|
226
|
+
"typusLeaderboardRegistry",
|
|
227
|
+
"user",
|
|
228
|
+
"tradingFeeUsd",
|
|
229
|
+
"expMultiplier",
|
|
230
|
+
];
|
|
231
|
+
return (tx) => tx.moveCall({
|
|
232
|
+
package: packageAddress,
|
|
233
|
+
module: "admin",
|
|
234
|
+
function: "add_tails_exp_and_leaderboard",
|
|
235
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/** Adds a score to the competition leaderboard. */
|
|
239
|
+
function addCompetitionLeaderboard(options) {
|
|
240
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
241
|
+
const argumentsTypes = [
|
|
242
|
+
`${packageAddress}::admin::Version`,
|
|
243
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
244
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
|
|
245
|
+
"0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
|
|
246
|
+
"address",
|
|
247
|
+
"u64",
|
|
248
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
249
|
+
];
|
|
250
|
+
const parameterNames = ["version", "typusEcosystemVersion", "typusLeaderboardRegistry", "leaderboardKey", "user", "score"];
|
|
251
|
+
return (tx) => tx.moveCall({
|
|
252
|
+
package: packageAddress,
|
|
253
|
+
module: "admin",
|
|
254
|
+
function: "add_competition_leaderboard",
|
|
255
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Sends the collected fees to the fee address. Safe with constant address as
|
|
260
|
+
* receiver
|
|
261
|
+
*/
|
|
262
|
+
function sendFee(options) {
|
|
263
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
264
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`];
|
|
265
|
+
const parameterNames = ["version"];
|
|
266
|
+
return (tx) => tx.moveCall({
|
|
267
|
+
package: packageAddress,
|
|
268
|
+
module: "admin",
|
|
269
|
+
function: "send_fee",
|
|
270
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
271
|
+
typeArguments: options.typeArguments,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/** Charges a protocol fee. */
|
|
275
|
+
function chargeFee(options) {
|
|
276
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
277
|
+
const argumentsTypes = [
|
|
278
|
+
`${packageAddress}::admin::Version`,
|
|
279
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
280
|
+
];
|
|
281
|
+
const parameterNames = ["version", "balance"];
|
|
282
|
+
return (tx) => tx.moveCall({
|
|
283
|
+
package: packageAddress,
|
|
284
|
+
module: "admin",
|
|
285
|
+
function: "charge_fee",
|
|
286
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
287
|
+
typeArguments: options.typeArguments,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Sends the liquidator fees to the fee address. Safe with constant address as
|
|
292
|
+
* receiver
|
|
293
|
+
*/
|
|
294
|
+
function sendLiquidatorFee(options) {
|
|
295
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
296
|
+
const argumentsTypes = [`${packageAddress}::admin::Version`];
|
|
297
|
+
const parameterNames = ["version"];
|
|
298
|
+
return (tx) => tx.moveCall({
|
|
299
|
+
package: packageAddress,
|
|
300
|
+
module: "admin",
|
|
301
|
+
function: "send_liquidator_fee",
|
|
302
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
303
|
+
typeArguments: options.typeArguments,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/** Charges a liquidator fee. */
|
|
307
|
+
function chargeLiquidatorFee(options) {
|
|
308
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
309
|
+
const argumentsTypes = [
|
|
310
|
+
`${packageAddress}::admin::Version`,
|
|
311
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
312
|
+
];
|
|
313
|
+
const parameterNames = ["version", "balance"];
|
|
314
|
+
return (tx) => tx.moveCall({
|
|
315
|
+
package: packageAddress,
|
|
316
|
+
module: "admin",
|
|
317
|
+
function: "charge_liquidator_fee",
|
|
318
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
319
|
+
typeArguments: options.typeArguments,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
/** The `competition` module defines the logic for trading competitions. */
|
|
5
|
-
import { MoveStruct } from "../utils/index";
|
|
5
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index";
|
|
6
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
6
7
|
export declare const CompetitionConfig: MoveStruct<{
|
|
7
8
|
id: MoveStruct<{
|
|
8
9
|
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
@@ -20,3 +21,40 @@ export declare const CompetitionConfig: MoveStruct<{
|
|
|
20
21
|
length: number;
|
|
21
22
|
}, string>;
|
|
22
23
|
}, "@typus/perp::competition::CompetitionConfig">;
|
|
24
|
+
export interface NewCompetitionConfigArguments {
|
|
25
|
+
version: RawTransactionArgument<string>;
|
|
26
|
+
boostBp: RawTransactionArgument<number | bigint[]>;
|
|
27
|
+
programName: RawTransactionArgument<string>;
|
|
28
|
+
}
|
|
29
|
+
export interface NewCompetitionConfigOptions {
|
|
30
|
+
package?: string;
|
|
31
|
+
arguments: NewCompetitionConfigArguments | [
|
|
32
|
+
version: RawTransactionArgument<string>,
|
|
33
|
+
boostBp: RawTransactionArgument<number | bigint[]>,
|
|
34
|
+
programName: RawTransactionArgument<string>
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
export declare function newCompetitionConfig(options: NewCompetitionConfigOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
38
|
+
export interface AddScoreArguments {
|
|
39
|
+
version: RawTransactionArgument<string>;
|
|
40
|
+
ecosystemVersion: RawTransactionArgument<string>;
|
|
41
|
+
typusLeaderboardRegistry: RawTransactionArgument<string>;
|
|
42
|
+
tailsStakingRegistry: RawTransactionArgument<string>;
|
|
43
|
+
competitionConfig: RawTransactionArgument<string>;
|
|
44
|
+
volumeUsd: RawTransactionArgument<number | bigint>;
|
|
45
|
+
user: RawTransactionArgument<string>;
|
|
46
|
+
}
|
|
47
|
+
export interface AddScoreOptions {
|
|
48
|
+
package?: string;
|
|
49
|
+
arguments: AddScoreArguments | [
|
|
50
|
+
version: RawTransactionArgument<string>,
|
|
51
|
+
ecosystemVersion: RawTransactionArgument<string>,
|
|
52
|
+
typusLeaderboardRegistry: RawTransactionArgument<string>,
|
|
53
|
+
tailsStakingRegistry: RawTransactionArgument<string>,
|
|
54
|
+
competitionConfig: RawTransactionArgument<string>,
|
|
55
|
+
volumeUsd: RawTransactionArgument<number | bigint>,
|
|
56
|
+
user: RawTransactionArgument<string>
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
/** Adds a score to the competition leaderboard. WARNING: no authority check inside */
|
|
60
|
+
export declare function addScore(options: AddScoreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -37,6 +37,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.CompetitionConfig = void 0;
|
|
40
|
+
exports.newCompetitionConfig = newCompetitionConfig;
|
|
41
|
+
exports.addScore = addScore;
|
|
40
42
|
/** The `competition` module defines the logic for trading competitions. */
|
|
41
43
|
const index_1 = require("../utils/index");
|
|
42
44
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
@@ -56,3 +58,47 @@ exports.CompetitionConfig = new index_1.MoveStruct({
|
|
|
56
58
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
57
59
|
},
|
|
58
60
|
});
|
|
61
|
+
function newCompetitionConfig(options) {
|
|
62
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
63
|
+
const argumentsTypes = [
|
|
64
|
+
`${packageAddress}::admin::Version`,
|
|
65
|
+
"vector<u64>",
|
|
66
|
+
"0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
|
|
67
|
+
];
|
|
68
|
+
const parameterNames = ["version", "boostBp", "programName"];
|
|
69
|
+
return (tx) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: "competition",
|
|
72
|
+
function: "new_competition_config",
|
|
73
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** Adds a score to the competition leaderboard. WARNING: no authority check inside */
|
|
77
|
+
function addScore(options) {
|
|
78
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
79
|
+
const argumentsTypes = [
|
|
80
|
+
`${packageAddress}::admin::Version`,
|
|
81
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
82
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::leaderboard::TypusLeaderboardRegistry",
|
|
83
|
+
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tails_staking::TailsStakingRegistry",
|
|
84
|
+
`${packageAddress}::competition::CompetitionConfig`,
|
|
85
|
+
"u64",
|
|
86
|
+
"address",
|
|
87
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
88
|
+
];
|
|
89
|
+
const parameterNames = [
|
|
90
|
+
"version",
|
|
91
|
+
"ecosystemVersion",
|
|
92
|
+
"typusLeaderboardRegistry",
|
|
93
|
+
"tailsStakingRegistry",
|
|
94
|
+
"competitionConfig",
|
|
95
|
+
"volumeUsd",
|
|
96
|
+
"user",
|
|
97
|
+
];
|
|
98
|
+
return (tx) => tx.moveCall({
|
|
99
|
+
package: packageAddress,
|
|
100
|
+
module: "competition",
|
|
101
|
+
function: "add_score",
|
|
102
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
@@ -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";
|
|
24
|
+
export declare const Table: MoveStruct<{
|
|
25
|
+
/** the ID of this table */
|
|
26
|
+
id: MoveStruct<{
|
|
27
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
28
|
+
}, "0x2::object::UID">;
|
|
29
|
+
/** the number of key-value pairs in the table */
|
|
30
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
31
|
+
}, "0x2::table::Table">;
|
|
@@ -36,21 +36,36 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
/**
|
|
41
|
-
|
|
39
|
+
exports.Table = void 0;
|
|
40
|
+
/**
|
|
41
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
42
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
43
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
44
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
45
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
46
|
+
* runtime. For example
|
|
47
|
+
*
|
|
48
|
+
* ```
|
|
49
|
+
* let table1 = table::new<u64, bool>();
|
|
50
|
+
* let table2 = table::new<u64, bool>();
|
|
51
|
+
* table::add(&mut table1, 0, false);
|
|
52
|
+
* table::add(&mut table1, 1, true);
|
|
53
|
+
* table::add(&mut table2, 0, false);
|
|
54
|
+
* table::add(&mut table2, 1, true);
|
|
55
|
+
* // table1 does not equal table2, despite having the same entries
|
|
56
|
+
* assert!(&table1 != &table2);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
const index_1 = require("../../../utils/index");
|
|
42
60
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
43
|
-
const object = __importStar(require("./
|
|
44
|
-
const $moduleName = "
|
|
45
|
-
exports.
|
|
46
|
-
name: `${$moduleName}::
|
|
61
|
+
const object = __importStar(require("./object"));
|
|
62
|
+
const $moduleName = "0x2::table";
|
|
63
|
+
exports.Table = new index_1.MoveStruct({
|
|
64
|
+
name: `${$moduleName}::Table`,
|
|
47
65
|
fields: {
|
|
66
|
+
/** the ID of this table */
|
|
48
67
|
id: object.UID,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
exports.TLP = new index_1.MoveStruct({
|
|
52
|
-
name: `${$moduleName}::TLP`,
|
|
53
|
-
fields: {
|
|
54
|
-
dummy_field: bcs_1.bcs.bool(),
|
|
68
|
+
/** the number of key-value pairs in the table */
|
|
69
|
+
size: bcs_1.bcs.u64(),
|
|
55
70
|
},
|
|
56
71
|
});
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
/**************************************************************
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* No authority chech in these public functions, do not let `DepositVault`
|
|
6
|
-
* `BidVault` and `RefundVault` be exposed.
|
|
7
|
-
*/
|
|
8
4
|
import { MoveStruct } from "../../../utils/index";
|
|
9
5
|
export declare const TypusBidReceipt: MoveStruct<{
|
|
10
6
|
id: MoveStruct<{
|
|
11
7
|
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
12
8
|
}, "0x2::object::UID">;
|
|
13
|
-
/** The ID of the `BidVault`. */
|
|
14
9
|
vid: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
15
|
-
/** The index of the vault. */
|
|
16
10
|
index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
17
|
-
/** Metadata for display purposes. */
|
|
18
11
|
metadata: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
19
|
-
/** Padding for additional u64 fields. */
|
|
20
12
|
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
21
13
|
length: number;
|
|
22
14
|
}, string>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**************************************************************
|
|
3
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
4
|
-
**************************************************************/
|
|
5
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
3
|
if (k2 === undefined) k2 = k;
|
|
7
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,10 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
34
|
})();
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.TypusBidReceipt = void 0;
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
*/
|
|
37
|
+
/**************************************************************
|
|
38
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
39
|
+
**************************************************************/
|
|
44
40
|
const index_1 = require("../../../utils/index");
|
|
45
41
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
46
42
|
const object = __importStar(require("../sui/object"));
|
|
@@ -49,13 +45,9 @@ exports.TypusBidReceipt = new index_1.MoveStruct({
|
|
|
49
45
|
name: `${$moduleName}::TypusBidReceipt`,
|
|
50
46
|
fields: {
|
|
51
47
|
id: object.UID,
|
|
52
|
-
/** The ID of the `BidVault`. */
|
|
53
48
|
vid: bcs_1.bcs.Address,
|
|
54
|
-
/** The index of the vault. */
|
|
55
49
|
index: bcs_1.bcs.u64(),
|
|
56
|
-
/** Metadata for display purposes. */
|
|
57
50
|
metadata: bcs_1.bcs.string(),
|
|
58
|
-
/** Padding for additional u64 fields. */
|
|
59
51
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
60
52
|
},
|
|
61
53
|
});
|