@typus/typus-perp-sdk 1.0.40-fix-history-5 → 1.0.40-fix-history-7
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/user/history.js +5 -3
- package/package.json +1 -1
package/dist/src/user/history.js
CHANGED
|
@@ -119,14 +119,13 @@ 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; });
|
|
123
122
|
var e = {
|
|
124
123
|
action: "Place Order",
|
|
125
124
|
typeName: name,
|
|
126
125
|
order_id: json.order_id,
|
|
127
126
|
position_id: json.linked_position_id,
|
|
128
127
|
market: market,
|
|
129
|
-
side:
|
|
128
|
+
side: json.is_long ? "Long" : "Short",
|
|
130
129
|
order_type: order_type,
|
|
131
130
|
status: json.filled ? "Filled" : "Open",
|
|
132
131
|
size: size,
|
|
@@ -149,7 +148,7 @@ function parseUserHistory(raw_events) {
|
|
|
149
148
|
var price = json.filled_price;
|
|
150
149
|
var action;
|
|
151
150
|
var related;
|
|
152
|
-
if (json.linked_position_id) {
|
|
151
|
+
if (json.linked_position_id != undefined) {
|
|
153
152
|
action = "Order Filled (Close Position)";
|
|
154
153
|
related = events.findLast(function (e) { return e.position_id === json.linked_position_id && e.market === market; });
|
|
155
154
|
// the "Place Order" is emit after Order Filled if filled immediately
|
|
@@ -378,6 +377,9 @@ function getOrderMatchFromSentio(userAddress, startTimestamp, events) {
|
|
|
378
377
|
datas = _a.sent();
|
|
379
378
|
order_match = datas.map(function (x) {
|
|
380
379
|
var base_token = toToken(x.trading_token);
|
|
380
|
+
if (x.transaction_hash == "ELpp2GkW6PRVCLbKqJNgRrNTch2py42rA6PG9JRJnnfm") {
|
|
381
|
+
console.log({ x: x });
|
|
382
|
+
}
|
|
381
383
|
var txHistory = {
|
|
382
384
|
action: x.order_type == "Open" ? "Order Filled (Open Position)" : "Order Filled (Close Position)",
|
|
383
385
|
typeName: "OrderFilledEvent",
|