@dhedge/backend-flatcoin-core 0.2.68 → 0.2.69
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
|
@@ -6,6 +6,13 @@ export declare enum PERIODS {
|
|
|
6
6
|
HALF_YEAR = "HALF_YEAR",
|
|
7
7
|
YEAR = "YEAR"
|
|
8
8
|
}
|
|
9
|
+
export declare enum HistoricalPeriod {
|
|
10
|
+
ONE_DAY = "1d",
|
|
11
|
+
ONE_WEEK = "1w",
|
|
12
|
+
ONE_MONTH = "1m",
|
|
13
|
+
ONE_YEAR = "12m",
|
|
14
|
+
ALL = "all"
|
|
15
|
+
}
|
|
9
16
|
export declare const PERIOD_IN_SECONDS: {
|
|
10
17
|
DAY: number;
|
|
11
18
|
WEEK: number;
|
package/dist/constants/enum.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LimitOrderStatus = exports.LimitOrderExecutionType = exports.OrderType = exports.LeveragePositionStatus = exports.getChartPeriod = exports.PERIOD_IN_SECONDS = exports.PERIODS = void 0;
|
|
3
|
+
exports.LimitOrderStatus = exports.LimitOrderExecutionType = exports.OrderType = exports.LeveragePositionStatus = exports.getChartPeriod = exports.PERIOD_IN_SECONDS = exports.HistoricalPeriod = exports.PERIODS = void 0;
|
|
4
4
|
var PERIODS;
|
|
5
5
|
(function (PERIODS) {
|
|
6
6
|
PERIODS["DAY"] = "DAY";
|
|
@@ -10,6 +10,14 @@ var PERIODS;
|
|
|
10
10
|
PERIODS["HALF_YEAR"] = "HALF_YEAR";
|
|
11
11
|
PERIODS["YEAR"] = "YEAR";
|
|
12
12
|
})(PERIODS || (exports.PERIODS = PERIODS = {}));
|
|
13
|
+
var HistoricalPeriod;
|
|
14
|
+
(function (HistoricalPeriod) {
|
|
15
|
+
HistoricalPeriod["ONE_DAY"] = "1d";
|
|
16
|
+
HistoricalPeriod["ONE_WEEK"] = "1w";
|
|
17
|
+
HistoricalPeriod["ONE_MONTH"] = "1m";
|
|
18
|
+
HistoricalPeriod["ONE_YEAR"] = "12m";
|
|
19
|
+
HistoricalPeriod["ALL"] = "all";
|
|
20
|
+
})(HistoricalPeriod || (exports.HistoricalPeriod = HistoricalPeriod = {}));
|
|
13
21
|
exports.PERIOD_IN_SECONDS = {
|
|
14
22
|
[PERIODS.DAY]: 24 * 60 * 60 * 1000,
|
|
15
23
|
[PERIODS.WEEK]: 7 * 24 * 60 * 60 * 1000,
|
|
@@ -46,13 +46,13 @@ let PriceRepository = class PriceRepository {
|
|
|
46
46
|
}
|
|
47
47
|
getRepository(period) {
|
|
48
48
|
switch (period) {
|
|
49
|
-
case constants_1.
|
|
49
|
+
case constants_1.HistoricalPeriod.ONE_DAY:
|
|
50
50
|
return this.flatcoinPriceOneDayRepository;
|
|
51
|
-
case constants_1.
|
|
51
|
+
case constants_1.HistoricalPeriod.ONE_WEEK:
|
|
52
52
|
return this.flatcoinPriceOneWeekRepository;
|
|
53
|
-
case constants_1.
|
|
53
|
+
case constants_1.HistoricalPeriod.ONE_MONTH:
|
|
54
54
|
return this.flatcoinPriceOneMonthRepository;
|
|
55
|
-
case constants_1.
|
|
55
|
+
case constants_1.HistoricalPeriod.ONE_YEAR:
|
|
56
56
|
return this.flatcoinPriceOneYearRepository;
|
|
57
57
|
default:
|
|
58
58
|
throw new Error('Invalid period provided.');
|