@typus/typus-perp-sdk 1.1.6 → 1.1.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.
package/dist/src/fetch.js CHANGED
@@ -486,8 +486,9 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
486
486
  }
487
487
  finally { if (e_4) throw e_4.error; }
488
488
  }
489
+ console.log(input.positions.slice(3, 4));
489
490
  try {
490
- for (_e = __values(input.positions), _f = _e.next(); !_f.done; _f = _e.next()) {
491
+ for (_e = __values(input.positions.slice(2, 3)), _f = _e.next(); !_f.done; _f = _e.next()) {
491
492
  position = _f.value;
492
493
  TOKEN = (0, constants_1.typeArgToAsset)(position.collateralToken.name);
493
494
  BASE_TOKEN = (0, constants_1.typeArgToAsset)(position.symbol.baseToken.name);
@@ -515,7 +516,7 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
515
516
  return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: input.user, transactionBlock: tx })];
516
517
  case 2:
517
518
  res = _k.sent();
518
- results = res.results.slice(-input.positions.length).map(function (x) {
519
+ results = res.results ? res.results.slice(-input.positions.length).map(function (x) {
519
520
  // console.log(x);
520
521
  var liquidationPrice = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[0][0])));
521
522
  var isProfit = bcs_1.bcs.bool().parse(Uint8Array.from(x.returnValues[1][0]));
@@ -539,7 +540,7 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
539
540
  closeFee: closeFee,
540
541
  pnlAfterFee: pnl - cost,
541
542
  };
542
- });
543
+ }) : [];
543
544
  // console.log(results);
544
545
  return [2 /*return*/, results];
545
546
  }
package/dist/src/index.js CHANGED
@@ -36,7 +36,7 @@ transactions_1.Transaction.registerGlobalSerializationPlugin("namedPackagesPlugi
36
36
  exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
37
37
  ? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
38
38
  : "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
39
- exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0x5687fc97b7a4adc65c282f1e4d7d1154c30a27cfdbbb9571481dcbacb50dd754" : "@typus/perp";
39
+ exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0x21d5e2291c0c40cad074a702cde333a388fb592b7cf5949dd1250bcd72d7cbfa" : "@typus/perp";
40
40
  exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
41
41
  ? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
42
42
  : "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",