@dhedge/backend-flatcoin-core 0.2.51 → 0.2.52
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/entity/unitBalanceChart/unit-balance-one-year.js +1 -1
- package/dist/entity/unitBalanceChart/unit-balance-three-months.js +1 -1
- package/dist/entity/unitBalanceChart/unit-balance.d.ts +1 -3
- package/dist/entity/unitBalanceChart/unit-balance.js +2 -15
- package/dist/repository/leverage-balance.repository.d.ts +1 -7
- package/dist/repository/leverage-balance.repository.js +18 -20
- package/dist/repository/unit-balance.repository.d.ts +1 -6
- package/dist/repository/unit-balance.repository.js +17 -20
- package/package.json +1 -1
|
@@ -13,5 +13,5 @@ let UnitBalanceOneYear = class UnitBalanceOneYear extends unit_balance_parent_1.
|
|
|
13
13
|
};
|
|
14
14
|
exports.UnitBalanceOneYear = UnitBalanceOneYear;
|
|
15
15
|
exports.UnitBalanceOneYear = UnitBalanceOneYear = __decorate([
|
|
16
|
-
(0, typeorm_1.Entity)({ name: '
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'unit_balances_1y' })
|
|
17
17
|
], UnitBalanceOneYear);
|
|
@@ -13,5 +13,5 @@ let UnitBalanceThreeMonths = class UnitBalanceThreeMonths extends unit_balance_p
|
|
|
13
13
|
};
|
|
14
14
|
exports.UnitBalanceThreeMonths = UnitBalanceThreeMonths;
|
|
15
15
|
exports.UnitBalanceThreeMonths = UnitBalanceThreeMonths = __decorate([
|
|
16
|
-
(0, typeorm_1.Entity)({ name: '
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'unit_balances_3m' })
|
|
17
17
|
], UnitBalanceThreeMonths);
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const unit_balance_parent_1 = require("./unit-balance-parent");
|
|
12
|
-
let UnitBalance = class UnitBalance extends unit_balance_parent_1.UnitBalanceParent {
|
|
13
|
-
};
|
|
14
|
-
exports.UnitBalance = UnitBalance;
|
|
15
|
-
exports.UnitBalance = UnitBalance = __decorate([
|
|
16
|
-
(0, typeorm_1.Entity)({ name: 'unit_balances' })
|
|
17
|
-
], UnitBalance);
|
|
3
|
+
// @Entity({ name: 'unit_balances' })
|
|
4
|
+
// export class UnitBalance extends UnitBalanceParent {}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
2
|
import { FlatcoinPriceParent } from '../entity';
|
|
3
|
-
import { UnitBalance } from '../entity/unitBalanceChart/unit-balance';
|
|
4
|
-
import { LeverageBalance } from '../entity/leverageBalanceChart/leverage-balance';
|
|
5
3
|
import { LeverageBalanceOneWeek } from '../entity/leverageBalanceChart/leverage-balance-one-week';
|
|
6
4
|
import { LeverageBalanceOneMonth } from '../entity/leverageBalanceChart/leverage-balance-one-month';
|
|
7
5
|
import { LeverageBalanceThreeMonths } from '../entity/leverageBalanceChart/leverage-balance-three-months';
|
|
@@ -13,11 +11,7 @@ export declare class LeverageBalanceRepository {
|
|
|
13
11
|
private leverageBalanceOneMonthRepository;
|
|
14
12
|
private leverageBalanceThreeMonthsRepository;
|
|
15
13
|
private leverageBalanceOneYearRepository;
|
|
16
|
-
|
|
17
|
-
constructor(leverageBalanceOneDayRepository: Repository<LeverageBalanceOneDay>, leverageBalanceOneWeekRepository: Repository<LeverageBalanceOneWeek>, leverageBalanceOneMonthRepository: Repository<LeverageBalanceOneMonth>, leverageBalanceThreeMonthsRepository: Repository<LeverageBalanceThreeMonths>, leverageBalanceOneYearRepository: Repository<LeverageBalanceOneYear>, leverageBalanceRepository: Repository<LeverageBalance>);
|
|
14
|
+
constructor(leverageBalanceOneDayRepository: Repository<LeverageBalanceOneDay>, leverageBalanceOneWeekRepository: Repository<LeverageBalanceOneWeek>, leverageBalanceOneMonthRepository: Repository<LeverageBalanceOneMonth>, leverageBalanceThreeMonthsRepository: Repository<LeverageBalanceThreeMonths>, leverageBalanceOneYearRepository: Repository<LeverageBalanceOneYear>);
|
|
18
15
|
findAllByPeriod(account: string, period: string): Promise<FlatcoinPriceParent[]>;
|
|
19
|
-
findLast(): Promise<UnitBalance | null>;
|
|
20
|
-
findFirstByTimestamp(fromTimestamp: number): Promise<UnitBalance | null>;
|
|
21
|
-
findFirst(): Promise<UnitBalance | null>;
|
|
22
16
|
getRepository(period: string): Repository<any>;
|
|
23
17
|
}
|
|
@@ -17,20 +17,20 @@ 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
|
-
|
|
20
|
+
// import { UnitBalance } from '../entity/unitBalanceChart/unit-balance';
|
|
21
|
+
// import { LeverageBalance } from '../entity/leverageBalanceChart/leverage-balance';
|
|
21
22
|
const leverage_balance_one_week_1 = require("../entity/leverageBalanceChart/leverage-balance-one-week");
|
|
22
23
|
const leverage_balance_one_month_1 = require("../entity/leverageBalanceChart/leverage-balance-one-month");
|
|
23
24
|
const leverage_balance_three_months_1 = require("../entity/leverageBalanceChart/leverage-balance-three-months");
|
|
24
25
|
const leverage_balance_one_day_1 = require("../entity/leverageBalanceChart/leverage-balance-one-day");
|
|
25
26
|
const leverage_balance_one_year_1 = require("../entity/leverageBalanceChart/leverage-balance-one-year");
|
|
26
27
|
let LeverageBalanceRepository = class LeverageBalanceRepository {
|
|
27
|
-
constructor(leverageBalanceOneDayRepository, leverageBalanceOneWeekRepository, leverageBalanceOneMonthRepository, leverageBalanceThreeMonthsRepository, leverageBalanceOneYearRepository
|
|
28
|
+
constructor(leverageBalanceOneDayRepository, leverageBalanceOneWeekRepository, leverageBalanceOneMonthRepository, leverageBalanceThreeMonthsRepository, leverageBalanceOneYearRepository) {
|
|
28
29
|
this.leverageBalanceOneDayRepository = leverageBalanceOneDayRepository;
|
|
29
30
|
this.leverageBalanceOneWeekRepository = leverageBalanceOneWeekRepository;
|
|
30
31
|
this.leverageBalanceOneMonthRepository = leverageBalanceOneMonthRepository;
|
|
31
32
|
this.leverageBalanceThreeMonthsRepository = leverageBalanceThreeMonthsRepository;
|
|
32
33
|
this.leverageBalanceOneYearRepository = leverageBalanceOneYearRepository;
|
|
33
|
-
this.leverageBalanceRepository = leverageBalanceRepository;
|
|
34
34
|
}
|
|
35
35
|
async findAllByPeriod(account, period) {
|
|
36
36
|
return this.getRepository(period)
|
|
@@ -40,21 +40,21 @@ let LeverageBalanceRepository = class LeverageBalanceRepository {
|
|
|
40
40
|
.orderBy('timestamp', 'ASC')
|
|
41
41
|
.getMany();
|
|
42
42
|
}
|
|
43
|
-
async findLast() {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
async findFirstByTimestamp(fromTimestamp) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
async findFirst() {
|
|
56
|
-
|
|
57
|
-
}
|
|
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
58
|
getRepository(period) {
|
|
59
59
|
switch (period) {
|
|
60
60
|
case constants_1.HistoricalPeriod.ONE_WEEK:
|
|
@@ -80,11 +80,9 @@ exports.LeverageBalanceRepository = LeverageBalanceRepository = __decorate([
|
|
|
80
80
|
__param(2, (0, typeorm_1.InjectRepository)(leverage_balance_one_month_1.LeverageBalanceOneMonth)),
|
|
81
81
|
__param(3, (0, typeorm_1.InjectRepository)(leverage_balance_three_months_1.LeverageBalanceThreeMonths)),
|
|
82
82
|
__param(4, (0, typeorm_1.InjectRepository)(leverage_balance_one_year_1.LeverageBalanceOneYear)),
|
|
83
|
-
__param(5, (0, typeorm_1.InjectRepository)(leverage_balance_1.LeverageBalance)),
|
|
84
83
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
85
84
|
typeorm_2.Repository,
|
|
86
85
|
typeorm_2.Repository,
|
|
87
86
|
typeorm_2.Repository,
|
|
88
|
-
typeorm_2.Repository,
|
|
89
87
|
typeorm_2.Repository])
|
|
90
88
|
], LeverageBalanceRepository);
|
|
@@ -3,7 +3,6 @@ import { FlatcoinPriceParent } from '../entity';
|
|
|
3
3
|
import { UnitBalanceHalfYear } from '../entity/unitBalanceChart/unit-balance-half-year';
|
|
4
4
|
import { UnitBalanceOneWeek } from '../entity/unitBalanceChart/unit-balance-one-week';
|
|
5
5
|
import { UnitBalanceOneMonth } from '../entity/unitBalanceChart/unit-balance-one-month';
|
|
6
|
-
import { UnitBalance } from '../entity/unitBalanceChart/unit-balance';
|
|
7
6
|
import { UnitBalanceThreeMonths } from '../entity/unitBalanceChart/unit-balance-three-months';
|
|
8
7
|
import { UnitBalanceOneYear } from '../entity/unitBalanceChart/unit-balance-one-year';
|
|
9
8
|
export declare class UnitBalanceRepository {
|
|
@@ -12,11 +11,7 @@ export declare class UnitBalanceRepository {
|
|
|
12
11
|
private unitBalanceThreeMonthsRepository;
|
|
13
12
|
private unitBalanceHalfYearRepository;
|
|
14
13
|
private unitBalanceOneYearRepository;
|
|
15
|
-
|
|
16
|
-
constructor(unitBalanceOneWeekRepository: Repository<UnitBalanceOneWeek>, unitBalanceOneMonthRepository: Repository<UnitBalanceOneMonth>, unitBalanceThreeMonthsRepository: Repository<UnitBalanceThreeMonths>, unitBalanceHalfYearRepository: Repository<UnitBalanceHalfYear>, unitBalanceOneYearRepository: Repository<UnitBalanceOneYear>, unitBalanceRepository: Repository<UnitBalance>);
|
|
14
|
+
constructor(unitBalanceOneWeekRepository: Repository<UnitBalanceOneWeek>, unitBalanceOneMonthRepository: Repository<UnitBalanceOneMonth>, unitBalanceThreeMonthsRepository: Repository<UnitBalanceThreeMonths>, unitBalanceHalfYearRepository: Repository<UnitBalanceHalfYear>, unitBalanceOneYearRepository: Repository<UnitBalanceOneYear>);
|
|
17
15
|
findAllByPeriod(account: string, period: string): Promise<FlatcoinPriceParent[]>;
|
|
18
|
-
findLast(): Promise<UnitBalance | null>;
|
|
19
|
-
findFirstByTimestamp(fromTimestamp: number): Promise<UnitBalance | null>;
|
|
20
|
-
findFirst(): Promise<UnitBalance | null>;
|
|
21
16
|
getRepository(period: string): Repository<any>;
|
|
22
17
|
}
|
|
@@ -20,17 +20,15 @@ const constants_1 = require("../constants");
|
|
|
20
20
|
const unit_balance_half_year_1 = require("../entity/unitBalanceChart/unit-balance-half-year");
|
|
21
21
|
const unit_balance_one_week_1 = require("../entity/unitBalanceChart/unit-balance-one-week");
|
|
22
22
|
const unit_balance_one_month_1 = require("../entity/unitBalanceChart/unit-balance-one-month");
|
|
23
|
-
const unit_balance_1 = require("../entity/unitBalanceChart/unit-balance");
|
|
24
23
|
const unit_balance_three_months_1 = require("../entity/unitBalanceChart/unit-balance-three-months");
|
|
25
24
|
const unit_balance_one_year_1 = require("../entity/unitBalanceChart/unit-balance-one-year");
|
|
26
25
|
let UnitBalanceRepository = class UnitBalanceRepository {
|
|
27
|
-
constructor(unitBalanceOneWeekRepository, unitBalanceOneMonthRepository, unitBalanceThreeMonthsRepository, unitBalanceHalfYearRepository, unitBalanceOneYearRepository
|
|
26
|
+
constructor(unitBalanceOneWeekRepository, unitBalanceOneMonthRepository, unitBalanceThreeMonthsRepository, unitBalanceHalfYearRepository, unitBalanceOneYearRepository) {
|
|
28
27
|
this.unitBalanceOneWeekRepository = unitBalanceOneWeekRepository;
|
|
29
28
|
this.unitBalanceOneMonthRepository = unitBalanceOneMonthRepository;
|
|
30
29
|
this.unitBalanceThreeMonthsRepository = unitBalanceThreeMonthsRepository;
|
|
31
30
|
this.unitBalanceHalfYearRepository = unitBalanceHalfYearRepository;
|
|
32
31
|
this.unitBalanceOneYearRepository = unitBalanceOneYearRepository;
|
|
33
|
-
this.unitBalanceRepository = unitBalanceRepository;
|
|
34
32
|
}
|
|
35
33
|
async findAllByPeriod(account, period) {
|
|
36
34
|
return this.getRepository(period)
|
|
@@ -40,21 +38,22 @@ let UnitBalanceRepository = class UnitBalanceRepository {
|
|
|
40
38
|
.orderBy('timestamp', 'ASC')
|
|
41
39
|
.getMany();
|
|
42
40
|
}
|
|
43
|
-
async findLast() {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
async findFirstByTimestamp(fromTimestamp) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
+
// }
|
|
58
57
|
getRepository(period) {
|
|
59
58
|
switch (period) {
|
|
60
59
|
case constants_1.HistoricalPeriod.ONE_WEEK:
|
|
@@ -80,11 +79,9 @@ exports.UnitBalanceRepository = UnitBalanceRepository = __decorate([
|
|
|
80
79
|
__param(2, (0, typeorm_1.InjectRepository)(unit_balance_three_months_1.UnitBalanceThreeMonths)),
|
|
81
80
|
__param(3, (0, typeorm_1.InjectRepository)(unit_balance_half_year_1.UnitBalanceHalfYear)),
|
|
82
81
|
__param(4, (0, typeorm_1.InjectRepository)(unit_balance_one_year_1.UnitBalanceOneYear)),
|
|
83
|
-
__param(5, (0, typeorm_1.InjectRepository)(unit_balance_1.UnitBalance)),
|
|
84
82
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
85
83
|
typeorm_2.Repository,
|
|
86
84
|
typeorm_2.Repository,
|
|
87
85
|
typeorm_2.Repository,
|
|
88
|
-
typeorm_2.Repository,
|
|
89
86
|
typeorm_2.Repository])
|
|
90
87
|
], UnitBalanceRepository);
|