@typus/typus-sdk 1.0.75 → 1.0.76

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.
@@ -11,9 +11,9 @@ function typeArgsToAssets(typeArgs) {
11
11
  var typeArgs = x.split("::");
12
12
  switch ((0, sui_js_1.normalizeSuiAddress)(typeArgs[0])) {
13
13
  case "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881":
14
- return "BTC";
14
+ return "WBTC";
15
15
  case "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5":
16
- return "ETH";
16
+ return "WETH";
17
17
  case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
18
18
  return "SOL";
19
19
  case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
@@ -22,10 +22,10 @@ function typeArgsToAssets(typeArgs) {
22
22
  return "USDT";
23
23
  case config_json_1.default.TOKEN_PACKAGE:
24
24
  if (typeArgs[2] == "BTC") {
25
- return "BTC";
25
+ return "WBTC";
26
26
  }
27
27
  else if (typeArgs[2] == "ETH") {
28
- return "ETH";
28
+ return "WETH";
29
29
  }
30
30
  return typeArgs[2];
31
31
  default:
@@ -182,7 +182,7 @@ exports.getShowMap = getShowMap;
182
182
  function groupEventToShow(groupEvent, portfolioVault) {
183
183
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
184
184
  return __awaiter(this, void 0, void 0, function () {
185
- var PaidToDepositors, portfolio_payoff, PaidToBidders, exp, result;
185
+ var PaidToDepositors, portfolio_payoff, PaidToBidders, exp, ActivationTsMs, SettlementTsMs, result;
186
186
  return __generator(this, function (_r) {
187
187
  PaidToDepositors = Number((_a = groupEvent.deliveryEvent) === null || _a === void 0 ? void 0 : _a.premium_value) / Math.pow(10, Number(portfolioVault.config.bTokenDecimal));
188
188
  portfolio_payoff = ((_b = groupEvent.settleEvent) === null || _b === void 0 ? void 0 : _b.portfolio_payoff_is_neg)
@@ -200,19 +200,21 @@ function groupEventToShow(groupEvent, portfolioVault) {
200
200
  exp = 12;
201
201
  break;
202
202
  }
203
+ ActivationTsMs = Number((_e = groupEvent.newAuctionEvent) === null || _e === void 0 ? void 0 : _e.timestamp_ms);
204
+ SettlementTsMs = Number((_f = groupEvent.settleEvent) === null || _f === void 0 ? void 0 : _f.timestamp_ms);
203
205
  result = {
204
206
  // newAuctionEvent
205
- NewAuctionTx: (_e = groupEvent.newAuctionEvent) === null || _e === void 0 ? void 0 : _e.tx_digest,
206
- ActivationDate: new Date(Number((_f = groupEvent.newAuctionEvent) === null || _f === void 0 ? void 0 : _f.timestamp_ms)),
207
- StrikePrice: (_g = groupEvent.newAuctionEvent) === null || _g === void 0 ? void 0 : _g.vault_config.payoffConfigs.map(function (payoffConfig) { return Number(payoffConfig.strike) / Math.pow(10, 8); }),
207
+ NewAuctionTx: (_g = groupEvent.newAuctionEvent) === null || _g === void 0 ? void 0 : _g.tx_digest,
208
+ ActivationDate: new Date(ActivationTsMs - (ActivationTsMs % 3600000)),
209
+ StrikePrice: (_h = groupEvent.newAuctionEvent) === null || _h === void 0 ? void 0 : _h.vault_config.payoffConfigs.map(function (payoffConfig) { return Number(payoffConfig.strike) / Math.pow(10, 8); }),
208
210
  // deliveryEvent
209
- DeliveryTx: (_h = groupEvent.deliveryEvent) === null || _h === void 0 ? void 0 : _h.tx_digest,
210
- ProjectedAPY: Math.pow((1 + (1.01 * Number((_j = groupEvent.deliveryEvent) === null || _j === void 0 ? void 0 : _j.delivery_price)) / Math.pow(10, Number(portfolioVault.config.bTokenDecimal))), exp) - 1,
211
- Filled: Number((_k = groupEvent.deliveryEvent) === null || _k === void 0 ? void 0 : _k.delivery_size) / Number((_l = groupEvent.deliveryEvent) === null || _l === void 0 ? void 0 : _l.max_size),
211
+ DeliveryTx: (_j = groupEvent.deliveryEvent) === null || _j === void 0 ? void 0 : _j.tx_digest,
212
+ ProjectedAPY: Math.pow((1 + (1.01 * Number((_k = groupEvent.deliveryEvent) === null || _k === void 0 ? void 0 : _k.delivery_price)) / Math.pow(10, Number(portfolioVault.config.bTokenDecimal))), exp) - 1,
213
+ Filled: Number((_l = groupEvent.deliveryEvent) === null || _l === void 0 ? void 0 : _l.delivery_size) / Number((_m = groupEvent.deliveryEvent) === null || _m === void 0 ? void 0 : _m.max_size),
212
214
  PaidToDepositors: PaidToDepositors,
213
215
  // settleEvent
214
- SettleTx: (_m = groupEvent.settleEvent) === null || _m === void 0 ? void 0 : _m.tx_digest,
215
- SettlementTime: new Date(Number((_o = groupEvent.settleEvent) === null || _o === void 0 ? void 0 : _o.timestamp_ms)),
216
+ SettleTx: (_o = groupEvent.settleEvent) === null || _o === void 0 ? void 0 : _o.tx_digest,
217
+ SettlementTime: new Date(SettlementTsMs - (SettlementTsMs % 3600000)),
216
218
  SettlePrice: Number((_p = groupEvent.settleEvent) === null || _p === void 0 ? void 0 : _p.oracle_price) / Math.pow(10, 8),
217
219
  Return: Number((_q = groupEvent.settleEvent) === null || _q === void 0 ? void 0 : _q.share_price) / Math.pow(10, 8) - 1,
218
220
  PaidToBidders: PaidToBidders,
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.0.75",
5
+ "version": "1.0.76",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/sui.js": "^0.37.1",