@dhedge/backend-flatcoin-core 0.1.12 → 0.1.14
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/apy.d.ts +6 -0
- package/dist/entity/apy.js +41 -0
- package/dist/entity/flatcoin.price.d.ts +3 -0
- package/dist/entity/flatcoin.price.js +17 -0
- package/dist/entity/flatcoin.price.one.day.d.ts +3 -0
- package/dist/entity/flatcoin.price.one.day.js +17 -0
- package/dist/entity/flatcoin.price.one.month.d.ts +3 -0
- package/dist/entity/flatcoin.price.one.month.js +17 -0
- package/dist/entity/flatcoin.price.one.week.d.ts +3 -0
- package/dist/entity/flatcoin.price.one.week.js +17 -0
- package/dist/entity/flatcoin.price.one.year.d.ts +3 -0
- package/dist/entity/flatcoin.price.one.year.js +17 -0
- package/dist/entity/flatcoin.price.parent.d.ts +7 -0
- package/dist/entity/flatcoin.price.parent.js +44 -0
- package/dist/entity/index.d.ts +7 -0
- package/dist/entity/index.js +23 -0
- package/dist/index.d.ts +2 -31
- package/dist/index.js +18 -139
- package/dist/utils/column.numeric.transformer.d.ts +12 -0
- package/dist/utils/column.numeric.transformer.js +22 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/package.json +12 -12
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Apy = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
15
|
+
const utils_1 = require("../utils");
|
|
16
|
+
let Apy = class Apy {
|
|
17
|
+
};
|
|
18
|
+
exports.Apy = Apy;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'id' }),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], Apy.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
|
|
25
|
+
(0, typeorm_1.Column)({ name: 'monthly', type: 'decimal', precision: 30, scale: 2, transformer: utils_1.numericTransformer }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], Apy.prototype, "monthly", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'weekly', type: 'decimal', precision: 30, scale: 2, transformer: utils_1.numericTransformer }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], Apy.prototype, "weekly", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'daily', type: 'decimal', precision: 30, scale: 2, transformer: utils_1.numericTransformer }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], Apy.prototype, "daily", void 0);
|
|
38
|
+
exports.Apy = Apy = __decorate([
|
|
39
|
+
(0, graphql_1.ObjectType)(),
|
|
40
|
+
(0, typeorm_1.Entity)({ name: 'apy' })
|
|
41
|
+
], Apy);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FlatcoinPrice = void 0;
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const flatcoin_price_parent_1 = require("./flatcoin.price.parent");
|
|
12
|
+
let FlatcoinPrice = class FlatcoinPrice extends flatcoin_price_parent_1.FlatcoinPriceParent {
|
|
13
|
+
};
|
|
14
|
+
exports.FlatcoinPrice = FlatcoinPrice;
|
|
15
|
+
exports.FlatcoinPrice = FlatcoinPrice = __decorate([
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'flatcoin_prices' })
|
|
17
|
+
], FlatcoinPrice);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FlatcoinPriceOneDay = void 0;
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const flatcoin_price_parent_1 = require("./flatcoin.price.parent");
|
|
12
|
+
let FlatcoinPriceOneDay = class FlatcoinPriceOneDay extends flatcoin_price_parent_1.FlatcoinPriceParent {
|
|
13
|
+
};
|
|
14
|
+
exports.FlatcoinPriceOneDay = FlatcoinPriceOneDay;
|
|
15
|
+
exports.FlatcoinPriceOneDay = FlatcoinPriceOneDay = __decorate([
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'flatcoin_prices_1d' })
|
|
17
|
+
], FlatcoinPriceOneDay);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FlatcoinPriceOneMonth = void 0;
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const flatcoin_price_parent_1 = require("./flatcoin.price.parent");
|
|
12
|
+
let FlatcoinPriceOneMonth = class FlatcoinPriceOneMonth extends flatcoin_price_parent_1.FlatcoinPriceParent {
|
|
13
|
+
};
|
|
14
|
+
exports.FlatcoinPriceOneMonth = FlatcoinPriceOneMonth;
|
|
15
|
+
exports.FlatcoinPriceOneMonth = FlatcoinPriceOneMonth = __decorate([
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'flatcoin_prices_1m' })
|
|
17
|
+
], FlatcoinPriceOneMonth);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FlatcoinPriceOneWeek = void 0;
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const flatcoin_price_parent_1 = require("./flatcoin.price.parent");
|
|
12
|
+
let FlatcoinPriceOneWeek = class FlatcoinPriceOneWeek extends flatcoin_price_parent_1.FlatcoinPriceParent {
|
|
13
|
+
};
|
|
14
|
+
exports.FlatcoinPriceOneWeek = FlatcoinPriceOneWeek;
|
|
15
|
+
exports.FlatcoinPriceOneWeek = FlatcoinPriceOneWeek = __decorate([
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'flatcoin_prices_1w' })
|
|
17
|
+
], FlatcoinPriceOneWeek);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FlatcoinPriceOneYear = void 0;
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const flatcoin_price_parent_1 = require("./flatcoin.price.parent");
|
|
12
|
+
let FlatcoinPriceOneYear = class FlatcoinPriceOneYear extends flatcoin_price_parent_1.FlatcoinPriceParent {
|
|
13
|
+
};
|
|
14
|
+
exports.FlatcoinPriceOneYear = FlatcoinPriceOneYear;
|
|
15
|
+
exports.FlatcoinPriceOneYear = FlatcoinPriceOneYear = __decorate([
|
|
16
|
+
(0, typeorm_1.Entity)({ name: 'flatcoin_prices_1y' })
|
|
17
|
+
], FlatcoinPriceOneYear);
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FlatcoinPriceParent = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
15
|
+
let FlatcoinPriceParent = class FlatcoinPriceParent {
|
|
16
|
+
};
|
|
17
|
+
exports.FlatcoinPriceParent = FlatcoinPriceParent;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'id' }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], FlatcoinPriceParent.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, graphql_1.Field)(),
|
|
24
|
+
(0, typeorm_1.Column)({ name: 'price_usd', type: 'numeric', precision: 30 }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], FlatcoinPriceParent.prototype, "priceUsd", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, graphql_1.Field)(),
|
|
29
|
+
(0, typeorm_1.Column)({ name: 'price_usd_formatted', type: 'decimal', precision: 10, scale: 2 }),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], FlatcoinPriceParent.prototype, "priceUsdFormatted", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, graphql_1.Field)(),
|
|
34
|
+
(0, typeorm_1.Column)({ name: 'timestamp', type: 'numeric', precision: 25 }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], FlatcoinPriceParent.prototype, "timestamp", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ name: 'block_number', type: 'numeric', precision: 25 }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], FlatcoinPriceParent.prototype, "blockNumber", void 0);
|
|
41
|
+
exports.FlatcoinPriceParent = FlatcoinPriceParent = __decorate([
|
|
42
|
+
(0, graphql_1.ObjectType)(),
|
|
43
|
+
(0, typeorm_1.Entity)()
|
|
44
|
+
], FlatcoinPriceParent);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './apy';
|
|
2
|
+
export * from './flatcoin.price.one.day';
|
|
3
|
+
export * from './flatcoin.price.one.month';
|
|
4
|
+
export * from './flatcoin.price.one.week';
|
|
5
|
+
export * from './flatcoin.price.one.year';
|
|
6
|
+
export * from './flatcoin.price.parent';
|
|
7
|
+
export * from './flatcoin.price';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./apy"), exports);
|
|
18
|
+
__exportStar(require("./flatcoin.price.one.day"), exports);
|
|
19
|
+
__exportStar(require("./flatcoin.price.one.month"), exports);
|
|
20
|
+
__exportStar(require("./flatcoin.price.one.week"), exports);
|
|
21
|
+
__exportStar(require("./flatcoin.price.one.year"), exports);
|
|
22
|
+
__exportStar(require("./flatcoin.price.parent"), exports);
|
|
23
|
+
__exportStar(require("./flatcoin.price"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
priceUsd: string;
|
|
4
|
-
priceUsdFormatted: number;
|
|
5
|
-
timestamp: number;
|
|
6
|
-
blockNumber: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare class FlatcoinPriceOneDay extends FlatcoinPriceParent {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare class FlatcoinPriceOneMonth extends FlatcoinPriceParent {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare class FlatcoinPriceOneWeek extends FlatcoinPriceParent {
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare class FlatcoinPriceOneYear extends FlatcoinPriceParent {
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare class FlatcoinPrice extends FlatcoinPriceParent {
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare class Apy {
|
|
25
|
-
id: number;
|
|
26
|
-
monthly: number;
|
|
27
|
-
weekly: number;
|
|
28
|
-
daily: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Apy, FlatcoinPrice, FlatcoinPriceOneDay, FlatcoinPriceOneMonth, FlatcoinPriceOneWeek, FlatcoinPriceOneYear, FlatcoinPriceParent };
|
|
1
|
+
export * from './entity';
|
|
2
|
+
export * from './utils';
|
package/dist/index.js
CHANGED
|
@@ -1,139 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var FlatcoinPriceParent = class {
|
|
20
|
-
};
|
|
21
|
-
__decorateClass([
|
|
22
|
-
PrimaryGeneratedColumn({ name: "id" })
|
|
23
|
-
], FlatcoinPriceParent.prototype, "id", 2);
|
|
24
|
-
__decorateClass([
|
|
25
|
-
Field(),
|
|
26
|
-
Column({ name: "price_usd", type: "numeric", precision: 30 })
|
|
27
|
-
], FlatcoinPriceParent.prototype, "priceUsd", 2);
|
|
28
|
-
__decorateClass([
|
|
29
|
-
Field(),
|
|
30
|
-
Column({ name: "price_usd_formatted", type: "decimal", precision: 10, scale: 2 })
|
|
31
|
-
], FlatcoinPriceParent.prototype, "priceUsdFormatted", 2);
|
|
32
|
-
__decorateClass([
|
|
33
|
-
Field(),
|
|
34
|
-
Column({ name: "timestamp", type: "numeric", precision: 25 })
|
|
35
|
-
], FlatcoinPriceParent.prototype, "timestamp", 2);
|
|
36
|
-
__decorateClass([
|
|
37
|
-
Column({ name: "block_number", type: "numeric", precision: 25 })
|
|
38
|
-
], FlatcoinPriceParent.prototype, "blockNumber", 2);
|
|
39
|
-
FlatcoinPriceParent = __decorateClass([
|
|
40
|
-
ObjectType(),
|
|
41
|
-
Entity()
|
|
42
|
-
], FlatcoinPriceParent);
|
|
43
|
-
|
|
44
|
-
// src/entity/flatcoin.price.one.day.ts
|
|
45
|
-
var FlatcoinPriceOneDay = class extends FlatcoinPriceParent {
|
|
46
|
-
};
|
|
47
|
-
FlatcoinPriceOneDay = __decorateClass([
|
|
48
|
-
Entity2({ name: "flatcoin_prices_1d" })
|
|
49
|
-
], FlatcoinPriceOneDay);
|
|
50
|
-
|
|
51
|
-
// src/entity/flatcoin.price.one.month.ts
|
|
52
|
-
import { Entity as Entity3 } from "typeorm";
|
|
53
|
-
var FlatcoinPriceOneMonth = class extends FlatcoinPriceParent {
|
|
54
|
-
};
|
|
55
|
-
FlatcoinPriceOneMonth = __decorateClass([
|
|
56
|
-
Entity3({ name: "flatcoin_prices_1m" })
|
|
57
|
-
], FlatcoinPriceOneMonth);
|
|
58
|
-
|
|
59
|
-
// src/entity/flatcoin.price.one.week.ts
|
|
60
|
-
import { Entity as Entity4 } from "typeorm";
|
|
61
|
-
var FlatcoinPriceOneWeek = class extends FlatcoinPriceParent {
|
|
62
|
-
};
|
|
63
|
-
FlatcoinPriceOneWeek = __decorateClass([
|
|
64
|
-
Entity4({ name: "flatcoin_prices_1w" })
|
|
65
|
-
], FlatcoinPriceOneWeek);
|
|
66
|
-
|
|
67
|
-
// src/entity/flatcoin.price.one.year.ts
|
|
68
|
-
import { Entity as Entity5 } from "typeorm";
|
|
69
|
-
var FlatcoinPriceOneYear = class extends FlatcoinPriceParent {
|
|
70
|
-
};
|
|
71
|
-
FlatcoinPriceOneYear = __decorateClass([
|
|
72
|
-
Entity5({ name: "flatcoin_prices_1y" })
|
|
73
|
-
], FlatcoinPriceOneYear);
|
|
74
|
-
|
|
75
|
-
// src/entity/flatcoin.price.ts
|
|
76
|
-
import { Entity as Entity6 } from "typeorm";
|
|
77
|
-
var FlatcoinPrice = class extends FlatcoinPriceParent {
|
|
78
|
-
};
|
|
79
|
-
FlatcoinPrice = __decorateClass([
|
|
80
|
-
Entity6({ name: "flatcoin_prices" })
|
|
81
|
-
], FlatcoinPrice);
|
|
82
|
-
|
|
83
|
-
// src/entity/apy.ts
|
|
84
|
-
import { Column as Column2, Entity as Entity7, PrimaryGeneratedColumn as PrimaryGeneratedColumn2 } from "typeorm";
|
|
85
|
-
import { Field as Field2, Float, ObjectType as ObjectType2 } from "@nestjs/graphql";
|
|
86
|
-
|
|
87
|
-
// src/utils/column.numeric.transformer.ts
|
|
88
|
-
import { BigNumber } from "ethers";
|
|
89
|
-
var ColumnNumericTransformer = class {
|
|
90
|
-
to(data) {
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
from(data) {
|
|
94
|
-
return parseFloat(data);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
var numericTransformer = new ColumnNumericTransformer();
|
|
98
|
-
var ColumnBigNumberTransformer = class {
|
|
99
|
-
to(data) {
|
|
100
|
-
return data == null ? void 0 : data.toBigInt();
|
|
101
|
-
}
|
|
102
|
-
from(data) {
|
|
103
|
-
return data ? BigNumber.from(data) : null;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
var bigNumberTransformer = new ColumnBigNumberTransformer();
|
|
107
|
-
|
|
108
|
-
// src/entity/apy.ts
|
|
109
|
-
var Apy = class {
|
|
110
|
-
};
|
|
111
|
-
__decorateClass([
|
|
112
|
-
PrimaryGeneratedColumn2({ name: "id" })
|
|
113
|
-
], Apy.prototype, "id", 2);
|
|
114
|
-
__decorateClass([
|
|
115
|
-
Field2(() => Float, { nullable: false }),
|
|
116
|
-
Column2({ name: "monthly", type: "decimal", precision: 30, scale: 2, transformer: numericTransformer })
|
|
117
|
-
], Apy.prototype, "monthly", 2);
|
|
118
|
-
__decorateClass([
|
|
119
|
-
Field2(() => Float, { nullable: false }),
|
|
120
|
-
Column2({ name: "weekly", type: "decimal", precision: 30, scale: 2, transformer: numericTransformer })
|
|
121
|
-
], Apy.prototype, "weekly", 2);
|
|
122
|
-
__decorateClass([
|
|
123
|
-
Field2(() => Float, { nullable: false }),
|
|
124
|
-
Column2({ name: "daily", type: "decimal", precision: 30, scale: 2, transformer: numericTransformer })
|
|
125
|
-
], Apy.prototype, "daily", 2);
|
|
126
|
-
Apy = __decorateClass([
|
|
127
|
-
ObjectType2(),
|
|
128
|
-
Entity7({ name: "apy" })
|
|
129
|
-
], Apy);
|
|
130
|
-
export {
|
|
131
|
-
Apy,
|
|
132
|
-
FlatcoinPrice,
|
|
133
|
-
FlatcoinPriceOneDay,
|
|
134
|
-
FlatcoinPriceOneMonth,
|
|
135
|
-
FlatcoinPriceOneWeek,
|
|
136
|
-
FlatcoinPriceOneYear,
|
|
137
|
-
FlatcoinPriceParent
|
|
138
|
-
};
|
|
139
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./entity"), exports);
|
|
18
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BigNumber } from 'ethers';
|
|
2
|
+
declare class ColumnNumericTransformer {
|
|
3
|
+
to(data: number): number;
|
|
4
|
+
from(data: string): number;
|
|
5
|
+
}
|
|
6
|
+
export declare const numericTransformer: ColumnNumericTransformer;
|
|
7
|
+
declare class ColumnBigNumberTransformer {
|
|
8
|
+
to(data?: BigNumber): bigint | undefined;
|
|
9
|
+
from(data?: bigint): BigNumber | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const bigNumberTransformer: ColumnBigNumberTransformer;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bigNumberTransformer = exports.numericTransformer = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
class ColumnNumericTransformer {
|
|
6
|
+
to(data) {
|
|
7
|
+
return data;
|
|
8
|
+
}
|
|
9
|
+
from(data) {
|
|
10
|
+
return parseFloat(data);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.numericTransformer = new ColumnNumericTransformer();
|
|
14
|
+
class ColumnBigNumberTransformer {
|
|
15
|
+
to(data) {
|
|
16
|
+
return data?.toBigInt();
|
|
17
|
+
}
|
|
18
|
+
from(data) {
|
|
19
|
+
return data ? ethers_1.BigNumber.from(data) : null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.bigNumberTransformer = new ColumnBigNumberTransformer();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './column.numeric.transformer';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./column.numeric.transformer"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhedge/backend-flatcoin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Backend Flatcoin Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"/dist"
|
|
17
17
|
],
|
|
18
|
-
"sideEffects": false,
|
|
19
18
|
"dependencies": {
|
|
20
19
|
"@nestjs/graphql": "^12.0.9",
|
|
21
20
|
"typeorm": "^0.3.17",
|
|
@@ -25,17 +24,17 @@
|
|
|
25
24
|
"@swc/core": "^1.3.90",
|
|
26
25
|
"@types/dedent": "^0.7.0",
|
|
27
26
|
"@types/fs-extra": "^11.0.1",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
28
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
30
29
|
"dedent": "^0.7.0",
|
|
31
|
-
"eslint": "^8.
|
|
32
|
-
"eslint-config-prettier": "^
|
|
33
|
-
"eslint-plugin-prettier": "^
|
|
30
|
+
"eslint": "^8.0.1",
|
|
31
|
+
"eslint-config-prettier": "^8.3.0",
|
|
32
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
34
33
|
"execa": "^7.1.1",
|
|
35
34
|
"fs-extra": "^11.1.1",
|
|
36
|
-
"prettier": "3.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
35
|
+
"prettier": "^2.3.2",
|
|
36
|
+
"typescript": "^5.0.0",
|
|
37
|
+
"rimraf": "5.0.5"
|
|
39
38
|
},
|
|
40
39
|
"repository": {
|
|
41
40
|
"type": "git",
|
|
@@ -45,10 +44,11 @@
|
|
|
45
44
|
"scripts": {
|
|
46
45
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
47
46
|
"lint-fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
48
|
-
"build": "
|
|
47
|
+
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
49
48
|
"typecheck": "tsc --noEmit",
|
|
50
49
|
"precommit": "npm run lint && npm run typecheck && npm run test",
|
|
51
|
-
"prepublish": "npm run build",
|
|
50
|
+
"prepublish:npm": "npm run build",
|
|
51
|
+
"publish:npm": "npm publish",
|
|
52
52
|
"test": "vitest run --coverage"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entity/flatcoin.price.one.day.ts","../src/entity/flatcoin.price.parent.ts","../src/entity/flatcoin.price.one.month.ts","../src/entity/flatcoin.price.one.week.ts","../src/entity/flatcoin.price.one.year.ts","../src/entity/flatcoin.price.ts","../src/entity/apy.ts","../src/utils/column.numeric.transformer.ts"],"sourcesContent":["import { Entity } from 'typeorm';\nimport { FlatcoinPriceParent } from './flatcoin.price.parent';\n\n@Entity({ name: 'flatcoin_prices_1d' })\nexport class FlatcoinPriceOneDay extends FlatcoinPriceParent {}\n","import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';\nimport { Field, ObjectType } from '@nestjs/graphql';\n\n@ObjectType()\n@Entity()\nexport abstract class FlatcoinPriceParent {\n @PrimaryGeneratedColumn({ name: 'id' })\n id: number;\n\n @Field()\n @Column({ name: 'price_usd', type: 'numeric', precision: 30 })\n priceUsd: string;\n\n @Field()\n @Column({ name: 'price_usd_formatted', type: 'decimal', precision: 10, scale: 2 })\n priceUsdFormatted: number;\n\n @Field()\n @Column({ name: 'timestamp', type: 'numeric', precision: 25 })\n timestamp: number;\n\n @Column({ name: 'block_number', type: 'numeric', precision: 25 })\n blockNumber: number;\n}\n","import { Entity } from 'typeorm';\nimport { FlatcoinPriceParent } from './flatcoin.price.parent';\n\n@Entity({ name: 'flatcoin_prices_1m' })\nexport class FlatcoinPriceOneMonth extends FlatcoinPriceParent {}\n","import { Entity } from 'typeorm';\nimport { FlatcoinPriceParent } from './flatcoin.price.parent';\n\n@Entity({ name: 'flatcoin_prices_1w' })\nexport class FlatcoinPriceOneWeek extends FlatcoinPriceParent {}\n","import { Entity } from 'typeorm';\nimport { FlatcoinPriceParent } from './flatcoin.price.parent';\n\n@Entity({ name: 'flatcoin_prices_1y' })\nexport class FlatcoinPriceOneYear extends FlatcoinPriceParent {}\n","import { Entity } from 'typeorm';\nimport { FlatcoinPriceParent } from './flatcoin.price.parent';\n\n@Entity({ name: 'flatcoin_prices' })\nexport class FlatcoinPrice extends FlatcoinPriceParent {}\n","import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';\nimport { Field, Float, ObjectType } from '@nestjs/graphql';\nimport { numericTransformer } from '../utils/column.numeric.transformer';\n\n@ObjectType()\n@Entity({ name: 'apy' })\nexport class Apy {\n @PrimaryGeneratedColumn({ name: 'id' })\n id: number;\n\n @Field(() => Float, { nullable: false })\n @Column({ name: 'monthly', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })\n monthly: number;\n\n @Field(() => Float, { nullable: false })\n @Column({ name: 'weekly', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })\n weekly: number;\n\n @Field(() => Float, { nullable: false })\n @Column({ name: 'daily', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })\n daily: number;\n}\n","import { BigNumber } from 'ethers';\n\nclass ColumnNumericTransformer {\n to(data: number): number {\n return data;\n }\n\n from(data: string): number {\n return parseFloat(data);\n }\n}\n\nexport const numericTransformer = new ColumnNumericTransformer();\n\nclass ColumnBigNumberTransformer {\n to(data?: BigNumber): bigint | undefined {\n return data?.toBigInt();\n }\n\n from(data?: bigint): BigNumber | null {\n return data ? BigNumber.from(data) : null;\n }\n}\n\nexport const bigNumberTransformer = new ColumnBigNumberTransformer();\n"],"mappings":"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","names":["Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Column","Entity","PrimaryGeneratedColumn","Field","ObjectType","PrimaryGeneratedColumn","Field","Column","ObjectType","Entity"]}
|