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