@dhedge/backend-flatcoin-core 0.2.57 → 0.2.59

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.
@@ -1,19 +1,17 @@
1
- declare enum HistoricalPeriod {
2
- ONE_DAY = "1d",
3
- ONE_WEEK = "1w",
4
- ONE_MONTH = "1m",
5
- THREE_MONTHS = "3m",
6
- HALF_YEAR = "6m",
7
- ONE_YEAR = "12m",
8
- ALL = "all"
1
+ export declare enum PERIODS {
2
+ DAY = "DAY",
3
+ WEEK = "WEEK",
4
+ MONTH = "MONTH",
5
+ THREE_MONTHS = "THREE_MONTHS",
6
+ HALF_YEAR = "HALF_YEAR",
7
+ YEAR = "YEAR"
9
8
  }
10
9
  export declare const PERIOD_IN_SECONDS: {
11
- "1d": number;
12
- "1w": number;
13
- "1m": number;
10
+ DAY: number;
11
+ WEEK: number;
12
+ MONTH: number;
14
13
  };
15
- export { HistoricalPeriod };
16
- export declare const getChartPeriod: (value: string) => HistoricalPeriod;
14
+ export declare const getChartPeriod: (value: string) => PERIODS;
17
15
  export declare enum LeveragePositionStatus {
18
16
  OPEN = "OPEN",
19
17
  CLOSED = "CLOSED",
@@ -1,28 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LimitOrderStatus = exports.LimitOrderExecutionType = exports.OrderType = exports.LeveragePositionStatus = exports.getChartPeriod = exports.HistoricalPeriod = exports.PERIOD_IN_SECONDS = void 0;
4
- var HistoricalPeriod;
5
- (function (HistoricalPeriod) {
6
- HistoricalPeriod["ONE_DAY"] = "1d";
7
- HistoricalPeriod["ONE_WEEK"] = "1w";
8
- HistoricalPeriod["ONE_MONTH"] = "1m";
9
- HistoricalPeriod["THREE_MONTHS"] = "3m";
10
- HistoricalPeriod["HALF_YEAR"] = "6m";
11
- HistoricalPeriod["ONE_YEAR"] = "12m";
12
- HistoricalPeriod["ALL"] = "all";
13
- })(HistoricalPeriod || (exports.HistoricalPeriod = HistoricalPeriod = {}));
3
+ exports.LimitOrderStatus = exports.LimitOrderExecutionType = exports.OrderType = exports.LeveragePositionStatus = exports.getChartPeriod = exports.PERIOD_IN_SECONDS = exports.PERIODS = void 0;
4
+ var PERIODS;
5
+ (function (PERIODS) {
6
+ PERIODS["DAY"] = "DAY";
7
+ PERIODS["WEEK"] = "WEEK";
8
+ PERIODS["MONTH"] = "MONTH";
9
+ PERIODS["THREE_MONTHS"] = "THREE_MONTHS";
10
+ PERIODS["HALF_YEAR"] = "HALF_YEAR";
11
+ PERIODS["YEAR"] = "YEAR";
12
+ })(PERIODS || (exports.PERIODS = PERIODS = {}));
14
13
  exports.PERIOD_IN_SECONDS = {
15
- [HistoricalPeriod.ONE_DAY]: 24 * 60 * 60 * 1000,
16
- [HistoricalPeriod.ONE_WEEK]: 7 * 24 * 60 * 60 * 1000,
17
- [HistoricalPeriod.ONE_MONTH]: 30 * 24 * 60 * 60 * 1000,
14
+ [PERIODS.DAY]: 24 * 60 * 60 * 1000,
15
+ [PERIODS.WEEK]: 7 * 24 * 60 * 60 * 1000,
16
+ [PERIODS.MONTH]: 30 * 24 * 60 * 60 * 1000,
18
17
  };
19
18
  const getChartPeriod = (value) => {
20
- const indexOf = Object.values(HistoricalPeriod).indexOf(value);
19
+ const indexOf = Object.values(PERIODS).indexOf(value);
21
20
  if (indexOf !== undefined) {
22
- return Object.keys(HistoricalPeriod)[indexOf];
21
+ return Object.keys(PERIODS)[indexOf];
23
22
  }
24
23
  else {
25
- return HistoricalPeriod.ONE_MONTH;
24
+ return PERIODS.MONTH;
26
25
  }
27
26
  };
28
27
  exports.getChartPeriod = getChartPeriod;
@@ -57,15 +57,15 @@ let LeverageBalanceRepository = class LeverageBalanceRepository {
57
57
  // }
58
58
  getRepository(period) {
59
59
  switch (period) {
60
- case constants_1.HistoricalPeriod.ONE_WEEK:
60
+ case constants_1.PERIODS.WEEK:
61
61
  return this.leverageBalanceOneWeekRepository;
62
- case constants_1.HistoricalPeriod.ONE_MONTH:
62
+ case constants_1.PERIODS.MONTH:
63
63
  return this.leverageBalanceOneMonthRepository;
64
- case constants_1.HistoricalPeriod.THREE_MONTHS:
64
+ case constants_1.PERIODS.THREE_MONTHS:
65
65
  return this.leverageBalanceThreeMonthsRepository;
66
- case constants_1.HistoricalPeriod.HALF_YEAR:
66
+ case constants_1.PERIODS.HALF_YEAR:
67
67
  return this.leverageBalanceOneDayRepository;
68
- case constants_1.HistoricalPeriod.ONE_YEAR:
68
+ case constants_1.PERIODS.YEAR:
69
69
  return this.leverageBalanceOneYearRepository;
70
70
  default:
71
71
  throw new Error('Invalid period provided.');
@@ -46,13 +46,13 @@ let PriceRepository = class PriceRepository {
46
46
  }
47
47
  getRepository(period) {
48
48
  switch (period) {
49
- case constants_1.HistoricalPeriod.ONE_DAY:
49
+ case constants_1.PERIODS.DAY:
50
50
  return this.flatcoinPriceOneDayRepository;
51
- case constants_1.HistoricalPeriod.ONE_WEEK:
51
+ case constants_1.PERIODS.WEEK:
52
52
  return this.flatcoinPriceOneWeekRepository;
53
- case constants_1.HistoricalPeriod.ONE_MONTH:
53
+ case constants_1.PERIODS.MONTH:
54
54
  return this.flatcoinPriceOneMonthRepository;
55
- case constants_1.HistoricalPeriod.ONE_YEAR:
55
+ case constants_1.PERIODS.YEAR:
56
56
  return this.flatcoinPriceOneYearRepository;
57
57
  default:
58
58
  throw new Error('Invalid period provided.');
@@ -56,15 +56,15 @@ let UnitBalanceRepository = class UnitBalanceRepository {
56
56
  // }
57
57
  getRepository(period) {
58
58
  switch (period) {
59
- case constants_1.HistoricalPeriod.ONE_WEEK:
59
+ case constants_1.PERIODS.WEEK:
60
60
  return this.unitBalanceOneWeekRepository;
61
- case constants_1.HistoricalPeriod.ONE_MONTH:
61
+ case constants_1.PERIODS.MONTH:
62
62
  return this.unitBalanceOneMonthRepository;
63
- case constants_1.HistoricalPeriod.THREE_MONTHS:
63
+ case constants_1.PERIODS.THREE_MONTHS:
64
64
  return this.unitBalanceThreeMonthsRepository;
65
- case constants_1.HistoricalPeriod.HALF_YEAR:
65
+ case constants_1.PERIODS.HALF_YEAR:
66
66
  return this.unitBalanceHalfYearRepository;
67
- case constants_1.HistoricalPeriod.ONE_YEAR:
67
+ case constants_1.PERIODS.YEAR:
68
68
  return this.unitBalanceOneYearRepository;
69
69
  default:
70
70
  throw new Error('Invalid period provided.');
@@ -495,6 +495,7 @@ exports.getOpenPositionsQueryPaginated = (0, graphql_request_1.gql) `
495
495
  query GetOpenPositions($skip: Int, $first: Int) {
496
496
  positions(where: { status: 0 }, skip: $skip, first: $first) {
497
497
  tokenId
498
+ account
498
499
  }
499
500
  }
500
501
  `;
@@ -502,6 +503,7 @@ exports.getClosedPositionsQueryPaginated = (0, graphql_request_1.gql) `
502
503
  query GetClosedPositions($skip: Int, $first: Int) {
503
504
  positions(where: { status_in: [1, 2, 3] }, skip: $skip, first: $first) {
504
505
  tokenId
506
+ account
505
507
  }
506
508
  }
507
509
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.2.57",
3
+ "version": "0.2.59",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",