@typus/typus-sdk 1.6.11 → 1.6.12
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/auto-bid/token-user-entry.js +60 -5
- package/dist/src/constants/token.d.ts +58 -21
- package/dist/src/constants/token.js +165 -275
- package/dist/src/typus-dov-single-v2/history/user-history.d.ts +1 -2
- package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +0 -1
- package/dist/src/typus-dov-single-v2/token-user-entry.js +65 -14
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
- package/dist/src/typus-dov-single-v2/user-entry.js +8 -5
- package/dist/src/typus-safu/user-entry.js +1 -1
- package/dist/src/utils/api/sentio/vault-history.js +3 -3
- package/dist/src/utils/pyth/constant.d.ts +50 -7
- package/dist/src/utils/pyth/constant.js +30 -70
- package/dist/src/utils/pyth/pythClient.d.ts +1 -1
- package/dist/src/utils/pyth/pythClient.js +5 -5
- package/dist/src/utils/tools.js +1 -1
- package/dist/src/utils/typusConfig.d.ts +68 -1
- package/package.json +3 -2
|
@@ -20,9 +20,22 @@ exports.getTokenNewStrategyTx = getTokenNewStrategyTx;
|
|
|
20
20
|
exports.getTokenUpdateStrategyTx = getTokenUpdateStrategyTx;
|
|
21
21
|
exports.getTokenCloseStrategyTx = getTokenCloseStrategyTx;
|
|
22
22
|
exports.getTokenWithdrawProfitStrategyTx = getTokenWithdrawProfitStrategyTx;
|
|
23
|
-
var token_user_entry_1 = require("../../src/typus-dov-single-v2/token-user-entry");
|
|
24
23
|
function getTokenNewStrategyTx(config, tx, input) {
|
|
25
|
-
var typusTokenRegistry =
|
|
24
|
+
var typusTokenRegistry = "";
|
|
25
|
+
switch (input.typusTokenType.split("::")[1]) {
|
|
26
|
+
case "mfud":
|
|
27
|
+
typusTokenRegistry = config.registry.token.mfud;
|
|
28
|
+
break;
|
|
29
|
+
case "mblub":
|
|
30
|
+
typusTokenRegistry = config.registry.token.mblub;
|
|
31
|
+
break;
|
|
32
|
+
case "mliq":
|
|
33
|
+
typusTokenRegistry = config.registry.token.mliq;
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
console.log("No such token exists!");
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
26
39
|
var tToken = tx.moveCall({
|
|
27
40
|
target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
|
|
28
41
|
arguments: [
|
|
@@ -49,7 +62,21 @@ function getTokenNewStrategyTx(config, tx, input) {
|
|
|
49
62
|
return tx;
|
|
50
63
|
}
|
|
51
64
|
function getTokenUpdateStrategyTx(config, tx, input) {
|
|
52
|
-
var typusTokenRegistry =
|
|
65
|
+
var typusTokenRegistry = "";
|
|
66
|
+
switch (input.typusTokenType.split("::")[1]) {
|
|
67
|
+
case "mfud":
|
|
68
|
+
typusTokenRegistry = config.registry.token.mfud;
|
|
69
|
+
break;
|
|
70
|
+
case "mblub":
|
|
71
|
+
typusTokenRegistry = config.registry.token.mblub;
|
|
72
|
+
break;
|
|
73
|
+
case "mliq":
|
|
74
|
+
typusTokenRegistry = config.registry.token.mliq;
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
console.log("No such token exists!");
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
53
80
|
var _a = __read(tx.moveCall({
|
|
54
81
|
target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
|
|
55
82
|
arguments: [
|
|
@@ -77,7 +104,21 @@ function getTokenUpdateStrategyTx(config, tx, input) {
|
|
|
77
104
|
return tx;
|
|
78
105
|
}
|
|
79
106
|
function getTokenCloseStrategyTx(config, tx, input) {
|
|
80
|
-
var typusTokenRegistry =
|
|
107
|
+
var typusTokenRegistry = "";
|
|
108
|
+
switch (input.typusTokenType.split("::")[1]) {
|
|
109
|
+
case "mfud":
|
|
110
|
+
typusTokenRegistry = config.registry.token.mfud;
|
|
111
|
+
break;
|
|
112
|
+
case "mblub":
|
|
113
|
+
typusTokenRegistry = config.registry.token.mblub;
|
|
114
|
+
break;
|
|
115
|
+
case "mliq":
|
|
116
|
+
typusTokenRegistry = config.registry.token.mliq;
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
console.log("No such token exists!");
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
81
122
|
var _a = __read(tx.moveCall({
|
|
82
123
|
target: "".concat(config.package.dovSingle, "::auto_bid::close_strategy"),
|
|
83
124
|
typeArguments: input.typeArguments,
|
|
@@ -112,7 +153,21 @@ function getTokenCloseStrategyTx(config, tx, input) {
|
|
|
112
153
|
return tx;
|
|
113
154
|
}
|
|
114
155
|
function getTokenWithdrawProfitStrategyTx(config, tx, input) {
|
|
115
|
-
var typusTokenRegistry =
|
|
156
|
+
var typusTokenRegistry = "";
|
|
157
|
+
switch (input.typusTokenType.split("::")[1]) {
|
|
158
|
+
case "mfud":
|
|
159
|
+
typusTokenRegistry = config.registry.token.mfud;
|
|
160
|
+
break;
|
|
161
|
+
case "mblub":
|
|
162
|
+
typusTokenRegistry = config.registry.token.mblub;
|
|
163
|
+
break;
|
|
164
|
+
case "mliq":
|
|
165
|
+
typusTokenRegistry = config.registry.token.mliq;
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
console.log("No such token exists!");
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
116
171
|
var d_token = tx.moveCall({
|
|
117
172
|
target: "".concat(config.package.dovSingle, "::auto_bid::withdraw_profit"),
|
|
118
173
|
typeArguments: input.typeArguments,
|
|
@@ -1,28 +1,65 @@
|
|
|
1
1
|
export declare function typeArgsToAssets(typeArgs: string[]): string[];
|
|
2
|
-
export declare function typeArgToAsset(typeArg: string):
|
|
3
|
-
export declare function assetToDecimal(asset:
|
|
2
|
+
export declare function typeArgToAsset(typeArg: string): string;
|
|
3
|
+
export declare function assetToDecimal(asset: string): number | undefined;
|
|
4
4
|
export declare const tokenType: {
|
|
5
|
+
SUI: string;
|
|
5
6
|
MAINNET: {
|
|
6
|
-
|
|
7
|
+
SUI: string;
|
|
8
|
+
BTC: string;
|
|
9
|
+
ETH: string;
|
|
10
|
+
wUSDC: string;
|
|
11
|
+
USDT: string;
|
|
12
|
+
CETUS: string;
|
|
13
|
+
BUCK: string;
|
|
14
|
+
SOL: string;
|
|
15
|
+
TURBOS: string;
|
|
16
|
+
APT: string;
|
|
17
|
+
FUD: string;
|
|
18
|
+
MFUD: string;
|
|
19
|
+
INJ: string;
|
|
20
|
+
SEI: string;
|
|
21
|
+
AFSUI: string;
|
|
22
|
+
JUP: string;
|
|
23
|
+
NAVX: string;
|
|
24
|
+
USDY: string;
|
|
25
|
+
TEXP: string;
|
|
26
|
+
SCA: string;
|
|
27
|
+
VSUI: string;
|
|
28
|
+
HASUI: string;
|
|
29
|
+
LIQ: string;
|
|
30
|
+
HIPPO: string;
|
|
31
|
+
MLIQ: string;
|
|
32
|
+
BLUE: string;
|
|
33
|
+
TYPUS: string;
|
|
34
|
+
WAL: string;
|
|
35
|
+
STSUI: string;
|
|
7
36
|
};
|
|
8
37
|
TESTNET: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
SUI: string;
|
|
39
|
+
CETUS: string;
|
|
40
|
+
BUCK: string;
|
|
41
|
+
SOL: string;
|
|
42
|
+
TURBOS: string;
|
|
43
|
+
APT: string;
|
|
44
|
+
FUD: string;
|
|
45
|
+
MFUD: string;
|
|
46
|
+
USDT: string;
|
|
47
|
+
AFSUI: string;
|
|
48
|
+
INJ: string;
|
|
49
|
+
SEI: string;
|
|
50
|
+
USDY: string;
|
|
51
|
+
TEXP: string;
|
|
52
|
+
SCA: string;
|
|
53
|
+
BTC: string;
|
|
54
|
+
ETH: string;
|
|
55
|
+
wUSDC: string;
|
|
56
|
+
USDC: string;
|
|
57
|
+
BLUB: string;
|
|
58
|
+
MBLUB: string;
|
|
59
|
+
TYPUS: string;
|
|
27
60
|
};
|
|
28
61
|
};
|
|
62
|
+
export type TOKEN = "SUI" | "CETUS" | "BUCK" | "SOL" | "TURBOS" | "APT" | "FUD" | "MFUD" | "BLUB" | "MBLUB" | "USDT" | "AFSUI" | "INJ" | "SEI" | "USDY" | "TEXP" | "SCA" | "BTC" | "ETH" | "USDC" | "LIQ" | "MLIQ" | "HIPPO" | "DEEP" | "BLUE" | "wUSDC" | "TYPUS" | "WAL" | "STSUI";
|
|
63
|
+
export declare function typeArgToToken(typeArg: string): string;
|
|
64
|
+
export declare function tokenTypeToAsset(env: "MAINNET" | "TESTNET", tokenAddress: string): string | undefined;
|
|
65
|
+
export declare function assetToTokenType(env: "MAINNET" | "TESTNET", token: string): string;
|