@typus/typus-perp-sdk 1.0.47 → 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.
- package/dist/src/user/history.js +11 -6
- package/package.json +1 -1
package/dist/src/user/history.js
CHANGED
|
@@ -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
|
-
|
|
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)((
|
|
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;
|