@dhedge/backend-flatcoin-core 0.3.8 → 0.3.10
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/constants/enum.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare enum HistoricalPeriod {
|
|
|
14
14
|
ONE_DAY = "1d",
|
|
15
15
|
ONE_WEEK = "1w",
|
|
16
16
|
ONE_MONTH = "1m",
|
|
17
|
+
THREE_MONTH = "3m",
|
|
18
|
+
SIX_MONTH = "6m",
|
|
17
19
|
ONE_YEAR = "12m",
|
|
18
20
|
ALL = "all"
|
|
19
21
|
}
|
|
@@ -21,6 +23,9 @@ export declare const PERIOD_IN_SECONDS: {
|
|
|
21
23
|
"1d": number;
|
|
22
24
|
"1w": number;
|
|
23
25
|
"1m": number;
|
|
26
|
+
"3m": number;
|
|
27
|
+
"6m": number;
|
|
28
|
+
"12m": number;
|
|
24
29
|
};
|
|
25
30
|
export declare const getChartPeriod: (value: string) => PERIODS;
|
|
26
31
|
export declare enum LeveragePositionStatus {
|
package/dist/constants/enum.js
CHANGED
|
@@ -20,6 +20,8 @@ var HistoricalPeriod;
|
|
|
20
20
|
HistoricalPeriod["ONE_DAY"] = "1d";
|
|
21
21
|
HistoricalPeriod["ONE_WEEK"] = "1w";
|
|
22
22
|
HistoricalPeriod["ONE_MONTH"] = "1m";
|
|
23
|
+
HistoricalPeriod["THREE_MONTH"] = "3m";
|
|
24
|
+
HistoricalPeriod["SIX_MONTH"] = "6m";
|
|
23
25
|
HistoricalPeriod["ONE_YEAR"] = "12m";
|
|
24
26
|
HistoricalPeriod["ALL"] = "all";
|
|
25
27
|
})(HistoricalPeriod || (exports.HistoricalPeriod = HistoricalPeriod = {}));
|
|
@@ -27,6 +29,9 @@ exports.PERIOD_IN_SECONDS = {
|
|
|
27
29
|
[HistoricalPeriod.ONE_DAY]: 24 * 60 * 60 * 1000,
|
|
28
30
|
[HistoricalPeriod.ONE_WEEK]: 7 * 24 * 60 * 60 * 1000,
|
|
29
31
|
[HistoricalPeriod.ONE_MONTH]: 30 * 24 * 60 * 60 * 1000,
|
|
32
|
+
[HistoricalPeriod.THREE_MONTH]: 91 * 24 * 60 * 60 * 1000,
|
|
33
|
+
[HistoricalPeriod.SIX_MONTH]: 182 * 24 * 60 * 60 * 1000,
|
|
34
|
+
[HistoricalPeriod.ONE_YEAR]: 365 * 24 * 60 * 60 * 1000,
|
|
30
35
|
};
|
|
31
36
|
const getChartPeriod = (value) => {
|
|
32
37
|
const indexOf = Object.values(PERIODS).indexOf(value);
|
|
@@ -27,7 +27,7 @@ export declare class GraphQueryService {
|
|
|
27
27
|
getClosedPositionsPaginated(skip: number, first: number): Promise<Position[]>;
|
|
28
28
|
getClosedPositions(closeTimestampVar: number): Promise<Position[]>;
|
|
29
29
|
getClosedPositionsByCloseBlockFrom(closeBlockFrom: number): Promise<Position[]>;
|
|
30
|
-
|
|
30
|
+
getLiquidatedPositionsByCloseBlockFrom(closeBlockFrom: number): Promise<Position[]>;
|
|
31
31
|
getAllUnitHolders(): Promise<UnitHolder[]>;
|
|
32
32
|
getUnitHoldersPaginated(skip: number, first: number): Promise<UnitHolder[]>;
|
|
33
33
|
}
|
|
@@ -287,10 +287,10 @@ let GraphQueryService = class GraphQueryService {
|
|
|
287
287
|
throw error;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
async
|
|
290
|
+
async getLiquidatedPositionsByCloseBlockFrom(closeBlockFrom) {
|
|
291
291
|
const variables = { closeBlockFrom };
|
|
292
292
|
try {
|
|
293
|
-
const response = await this.graphQLClient.request(exports.
|
|
293
|
+
const response = await this.graphQLClient.request(exports.getLiquidatedPositionsQueryByCloseBlockFrom, variables);
|
|
294
294
|
this.logger.log(`Fetched ${response.positions.length} liquidated positions from the graph from block ${closeBlockFrom}`);
|
|
295
295
|
return response.positions;
|
|
296
296
|
}
|