@typus/typus-perp-sdk 1.0.30 → 1.0.32
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/fetch.d.ts +3 -0
- package/dist/src/fetch.js +3 -1
- package/dist/src/typus_perp/admin/functions.d.ts +25 -25
- package/dist/src/typus_perp/admin/functions.js +66 -53
- package/dist/src/typus_perp/admin/structs.d.ts +222 -222
- package/dist/src/typus_perp/admin/structs.js +256 -256
- package/dist/src/typus_perp/error/functions.d.ts +67 -67
- package/dist/src/typus_perp/error/functions.js +201 -134
- package/dist/src/typus_perp/escrow/functions.d.ts +3 -3
- package/dist/src/typus_perp/escrow/functions.js +9 -6
- package/dist/src/typus_perp/lending/functions.d.ts +15 -0
- package/dist/src/typus_perp/lending/functions.js +22 -0
- package/dist/src/typus_perp/lp-pool/functions.d.ts +102 -63
- package/dist/src/typus_perp/lp-pool/functions.js +243 -123
- package/dist/src/typus_perp/lp-pool/structs.d.ts +616 -348
- package/dist/src/typus_perp/lp-pool/structs.js +1202 -768
- package/dist/src/typus_perp/math/functions.d.ts +16 -5
- package/dist/src/typus_perp/math/functions.js +33 -12
- package/dist/src/typus_perp/position/functions.d.ts +86 -86
- package/dist/src/typus_perp/position/functions.js +223 -157
- package/dist/src/typus_perp/symbol/functions.d.ts +4 -4
- package/dist/src/typus_perp/symbol/functions.js +14 -10
- package/dist/src/typus_perp/tlp/functions.d.ts +5 -5
- package/dist/src/typus_perp/tlp/functions.js +17 -12
- package/dist/src/typus_perp/token-interface/functions.d.ts +2 -2
- package/dist/src/typus_perp/token-interface/functions.js +6 -4
- package/dist/src/typus_perp/trading/functions.d.ts +75 -75
- package/dist/src/typus_perp/trading/functions.js +189 -138
- package/dist/src/typus_perp/trading/structs.d.ts +6 -0
- package/dist/src/typus_perp/trading/structs.js +6 -0
- package/dist/src/typus_perp/treasury-caps/functions.d.ts +4 -4
- package/dist/src/typus_perp/treasury-caps/functions.js +14 -10
- package/package.json +2 -2
package/dist/src/fetch.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export declare function getUserOrders(config: TypusConfig, user: string): Promis
|
|
|
19
19
|
export declare function getUserPositions(config: TypusConfig, user: string): Promise<Position[]>;
|
|
20
20
|
export declare function parseOptionBidReceipts(positions: Position[]): (TypusBidReceipt | null)[];
|
|
21
21
|
export declare function getUserStake(config: TypusConfig, user: string): Promise<[LpUserShare, string[]][]>;
|
|
22
|
+
/**
|
|
23
|
+
* @returns [liquidationPrice, pnl(in USD)]
|
|
24
|
+
*/
|
|
22
25
|
export declare function getLiquidationPriceAndPnl(config: TypusConfig, pythClient: PythClient, input: {
|
|
23
26
|
positions: Position[];
|
|
24
27
|
user: string;
|
package/dist/src/fetch.js
CHANGED
|
@@ -398,7 +398,9 @@ function getUserStake(config, user) {
|
|
|
398
398
|
});
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
|
|
401
|
+
/**
|
|
402
|
+
* @returns [liquidationPrice, pnl(in USD)]
|
|
403
|
+
*/
|
|
402
404
|
function getLiquidationPriceAndPnl(config, pythClient, input) {
|
|
403
405
|
return __awaiter(this, void 0, void 0, function () {
|
|
404
406
|
var provider, tx, tokens, _a, _b, position, TOKEN, BASE_TOKEN, _c, _d, token, _e, _f, position, TOKEN, BASE_TOKEN, res, results;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
2
|
-
export declare function upgrade(tx: Transaction, version: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
3
|
-
export declare function init(tx: Transaction): import("@mysten/sui/transactions").TransactionResult;
|
|
4
|
-
export declare function verify(tx: Transaction, version: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
5
2
|
export interface AddAuthorizedUserArgs {
|
|
6
3
|
version: TransactionObjectInput;
|
|
7
4
|
userAddress: string | TransactionArgument;
|
|
8
5
|
}
|
|
9
|
-
export declare function addAuthorizedUser(tx: Transaction, args: AddAuthorizedUserArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
10
|
-
export interface
|
|
11
|
-
version: TransactionObjectInput;
|
|
12
|
-
balance: TransactionObjectInput;
|
|
13
|
-
}
|
|
14
|
-
export declare function chargeFee(tx: Transaction, typeArg: string, args: ChargeFeeArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
15
|
-
export interface RemoveAuthorizedUserArgs {
|
|
6
|
+
export declare function addAuthorizedUser(tx: Transaction, args: AddAuthorizedUserArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
7
|
+
export interface AddExpLeaderboardArgs {
|
|
16
8
|
version: TransactionObjectInput;
|
|
17
|
-
|
|
9
|
+
typusEcosystemVersion: TransactionObjectInput;
|
|
10
|
+
typusLeaderboardRegistry: TransactionObjectInput;
|
|
11
|
+
user: string | TransactionArgument;
|
|
12
|
+
score: bigint | TransactionArgument;
|
|
13
|
+
clock: TransactionObjectInput;
|
|
18
14
|
}
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function sendFee(tx: Transaction, typeArg: string, version: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
21
|
-
export declare function versionCheck(tx: Transaction, version: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
15
|
+
export declare function addExpLeaderboard(tx: Transaction, args: AddExpLeaderboardArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
22
16
|
export interface AddTailsExpAmountArgs {
|
|
23
17
|
version: TransactionObjectInput;
|
|
24
18
|
typusEcosystemVersion: TransactionObjectInput;
|
|
@@ -26,24 +20,30 @@ export interface AddTailsExpAmountArgs {
|
|
|
26
20
|
user: string | TransactionArgument;
|
|
27
21
|
amount: bigint | TransactionArgument;
|
|
28
22
|
}
|
|
29
|
-
export declare function addTailsExpAmount(tx: Transaction, args: AddTailsExpAmountArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
30
|
-
export interface
|
|
23
|
+
export declare function addTailsExpAmount(tx: Transaction, args: AddTailsExpAmountArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
24
|
+
export interface ChargeFeeArgs {
|
|
31
25
|
version: TransactionObjectInput;
|
|
32
|
-
|
|
33
|
-
typusLeaderboardRegistry: TransactionObjectInput;
|
|
34
|
-
user: string | TransactionArgument;
|
|
35
|
-
score: bigint | TransactionArgument;
|
|
36
|
-
clock: TransactionObjectInput;
|
|
26
|
+
balance: TransactionObjectInput;
|
|
37
27
|
}
|
|
38
|
-
export declare function
|
|
28
|
+
export declare function chargeFee(tx: Transaction, typeArg: string, args: ChargeFeeArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
39
29
|
export interface ChargeLiquidatorFeeArgs {
|
|
40
30
|
version: TransactionObjectInput;
|
|
41
31
|
balance: TransactionObjectInput;
|
|
42
32
|
}
|
|
43
|
-
export declare function chargeLiquidatorFee(tx: Transaction, typeArg: string, args: ChargeLiquidatorFeeArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
33
|
+
export declare function chargeLiquidatorFee(tx: Transaction, typeArg: string, args: ChargeLiquidatorFeeArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
34
|
+
export declare function init(tx: Transaction, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
44
35
|
export interface InstallEcosystemManagerCapEntryArgs {
|
|
45
36
|
version: TransactionObjectInput;
|
|
46
37
|
typusEcosystemVersion: TransactionObjectInput;
|
|
47
38
|
}
|
|
48
|
-
export declare function installEcosystemManagerCapEntry(tx: Transaction, args: InstallEcosystemManagerCapEntryArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
49
|
-
export
|
|
39
|
+
export declare function installEcosystemManagerCapEntry(tx: Transaction, args: InstallEcosystemManagerCapEntryArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
40
|
+
export interface RemoveAuthorizedUserArgs {
|
|
41
|
+
version: TransactionObjectInput;
|
|
42
|
+
userAddress: string | TransactionArgument;
|
|
43
|
+
}
|
|
44
|
+
export declare function removeAuthorizedUser(tx: Transaction, args: RemoveAuthorizedUserArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
45
|
+
export declare function sendFee(tx: Transaction, typeArg: string, version: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
46
|
+
export declare function sendLiquidatorFee(tx: Transaction, typeArg: string, version: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
47
|
+
export declare function upgrade(tx: Transaction, version: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
48
|
+
export declare function verify(tx: Transaction, version: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
49
|
+
export declare function versionCheck(tx: Transaction, version: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,92 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upgrade = upgrade;
|
|
4
|
-
exports.init = init;
|
|
5
|
-
exports.verify = verify;
|
|
6
3
|
exports.addAuthorizedUser = addAuthorizedUser;
|
|
7
|
-
exports.chargeFee = chargeFee;
|
|
8
|
-
exports.removeAuthorizedUser = removeAuthorizedUser;
|
|
9
|
-
exports.sendFee = sendFee;
|
|
10
|
-
exports.versionCheck = versionCheck;
|
|
11
|
-
exports.addTailsExpAmount = addTailsExpAmount;
|
|
12
4
|
exports.addExpLeaderboard = addExpLeaderboard;
|
|
5
|
+
exports.addTailsExpAmount = addTailsExpAmount;
|
|
6
|
+
exports.chargeFee = chargeFee;
|
|
13
7
|
exports.chargeLiquidatorFee = chargeLiquidatorFee;
|
|
8
|
+
exports.init = init;
|
|
14
9
|
exports.installEcosystemManagerCapEntry = installEcosystemManagerCapEntry;
|
|
10
|
+
exports.removeAuthorizedUser = removeAuthorizedUser;
|
|
11
|
+
exports.sendFee = sendFee;
|
|
15
12
|
exports.sendLiquidatorFee = sendLiquidatorFee;
|
|
13
|
+
exports.upgrade = upgrade;
|
|
14
|
+
exports.verify = verify;
|
|
15
|
+
exports.versionCheck = versionCheck;
|
|
16
16
|
var __1 = require("..");
|
|
17
17
|
var util_1 = require("../../_framework/util");
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
function init(tx) {
|
|
22
|
-
return tx.moveCall({ target: "".concat(__1.PUBLISHED_AT, "::admin::init"), arguments: [] });
|
|
23
|
-
}
|
|
24
|
-
function verify(tx, version) {
|
|
25
|
-
return tx.moveCall({ target: "".concat(__1.PUBLISHED_AT, "::admin::verify"), arguments: [(0, util_1.obj)(tx, version)] });
|
|
26
|
-
}
|
|
27
|
-
function addAuthorizedUser(tx, args) {
|
|
28
|
-
return tx.moveCall({
|
|
29
|
-
target: "".concat(__1.PUBLISHED_AT, "::admin::add_authorized_user"),
|
|
30
|
-
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.pure)(tx, args.userAddress, "address")],
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function chargeFee(tx, typeArg, args) {
|
|
34
|
-
return tx.moveCall({
|
|
35
|
-
target: "".concat(__1.PUBLISHED_AT, "::admin::charge_fee"),
|
|
36
|
-
typeArguments: [typeArg],
|
|
37
|
-
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.balance)],
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function removeAuthorizedUser(tx, args) {
|
|
18
|
+
function addAuthorizedUser(tx, args, published_at) {
|
|
19
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
41
20
|
return tx.moveCall({
|
|
42
|
-
target: "".concat(
|
|
21
|
+
target: "".concat(published_at, "::admin::add_authorized_user"),
|
|
43
22
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.pure)(tx, args.userAddress, "address")],
|
|
44
23
|
});
|
|
45
24
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
function versionCheck(tx, version) {
|
|
50
|
-
return tx.moveCall({ target: "".concat(__1.PUBLISHED_AT, "::admin::version_check"), arguments: [(0, util_1.obj)(tx, version)] });
|
|
51
|
-
}
|
|
52
|
-
function addTailsExpAmount(tx, args) {
|
|
25
|
+
function addExpLeaderboard(tx, args, published_at) {
|
|
26
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
53
27
|
return tx.moveCall({
|
|
54
|
-
target: "".concat(
|
|
28
|
+
target: "".concat(published_at, "::admin::add_exp_leaderboard"),
|
|
55
29
|
arguments: [
|
|
56
30
|
(0, util_1.obj)(tx, args.version),
|
|
57
31
|
(0, util_1.obj)(tx, args.typusEcosystemVersion),
|
|
58
|
-
(0, util_1.obj)(tx, args.
|
|
32
|
+
(0, util_1.obj)(tx, args.typusLeaderboardRegistry),
|
|
59
33
|
(0, util_1.pure)(tx, args.user, "address"),
|
|
60
|
-
(0, util_1.pure)(tx, args.
|
|
34
|
+
(0, util_1.pure)(tx, args.score, "u64"),
|
|
35
|
+
(0, util_1.obj)(tx, args.clock),
|
|
61
36
|
],
|
|
62
37
|
});
|
|
63
38
|
}
|
|
64
|
-
function
|
|
39
|
+
function addTailsExpAmount(tx, args, published_at) {
|
|
40
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
65
41
|
return tx.moveCall({
|
|
66
|
-
target: "".concat(
|
|
42
|
+
target: "".concat(published_at, "::admin::add_tails_exp_amount"),
|
|
67
43
|
arguments: [
|
|
68
44
|
(0, util_1.obj)(tx, args.version),
|
|
69
45
|
(0, util_1.obj)(tx, args.typusEcosystemVersion),
|
|
70
|
-
(0, util_1.obj)(tx, args.
|
|
46
|
+
(0, util_1.obj)(tx, args.typusUserRegistry),
|
|
71
47
|
(0, util_1.pure)(tx, args.user, "address"),
|
|
72
|
-
(0, util_1.pure)(tx, args.
|
|
73
|
-
(0, util_1.obj)(tx, args.clock),
|
|
48
|
+
(0, util_1.pure)(tx, args.amount, "u64"),
|
|
74
49
|
],
|
|
75
50
|
});
|
|
76
51
|
}
|
|
77
|
-
function
|
|
52
|
+
function chargeFee(tx, typeArg, args, published_at) {
|
|
53
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
78
54
|
return tx.moveCall({
|
|
79
|
-
target: "".concat(
|
|
55
|
+
target: "".concat(published_at, "::admin::charge_fee"),
|
|
80
56
|
typeArguments: [typeArg],
|
|
81
57
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.balance)],
|
|
82
58
|
});
|
|
83
59
|
}
|
|
84
|
-
function
|
|
60
|
+
function chargeLiquidatorFee(tx, typeArg, args, published_at) {
|
|
61
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
85
62
|
return tx.moveCall({
|
|
86
|
-
target: "".concat(
|
|
63
|
+
target: "".concat(published_at, "::admin::charge_liquidator_fee"),
|
|
64
|
+
typeArguments: [typeArg],
|
|
65
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.balance)],
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function init(tx, published_at) {
|
|
69
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
70
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::init"), arguments: [] });
|
|
71
|
+
}
|
|
72
|
+
function installEcosystemManagerCapEntry(tx, args, published_at) {
|
|
73
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
74
|
+
return tx.moveCall({
|
|
75
|
+
target: "".concat(published_at, "::admin::install_ecosystem_manager_cap_entry"),
|
|
87
76
|
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.typusEcosystemVersion)],
|
|
88
77
|
});
|
|
89
78
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
79
|
+
function removeAuthorizedUser(tx, args, published_at) {
|
|
80
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
81
|
+
return tx.moveCall({
|
|
82
|
+
target: "".concat(published_at, "::admin::remove_authorized_user"),
|
|
83
|
+
arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.pure)(tx, args.userAddress, "address")],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function sendFee(tx, typeArg, version, published_at) {
|
|
87
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
88
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::send_fee"), typeArguments: [typeArg], arguments: [(0, util_1.obj)(tx, version)] });
|
|
89
|
+
}
|
|
90
|
+
function sendLiquidatorFee(tx, typeArg, version, published_at) {
|
|
91
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
92
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::send_liquidator_fee"), typeArguments: [typeArg], arguments: [(0, util_1.obj)(tx, version)] });
|
|
93
|
+
}
|
|
94
|
+
function upgrade(tx, version, published_at) {
|
|
95
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
96
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::upgrade"), arguments: [(0, util_1.obj)(tx, version)] });
|
|
97
|
+
}
|
|
98
|
+
function verify(tx, version, published_at) {
|
|
99
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
100
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::verify"), arguments: [(0, util_1.obj)(tx, version)] });
|
|
101
|
+
}
|
|
102
|
+
function versionCheck(tx, version, published_at) {
|
|
103
|
+
if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
|
|
104
|
+
return tx.moveCall({ target: "".concat(published_at, "::admin::version_check"), arguments: [(0, util_1.obj)(tx, version)] });
|
|
92
105
|
}
|