@typus/typus-sdk 1.6.7 → 1.6.9

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.
@@ -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,63 +1,28 @@
1
1
  export declare function typeArgsToAssets(typeArgs: string[]): string[];
2
- export declare function typeArgToAsset(typeArg: string): string;
3
- export declare function assetToDecimal(asset: string): number | undefined;
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
- 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;
6
+ [key in TOKEN]: string;
34
7
  };
35
8
  TESTNET: {
36
- SUI: string;
37
- CETUS: string;
38
- BUCK: string;
39
- SOL: string;
40
- TURBOS: string;
41
- APT: string;
42
- FUD: string;
43
- MFUD: string;
44
- USDT: string;
45
- AFSUI: string;
46
- INJ: string;
47
- SEI: string;
48
- USDY: string;
49
- TEXP: string;
50
- SCA: string;
51
- BTC: string;
52
- ETH: string;
53
- wUSDC: string;
54
- USDC: string;
55
- BLUB: string;
56
- MBLUB: string;
57
- 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" | "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;
58
27
  };
59
28
  };
60
- 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";
61
- export declare function typeArgToToken(typeArg: string): string;
62
- export declare function tokenTypeToAsset(env: 'MAINNET' | 'TESTNET', tokenAddress: string): string | undefined;
63
- export declare function assetToTokenType(env: 'MAINNET' | 'TESTNET', token: string): string;