@dhedge/backend-flatcoin-core 0.2.61 → 0.2.62
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,10 +1,10 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
|
-
import {
|
|
3
|
-
import { LeverageBalanceOneWeek } from '../entity
|
|
4
|
-
import { LeverageBalanceOneMonth } from '../entity
|
|
5
|
-
import { LeverageBalanceThreeMonths } from '../entity
|
|
6
|
-
import { LeverageBalanceOneDay } from '../entity
|
|
7
|
-
import { LeverageBalanceOneYear } from '../entity
|
|
2
|
+
import { UnitBalanceParent } from '../entity';
|
|
3
|
+
import { LeverageBalanceOneWeek } from '../entity';
|
|
4
|
+
import { LeverageBalanceOneMonth } from '../entity';
|
|
5
|
+
import { LeverageBalanceThreeMonths } from '../entity';
|
|
6
|
+
import { LeverageBalanceOneDay } from '../entity';
|
|
7
|
+
import { LeverageBalanceOneYear } from '../entity';
|
|
8
8
|
export declare class LeverageBalanceRepository {
|
|
9
9
|
private leverageBalanceOneDayRepository;
|
|
10
10
|
private leverageBalanceOneWeekRepository;
|
|
@@ -12,6 +12,6 @@ export declare class LeverageBalanceRepository {
|
|
|
12
12
|
private leverageBalanceThreeMonthsRepository;
|
|
13
13
|
private leverageBalanceOneYearRepository;
|
|
14
14
|
constructor(leverageBalanceOneDayRepository: Repository<LeverageBalanceOneDay>, leverageBalanceOneWeekRepository: Repository<LeverageBalanceOneWeek>, leverageBalanceOneMonthRepository: Repository<LeverageBalanceOneMonth>, leverageBalanceThreeMonthsRepository: Repository<LeverageBalanceThreeMonths>, leverageBalanceOneYearRepository: Repository<LeverageBalanceOneYear>);
|
|
15
|
-
findAllByPeriod(account: string, period: string): Promise<
|
|
15
|
+
findAllByPeriod(account: string, period: string): Promise<UnitBalanceParent[]>;
|
|
16
16
|
getRepository(period: string): Repository<any>;
|
|
17
17
|
}
|
|
@@ -17,13 +17,11 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const constants_1 = require("../constants");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const leverage_balance_one_day_1 = require("../entity/leverageBalanceChart/leverage-balance-one-day");
|
|
26
|
-
const leverage_balance_one_year_1 = require("../entity/leverageBalanceChart/leverage-balance-one-year");
|
|
20
|
+
const entity_1 = require("../entity");
|
|
21
|
+
const entity_2 = require("../entity");
|
|
22
|
+
const entity_3 = require("../entity");
|
|
23
|
+
const entity_4 = require("../entity");
|
|
24
|
+
const entity_5 = require("../entity");
|
|
27
25
|
let LeverageBalanceRepository = class LeverageBalanceRepository {
|
|
28
26
|
constructor(leverageBalanceOneDayRepository, leverageBalanceOneWeekRepository, leverageBalanceOneMonthRepository, leverageBalanceThreeMonthsRepository, leverageBalanceOneYearRepository) {
|
|
29
27
|
this.leverageBalanceOneDayRepository = leverageBalanceOneDayRepository;
|
|
@@ -40,21 +38,6 @@ let LeverageBalanceRepository = class LeverageBalanceRepository {
|
|
|
40
38
|
.orderBy('timestamp', 'ASC')
|
|
41
39
|
.getMany();
|
|
42
40
|
}
|
|
43
|
-
// async findLast(): Promise<UnitBalance | null> {
|
|
44
|
-
// return this.leverageBalanceRepository.createQueryBuilder().orderBy('timestamp', 'DESC').take(1).getOne();
|
|
45
|
-
// }
|
|
46
|
-
// async findFirstByTimestamp(fromTimestamp: number): Promise<UnitBalance | null> {
|
|
47
|
-
// return await this.leverageBalanceRepository
|
|
48
|
-
// .createQueryBuilder()
|
|
49
|
-
// .where('timestamp > :fromTimestamp')
|
|
50
|
-
// .setParameter('fromTimestamp', fromTimestamp)
|
|
51
|
-
// .orderBy('timestamp', 'ASC')
|
|
52
|
-
// .take(1)
|
|
53
|
-
// .getOne();
|
|
54
|
-
// }
|
|
55
|
-
// async findFirst(): Promise<UnitBalance | null> {
|
|
56
|
-
// return await this.leverageBalanceRepository.createQueryBuilder().orderBy('timestamp', 'ASC').take(1).getOne();
|
|
57
|
-
// }
|
|
58
41
|
getRepository(period) {
|
|
59
42
|
switch (period) {
|
|
60
43
|
case constants_1.PERIODS.DAY:
|
|
@@ -75,11 +58,11 @@ let LeverageBalanceRepository = class LeverageBalanceRepository {
|
|
|
75
58
|
exports.LeverageBalanceRepository = LeverageBalanceRepository;
|
|
76
59
|
exports.LeverageBalanceRepository = LeverageBalanceRepository = __decorate([
|
|
77
60
|
(0, common_1.Injectable)(),
|
|
78
|
-
__param(0, (0, typeorm_1.InjectRepository)(
|
|
79
|
-
__param(1, (0, typeorm_1.InjectRepository)(
|
|
80
|
-
__param(2, (0, typeorm_1.InjectRepository)(
|
|
81
|
-
__param(3, (0, typeorm_1.InjectRepository)(
|
|
82
|
-
__param(4, (0, typeorm_1.InjectRepository)(
|
|
61
|
+
__param(0, (0, typeorm_1.InjectRepository)(entity_4.LeverageBalanceOneDay)),
|
|
62
|
+
__param(1, (0, typeorm_1.InjectRepository)(entity_1.LeverageBalanceOneWeek)),
|
|
63
|
+
__param(2, (0, typeorm_1.InjectRepository)(entity_2.LeverageBalanceOneMonth)),
|
|
64
|
+
__param(3, (0, typeorm_1.InjectRepository)(entity_3.LeverageBalanceThreeMonths)),
|
|
65
|
+
__param(4, (0, typeorm_1.InjectRepository)(entity_5.LeverageBalanceOneYear)),
|
|
83
66
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
84
67
|
typeorm_2.Repository,
|
|
85
68
|
typeorm_2.Repository,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
|
-
import {
|
|
2
|
+
import { UnitBalanceParent } from '../entity';
|
|
3
3
|
import { UnitBalanceHalfYear } from '../entity';
|
|
4
4
|
import { UnitBalanceOneWeek } from '../entity';
|
|
5
5
|
import { UnitBalanceOneMonth } from '../entity';
|
|
@@ -12,6 +12,6 @@ export declare class UnitBalanceRepository {
|
|
|
12
12
|
private unitBalanceHalfYearRepository;
|
|
13
13
|
private unitBalanceOneYearRepository;
|
|
14
14
|
constructor(unitBalanceOneWeekRepository: Repository<UnitBalanceOneWeek>, unitBalanceOneMonthRepository: Repository<UnitBalanceOneMonth>, unitBalanceThreeMonthsRepository: Repository<UnitBalanceThreeMonths>, unitBalanceHalfYearRepository: Repository<UnitBalanceHalfYear>, unitBalanceOneYearRepository: Repository<UnitBalanceOneYear>);
|
|
15
|
-
findAllByPeriod(account: string, period: string): Promise<
|
|
15
|
+
findAllByPeriod(account: string, period: string): Promise<UnitBalanceParent[]>;
|
|
16
16
|
getRepository(period: string): Repository<any>;
|
|
17
17
|
}
|
|
@@ -38,22 +38,6 @@ let UnitBalanceRepository = class UnitBalanceRepository {
|
|
|
38
38
|
.orderBy('timestamp', 'ASC')
|
|
39
39
|
.getMany();
|
|
40
40
|
}
|
|
41
|
-
// async findLast(): Promise<UnitBalance | null> {
|
|
42
|
-
// return this.unitBalanceRepository.createQueryBuilder().orderBy('timestamp', 'DESC').take(1).getOne();
|
|
43
|
-
// }
|
|
44
|
-
// async findFirstByTimestamp(fromTimestamp: number): Promise<UnitBalance | null> {
|
|
45
|
-
// return await this.unitBalanceRepository
|
|
46
|
-
// .createQueryBuilder()
|
|
47
|
-
// .where('timestamp > :fromTimestamp')
|
|
48
|
-
// .setParameter('fromTimestamp', fromTimestamp)
|
|
49
|
-
// .orderBy('timestamp', 'ASC')
|
|
50
|
-
// .take(1)
|
|
51
|
-
// .getOne();
|
|
52
|
-
// }
|
|
53
|
-
//
|
|
54
|
-
// async findFirst(): Promise<UnitBalance | null> {
|
|
55
|
-
// return await this.unitBalanceRepository.createQueryBuilder().orderBy('timestamp', 'ASC').take(1).getOne();
|
|
56
|
-
// }
|
|
57
41
|
getRepository(period) {
|
|
58
42
|
switch (period) {
|
|
59
43
|
case constants_1.PERIODS.WEEK:
|