@typus/typus-perp-sdk 1.0.40-fix-history-5 → 1.0.40-fix-history-6

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.
@@ -119,7 +119,9 @@ function parseUserHistory(raw_events) {
119
119
  else if (json.reduce_only && json.is_stop_order) {
120
120
  order_type = "Stop Loss";
121
121
  }
122
- related = events.find(function (e) { return e.position_id == json.linked_position_id && e.market == market; });
122
+ if (json.linked_position_id != undefined) {
123
+ related = events.find(function (e) { return e.position_id == json.linked_position_id && e.market == market; });
124
+ }
123
125
  var e = {
124
126
  action: "Place Order",
125
127
  typeName: name,
@@ -149,7 +151,7 @@ function parseUserHistory(raw_events) {
149
151
  var price = json.filled_price;
150
152
  var action;
151
153
  var related;
152
- if (json.linked_position_id) {
154
+ if (json.linked_position_id != undefined) {
153
155
  action = "Order Filled (Close Position)";
154
156
  related = events.findLast(function (e) { return e.position_id === json.linked_position_id && e.market === market; });
155
157
  // the "Place Order" is emit after Order Filled if filled immediately
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.0.40-fix-history-5",
3
+ "version": "1.0.40-fix-history-6",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",