@typus/typus-sdk 1.6.7 → 1.6.8

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" | "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;
@@ -1,39 +1,9 @@
1
1
  "use strict";
2
- var __values = (this && this.__values) || function(o) {
3
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
- if (m) return m.call(o);
5
- if (o && typeof o.length === "number") return {
6
- next: function () {
7
- if (o && i >= o.length) o = void 0;
8
- return { value: o && o[i++], done: !o };
9
- }
10
- };
11
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
- };
13
- var __read = (this && this.__read) || function (o, n) {
14
- var m = typeof Symbol === "function" && o[Symbol.iterator];
15
- if (!m) return o;
16
- var i = m.call(o), r, ar = [], e;
17
- try {
18
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
- }
20
- catch (error) { e = { error: error }; }
21
- finally {
22
- try {
23
- if (r && !r.done && (m = i["return"])) m.call(i);
24
- }
25
- finally { if (e) throw e.error; }
26
- }
27
- return ar;
28
- };
29
2
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.tokenType = void 0;
3
+ exports.tokenRegistry = exports.oracle = exports.tokenType = void 0;
31
4
  exports.typeArgsToAssets = typeArgsToAssets;
32
5
  exports.typeArgToAsset = typeArgToAsset;
33
6
  exports.assetToDecimal = assetToDecimal;
34
- exports.typeArgToToken = typeArgToToken;
35
- exports.tokenTypeToAsset = tokenTypeToAsset;
36
- exports.assetToTokenType = assetToTokenType;
37
7
  var utils_1 = require("@mysten/sui/utils");
