@typus/typus-perp-sdk 1.1.49 → 1.1.51-upgrade
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/api/sentio.d.ts +1 -1
- package/dist/src/api/sentio.js +3 -3
- package/dist/src/client.d.ts +11 -12
- package/dist/src/client.js +16 -44
- package/dist/src/fetch.d.ts +15 -45
- package/dist/src/fetch.js +70 -69
- package/dist/src/generated/typus_perp/admin.d.ts +32 -42
- package/dist/src/generated/typus_perp/admin.js +41 -67
- package/dist/src/generated/typus_perp/competition.d.ts +22 -10
- package/dist/src/generated/typus_perp/competition.js +19 -54
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +2 -2
- package/dist/src/generated/typus_perp/deps/std/type_name.js +2 -2
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +3 -3
- package/dist/src/generated/typus_perp/deps/sui/balance.js +3 -3
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +4 -6
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +4 -38
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +4 -6
- package/dist/src/generated/typus_perp/deps/sui/table.js +4 -38
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +2 -2
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +2 -2
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +7 -9
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +6 -6
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +6 -10
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +5 -39
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +14 -8
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +13 -39
- package/dist/src/generated/typus_perp/error.d.ts +97 -87
- package/dist/src/generated/typus_perp/error.js +18 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +17 -21
- package/dist/src/generated/typus_perp/escrow.js +10 -22
- package/dist/src/generated/typus_perp/lending.d.ts +47 -0
- package/dist/src/generated/typus_perp/lending.js +40 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +718 -397
- package/dist/src/generated/typus_perp/lp_pool.js +485 -365
- package/dist/src/generated/typus_perp/math.d.ts +18 -8
- package/dist/src/generated/typus_perp/math.js +24 -6
- package/dist/src/generated/typus_perp/position.d.ts +207 -185
- package/dist/src/generated/typus_perp/position.js +236 -277
- package/dist/src/generated/typus_perp/profit_vault.d.ts +64 -72
- package/dist/src/generated/typus_perp/profit_vault.js +48 -86
- package/dist/src/generated/typus_perp/symbol.d.ts +6 -6
- package/dist/src/generated/typus_perp/symbol.js +11 -13
- package/dist/src/generated/typus_perp/trading.d.ts +451 -558
- package/dist/src/generated/typus_perp/trading.js +429 -681
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +5 -7
- package/dist/src/generated/typus_perp/treasury_caps.js +8 -45
- package/dist/src/generated/typus_stake_pool/admin.d.ts +13 -122
- package/dist/src/generated/typus_stake_pool/admin.js +19 -103
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +2 -2
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +2 -2
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +2 -2
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +2 -2
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +249 -240
- package/dist/src/generated/typus_stake_pool/stake_pool.js +159 -246
- package/dist/src/generated/utils/index.d.ts +21 -2
- package/dist/src/generated/utils/index.js +34 -10
- package/dist/src/user/history.d.ts +3 -2
- package/dist/src/user/history.js +60 -18
- package/dist/src/user/order.d.ts +1 -1
- package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
- package/package.json +8 -15
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_perp/user_account.d.ts +0 -146
- package/dist/src/generated/typus_perp/user_account.js +0 -221
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
- package/dist/src/grpc/graphql.d.ts +0 -26
- package/dist/src/grpc/graphql.js +0 -126
- package/dist/src/grpc/grpc.d.ts +0 -1
- package/dist/src/grpc/grpc.js +0 -38
- package/dist/src/grpc/ledgerService.d.ts +0 -0
- package/dist/src/grpc/ledgerService.js +0 -64
- package/dist/src/grpc/liveDataService.d.ts +0 -0
- package/dist/src/grpc/liveDataService.js +0 -49
|
@@ -6,22 +6,20 @@
|
|
|
6
6
|
* Perpetual Protocol. It includes version management, authority control, and fee
|
|
7
7
|
* handling.
|
|
8
8
|
*/
|
|
9
|
-
import { MoveStruct, type RawTransactionArgument } from "../utils/index";
|
|
9
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
|
|
10
10
|
import { type Transaction } from "@mysten/sui/transactions";
|
|
11
11
|
export declare const FeeInfo: MoveStruct<{
|
|
12
12
|
/** The type name of the token. */
|
|
13
13
|
token: MoveStruct<{
|
|
14
|
-
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
14
|
+
name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
|
|
15
15
|
}, "std::type_name::TypeName">;
|
|
16
16
|
/** The amount of fees collected. */
|
|
17
|
-
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
17
|
+
value: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
18
18
|
}, "@typus/perp::admin::FeeInfo">;
|
|
19
19
|
export declare const FeePool: MoveStruct<{
|
|
20
|
-
id:
|
|
21
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
22
|
-
}, "0x2::object::UID">;
|
|
20
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
23
21
|
/** A vector of `FeeInfo` structs. */
|
|
24
|
-
fee_infos: import("@mysten/sui/bcs").BcsType<{
|
|
22
|
+
fee_infos: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<{
|
|
25
23
|
token: {
|
|
26
24
|
name: string;
|
|
27
25
|
};
|
|
@@ -36,18 +34,14 @@ export declare const FeePool: MoveStruct<{
|
|
|
36
34
|
}, string>;
|
|
37
35
|
}, "@typus/perp::admin::FeePool">;
|
|
38
36
|
export declare const Version: MoveStruct<{
|
|
39
|
-
id:
|
|
40
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
41
|
-
}, "0x2::object::UID">;
|
|
37
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
42
38
|
/** The version number. */
|
|
43
|
-
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
39
|
+
value: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
44
40
|
/** The fee pool for protocol fees. */
|
|
45
41
|
fee_pool: MoveStruct<{
|
|
46
|
-
id:
|
|
47
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
48
|
-
}, "0x2::object::UID">;
|
|
42
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
49
43
|
/** A vector of `FeeInfo` structs. */
|
|
50
|
-
fee_infos: import("@mysten/sui/bcs").BcsType<{
|
|
44
|
+
fee_infos: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<{
|
|
51
45
|
token: {
|
|
52
46
|
name: string;
|
|
53
47
|
};
|
|
@@ -63,11 +57,9 @@ export declare const Version: MoveStruct<{
|
|
|
63
57
|
}, "@typus/perp::admin::FeePool">;
|
|
64
58
|
/** The fee pool for liquidator fees. */
|
|
65
59
|
liquidator_fee_pool: MoveStruct<{
|
|
66
|
-
id:
|
|
67
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
68
|
-
}, "0x2::object::UID">;
|
|
60
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
69
61
|
/** A vector of `FeeInfo` structs. */
|
|
70
|
-
fee_infos: import("@mysten/sui/bcs").BcsType<{
|
|
62
|
+
fee_infos: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<{
|
|
71
63
|
token: {
|
|
72
64
|
name: string;
|
|
73
65
|
};
|
|
@@ -83,38 +75,38 @@ export declare const Version: MoveStruct<{
|
|
|
83
75
|
}, "@typus/perp::admin::FeePool">;
|
|
84
76
|
/** The list of authorized addresses. */
|
|
85
77
|
authority: MoveStruct<{
|
|
86
|
-
contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
78
|
+
contents: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
87
79
|
length: number;
|
|
88
80
|
}, string>;
|
|
89
81
|
}, "0x2::vec_set::VecSet<bytes[32]>">;
|
|
90
82
|
/** Padding for future use. */
|
|
91
|
-
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
83
|
+
u64_padding: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
|
|
92
84
|
length: number;
|
|
93
85
|
}, string>;
|
|
94
86
|
}, "@typus/perp::admin::Version">;
|
|
95
87
|
export declare const SendFeeEvent: MoveStruct<{
|
|
96
88
|
/** The type name of the token. */
|
|
97
89
|
token: MoveStruct<{
|
|
98
|
-
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
90
|
+
name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
|
|
99
91
|
}, "std::type_name::TypeName">;
|
|
100
92
|
/** The amount of fees sent. */
|
|
101
|
-
amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
93
|
+
amount: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
102
94
|
}, "@typus/perp::admin::SendFeeEvent">;
|
|
103
95
|
export declare const ProtocolFeeEvent: MoveStruct<{
|
|
104
96
|
/** The type name of the token. */
|
|
105
97
|
token: MoveStruct<{
|
|
106
|
-
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
98
|
+
name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
|
|
107
99
|
}, "std::type_name::TypeName">;
|
|
108
100
|
/** The amount of fees charged. */
|
|
109
|
-
amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
101
|
+
amount: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
110
102
|
}, "@typus/perp::admin::ProtocolFeeEvent">;
|
|
111
103
|
export declare const PutInsuranceFundEvent: MoveStruct<{
|
|
112
104
|
/** The type name of the token. */
|
|
113
105
|
token: MoveStruct<{
|
|
114
|
-
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
106
|
+
name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
|
|
115
107
|
}, "std::type_name::TypeName">;
|
|
116
108
|
/** The amount of funds put into the insurance fund. */
|
|
117
|
-
amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
109
|
+
amount: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
|
|
118
110
|
}, "@typus/perp::admin::PutInsuranceFundEvent">;
|
|
119
111
|
export interface VersionCheckArguments {
|
|
120
112
|
version: RawTransactionArgument<string>;
|
|
@@ -124,7 +116,7 @@ export interface VersionCheckOptions {
|
|
|
124
116
|
arguments: VersionCheckArguments | [version: RawTransactionArgument<string>];
|
|
125
117
|
}
|
|
126
118
|
/** Checks if the contract version is valid. */
|
|
127
|
-
export declare function versionCheck(options: VersionCheckOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
119
|
+
export declare function versionCheck(options: VersionCheckOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
128
120
|
export interface UpgradeArguments {
|
|
129
121
|
version: RawTransactionArgument<string>;
|
|
130
122
|
}
|
|
@@ -133,12 +125,12 @@ export interface UpgradeOptions {
|
|
|
133
125
|
arguments: UpgradeArguments | [version: RawTransactionArgument<string>];
|
|
134
126
|
}
|
|
135
127
|
/** Upgrades the contract version. WARNING: no authority check inside */
|
|
136
|
-
export declare function upgrade(options: UpgradeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
128
|
+
export declare function upgrade(options: UpgradeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
137
129
|
export interface InitOptions {
|
|
138
130
|
package?: string;
|
|
139
131
|
arguments?: [];
|
|
140
132
|
}
|
|
141
|
-
export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
133
|
+
export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
142
134
|
export interface VerifyArguments {
|
|
143
135
|
version: RawTransactionArgument<string>;
|
|
144
136
|
}
|
|
@@ -147,7 +139,7 @@ export interface VerifyOptions {
|
|
|
147
139
|
arguments: VerifyArguments | [version: RawTransactionArgument<string>];
|
|
148
140
|
}
|
|
149
141
|
/** [Authorized Function] Verifies if the sender is an authorized user. */
|
|
150
|
-
export declare function verify(options: VerifyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
142
|
+
export declare function verify(options: VerifyOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
151
143
|
export interface AddAuthorizedUserArguments {
|
|
152
144
|
version: RawTransactionArgument<string>;
|
|
153
145
|
userAddress: RawTransactionArgument<string>;
|
|
@@ -156,8 +148,7 @@ export interface AddAuthorizedUserOptions {
|
|
|
156
148
|
package?: string;
|
|
157
149
|
arguments: AddAuthorizedUserArguments | [version: RawTransactionArgument<string>, userAddress: RawTransactionArgument<string>];
|
|
158
150
|
}
|
|
159
|
-
|
|
160
|
-
export declare function addAuthorizedUser(options: AddAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
151
|
+
export declare function addAuthorizedUser(options: AddAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
161
152
|
export interface RemoveAuthorizedUserArguments {
|
|
162
153
|
version: RawTransactionArgument<string>;
|
|
163
154
|
userAddress: RawTransactionArgument<string>;
|
|
@@ -166,8 +157,7 @@ export interface RemoveAuthorizedUserOptions {
|
|
|
166
157
|
package?: string;
|
|
167
158
|
arguments: RemoveAuthorizedUserArguments | [version: RawTransactionArgument<string>, userAddress: RawTransactionArgument<string>];
|
|
168
159
|
}
|
|
169
|
-
|
|
170
|
-
export declare function removeAuthorizedUser(options: RemoveAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
160
|
+
export declare function removeAuthorizedUser(options: RemoveAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
171
161
|
export interface InstallEcosystemManagerCapEntryArguments {
|
|
172
162
|
version: RawTransactionArgument<string>;
|
|
173
163
|
typusEcosystemVersion: RawTransactionArgument<string>;
|
|
@@ -180,7 +170,7 @@ export interface InstallEcosystemManagerCapEntryOptions {
|
|
|
180
170
|
* [Authorized Function] Installs the ecosystem manager cap. TODO: can be remove
|
|
181
171
|
* after install
|
|
182
172
|
*/
|
|
183
|
-
export declare function installEcosystemManagerCapEntry(options: InstallEcosystemManagerCapEntryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
173
|
+
export declare function installEcosystemManagerCapEntry(options: InstallEcosystemManagerCapEntryOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
184
174
|
export interface AddTailsExpAndLeaderboardArguments {
|
|
185
175
|
version: RawTransactionArgument<string>;
|
|
186
176
|
typusEcosystemVersion: RawTransactionArgument<string>;
|
|
@@ -202,7 +192,7 @@ export interface AddTailsExpAndLeaderboardOptions {
|
|
|
202
192
|
expMultiplier: RawTransactionArgument<number | bigint>
|
|
203
193
|
];
|
|
204
194
|
}
|
|
205
|
-
export declare function addTailsExpAndLeaderboard(options: AddTailsExpAndLeaderboardOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
195
|
+
export declare function addTailsExpAndLeaderboard(options: AddTailsExpAndLeaderboardOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
206
196
|
export interface AddCompetitionLeaderboardArguments {
|
|
207
197
|
version: RawTransactionArgument<string>;
|
|
208
198
|
typusEcosystemVersion: RawTransactionArgument<string>;
|
|
@@ -223,7 +213,7 @@ export interface AddCompetitionLeaderboardOptions {
|
|
|
223
213
|
];
|
|
224
214
|
}
|
|
225
215
|
/** Adds a score to the competition leaderboard. */
|
|
226
|
-
export declare function addCompetitionLeaderboard(options: AddCompetitionLeaderboardOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
216
|
+
export declare function addCompetitionLeaderboard(options: AddCompetitionLeaderboardOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
227
217
|
export interface SendFeeArguments {
|
|
228
218
|
version: RawTransactionArgument<string>;
|
|
229
219
|
}
|
|
@@ -236,7 +226,7 @@ export interface SendFeeOptions {
|
|
|
236
226
|
* Sends the collected fees to the fee address. Safe with constant address as
|
|
237
227
|
* receiver
|
|
238
228
|
*/
|
|
239
|
-
export declare function sendFee(options: SendFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
229
|
+
export declare function sendFee(options: SendFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
240
230
|
export interface ChargeFeeArguments {
|
|
241
231
|
version: RawTransactionArgument<string>;
|
|
242
232
|
balance: RawTransactionArgument<string>;
|
|
@@ -247,7 +237,7 @@ export interface ChargeFeeOptions {
|
|
|
247
237
|
typeArguments: [string];
|
|
248
238
|
}
|
|
249
239
|
/** Charges a protocol fee. */
|
|
250
|
-
export declare function chargeFee(options: ChargeFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
240
|
+
export declare function chargeFee(options: ChargeFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
251
241
|
export interface SendLiquidatorFeeArguments {
|
|
252
242
|
version: RawTransactionArgument<string>;
|
|
253
243
|
}
|
|
@@ -260,7 +250,7 @@ export interface SendLiquidatorFeeOptions {
|
|
|
260
250
|
* Sends the liquidator fees to the fee address. Safe with constant address as
|
|
261
251
|
* receiver
|
|
262
252
|
*/
|
|
263
|
-
export declare function sendLiquidatorFee(options: SendLiquidatorFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
253
|
+
export declare function sendLiquidatorFee(options: SendLiquidatorFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
264
254
|
export interface ChargeLiquidatorFeeArguments {
|
|
265
255
|
version: RawTransactionArgument<string>;
|
|
266
256
|
balance: RawTransactionArgument<string>;
|
|
@@ -271,4 +261,4 @@ export interface ChargeLiquidatorFeeOptions {
|
|
|
271
261
|
typeArguments: [string];
|
|
272
262
|
}
|
|
273
263
|
/** Charges a liquidator fee. */
|
|
274
|
-
export declare function chargeLiquidatorFee(options: ChargeLiquidatorFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
264
|
+
export declare function chargeLiquidatorFee(options: ChargeLiquidatorFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
@@ -55,13 +55,15 @@ exports.chargeLiquidatorFee = chargeLiquidatorFee;
|
|
|
55
55
|
* Perpetual Protocol. It includes version management, authority control, and fee
|
|
56
56
|
* handling.
|
|
57
57
|
*/
|
|
58
|
-
const
|
|
58
|
+
const index_js_1 = require("../utils/index.js");
|
|
59
59
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
60
|
-
const type_name = __importStar(require("./deps/std/type_name"));
|
|
61
|
-
const
|
|
62
|
-
const
|
|
60
|
+
const type_name = __importStar(require("./deps/std/type_name.js"));
|
|
61
|
+
const vec_set = __importStar(require("./deps/sui/vec_set.js"));
|
|
62
|
+
const type_name_1 = __importStar(require("./deps/std/type_name.js"));
|
|
63
|
+
const type_name_2 = __importStar(require("./deps/std/type_name.js"));
|
|
64
|
+
const type_name_3 = __importStar(require("./deps/std/type_name.js"));
|
|
63
65
|
const $moduleName = "@typus/perp::admin";
|
|
64
|
-
exports.FeeInfo = new
|
|
66
|
+
exports.FeeInfo = new index_js_1.MoveStruct({
|
|
65
67
|
name: `${$moduleName}::FeeInfo`,
|
|
66
68
|
fields: {
|
|
67
69
|
/** The type name of the token. */
|
|
@@ -70,18 +72,18 @@ exports.FeeInfo = new index_1.MoveStruct({
|
|
|
70
72
|
value: bcs_1.bcs.u64(),
|
|
71
73
|
},
|
|
72
74
|
});
|
|
73
|
-
exports.FeePool = new
|
|
75
|
+
exports.FeePool = new index_js_1.MoveStruct({
|
|
74
76
|
name: `${$moduleName}::FeePool`,
|
|
75
77
|
fields: {
|
|
76
|
-
id:
|
|
78
|
+
id: bcs_1.bcs.Address,
|
|
77
79
|
/** A vector of `FeeInfo` structs. */
|
|
78
80
|
fee_infos: bcs_1.bcs.vector(exports.FeeInfo),
|
|
79
81
|
},
|
|
80
82
|
});
|
|
81
|
-
exports.Version = new
|
|
83
|
+
exports.Version = new index_js_1.MoveStruct({
|
|
82
84
|
name: `${$moduleName}::Version`,
|
|
83
85
|
fields: {
|
|
84
|
-
id:
|
|
86
|
+
id: bcs_1.bcs.Address,
|
|
85
87
|
/** The version number. */
|
|
86
88
|
value: bcs_1.bcs.u64(),
|
|
87
89
|
/** The fee pool for protocol fees. */
|
|
@@ -94,29 +96,29 @@ exports.Version = new index_1.MoveStruct({
|
|
|
94
96
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
95
97
|
},
|
|
96
98
|
});
|
|
97
|
-
exports.SendFeeEvent = new
|
|
99
|
+
exports.SendFeeEvent = new index_js_1.MoveStruct({
|
|
98
100
|
name: `${$moduleName}::SendFeeEvent`,
|
|
99
101
|
fields: {
|
|
100
102
|
/** The type name of the token. */
|
|
101
|
-
token:
|
|
103
|
+
token: type_name_1.TypeName,
|
|
102
104
|
/** The amount of fees sent. */
|
|
103
105
|
amount: bcs_1.bcs.u64(),
|
|
104
106
|
},
|
|
105
107
|
});
|
|
106
|
-
exports.ProtocolFeeEvent = new
|
|
108
|
+
exports.ProtocolFeeEvent = new index_js_1.MoveStruct({
|
|
107
109
|
name: `${$moduleName}::ProtocolFeeEvent`,
|
|
108
110
|
fields: {
|
|
109
111
|
/** The type name of the token. */
|
|
110
|
-
token:
|
|
112
|
+
token: type_name_2.TypeName,
|
|
111
113
|
/** The amount of fees charged. */
|
|
112
114
|
amount: bcs_1.bcs.u64(),
|
|
113
115
|
},
|
|
114
116
|
});
|
|
115
|
-
exports.PutInsuranceFundEvent = new
|
|
117
|
+
exports.PutInsuranceFundEvent = new index_js_1.MoveStruct({
|
|
116
118
|
name: `${$moduleName}::PutInsuranceFundEvent`,
|
|
117
119
|
fields: {
|
|
118
120
|
/** The type name of the token. */
|
|
119
|
-
token:
|
|
121
|
+
token: type_name_3.TypeName,
|
|
120
122
|
/** The amount of funds put into the insurance fund. */
|
|
121
123
|
amount: bcs_1.bcs.u64(),
|
|
122
124
|
},
|
|
@@ -124,25 +126,25 @@ exports.PutInsuranceFundEvent = new index_1.MoveStruct({
|
|
|
124
126
|
/** Checks if the contract version is valid. */
|
|
125
127
|
function versionCheck(options) {
|
|
126
128
|
const packageAddress = options.package ?? "@typus/perp";
|
|
127
|
-
const argumentsTypes = [
|
|
129
|
+
const argumentsTypes = [null];
|
|
128
130
|
const parameterNames = ["version"];
|
|
129
131
|
return (tx) => tx.moveCall({
|
|
130
132
|
package: packageAddress,
|
|
131
133
|
module: "admin",
|
|
132
134
|
function: "version_check",
|
|
133
|
-
arguments: (0,
|
|
135
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
138
|
/** Upgrades the contract version. WARNING: no authority check inside */
|
|
137
139
|
function upgrade(options) {
|
|
138
140
|
const packageAddress = options.package ?? "@typus/perp";
|
|
139
|
-
const argumentsTypes = [
|
|
141
|
+
const argumentsTypes = [null];
|
|
140
142
|
const parameterNames = ["version"];
|
|
141
143
|
return (tx) => tx.moveCall({
|
|
142
144
|
package: packageAddress,
|
|
143
145
|
module: "admin",
|
|
144
146
|
function: "upgrade",
|
|
145
|
-
arguments: (0,
|
|
147
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
146
148
|
});
|
|
147
149
|
}
|
|
148
150
|
function init(options = {}) {
|
|
@@ -156,37 +158,35 @@ function init(options = {}) {
|
|
|
156
158
|
/** [Authorized Function] Verifies if the sender is an authorized user. */
|
|
157
159
|
function verify(options) {
|
|
158
160
|
const packageAddress = options.package ?? "@typus/perp";
|
|
159
|
-
const argumentsTypes = [
|
|
161
|
+
const argumentsTypes = [null];
|
|
160
162
|
const parameterNames = ["version"];
|
|
161
163
|
return (tx) => tx.moveCall({
|
|
162
164
|
package: packageAddress,
|
|
163
165
|
module: "admin",
|
|
164
166
|
function: "verify",
|
|
165
|
-
arguments: (0,
|
|
167
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
|
-
/** [Authorized Function] Adds an authorized user. */
|
|
169
170
|
function addAuthorizedUser(options) {
|
|
170
171
|
const packageAddress = options.package ?? "@typus/perp";
|
|
171
|
-
const argumentsTypes = [
|
|
172
|
+
const argumentsTypes = [null, "address"];
|
|
172
173
|
const parameterNames = ["version", "userAddress"];
|
|
173
174
|
return (tx) => tx.moveCall({
|
|
174
175
|
package: packageAddress,
|
|
175
176
|
module: "admin",
|
|
176
177
|
function: "add_authorized_user",
|
|
177
|
-
arguments: (0,
|
|
178
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
|
-
/** [Authorized Function] Removes an authorized user. */
|
|
181
181
|
function removeAuthorizedUser(options) {
|
|
182
182
|
const packageAddress = options.package ?? "@typus/perp";
|
|
183
|
-
const argumentsTypes = [
|
|
183
|
+
const argumentsTypes = [null, "address"];
|
|
184
184
|
const parameterNames = ["version", "userAddress"];
|
|
185
185
|
return (tx) => tx.moveCall({
|
|
186
186
|
package: packageAddress,
|
|
187
187
|
module: "admin",
|
|
188
188
|
function: "remove_authorized_user",
|
|
189
|
-
arguments: (0,
|
|
189
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
@@ -195,30 +195,18 @@ function removeAuthorizedUser(options) {
|
|
|
195
195
|
*/
|
|
196
196
|
function installEcosystemManagerCapEntry(options) {
|
|
197
197
|
const packageAddress = options.package ?? "@typus/perp";
|
|
198
|
-
const argumentsTypes = [
|
|
199
|
-
`${packageAddress}::admin::Version`,
|
|
200
|
-
"0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
|
|
201
|
-
];
|
|
198
|
+
const argumentsTypes = [null, null];
|
|
202
199
|
const parameterNames = ["version", "typusEcosystemVersion"];
|
|
203
200
|
return (tx) => tx.moveCall({
|
|
204
201
|
package: packageAddress,
|
|
205
202
|
module: "admin",
|
|
206
203
|
function: "install_ecosystem_manager_cap_entry",
|
|
207
|
-
arguments: (0,
|
|
204
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
208
205
|
});
|
|
209
206
|
}
|
|
210
207
|
function addTailsExpAndLeaderboard(options) {
|
|
211
208
|
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
|
-
];
|
|
209
|
+
const argumentsTypes = [null, null, null, null, "address", "u64", "u64", "0x2::clock::Clock"];
|
|
222
210
|
const parameterNames = [
|
|
223
211
|
"version",
|
|
224
212
|
"typusEcosystemVersion",
|
|
@@ -232,27 +220,19 @@ function addTailsExpAndLeaderboard(options) {
|
|
|
232
220
|
package: packageAddress,
|
|
233
221
|
module: "admin",
|
|
234
222
|
function: "add_tails_exp_and_leaderboard",
|
|
235
|
-
arguments: (0,
|
|
223
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
236
224
|
});
|
|
237
225
|
}
|
|
238
226
|
/** Adds a score to the competition leaderboard. */
|
|
239
227
|
function addCompetitionLeaderboard(options) {
|
|
240
228
|
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
|
-
];
|
|
229
|
+
const argumentsTypes = [null, null, null, "0x1::string::String", "address", "u64", "0x2::clock::Clock"];
|
|
250
230
|
const parameterNames = ["version", "typusEcosystemVersion", "typusLeaderboardRegistry", "leaderboardKey", "user", "score"];
|
|
251
231
|
return (tx) => tx.moveCall({
|
|
252
232
|
package: packageAddress,
|
|
253
233
|
module: "admin",
|
|
254
234
|
function: "add_competition_leaderboard",
|
|
255
|
-
arguments: (0,
|
|
235
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
256
236
|
});
|
|
257
237
|
}
|
|
258
238
|
/**
|
|
@@ -261,29 +241,26 @@ function addCompetitionLeaderboard(options) {
|
|
|
261
241
|
*/
|
|
262
242
|
function sendFee(options) {
|
|
263
243
|
const packageAddress = options.package ?? "@typus/perp";
|
|
264
|
-
const argumentsTypes = [
|
|
244
|
+
const argumentsTypes = [null];
|
|
265
245
|
const parameterNames = ["version"];
|
|
266
246
|
return (tx) => tx.moveCall({
|
|
267
247
|
package: packageAddress,
|
|
268
248
|
module: "admin",
|
|
269
249
|
function: "send_fee",
|
|
270
|
-
arguments: (0,
|
|
250
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
271
251
|
typeArguments: options.typeArguments,
|
|
272
252
|
});
|
|
273
253
|
}
|
|
274
254
|
/** Charges a protocol fee. */
|
|
275
255
|
function chargeFee(options) {
|
|
276
256
|
const packageAddress = options.package ?? "@typus/perp";
|
|
277
|
-
const argumentsTypes = [
|
|
278
|
-
`${packageAddress}::admin::Version`,
|
|
279
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
280
|
-
];
|
|
257
|
+
const argumentsTypes = [null, null];
|
|
281
258
|
const parameterNames = ["version", "balance"];
|
|
282
259
|
return (tx) => tx.moveCall({
|
|
283
260
|
package: packageAddress,
|
|
284
261
|
module: "admin",
|
|
285
262
|
function: "charge_fee",
|
|
286
|
-
arguments: (0,
|
|
263
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
287
264
|
typeArguments: options.typeArguments,
|
|
288
265
|
});
|
|
289
266
|
}
|
|
@@ -293,29 +270,26 @@ function chargeFee(options) {
|
|
|
293
270
|
*/
|
|
294
271
|
function sendLiquidatorFee(options) {
|
|
295
272
|
const packageAddress = options.package ?? "@typus/perp";
|
|
296
|
-
const argumentsTypes = [
|
|
273
|
+
const argumentsTypes = [null];
|
|
297
274
|
const parameterNames = ["version"];
|
|
298
275
|
return (tx) => tx.moveCall({
|
|
299
276
|
package: packageAddress,
|
|
300
277
|
module: "admin",
|
|
301
278
|
function: "send_liquidator_fee",
|
|
302
|
-
arguments: (0,
|
|
279
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
303
280
|
typeArguments: options.typeArguments,
|
|
304
281
|
});
|
|
305
282
|
}
|
|
306
283
|
/** Charges a liquidator fee. */
|
|
307
284
|
function chargeLiquidatorFee(options) {
|
|
308
285
|
const packageAddress = options.package ?? "@typus/perp";
|
|
309
|
-
const argumentsTypes = [
|
|
310
|
-
`${packageAddress}::admin::Version`,
|
|
311
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
312
|
-
];
|
|
286
|
+
const argumentsTypes = [null, null];
|
|
313
287
|
const parameterNames = ["version", "balance"];
|
|
314
288
|
return (tx) => tx.moveCall({
|
|
315
289
|
package: packageAddress,
|
|
316
290
|
module: "admin",
|
|
317
291
|
function: "charge_liquidator_fee",
|
|
318
|
-
arguments: (0,
|
|
292
|
+
arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
319
293
|
typeArguments: options.typeArguments,
|
|
320
294
|
});
|
|
321
295
|
}
|
|
@@ -2,22 +2,20 @@
|
|
|
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, type RawTransactionArgument } from "../utils/index";
|
|
5
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
|
|
6
6
|
import { type Transaction } from "@mysten/sui/transactions";
|
|
7
7
|
export declare const CompetitionConfig: MoveStruct<{
|
|
8
|
-
id:
|
|
9
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
10
|
-
}, "0x2::object::UID">;
|
|
8
|
+
id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
11
9
|
/** The boost in basis points for each staking level. */
|
|
12
|
-
boost_bp: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
10
|
+
boost_bp: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
|
|
13
11
|
length: number;
|
|
14
12
|
}, string>;
|
|
15
13
|
/** Whether the competition is active. */
|
|
16
|
-
is_active: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
14
|
+
is_active: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<boolean, boolean, "bool">;
|
|
17
15
|
/** The name of the program. */
|
|
18
|
-
program_name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
16
|
+
program_name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
|
|
19
17
|
/** Padding for future use. */
|
|
20
|
-
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
18
|
+
u64_padding: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
|
|
21
19
|
length: number;
|
|
22
20
|
}, string>;
|
|
23
21
|
}, "@typus/perp::competition::CompetitionConfig">;
|
|
@@ -34,7 +32,21 @@ export interface NewCompetitionConfigOptions {
|
|
|
34
32
|
programName: RawTransactionArgument<string>
|
|
35
33
|
];
|
|
36
34
|
}
|
|
37
|
-
export declare function newCompetitionConfig(options: NewCompetitionConfigOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
35
|
+
export declare function newCompetitionConfig(options: NewCompetitionConfigOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
36
|
+
export interface SetBoostBpArguments {
|
|
37
|
+
version: RawTransactionArgument<string>;
|
|
38
|
+
competitionConfig: RawTransactionArgument<string>;
|
|
39
|
+
boostBp: RawTransactionArgument<number | bigint[]>;
|
|
40
|
+
}
|
|
41
|
+
export interface SetBoostBpOptions {
|
|
42
|
+
package?: string;
|
|
43
|
+
arguments: SetBoostBpArguments | [
|
|
44
|
+
version: RawTransactionArgument<string>,
|
|
45
|
+
competitionConfig: RawTransactionArgument<string>,
|
|
46
|
+
boostBp: RawTransactionArgument<number | bigint[]>
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
export declare function setBoostBp(options: SetBoostBpOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
38
50
|
export interface AddScoreArguments {
|
|
39
51
|
version: RawTransactionArgument<string>;
|
|
40
52
|
ecosystemVersion: RawTransactionArgument<string>;
|
|
@@ -57,4 +69,4 @@ export interface AddScoreOptions {
|
|
|
57
69
|
];
|
|
58
70
|
}
|
|
59
71
|
/** 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;
|
|
72
|
+
export declare function addScore(options: AddScoreOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|