@typus/typus-perp-sdk 1.0.40-fix-history-3 → 1.0.40-fix-history-5
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.
|
@@ -20,6 +20,7 @@ export interface Event {
|
|
|
20
20
|
realized_pnl: number | undefined;
|
|
21
21
|
timestamp: string;
|
|
22
22
|
tx_digest: string;
|
|
23
|
+
dov_index: string | undefined;
|
|
23
24
|
}
|
|
24
25
|
export declare function parseUserHistory(raw_events: any): Promise<Event[]>;
|
|
25
26
|
export declare function getGraphQLEvents(module: string, sender: string, beforeCursor?: string | null): Promise<any>;
|
package/dist/src/user/history.js
CHANGED
|
@@ -137,6 +137,7 @@ function parseUserHistory(raw_events) {
|
|
|
137
137
|
realized_pnl: undefined,
|
|
138
138
|
timestamp: timestamp,
|
|
139
139
|
tx_digest: tx_digest,
|
|
140
|
+
dov_index: json.dov_index,
|
|
140
141
|
};
|
|
141
142
|
events.push(e);
|
|
142
143
|
break;
|
|
@@ -178,6 +179,7 @@ function parseUserHistory(raw_events) {
|
|
|
178
179
|
realized_pnl: realized_pnl,
|
|
179
180
|
timestamp: timestamp,
|
|
180
181
|
tx_digest: tx_digest,
|
|
182
|
+
dov_index: related === null || related === void 0 ? void 0 : related.dov_index,
|
|
181
183
|
};
|
|
182
184
|
events.push(e);
|
|
183
185
|
break;
|
|
@@ -213,6 +215,7 @@ function parseUserHistory(raw_events) {
|
|
|
213
215
|
realized_pnl: undefined,
|
|
214
216
|
timestamp: timestamp,
|
|
215
217
|
tx_digest: tx_digest,
|
|
218
|
+
dov_index: related === null || related === void 0 ? void 0 : related.dov_index,
|
|
216
219
|
};
|
|
217
220
|
events.push(e);
|
|
218
221
|
break;
|
|
@@ -246,6 +249,7 @@ function parseUserHistory(raw_events) {
|
|
|
246
249
|
realized_pnl: undefined,
|
|
247
250
|
timestamp: timestamp,
|
|
248
251
|
tx_digest: tx_digest,
|
|
252
|
+
dov_index: related === null || related === void 0 ? void 0 : related.dov_index,
|
|
249
253
|
};
|
|
250
254
|
events.push(e);
|
|
251
255
|
break;
|
|
@@ -271,6 +275,7 @@ function parseUserHistory(raw_events) {
|
|
|
271
275
|
realized_pnl: -Number(json.fee_amount_usd) / Math.pow(10, 9),
|
|
272
276
|
timestamp: timestamp,
|
|
273
277
|
tx_digest: tx_digest,
|
|
278
|
+
dov_index: undefined,
|
|
274
279
|
};
|
|
275
280
|
events.push(e);
|
|
276
281
|
break;
|
|
@@ -341,6 +346,7 @@ function getLiquidateFromSentio(userAddress, startTimestamp, events) {
|
|
|
341
346
|
realized_pnl: -collateral * Number(x.collateral_price),
|
|
342
347
|
timestamp: x.timestamp,
|
|
343
348
|
tx_digest: x.transaction_hash,
|
|
349
|
+
dov_index: undefined,
|
|
344
350
|
};
|
|
345
351
|
return txHistory;
|
|
346
352
|
});
|
|
@@ -350,6 +356,7 @@ function getLiquidateFromSentio(userAddress, startTimestamp, events) {
|
|
|
350
356
|
// console.log(related);
|
|
351
357
|
if (related) {
|
|
352
358
|
x.side = related.side;
|
|
359
|
+
x.dov_index = related.dov_index;
|
|
353
360
|
}
|
|
354
361
|
return x;
|
|
355
362
|
});
|
|
@@ -388,6 +395,7 @@ function getOrderMatchFromSentio(userAddress, startTimestamp, events) {
|
|
|
388
395
|
realized_pnl: x.realized_pnl,
|
|
389
396
|
timestamp: x.timestamp,
|
|
390
397
|
tx_digest: x.transaction_hash,
|
|
398
|
+
dov_index: undefined,
|
|
391
399
|
};
|
|
392
400
|
return txHistory;
|
|
393
401
|
});
|
|
@@ -399,6 +407,7 @@ function getOrderMatchFromSentio(userAddress, startTimestamp, events) {
|
|
|
399
407
|
if (related) {
|
|
400
408
|
x.order_type = related.order_type;
|
|
401
409
|
x.collateral = related.collateral;
|
|
410
|
+
x.dov_index = related.dov_index;
|
|
402
411
|
}
|
|
403
412
|
else {
|
|
404
413
|
x.order_type = "Market";
|
|
@@ -440,6 +449,7 @@ function getRealizeOptionFromSentio(userAddress, startTimestamp, events) {
|
|
|
440
449
|
realized_pnl: Number(x.user_remaining_in_usd),
|
|
441
450
|
timestamp: x.timestamp,
|
|
442
451
|
tx_digest: x.transaction_hash,
|
|
452
|
+
dov_index: undefined,
|
|
443
453
|
};
|
|
444
454
|
// console.log(txHistory);
|
|
445
455
|
return txHistory;
|
|
@@ -451,6 +461,7 @@ function getRealizeOptionFromSentio(userAddress, startTimestamp, events) {
|
|
|
451
461
|
if (related) {
|
|
452
462
|
x.side = related.side;
|
|
453
463
|
x.size = related.size;
|
|
464
|
+
x.dov_index = related.dov_index;
|
|
454
465
|
}
|
|
455
466
|
return x;
|
|
456
467
|
});
|