38
8
  function typeArgsToAssets(typeArgs) {
39
9
  var assets = typeArgs.map(function (x) { return typeArgToAsset(x); });
@@ -41,66 +11,160 @@ function typeArgsToAssets(typeArgs) {
41
11
  }
42
12
  function typeArgToAsset(typeArg) {
43
13
  var typeArgs = typeArg.split("::");
44
- switch ((0, utils_1.normalizeSuiAddress)(typeArgs[0])) {
45
- case "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55":
46
- return "VSUI";
47
- case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881":
48
- return "WBTC";
49
- case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5":
50
- return "WETH";
51
- case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
52
- return "WSOL";
53
- case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
54
- return "wUSDC";
55
- case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c":
56
- return "USDT";
57
- case "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a":
14
+ switch ("".concat((0, utils_1.normalizeSuiAddress)(typeArgs[0]), "::").concat(typeArgs[1], "::").concat(typeArgs[2])) {
15
+ // native
16
+ // SUI
17
+ case "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI":
18
+ return "SUI";
19
+ // CETUS
20
+ case "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS": // MAINNET
21
+ case "0xb69a412ba4b22137088183da5e5042d37ba17580897884f00f959d4135d3e1a7::cetus::CETUS": // TESTNET
22
+ return "CETUS";
23
+ // TURBOS
24
+ case "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS": // MAINNET
25
+ case "0xebc68999f399a5ba121f8e59c0940eaa0e074e30454403357b93b25af9f30117::turbos::TURBOS": // TESTNET
58
26
  return "TURBOS";
59
- case "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37":
60
- return "APT";
61
- case "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1":
62
- return "FUD";
63
- case "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc":
64
- return "AFSUI";
65
- case "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6":
27
+ // NAVX
28
+ case "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX":
29
+ return "NAVX";
30
+ // SCA
31
+ case "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA": // MAINNET
32
+ case "0xd33ea459d9e667c112f5168464a885a654d7bc3fd6903720aaa8cf495a32a77e::sca::SCA": // TESTNET
66
33
  return "SCA";
67
- case "0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb":
68
- return "USDY";
69
- case "0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b":
34
+ // DEEP
35
+ case "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP":
36
+ return "DEEP";
37
+ // BLUE
38
+ case "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE":
39
+ return "BLUE";
40
+ // TYPUS
41
+ case "0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS": // MAINNET
42
+ case "0xaded0918624ba1a31a9818ae73ccb557d46f35cb0d754b34597356ce38e6004d::typus::TYPUS": // TESTNET
43
+ return "TYPUS";
44
+ // NS
45
+ case "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS": // MAINNET
46
+ case "0xac39f86c22c0924d066454873f801b3a338791846ae8c5fd8259a9719b36f2aa::ns::NS": // TESTNET
47
+ return "NS";
48
+ // meme
49
+ // FUD
50
+ case "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD": // MAINNET
51
+ case "0x461efa7ee5aa1b27e44450d79e2104e7fc0991461e9eb1c2a3fc1f44cd554856::fud::FUD": // TESTNET
52
+ return "FUD";
53
+ // MFUD
54
+ case "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d::mfud::MFUD": // MAINNET
55
+ case "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c::mfud::MFUD": // TESTNET
56
+ return "MFUD";
57
+ // BLUB
58
+ case "0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB": // MAINNET
59
+ case "0x94b8f6dcceeb2be160f6837089cc7502458f4f070fa0814380737acb0c41fd5b::BLUB::BLUB": // TESTNET
60
+ return "BLUB";
61
+ // MBLUB
62
+ case "0x494e1772851793ed39e2aee9990740fe3fc4d50476572b6192adea9268e8b40c::mblub::MBLUB": // MAINNET
63
+ case "0x4b5d0a097ee8a309a89bb2bc589403a4a9a39de639d576495b697be2a60f69bb::mblub::MBLUB": // TESTNET
64
+ return "MBLUB";
65
+ // LIQ
66
+ case "0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2::liq::LIQ":
67
+ return "LIQ";
68
+ // MLIQ
69
+ case "0x9614657c9d7e8799be4f49781ef1a9247b83ee178976df6c92d29b6026b9dadf::mliq::MLIQ":
70
+ return "MLIQ";
71
+ // HIPPO
72
+ case "0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b::sudeng::SUDENG":
70
73
  return "HIPPO";
71
- case "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf":
72
- return "sSUI";
73
- case "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e":
74
+ // native USD
75
+ // BUCK
76
+ case "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK": // MAINNET
77
+ case "0x879cd4804fe865897090e26eceb9f7a7cfda7dda1b2529a81631fa567e67375c::buck::BUCK": // TESTNET
78
+ return "BUCK";
79
+ // USDY
80
+ case "0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY": // MAINNET
81
+ case "0x579809c614d4388ed821c9f304bb741715cdf4a718707eb7c6fcf7b7189870ef::usdy::USDY": // TESTNET
82
+ return "USDY";
83
+ // AUSD
84
+ case "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD": // MAINNET
85
+ case "0x087653e9ffcc8ffe85e0e20523388aa27af2a5997ae64224444f0d98a2ba8279::ausd::AUSD": // TESTNET
86
+ return "AUSD";
87
+ // USDC
88
+ case "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC": // MAINNET
89
+ case "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC": // TESTNET
90
+ return "USDC";
91
+ // wormhole bridge
92
+ // wBTC
93
+ case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN": // MAINNET
94
+ case "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::btc::BTC": // TESTNET
95
+ return "wBTC";
96
+ // wETH
97
+ case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN": // MAINNET
98
+ case "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::eth::ETH": // TESTNET
99
+ return "wETH";
100
+ // wUSDC
101
+ case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN": // MAINNET
102
+ case "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::usdc::USDC": // TESTNET
103
+ return "wUSDC";
104
+ // wUSDT
105
+ case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN": // MAINNET
106
+ case "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT": // TESTNET
107
+ return "wUSDT";
108
+ // wSOL
109
+ case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN": // MAINNET
110
+ case "0x879cd4804fe865897090e26eceb9f7a7cfda7dda1b2529a81631fa567e67375c::sol::SOL": // TESTNET
111
+ return "wSOL";
112
+ // wAPT
113
+ case "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN": // MAINNET
114
+ case "0xdede697a5748d20ebff2aabf3f2fd5bd9e41afb1a624b636cddc6df69078bd22::apt::APT": // TESTNET
115
+ return "wAPT";
116
+ // native bridge
117
+ // sbETH
118
+ case "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH":
119
+ return "sbETH";
120
+ // sbUSDT
121
+ case "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT":
122
+ return "sbUSDT";
123
+ // LST
124
+ // VSUI
125
+ case "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT":
126
+ return "VSUI";
127
+ // HASUI
128
+ case "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI":
129
+ return "HASUI";
130
+ // AFSUI
131
+ case "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI": // MAINNET
132
+ case "0xd31923b6821fb7ba32d23e514b43d307da6ef991f9ef1af2cc4e26a0992ac87a::afsui::AFSUI": // TESTNET
133
+ return "AFSUI";
134
+ // SPSUI
135
+ case "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI":
136
+ return "SPSUI";
137
+ // STSUI
138
+ case "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI":
139
+ return "STSUI";
140
+ // INJ
141
+ case "0xcac46c81bbe1e516c65f4c3e5da81e7092cc2e70218deafb31f1c8d5fcc9dae3::inj::INJ": // MAINNET
142
+ case "0xfd3d56e007e3ae44d74b6a6840de0bd04a3724360abd89ae683ca7d592bbb49e::inj::INJ": // TESTNET
143
+ return "INJ";
144
+ // JUP
145
+ case "0x3dc8710253682b53706bd110d51fd9b298d5bb923b535fb7bca88e049208c508::jup::JUP": // MAINNET
146
+ return "JUP";
147
+ // SEI
148
+ case "0xcac46c81bbe1e516c65f4c3e5da81e7092cc2e70218deafb31f1c8d5fcc9dae3::sei::SEI": // MAINNET
149
+ case "0xfd3d56e007e3ae44d74b6a6840de0bd04a3724360abd89ae683ca7d592bbb49e::sei::SEI": // TESTNET
150
+ return "SEI";
151
+ // sSCA
152
+ case "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA":
74
153
  return "sSCA";
75
- case "0x0000000000000000000000000000000000000000000000000000000000000002":
76
- return "SUI";
77
- case "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519":
78
- if (typeArgs[1] === "usdc") {
79
- return "wUSDC";
80
- }
81
- else if (typeArgs[1] === "btc") {
82
- return "WBTC";
83
- }
84
- else if (typeArgs[1] === "eth") {
85
- return "WETH";
86
- }
154
+ // TEXP
155
+ case "0x37816d28c34cc0df82655ca97b3f066112a5f3c202cbb4aaa76c8af54e779750::tails_exp::TAILS_EXP":
156
+ return "TEXP";
157
+ // USD
158
+ case "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::trading::USD":
159
+ return "USD";
87
160
  default:
88
- if (typeArgs[2] == "BTC") {
89
- return "WBTC";
90
- }
91
- else if (typeArgs[2] == "ETH") {
92
- return "WETH";
93
- }
94
- else if (typeArgs[2] == "SOL") {
95
- return "WSOL";
96
- }
97
- return typeArgs[2];
161
+ throw new Error("Unknown typeArg: ".concat(typeArg));
98
162
  }
99
163
  }
100
164
  function assetToDecimal(asset) {
101
165
  switch (asset) {
102
166
  case "SUI":
103
- case "sSUI":
167
+ case "SPSUI":
104
168
  case "CETUS":
105
169
  case "TURBOS":
106
170
  case "BUCK":
@@ -113,21 +177,21 @@ function assetToDecimal(asset) {
113
177
  case "TYPUS":
114
178
  case "BLUE":
115
179
  case "sSCA":
180
+ case "STSUI":
116
181
  return 9;
117
- case "BTC":
118
- case "WBTC":
119
- case "ETH":
120
- case "WETH":
121
- case "SOL":
122
- case "WSOL":
123
- case "APT":
182
+ case "wBTC":
183
+ case "sbETH":
184
+ case "wETH":
185
+ case "wSOL":
186
+ case "wAPT":
124
187
  case "INJ":
125
188
  case "SEI":
126
189
  case "JUP":
127
190
  return 8;
128
191
  case "USDC":
129
192
  case "wUSDC":
130
- case "USDT":
193
+ case "wUSDT":
194
+ case "sbUSDT":
131
195
  case "USDY":
132
196
  case "AUSD":
133
197
  case "DEEP":
@@ -135,6 +199,7 @@ function assetToDecimal(asset) {
135
199
  case "MLIQ":
136
200
  case "MFUD":
137
201
  case "MBLUB":
202
+ case "NS":
138
203
  return 6;
139
204
  case "FUD":
140
205
  return 5;
@@ -143,18 +208,17 @@ function assetToDecimal(asset) {
143
208
  }
144
209
  }
145
210
  exports.tokenType = {
146
- SUI: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
147
211
  MAINNET: {
148
212
  SUI: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
149
- BTC: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",
150
- ETH: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
213
+ wBTC: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",
214
+ wETH: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
151
215
  wUSDC: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
152
- USDT: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
216
+ wUSDT: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
217
+ wSOL: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",
218
+ wAPT: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",
153
219
  CETUS: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
154
220
  BUCK: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",
155
- SOL: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",
156
221
  TURBOS: "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS",
157
- APT: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",
158
222
  FUD: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
159
223
  MFUD: "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d::mfud::MFUD",
160
224
  INJ: "0xcac46c81bbe1e516c65f4c3e5da81e7092cc2e70218deafb31f1c8d5fcc9dae3::inj::INJ",
@@ -172,92 +236,130 @@ exports.tokenType = {
172
236
  MLIQ: "9614657c9d7e8799be4f49781ef1a9247b83ee178976df6c92d29b6026b9dadf::mliq::MLIQ",
173
237
  BLUE: "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE",
174
238
  TYPUS: "0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS",
239
+ DEEP: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
240
+ BLUB: "0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB",
241
+ MBLUB: "0x494e1772851793ed39e2aee9990740fe3fc4d50476572b6192adea9268e8b40c::mblub::MBLUB",
242
+ AUSD: "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD",
243
+ USDC: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
244
+ sbETH: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH",
245
+ sbUSDT: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
246
+ SPSUI: "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI",
247
+ sSCA: "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",
248
+ USD: "",
249
+ STSUI: "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",
250
+ NS: "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS",
175
251
  },
176
252
  TESTNET: {
177
253
  SUI: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
178
254
  CETUS: "0xb69a412ba4b22137088183da5e5042d37ba17580897884f00f959d4135d3e1a7::cetus::CETUS",
179
255
  BUCK: "0x879cd4804fe865897090e26eceb9f7a7cfda7dda1b2529a81631fa567e67375c::buck::BUCK",
180
- SOL: "0x879cd4804fe865897090e26eceb9f7a7cfda7dda1b2529a81631fa567e67375c::sol::SOL",
256
+ wSOL: "0x879cd4804fe865897090e26eceb9f7a7cfda7dda1b2529a81631fa567e67375c::sol::SOL",
181
257
  TURBOS: "0xebc68999f399a5ba121f8e59c0940eaa0e074e30454403357b93b25af9f30117::turbos::TURBOS",
182
- APT: "0xdede697a5748d20ebff2aabf3f2fd5bd9e41afb1a624b636cddc6df69078bd22::apt::APT",
258
+ wAPT: "0xdede697a5748d20ebff2aabf3f2fd5bd9e41afb1a624b636cddc6df69078bd22::apt::APT",
183
259
  FUD: "0x461efa7ee5aa1b27e44450d79e2104e7fc0991461e9eb1c2a3fc1f44cd554856::fud::FUD",
184
260
  MFUD: "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c::mfud::MFUD",
185
- USDT: "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT",
261
+ wUSDT: "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT",
186
262
  AFSUI: "0xd31923b6821fb7ba32d23e514b43d307da6ef991f9ef1af2cc4e26a0992ac87a::afsui::AFSUI",
187
263
  INJ: "0xfd3d56e007e3ae44d74b6a6840de0bd04a3724360abd89ae683ca7d592bbb49e::inj::INJ",
188
264
  SEI: "0xfd3d56e007e3ae44d74b6a6840de0bd04a3724360abd89ae683ca7d592bbb49e::sei::SEI",
189
265
  USDY: "0x579809c614d4388ed821c9f304bb741715cdf4a718707eb7c6fcf7b7189870ef::usdy::USDY",
190
266
  TEXP: "0x9b43ee208a3b235810c145bca1161d1a71d08bfe76b1e55bb3db319ea95d0149::tails_exp::TAILS_EXP",
191
267
  SCA: "0xd33ea459d9e667c112f5168464a885a654d7bc3fd6903720aaa8cf495a32a77e::sca::SCA",
192
- BTC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::btc::BTC",
193
- ETH: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::eth::ETH",
268
+ wBTC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::btc::BTC",
269
+ wETH: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::eth::ETH",
194
270
  wUSDC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::usdc::USDC",
195
271
  USDC: "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC",
196
272
  BLUB: "0x94b8f6dcceeb2be160f6837089cc7502458f4f070fa0814380737acb0c41fd5b::blub::BLUB",
197
273
  MBLUB: "0x4b5d0a097ee8a309a89bb2bc589403a4a9a39de639d576495b697be2a60f69bb::mblub::MBLUB",
198
274
  TYPUS: "0xaded0918624ba1a31a9818ae73ccb557d46f35cb0d754b34597356ce38e6004d::typus::TYPUS",
275
+ NAVX: "",
276
+ DEEP: "",
277
+ BLUE: "",
278
+ LIQ: "",
279
+ HIPPO: "",
280
+ MLIQ: "",
281
+ AUSD: "0x087653e9ffcc8ffe85e0e20523388aa27af2a5997ae64224444f0d98a2ba8279::ausd::AUSD",
282
+ sbETH: "",
283
+ sbUSDT: "",
284
+ VSUI: "",
285
+ HASUI: "",
286
+ SPSUI: "",
287
+ JUP: "",
288
+ sSCA: "",
289
+ USD: "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::trading::USD",
290
+ STSUI: "",
291
+ NS: "0xac39f86c22c0924d066454873f801b3a338791846ae8c5fd8259a9719b36f2aa::ns::NS",
292
+ },
293
+ };
294
+ exports.oracle = {
295
+ MAINNET: {
296
+ SUI: "0x0a318f26fcf35922a8671a2d843872a7a25ac10b678bdee52f10fbc77140c0d0",
297
+ USDC: "0x749d80ae01f8accf80100438bea507bba8294f41b9a0d958503341dda0433833",
298
+ wUSDT: "0x9912f1b7a53b8d41b7c49b8ccba9ed7cef4b0aa485d6be6101d53fe4d48dc236",
299
+ wBTC: "0xa44a2db4812b5e0591661d1ade0bbce5b1944960aba6547469734dbbc1f1b9a2",
300
+ wETH: "0xd873a1c00439e5f6915c4d9e0c52683d6a277a3d0e4e915f817d21632430da0b",
301
+ wSOL: "0x1bdb5e4bd7dfc96922ad932606eccdd715c08fc95735b0f67b6b3174179d30cc",
302
+ CETUS: "0x58630809649d34da76311b8c495e3e11cba9dbbe2a22eeb8c0acca2231405c61",
303
+ TURBOS: "0xe7a30c988f7151c3de432f410db14373fe6a54631f61e82e4015b919f4ad37e8",
304
+ SCA: "0x591fe9aaf5f8bd9d090b1d9aa00a2fc3f702ed4a13aec796bf3912cccfd7d5f4",
305
+ SEI: "0x08fa570a1913ba984d35bad78f4045c078b9ec1719dba106708c98073bd04b2f",
306
+ INJ: "0x12e538aafaf9ced7aa0135d472eb7aed21cea1c6d74d27d49898ee97fd9deaa4",
307
+ AFSUI: "0xe231551833a99abcaa9ae773554a1e2874a94df8b680b1788937149027249b37",
308
+ MFUD: "0xbd7066b793fcaa4f863e78790f7e61b22e6cda90cc558f28252db0c911f3db5b",
309
+ MBLUB: "0x29a9fb48d7f3e07e297ec6fe4421a2a997472db18728a279112757dd6e273a8f",
310
+ JUP: "0xb4efb2d9ce05eb62c45675b5605209e3255581507f82b37587039c100a6e9ba3",
311
+ NAVX: "0xf7521d43dca7032a72d45b8c56a0ee3bf1ac79ec2a7f2be0bbd7ec21c38dd8b1",
312
+ HASUI: "0x371c329d6111c145f159e3febd25001b79dd816a677cc4562beeceaafbac7889",
313
+ VSUI: "0xf734959989487f8aad20b3bbb3d6b0241b910a298e1903b169cf43c0644d8879",
314
+ DEEP: "0x5c021fb380ee5530ea4e979fe684beca0567c58a739b8e9bf29121cd0a490fcf",
315
+ BLUE: "0x5cb674306348b7fbbb5cefb4b9d085727ce81ef736eeb3caa09f780677767eb6",
316
+ TYPUS: "0xede73f9eea4e6685a096403955b535e826274f83841be1c7d9f836c5e9564a42",
317
+ NS: "0xfae12d4846bbf638efd477108df78c4823425a2c79395d16653eba455c485447",
318
+ },
319
+ TESTNET: {
320
+ SUI: "0x9083c9ce1a1eef569bb1a8b31dfa5e0fce2e05887e68ba79ca6ae522acd041f3",
321
+ USDC: "0xb2c06a7b3831c92193c978ee225cac87500b8d858bcc853b6bf81d055886f057",
322
+ wUSDC: "0xa547855d0e0579dfa38b0b83fc5ff55746c4bc629363920ba84aef7c1e70a818",
323
+ wUSDT: "0x5c1b997c58ab64151e7f114f6a5c8b966aed871a06b3eb0730cf79822e894323",
324
+ wBTC: "0xc4ae30a21401fa66dc095ec7947d392cbabb7777f470b37d7c73b30574a614a7",
325
+ wETH: "0x1c36306a416d08895b6cdc64467c8987b1c1c88c0b46645c252b4c7b635586b1",
326
+ wSOL: "0x24372c35d30c6187d2377af195627d4ad9ed2acc195d8830b819d47312982011",
327
+ CETUS: "0xa4a561eb803df50be1633ab2fea597991ccb3cf35f0aac849f8742e54bd4ea9e",
328
+ TURBOS: "0xc811467327673c231815e26e7a139fb0acb8238441d341cbc3dbf556eeeefcc2",
329
+ SCA: "0xff5e6420079d2ea8b89e487bbe5ea0cbe2721fcf4391fa22b10302c8e2b45a3c",
330
+ SEI: "0x8143fba1105a0015680c7a7719193fedd9826972494a946f660fe3791a6f7e12",
331
+ INJ: "0xef20f3562324e8c408949a14bc7f5a37e8ce639aeaed80f07fd3552b0130bac8",
332
+ AFSUI: "0x03dd52c8b773e5d3886608efda6fa430774f12196aa349d989dde5c3636e49f9",
333
+ MFUD: "0x54f153e45008fcb7e2adf781d750f1bcbcd85e72bec6df769b6fe3e1ad6c02e4",
334
+ MBLUB: "0x826253a1dde9907e28f465df8b2a19ba5994b4b069abad98658532785940338a",
335
+ TYPUS: "0x73bb8651018bced7e737557fc9e4a7cf02ae28345b645566d0fd4df2da183048",
336
+ NS: "0x4481ebc6a26ac72abb9ecbedba60fcba87440f1306c125c1bdf61d1248af4482",
337
+ },
338
+ };
339
+ exports.tokenRegistry = {
340
+ MAINNET: {
341
+ MFUD: "0xb8d7e7ab783e56700c0212bd9f0938bba9dd3e7241c149e6c52b21334ec45ece",
342
+ MBLUB: "0x37c31cfd324a8fdafc6dff5a083822c65b360c9dc04e2b6c4453f051754c7c3a",
343
+ MLIQ: "0x70acdb4a2978d2d99edf9ce0297e34e314cd097fd243a7ddbc00af1eb77f2454",
344
+ },
345
+ TESTNET: {
346
+ wBTC: "0xcf5184b85f47cb1ffe421249e48b2cd34807534e1a4b4ad384009295bbbd3bf4",
347
+ wETH: "0x5cd3726a1d1ef32bffaaeb2ec4964f0ffac56cfb919f7d13d4672aed5059bfa1",
348
+ wSOL: "0x1186a198ebd006e4f444ff88334307d6b376c02a040cfdad380ca06090f52472",
349
+ wAPT: "0xf8d1edd32c4847c6d2c0e5fbf61291ae393092540e5e0723e7c6cf52089d670f",
350
+ wUSDT: "0xc0bd93d1c77ff19bef3f3cd55564aa55acb46cbcc77905d2fa4893ac16cffea7",
351
+ wUSDC: "0xf7df3c68a7d3ffc54065565c94a9fa3f5342957340bce78be74373846241a833",
352
+ CETUS: "0x24a7a5297a3656ebea71ed72a4974a7710943d9a598fda60fe60b44262da9f27",
353
+ BUCK: "0x441cf46a499c6e4d0560c4c9000351f34a928e53018d65857a1591ca1aa2bd58",
354
+ TURBOS: "0x45179ff4beedfc94c29044081f3722d34ba36813b99d416bb868d1769a85bb57",
355
+ FUD: "0x694d47bedc6a80b405fc5c1051f065e33b2a3c5f7b79f76cb2905233b2a8c885",
356
+ AFSUI: "0xfee32f5338f70a782f25fabf7fa934130b43715ad6fa2aefbf91305c825c3e23",
357
+ INJ: "0xcfd839650442dce7ec74b2c2b2f0c5ee0d8fe1bc542d1c71062ae34192c4514c",
358
+ SEI: "0x2b2015fa8cad497e9673734d66ac66f411dadf2ee11be6d370ab8418331c0132",
359
+ SCA: "0xdb322211ad67d01232dc296fc9a1dae89fcf6188b1e6cf16e7a48e4061d23b78",
360
+ BLUB: "0xd470dbb74ae3f4cea5b39f1edaf729145fcdc8da023c81346fce1c1de046e6e4",
361
+ AUSD: "0xd87ea623f4f2635d66f59d7defaeb96e0147e0cdd8f5406756433d8d8849f785",
362
+ MFUD: "0x7ad87901531693f1baa541712947860dcc543617e11b14993ad70d20daf159c6",
363
+ MBLUB: "0x7c36d8c1b2b569676d9a3f4c73487ec49b483111cc0abf4b0d5654e026ac3d3a",
199
364
  },
200
365
  };
201
- function typeArgToToken(typeArg) {
202
- // console.log(typeArg);
203
- var typeArgs = typeArg.split("::");
204
- switch ((0, utils_1.normalizeSuiAddress)(typeArgs[0])) {
205
- case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881":
206
- return "BTC";
207
- case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5":
208
- return "ETH";
209
- case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
210
- return "SOL";
211
- case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
212
- return "wUSDC";
213
- case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c":
214
- return "USDT";
215
- case "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a":
216
- return "TURBOS";
217
- case "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37":
218
- return "APT";
219
- case "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1":
220
- return "FUD";
221
- case "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc":
222
- return "AFSUI";
223
- case "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6":
224
- return "SCA";
225
- case "0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb":
226
- return "USDY";
227
- case "0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2":
228
- return "LIQ";
229
- case "0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b":
230
- return "HIPPO";
231
- case "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270":
232
- return "DEEP";
233
- case "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca":
234
- return "BLUE";
235
- default:
236
- return typeArgs[2];
237
- }
238
- }
239
- function tokenTypeToAsset(env, tokenAddress) {
240
- var e_1, _a;
241
- var normalizedTokenAddress = (0, utils_1.normalizeSuiAddress)(tokenAddress);
242
- var tokens = exports.tokenType[env];
243
- try {
244
- for (var _b = __values(Object.entries(tokens)), _c = _b.next(); !_c.done; _c = _b.next()) {
245
- var _d = __read(_c.value, 2), token = _d[0], address = _d[1];
246
- if (address === normalizedTokenAddress) {
247
- return token;
248
- }
249
- }
250
- }
251
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
252
- finally {
253
- try {
254
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
255
- }
256
- finally { if (e_1) throw e_1.error; }
257
- }
258
- // not found => return undefined
259
- return undefined;
260
- }
261
- function assetToTokenType(env, token) {
262
- return exports.tokenType[env][token];
263
- }
@@ -1,5 +1,6 @@
1
1
  import { EventId, SuiClient, SuiEvent } from "@mysten/sui/client";
2
2
  import { Vault } from "../../../src/typus-dov-single-v2";
3
+ import { TOKEN } from "../../../src/constants";
3
4
  export { getNewBidFromSentio, getExerciseFromSentio } from "../../../src/utils/api/sentio/events";
4
5
  export declare function getUserEvents(provider: SuiClient, sender: string, cursor?: EventId | null): Promise<[SuiEvent[], EventId | null | undefined]>;
5
6
  export declare function getAutoBidEvents(provider: SuiClient, originPackage: string, startTimeMs: number): Promise<SuiEvent[]>;
@@ -20,7 +21,7 @@ export declare function parseTxHistory(datas: Array<any>, vaults: {
20
21
  }): Promise<Array<TxHistory>>;
21
22
  export declare function parseVaultInfo(vaults: {
22
23
  [key: string]: Vault;
23
- }, Index: string, action: string): (string | undefined)[];
24
+ }, Index: string, action: string): [string | undefined, string | undefined, string | undefined, TOKEN | undefined, TOKEN | undefined, TOKEN | undefined];
24
25
  export declare function getDepositorCashFlows(userHistory: TxHistory[]): Map<string, DepositorCashFlow>;
25
26
  export interface DepositorCashFlow {
26
27
  D_TOKEN: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
2
  import { TypusConfig } from "../../src/utils";
3
+ export declare function getTokenRegistry(config: TypusConfig, typusTokenType: string): string;
3
4
  export declare function getTokenRaiseFundTx(config: TypusConfig, tx: Transaction, input: {
4
5
  typeArguments: string[];
5
6
  typusTokenType: string;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTokenRegistry = getTokenRegistry;
3
4
  exports.getTokenRaiseFundTx = getTokenRaiseFundTx;
4
5
  exports.getTokenReduceFundTx = getTokenReduceFundTx;
5
6
  exports.getTokenNewBidTx = getTokenNewBidTx;
@@ -7,22 +8,26 @@ exports.getTokenExerciseTx = getTokenExerciseTx;
7
8
  exports.getTokenRebateTx = getTokenRebateTx;
8
9
  exports.getTokenCompoundWithRedeemTx = getTokenCompoundWithRedeemTx;
9
10
  var constants_1 = require("../../src/constants");
10
- function getTokenRaiseFundTx(config, tx, input) {
11
+ function getTokenRegistry(config, typusTokenType) {
11
12
  var typusTokenRegistry = "";
12
- switch (input.typusTokenType.split("::")[1]) {
13
+ switch (typusTokenType.split("::")[1]) {
13
14
  case "mfud":
14
- typusTokenRegistry = config.registry.token.mfud;
15
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MFUD;
15
16
  break;
16
17
  case "mblub":
17
- typusTokenRegistry = config.registry.token.mblub;
18
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MBLUB;
18
19
  break;
19
20
  case "mliq":
20
- typusTokenRegistry = config.registry.token.mliq;
21
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MLIQ;
21
22
  break;
22
23
  default:
23
24
  console.log("No such token exists!");
24
25
  break;
25
26
  }
27
+ return typusTokenRegistry;
28
+ }
29
+ function getTokenRaiseFundTx(config, tx, input) {
30
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
26
31
  var typusTokenBalance = input.raiseCoins.length > 0
27
32
  ? tx.moveCall({
28
33
  target: "0x2::coin::into_balance",
@@ -66,21 +71,7 @@ function getTokenRaiseFundTx(config, tx, input) {
66
71
  return tx;
67
72
  }
68
73
  function getTokenReduceFundTx(config, tx, input) {
69
- var typusTokenRegistry = "";
70
- switch (input.typusTokenType.split("::")[1]) {
71
- case "mfud":
72
- typusTokenRegistry = config.registry.token.mfud;
73
- break;
74
- case "mblub":
75
- typusTokenRegistry = config.registry.token.mblub;
76
- break;
77
- case "mliq":
78
- typusTokenRegistry = config.registry.token.mliq;
79
- break;
80
- default:
81
- console.log("No such token exists!");
82
- break;
83
- }
74
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
84
75
  var result = tx.moveCall({
85
76
  target: "".concat(config.package.dovSingle, "::tds_user_entry::public_reduce_fund"),
86
77
  typeArguments: input.typeArguments,
@@ -166,21 +157,7 @@ function getTokenReduceFundTx(config, tx, input) {
166
157
  return tx;
167
158
  }
168
159
  function getTokenNewBidTx(config, tx, input) {
169
- var typusTokenRegistry = "";
170
- switch (input.typusTokenType.split("::")[1]) {
171
- case "mfud":
172
- typusTokenRegistry = config.registry.token.mfud;
173
- break;
174
- case "mblub":
175
- typusTokenRegistry = config.registry.token.mblub;
176
- break;
177
- case "mliq":
178
- typusTokenRegistry = config.registry.token.mliq;
179
- break;
180
- default:
181
- console.log("No such token exists!");
182
- break;
183
- }
160
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
184
161
  var mToken = tx.moveCall({
185
162
  target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
186
163
  arguments: [
@@ -213,21 +190,7 @@ function getTokenNewBidTx(config, tx, input) {
213
190
  return tx;
214
191
  }
215
192
  function getTokenExerciseTx(config, tx, input) {
216
- var typusTokenRegistry = "";
217
- switch (input.typusTokenType.split("::")[1]) {
218
- case "mfud":
219
- typusTokenRegistry = config.registry.token.mfud;
220
- break;
221
- case "mblub":
222
- typusTokenRegistry = config.registry.token.mblub;
223
- break;
224
- case "mliq":
225
- typusTokenRegistry = config.registry.token.mliq;
226
- break;
227
- default:
228
- console.log("No such token exists!");
229
- break;
230
- }
193
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
231
194
  var result = tx.moveCall({
232
195
  target: "".concat(config.package.dovSingle, "::tds_user_entry::exercise"),
233
196
  typeArguments: input.typeArguments,
@@ -253,21 +216,7 @@ function getTokenExerciseTx(config, tx, input) {
253
216
  return tx;
254
217
  }
255
218
  function getTokenRebateTx(config, tx, input) {
256
- var typusTokenRegistry = "";
257
- switch (input.typusTokenType.split("::")[1]) {
258
- case "mfud":
259
- typusTokenRegistry = config.registry.token.mfud;
260
- break;
261
- case "mblub":
262
- typusTokenRegistry = config.registry.token.mblub;
263
- break;
264
- case "mliq":
265
- typusTokenRegistry = config.registry.token.mliq;
266
- break;
267
- default:
268
- console.log("No such token exists!");
269
- break;
270
- }
219
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
271
220
  var result = tx.moveCall({
272
221
  target: "".concat(config.package.dovSingle, "::tds_user_entry::rebate"),
273
222
  typeArguments: [input.typeArgument],
@@ -124,7 +124,7 @@ export declare function getTransferBidReceiptTx(config: TypusConfig, tx: Transac
124
124
  export declare function getSplitBidReceiptTx(config: TypusConfig, tx: Transaction, input: {
125
125
  index: string;
126
126
  receipts: string[];
127
- share: string;
127
+ share?: string;
128
128
  recipient: string;
129
129
  }): import("@mysten/sui/transactions").TransactionResult;
130
130
  export declare function getMultiTransferBidReceiptTx(config: TypusConfig, input: {
@@ -26,7 +26,6 @@ exports.getSplitBidReceiptTx = getSplitBidReceiptTx;
26
26
  exports.getMultiTransferBidReceiptTx = getMultiTransferBidReceiptTx;
27
27
  exports.getRebateTx = getRebateTx;
28
28
  exports.getCompoundWithRedeemTx = getCompoundWithRedeemTx;
29
- var bcs_1 = require("@mysten/sui/bcs");
30
29
  var transactions_1 = require("@mysten/sui/transactions");
31
30
  var constants_1 = require("../../src/constants");
32
31
  var utils_1 = require("../../src/utils");
@@ -295,8 +294,7 @@ function getSplitBidReceiptTx(config, tx, input) {
295
294
  type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
296
295
  elements: input.receipts.map(function (receipt) { return tx.object(receipt); }),
297
296
  }),
298
- // tx.pure([input.share]),
299
- tx.pure(bcs_1.bcs.vector(bcs_1.bcs.U64).serialize([input.share])),
297
+ tx.pure.option("u64", input.share),
300
298
  ],
301
299
  });
302
300
  var unwrap0 = tx.moveCall({
@@ -304,12 +302,11 @@ function getSplitBidReceiptTx(config, tx, input) {
304
302
  typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
305
303
  arguments: [tx.object(result[0])],
306
304
  });
307
- var unwrap1 = tx.moveCall({
308
- target: "0x1::option::destroy_some",
309
- typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
310
- arguments: [tx.object(result[1])],
305
+ tx.moveCall({
306
+ target: "".concat(config.package.framework, "::vault::transfer_bid_receipt"),
307
+ typeArguments: [],
308
+ arguments: [tx.object(result[1]), tx.pure.address(input.recipient)],
311
309
  });
312
- tx.transferObjects([unwrap1], input.recipient);
313
310
  return unwrap0;
314
311
  }
315
312
  function getMultiTransferBidReceiptTx(config, input) {
@@ -79,7 +79,7 @@ function getReduceFundTx(config, tx, input) {
79
79
  tx.pure.u64(input.reduceFromWarmup),
80
80
  tx.pure.u64(input.reduceFromActive),
81
81
  tx.pure.u64(input.reduceFromInactive),
82
- tx.object((0, utils_1.splitCoins)(tx, constants_1.tokenType.SUI, [], input.feeAmount)),
82
+ tx.object((0, utils_1.splitCoins)(tx, constants_1.tokenType.MAINNET.SUI, [], input.feeAmount)),
83
83
  tx.object(constants_1.CLOCK),
84
84
  ],
85
85
  });
@@ -58,7 +58,7 @@ function getVaultHistorySummary(startTimestamp) {
58
58
  }
59
59
  requestData = {
60
60
  sqlQuery: {
61
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - BidderPremiumUSD as BidderPNL,\n CASE WHEN BidderPremiumUSD != 0 THEN BidderPNL / BidderPremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled, -- Average Filled Rate\n AVG(vault_history.OptionProfit) AS AverageLoss, -- Average Option Profit\n SUM(vault_history.OptionProfit) AS TotalOptionProfit, -- Total Option Profit\n AVG(CASE -- Calculating Average Drawdown, ignoring DepositAmount == 0\n WHEN vault_history.DepositAmount > 0 THEN vault_history.OptionProfit / vault_history.DepositAmount ELSE NULL\n END) AS AverageDrawdown, -- Average Drawdown (based on Option Profit and TVL)\n SUM(CASE WHEN vault_history.BidderPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS BidderWinRate, -- Calculating Bidder Win Rate (probability BidderPNL > 0)\n SUM(CASE WHEN vault_history.DepositorPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS DepositorWinRate -- Calculating Depositor Win Rate (probability DepositorPNL > 0)\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY Index ASC\n "),
61
+ sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value,\n SUM(bidder_fee) AS bidder_fee\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n (Delivery.bidder_bid_value + Delivery.bidder_fee) as BidderPremium,\n (Delivery.incentive_bid_value + Delivery.incentive_fee) as IncentivePremium,\n (safu_otc_aggregated.bidder_bid_value + safu_otc_aggregated.bidder_fee) as OtcPremium,\n (BidderPremium + IncentivePremium + OtcPremium) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n (Delivery.bidder_fee + Delivery.incentive_fee + safu_otc_aggregated.bidder_fee) * Delivery.price_b_token AS PremiumFeeUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD - PremiumFeeUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - PremiumUSD as BidderPNL,\n CASE WHEN PremiumUSD != 0 THEN BidderPNL / PremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled, -- Average Filled Rate\n AVG(vault_history.OptionProfit) AS AverageLoss, -- Average Option Profit\n SUM(vault_history.OptionProfit) AS TotalOptionProfit, -- Total Option Profit\n AVG(CASE -- Calculating Average Drawdown, ignoring DepositAmount == 0\n WHEN vault_history.DepositAmount > 0 THEN vault_history.OptionProfit / vault_history.DepositAmount ELSE NULL\n END) AS AverageDrawdown, -- Average Drawdown (based on Option Profit and TVL)\n SUM(CASE WHEN vault_history.BidderPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS BidderWinRate, -- Calculating Bidder Win Rate (probability BidderPNL > 0)\n SUM(CASE WHEN vault_history.DepositorPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS DepositorWinRate -- Calculating Depositor Win Rate (probability DepositorPNL > 0)\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY Index ASC\n "),
62
62
  size: 1000,
63
63
  },
64
64
  };
@@ -95,7 +95,7 @@ function getFilledSummary(startTimestamp) {
95
95
  }
96
96
  requestData = {
97
97
  sqlQuery: {
98
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price -- Get the most recent price before or at the hour\n FROM\n sui.coin_prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Delivery.timestamp as timestamp,\n Delivery.index as Index,\n Delivery.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Activate.deposit_balance as DepositAmount,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n VaultInfo.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Delivery\n JOIN Activate ON Delivery.index = Activate.index AND Delivery.round = Activate.round\n JOIN NewAuction ON Delivery.index = NewAuction.index AND Delivery.round = NewAuction.round\n JOIN VaultInfo ON Delivery.index = CAST(VaultInfo.id AS Decimal(76, 12))\n LEFT JOIN UpdateStrike ON Delivery.index = UpdateStrike.index AND Delivery.round = UpdateStrike.round\n LEFT JOIN safu_otc_aggregated ON Delivery.index = safu_otc_aggregated.index AND Delivery.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Delivery.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.BidderPremiumUSD) * 0.2 AS FeeUSD,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled -- Average Filled Rate\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY FeeUSD DESC\n "),
98
+ sql: "\n WITH safu_otc_aggregated AS (\n SELECT\n index,\n round,\n SUM(delivery_size) AS delivery_size\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Delivery.timestamp as timestamp,\n Delivery.index as Index,\n Delivery.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled\n FROM Delivery\n JOIN Activate ON Delivery.index = Activate.index AND Delivery.round = Activate.round\n JOIN NewAuction ON Delivery.index = NewAuction.index AND Delivery.round = NewAuction.round\n LEFT JOIN safu_otc_aggregated ON Delivery.index = safu_otc_aggregated.index AND Delivery.round = safu_otc_aggregated.round\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n SELECT\n vault_history.Index AS Index,\n AVG(vault_history.Filled) AS AverageFilled -- Average Filled Rate\n FROM vault_history\n GROUP BY Index\n ORDER BY Index DESC\n "),
99
99
  size: 1000,
100
100
  },
101
101
  };
@@ -127,7 +127,7 @@ function getVaultHistory(indices_1) {
127
127
  apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_v2/sql/execute";
128
128
  requestData = {
129
129
  sqlQuery: {
130
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price -- Get the most recent price before or at the hour\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n )\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n Activate.deposit_balance as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n (Settle.settle_balance - Settle.settled_balance) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - BidderPremiumUSD as BidderPNL,\n CASE WHEN BidderPremiumUSD != 0 THEN BidderPNL / BidderPremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n -- LEFT JOIN hourly_price_table ON LOWER(Settle.d_token) = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n WHERE Settle.index IN (".concat(indices.join(","), ")\n ORDER BY ActivationDate DESC;\n "),
130
+ sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value,\n SUM(bidder_fee) AS bidder_fee\n FROM SafuOtc\n GROUP BY index, round\n )\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n (Delivery.bidder_bid_value + Delivery.bidder_fee) as BidderPremium,\n (Delivery.incentive_bid_value + Delivery.incentive_fee) as IncentivePremium,\n (safu_otc_aggregated.bidder_bid_value + safu_otc_aggregated.bidder_fee) as OtcPremium,\n (BidderPremium + IncentivePremium + OtcPremium) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n IncentivePremium * Delivery.price_b_token AS IncentivePremiumUSD,\n (Delivery.bidder_fee + Delivery.incentive_fee + safu_otc_aggregated.bidder_fee) * Delivery.price_b_token AS PremiumFeeUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD - PremiumFeeUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - (PremiumUSD - IncentivePremiumUSD) as BidderPNL,\n CASE WHEN (PremiumUSD - IncentivePremiumUSD) != 0 THEN BidderPNL / (PremiumUSD - IncentivePremiumUSD) ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n -- LEFT JOIN hourly_price_table ON LOWER(Settle.d_token) = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n WHERE Settle.index IN (".concat(indices.join(","), ")\n ORDER BY ActivationDate DESC;\n "),
131
131
  size: limit,
132
132
  },
133
133
  };
@@ -1,43 +1,18 @@
1
+ import { TOKEN } from "../../../src/constants";
1
2
  export declare const priceIDs: {
2
3
  MAINNET: {
3
- SUI: string;
4
- USDC: string;
5
- USDT: string;
6
- BTC: string;
7
- ETH: string;
8
- SOL: string;
9
- CETUS: string;
10
- NAVX: string;
11
- SCA: string;
12
- TURBOS: string;
4
+ [key in TOKEN]?: string;
13
5
  };
14
6
  TESTNET: {
15
- SUI: string;
16
- USDC: string;
17
- wUSDC: string;
18
- USDT: string;
19
- BTC: string;
20
- ETH: string;
21
- SOL: string;
22
- CETUS: string;
23
- NAVX: string;
24
- SCA: string;
25
- TURBOS: string;
7
+ [key in TOKEN]?: string;
26
8
  };
27
9
  };
28
10
  export declare const priceInfoObjectIds: {
11
+ MAINNET: {
12
+ [key in TOKEN]?: string;
13
+ };
29
14
  TESTNET: {
30
- SUI: string;
31
- USDC: string;
32
- wUSDC: string;
33
- USDT: string;
34
- BTC: string;
35
- ETH: string;
36
- SOL: string;
37
- CETUS: string;
38
- NAVX: string;
39
- SCA: string;
40
- TURBOS: string;
15
+ [key in TOKEN]?: string;
41
16
  };
42
17
  };
43
18
  export declare const wormholeStateId: {
@@ -7,10 +7,10 @@ exports.priceIDs = {
7
7
  // Pyth EVM Stable
8
8
  SUI: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744", // SUI/USD price ID
9
9
  USDC: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a", // USDC/USD price ID
10
- USDT: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b", // USDT/USD price ID
11
- BTC: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
12
- ETH: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
13
- SOL: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d", // SOL/USD price ID
10
+ wUSDT: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b", // USDT/USD price ID
11
+ wBTC: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
12
+ wETH: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
13
+ wSOL: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d", // SOL/USD price ID
14
14
  CETUS: "0xe5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef", // CETUS/USD price ID
15
15
  NAVX: "0x88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46", // NAVX/USD price ID
16
16
  SCA: "0x7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc", // SCA/USD price ID
@@ -21,10 +21,10 @@ exports.priceIDs = {
21
21
  SUI: "0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266", // SUI/USD price ID
22
22
  USDC: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722", // USDC/USD price ID
23
23
  wUSDC: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722", // USDC/USD price ID
24
- USDT: "0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588", // USDT/USD price ID
25
- BTC: "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b", // BTC/USD price ID
26
- ETH: "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6", // ETH/USD price ID
27
- SOL: "0xfe650f0367d4a7ef9815a593ea15d36593f0643aaaf0149bb04be67ab851decd", // SOL/USD price ID
24
+ wUSDT: "0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588", // USDT/USD price ID
25
+ wBTC: "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b", // BTC/USD price ID
26
+ wETH: "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6", // ETH/USD price ID
27
+ wSOL: "0xfe650f0367d4a7ef9815a593ea15d36593f0643aaaf0149bb04be67ab851decd", // SOL/USD price ID
28
28
  CETUS: "0xcb324dafd531712dd31c39969ae0246ee4c6ae167257bcf8ac27e28ca35e6a0c", // CETUS/USD price ID
29
29
  NAVX: "0x946292ad3f481f36f5e558726cf4974e2a7a34598bf15d2abe3619e7b6a8db91", // NAVX/USD price ID
30
30
  SCA: "0xeacabc6304d11fc10a757f63286ef44415d8e91b7a1a525ae94a7ec9398b73f3", // SCA/USD price ID
@@ -32,26 +32,26 @@ exports.priceIDs = {
32
32
  },
33
33
  };
34
34
  exports.priceInfoObjectIds = {
35
- // MAINNET: {
35
+ MAINNET: {
36
36
  // // Pyth EVM Stable
37
37
  // SUI: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744", // SUI/USD price ID
38
38
  // USDC: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a", // USDC/USD price ID
39
- // USDT: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b", // USDT/USD price ID
40
- // BTC: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
41
- // ETH: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
42
- // SOL: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d", // SOL/USD price ID
39
+ // wUSDT: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b", // USDT/USD price ID
40
+ // wBTC: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
41
+ // wETH: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
42
+ // wSOL: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d", // SOL/USD price ID
43
43
  // CETUS: "0xe5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef", // CETUS/USD price ID
44
44
  // NAVX: "0x88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46", // NAVX/USD price ID
45
45
  // SCA: "0x7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc", // SCA/USD price ID
46
- // },
46
+ },
47
47
  TESTNET: {
48
48
  SUI: "0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0",
49
49
  USDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
50
50
  wUSDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
51
- USDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
52
- BTC: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
53
- ETH: "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
54
- SOL: "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
51
+ wUSDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
52
+ wBTC: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
53
+ wETH: "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
54
+ wSOL: "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
55
55
  CETUS: "0xb0ba78106259b7ceefd288edc5f65b65f8b7bca0816e61dae5136616aac7d3da",
56
56
  NAVX: "0x94905bdcaa656b0908aa8a3a42cf72b0e8e2e849f7d0a7e0e39bb9e1dc3c9cf6",
57
57
  SCA: "0xf96e3c4b7d74efbde9df5b669188421196e6164adf6fbaaa92903c42569807c8",
@@ -9,4 +9,4 @@ export declare class PythClient {
9
9
  }
10
10
  export declare function createPythClient(provider: any, network: "MAINNET" | "TESTNET"): PythClient;
11
11
  export declare function updatePyth(pythClient: PythClient, tx: Transaction, tokens: string[]): Promise<ObjectId[]>;
12
- export declare function updateOracleWithPyth(pythClient: PythClient, tx: Transaction, oraclePackage: string, typusOracle: string, baseToken: TOKEN, quoteToken: TOKEN): void;
12
+ export declare function updateOracleWithPythUsd(pythClient: PythClient, tx: Transaction, oraclePackage: string, baseToken: TOKEN): void;
@@ -38,9 +38,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.createPythClient = createPythClient;
40
40
  exports.updatePyth = updatePyth;
41
- exports.updateOracleWithPyth = updateOracleWithPyth;
41
+ exports.updateOracleWithPythUsd = updateOracleWithPythUsd;
42
42
  var pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
43
43
  var constant_1 = require("./constant");
44
+ var constants_1 = require("../../../src/constants");
44
45
  function createPythClient(provider, network) {
45
46
  var client = new pyth_sui_js_1.SuiPythClient(provider, constant_1.pythStateId[network], constant_1.wormholeStateId[network]);
46
47
  var connection = network == "MAINNET"
@@ -67,15 +68,14 @@ function updatePyth(pythClient, tx, tokens) {
67
68
  });
68
69
  });
69
70
  }
70
- function updateOracleWithPyth(pythClient, tx, oraclePackage, typusOracle, baseToken, quoteToken) {
71
+ function updateOracleWithPythUsd(pythClient, tx, oraclePackage, baseToken) {
71
72
  tx.moveCall({
72
- target: "".concat(oraclePackage, "::oracle::update_with_pyth"),
73
+ target: "".concat(oraclePackage, "::oracle::update_with_pyth_usd"),
73
74
  typeArguments: [],
74
75
  arguments: [
75
- tx.object(typusOracle),
76
+ tx.object(constants_1.oracle[pythClient.network][baseToken]),
76
77
  tx.object(constant_1.pythStateId[pythClient.network]),
77
78
  tx.object(constant_1.priceInfoObjectIds[pythClient.network][baseToken]),
78
- tx.object(constant_1.priceInfoObjectIds[pythClient.network][quoteToken]),
79
79
  tx.object("0x6"),
80
80
  ],
81
81
  });
@@ -80,7 +80,7 @@ function splitCoins(tx, token, coins, amount) {
80
80
  }), 1), coin = _a[0];
81
81
  }
82
82
  else {
83
- _b = __read((0, utils_1.normalizeStructTag)(token) == constants_1.tokenType.SUI
83
+ _b = __read((0, utils_1.normalizeStructTag)(token) == constants_1.tokenType.MAINNET.SUI
84
84
  ? tx.splitCoins(tx.gas, [tx.pure.u64(amount)])
85
85
  : (function () {
86
86
  var coin = coins.pop();
@@ -1,12 +1,11 @@
1
1
  export declare class TypusConfig {
2
+ network: "MAINNET" | "TESTNET";
2
3
  rpcEndpoint: string;
3
4
  packageOrigin: Package;
4
5
  package: Package;
5
6
  version: Version;
6
7
  registry: Registry;
7
8
  object: Object;
8
- oracle: Oracle;
9
- token: Token;
10
9
  static parse(json: any): TypusConfig;
11
10
  static local(path: any): TypusConfig;
12
11
  static default(network: "MAINNET" | "TESTNET", customRpcEndpoint: string | null, branch?: string): Promise<TypusConfig>;
@@ -67,13 +66,6 @@ export interface Registry {
67
66
  safu: {
68
67
  safu: string;
69
68
  };
70
- token: {
71
- inj: string;
72
- mfud: string;
73
- sei: string;
74
- mblub: string;
75
- mliq: string;
76
- };
77
69
  typus: {
78
70
  airdrop: string;
79
71
  leaderboard: string;
@@ -97,58 +89,3 @@ export interface Object {
97
89
  launchAuction: string;
98
90
  launchSnapshot: string;
99
91
  }
100
- export interface Oracle {
101
- afsui: string;
102
- apt: string;
103
- buck: string;
104
- cetus: string;
105
- inj: string;
106
- jup: string;
107
- navx: string;
108
- sca: string;
109
- sei: string;
110
- sol: string;
111
- sui: string;
112
- turbos: string;
113
- usdy: string;
114
- btc: string;
115
- eth: string;
116
- mliq: string;
117
- hippo: string;
118
- deep: string;
119
- }
120
- export interface Token {
121
- afsui: string;
122
- apt: string;
123
- ausd: string;
124
- blub: string;
125
- btc: string;
126
- buck: string;
127
- cetus: string;
128
- eth: string;
129
- fud: string;
130
- hasui: string;
131
- inj: string;
132
- jup: string;
133
- mblub: string;
134
- mfud: string;
135
- navx: string;
136
- sca: string;
137
- sei: string;
138
- sol: string;
139
- sui: string;
140
- texp: string;
141
- tgld: string;
142
- tlp: string;
143
- turbos: string;
144
- usd: string;
145
- usdc: string;
146
- usdt: string;
147
- usdy: string;
148
- vsui: string;
149
- wusdc: string;
150
- mliq: string;
151
- hippo: string;
152
- deep: string;
153
- typus: string;
154
- }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.6.7",
5
+ "version": "1.6.8",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.9.34",
@@ -15,8 +15,7 @@
15
15
  "camelcase-keys-deep": "^0.1.0",
16
16
  "dotenv": "^16.4.7",
17
17
  "lodash": "^4.17.21",
18
- "moment": "^2.30.1",
19
- "slack": "^11.0.2"
18
+ "moment": "^2.30.1"
20
19
  },
21
20
  "devDependencies": {
22
21
  "@types/bs58": "^4.0.1",