@typus/typus-perp-sdk 1.1.32-codegen-exp7 → 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.js +34 -3
- 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
|
@@ -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
|
});
|