@typus/typus-sdk 1.6.12 → 1.6.13
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 +5 -60
- package/dist/src/constants/token.d.ts +21 -58
- package/dist/src/constants/token.js +276 -165
- package/dist/src/typus-dov-single-v2/history/user-history.d.ts +2 -1
- package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +1 -0
- package/dist/src/typus-dov-single-v2/token-user-entry.js +14 -65
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
- package/dist/src/typus-dov-single-v2/user-entry.js +5 -8
- 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 +7 -50
- package/dist/src/utils/pyth/constant.js +70 -30
- 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 +1 -68
- package/package.json +2 -3
|
@@ -20,22 +20,9 @@ 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");
|
|
23
24
|
function getTokenNewStrategyTx(config, tx, input) {
|
|
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
|
-
}
|
|
25
|
+
var typusTokenRegistry = (0, token_user_entry_1.getTokenRegistry)(config, input.typusTokenType);
|
|
39
26
|
var tToken = tx.moveCall({
|
|
40
27
|
target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
|
|
41
28
|
arguments: [
|
|
@@ -62,21 +49,7 @@ function getTokenNewStrategyTx(config, tx, input) {
|
|
|
62
49
|
return tx;
|
|
63
50
|
}
|
|
64
51
|
function getTokenUpdateStrategyTx(config, tx, input) {
|
|
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
|
-
}
|
|
52
|
+
var typusTokenRegistry = (0, token_user_entry_1.getTokenRegistry)(config, input.typusTokenType);
|
|
80
53
|
var _a = __read(tx.moveCall({
|
|
81
54
|
target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
|
|
82
55
|
arguments: [
|
|
@@ -104,21 +77,7 @@ function getTokenUpdateStrategyTx(config, tx, input) {
|
|
|
104
77
|
return tx;
|
|
105
78
|
}
|
|
106
79
|
function getTokenCloseStrategyTx(config, tx, input) {
|
|
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
|
-
}
|
|
80
|
+
var typusTokenRegistry = (0, token_user_entry_1.getTokenRegistry)(config, input.typusTokenType);
|
|
122
81
|
var _a = __read(tx.moveCall({
|
|
123
82
|
target: "".concat(config.package.dovSingle, "::auto_bid::close_strategy"),
|
|
124
83
|
typeArguments: input.typeArguments,
|
|
@@ -153,21 +112,7 @@ function getTokenCloseStrategyTx(config, tx, input) {
|
|
|
153
112
|
return tx;
|
|
154
113
|
}
|
|
155
114
|
function getTokenWithdrawProfitStrategyTx(config, tx, input) {
|
|
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
|
-
}
|
|
115
|
+
var typusTokenRegistry = (0, token_user_entry_1.getTokenRegistry)(config, input.typusTokenType);
|
|
171
116
|
var d_token = tx.moveCall({
|
|
172
117
|
target: "".concat(config.package.dovSingle, "::auto_bid::withdraw_profit"),
|
|
173
118
|
typeArguments: input.typeArguments,
|
|
@@ -1,65 +1,28 @@
|
|
|
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): TOKEN;
|
|
3
|
+
export declare function assetToDecimal(asset: TOKEN): number | undefined;
|
|
4
4
|
export declare const tokenType: {
|
|
5
|
-
SUI: string;
|
|
6
5
|
MAINNET: {
|
|
7
|
-
|
|
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;
|
|
6
|
+
[key in TOKEN]: string;
|
|
36
7
|
};
|
|
37
8
|
TESTNET: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
USDC: string;
|
|
57
|
-
BLUB: string;
|
|
58
|
-
MBLUB: string;
|
|
59
|
-
TYPUS: string;
|
|
9
|
+
[key in TOKEN]: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type TOKEN = "SUI" | "CETUS" | "TURBOS" | "NAVX" | "SCA" | "DEEP" | "BLUE" | "TYPUS" | "NS" | "WAL" | "FUD" | "BLUB" | "LIQ" | "HIPPO" | "MFUD" | "MBLUB" | "MLIQ" | "BUCK" | "USDY" | "AUSD" | "USDC" | "wSOL" | "wAPT" | "wBTC" | "wETH" | "wUSDC" | "wUSDT" | "sbETH" | "sbUSDT" | "VSUI" | "HASUI" | "AFSUI" | "SPSUI" | "STSUI" | "INJ" | "JUP" | "SEI" | "sSCA" | "LBTC" | "TEXP" | "USD";
|
|
13
|
+
export declare const oracle: {
|
|
14
|
+
MAINNET: {
|
|
15
|
+
[key in TOKEN]?: string;
|
|
16
|
+
};
|
|
17
|
+
TESTNET: {
|
|
18
|
+
[key in TOKEN]?: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const tokenRegistry: {
|
|
22
|
+
MAINNET: {
|
|
23
|
+
[key in TOKEN]?: string;
|
|
24
|
+
};
|
|
25
|
+
TESTNET: {
|
|
26
|
+
[key in TOKEN]?: string;
|
|
60
27
|
};
|
|
61
28
|
};
|
|
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;
|