@dhedge/backend-flatcoin-core 0.2.68 → 0.2.70
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,10 +6,17 @@ 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
"1d": number;
|
|
18
|
+
"1w": number;
|
|
19
|
+
"1m": number;
|
|
13
20
|
};
|
|
14
21
|
export declare const getChartPeriod: (value: string) => PERIODS;
|
|
15
22
|
export declare enum LeveragePositionStatus {
|
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,10 +10,18 @@ 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
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
22
|
+
[HistoricalPeriod.ONE_DAY]: 24 * 60 * 60 * 1000,
|
|
23
|
+
[HistoricalPeriod.ONE_WEEK]: 7 * 24 * 60 * 60 * 1000,
|
|
24
|
+
[HistoricalPeriod.ONE_MONTH]: 30 * 24 * 60 * 60 * 1000,
|
|
17
25
|
};
|
|
18
26
|
const getChartPeriod = (value) => {
|
|
19
27
|
const indexOf = Object.values(PERIODS).indexOf(value);
|
|
@@ -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.');
|