@typus/typus-perp-sdk 1.0.46 → 1.0.48

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.
@@ -41,7 +41,7 @@ exports.getTlpAPRFromSentio = getTlpAPRFromSentio;
41
41
  exports.getVolumeFromSentio = getVolumeFromSentio;
42
42
  var src_1 = require("../../src");
43
43
  var headers = {
44
- "api-key": "vQCQ6ZvvFesph3Q8usDLKfc7Wx2D8AX5M",
44
+ "api-key": "ffJa6FwxeJNrQP8NZ5doEMXqdSA7XM6mT",
45
45
  "Content-Type": "application/json",
46
46
  };
47
47
  function getFromSentio(event, userAddress, startTimestamp) {
@@ -74,15 +74,15 @@ var structs_3 = require("../../src/typus_perp/lp-pool/structs");
74
74
  var sentio_1 = require("../../src/api/sentio");
75
75
  var src_1 = require("../../src");
76
76
  var checkOrderType = function (filled, reduceOnly, isStopOrder) {
77
- if (filled) {
78
- return "Market";
79
- }
80
77
  if (reduceOnly && !isStopOrder) {
81
78
  return "Take Profit";
82
79
  }
83
80
  if (reduceOnly && isStopOrder) {
84
81
  return "Stop Loss";
85
82
  }
83
+ if (filled) {
84
+ return "Market";
85
+ }
86
86
  return "Limit";
87
87
  };
88
88
  var parseCollateralAmount = function (collateral_amount, collateral_token, collateral_in_deposit_token, deposit_token) {
@@ -469,11 +469,16 @@ function getOrderMatchFromSentio(userAddress, startTimestamp, rawEvents) {
469
469
  }
470
470
  else {
471
471
  var sourceFilledOrder_2 = rawEvents.findLast(function (e) {
472
- var _a, _b;
472
+ var _a, _b, _c, _d;
473
473
  var rawEventJson = e.contents.json;
474
- return (((_a = rawEventJson === null || rawEventJson === void 0 ? void 0 : rawEventJson.base_token) === null || _a === void 0 ? void 0 : _a.name) &&
474
+ if (x.transaction_hash == "77dvZFz11rpasvco5kodZBZ6sAkX7HzQk4cCrmtwrd3n") {
475
+ if (rawEventJson.new_position_id == x.position_id) {
476
+ // console.log(x, rawEventJson);
477
+ }
478
+ }
479
+ return (((_b = (_a = rawEventJson === null || rawEventJson === void 0 ? void 0 : rawEventJson.symbol) === null || _a === void 0 ? void 0 : _a.base_token) === null || _b === void 0 ? void 0 : _b.name) &&
475
480
  rawEventJson.new_position_id == x.position_id &&
476
- (0, constants_1.typeArgToAsset)((_b = rawEventJson === null || rawEventJson === void 0 ? void 0 : rawEventJson.base_token) === null || _b === void 0 ? void 0 : _b.name) == x.trading_token);
481
+ (0, constants_1.typeArgToAsset)((_d = (_c = rawEventJson === null || rawEventJson === void 0 ? void 0 : rawEventJson.symbol) === null || _c === void 0 ? void 0 : _c.base_token) === null || _d === void 0 ? void 0 : _d.name) == x.trading_token);
477
482
  });
478
483
  related = rawEvents.findLast(function (e) {
479
484
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",