@dhedge/backend-flatcoin-core 0.1.8 → 0.1.9
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.js +23 -0
- package/dist/index.js +18 -0
- package/dist/utils/column.numeric.transformer.d.ts +12 -0
- package/dist/utils/column.numeric.transformer.js +22 -0
- package/dist/utils/index.js +17 -0
- package/package.json +23 -1
- package/.eslintrc.js +0 -25
- package/.github/workflows/checks.yml +0 -27
- package/.github/workflows/publish.yml +0 -25
- package/.prettierrc +0 -5
- package/index.d.ts +0 -1
- package/index.js +0 -6
- package/index.ts +0 -1
- package/src/entity/apy.ts +0 -22
- package/src/entity/flatcoin.price.one.day.ts +0 -5
- package/src/entity/flatcoin.price.one.month.ts +0 -5
- package/src/entity/flatcoin.price.one.week.ts +0 -5
- package/src/entity/flatcoin.price.one.year.ts +0 -5
- package/src/entity/flatcoin.price.parent.ts +0 -24
- package/src/entity/flatcoin.price.ts +0 -5
- package/src/utils/column.numeric.transformer.ts +0 -25
- package/tsconfig.json +0 -22
- /package/{src/entity/index.ts → dist/entity/index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -0
|
@@ -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,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.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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,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,7 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhedge/backend-flatcoin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Backend Flatcoin Core",
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.mts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
|
+
"default": "./dist/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"./entity": {
|
|
13
|
+
"types": "./dist/entity/index.d.mts",
|
|
14
|
+
"default": "./dist/entity/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./utils": {
|
|
17
|
+
"types": "./dist/utils/index.d.mts",
|
|
18
|
+
"default": "./dist/utils/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"/entity",
|
|
24
|
+
"/utils",
|
|
25
|
+
"/dist"
|
|
26
|
+
],
|
|
5
27
|
"dependencies": {
|
|
6
28
|
"@nestjs/graphql": "^12.0.9",
|
|
7
29
|
"typeorm": "^0.3.17",
|
package/.eslintrc.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: 'tsconfig.json',
|
|
5
|
-
tsconfigRootDir: __dirname,
|
|
6
|
-
sourceType: 'module',
|
|
7
|
-
},
|
|
8
|
-
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
9
|
-
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:prettier/recommended',
|
|
12
|
-
],
|
|
13
|
-
root: true,
|
|
14
|
-
env: {
|
|
15
|
-
node: true,
|
|
16
|
-
jest: true,
|
|
17
|
-
},
|
|
18
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
-
rules: {
|
|
20
|
-
'@typescript-eslint/interface-name-prefix': 'off',
|
|
21
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
22
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Run pr checks when a PR is opened
|
|
2
|
-
on:
|
|
3
|
-
workflow_dispatch:
|
|
4
|
-
pull_request:
|
|
5
|
-
types:
|
|
6
|
-
- opened
|
|
7
|
-
- synchronize
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
run-checks:
|
|
11
|
-
name: Build
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout Repo
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
- name: Setup Node
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: 18
|
|
20
|
-
cache: 'npm'
|
|
21
|
-
- name: Install Dependencies
|
|
22
|
-
run: npm install --frozen-lockfile
|
|
23
|
-
- name: Run Checks
|
|
24
|
-
env:
|
|
25
|
-
CI: true
|
|
26
|
-
# add npm run test
|
|
27
|
-
run: npm run lint && npm run build
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
name: Publish Package to npm
|
|
2
|
-
on:
|
|
3
|
-
workflow_dispatch:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
name: Build
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v3
|
|
13
|
-
# Setup .npmrc file to publish to npm
|
|
14
|
-
- uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: '18'
|
|
17
|
-
registry-url: 'https://registry.npmjs.org'
|
|
18
|
-
scope: '@dhedge'
|
|
19
|
-
- run: npm ci
|
|
20
|
-
# add npm run test
|
|
21
|
-
- run: npm run lint
|
|
22
|
-
- run: npm run build
|
|
23
|
-
- run: npm publish
|
|
24
|
-
env:
|
|
25
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.prettierrc
DELETED
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist';
|
package/index.js
DELETED
package/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist';
|
package/src/entity/apy.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
import { Field, Float, ObjectType } from '@nestjs/graphql';
|
|
3
|
-
import { numericTransformer } from '../utils';
|
|
4
|
-
|
|
5
|
-
@ObjectType()
|
|
6
|
-
@Entity({ name: 'apy' })
|
|
7
|
-
export class Apy {
|
|
8
|
-
@PrimaryGeneratedColumn({ name: 'id' })
|
|
9
|
-
id: number;
|
|
10
|
-
|
|
11
|
-
@Field(() => Float, { nullable: false })
|
|
12
|
-
@Column({ name: 'monthly', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })
|
|
13
|
-
monthly: number;
|
|
14
|
-
|
|
15
|
-
@Field(() => Float, { nullable: false })
|
|
16
|
-
@Column({ name: 'weekly', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })
|
|
17
|
-
weekly: number;
|
|
18
|
-
|
|
19
|
-
@Field(() => Float, { nullable: false })
|
|
20
|
-
@Column({ name: 'daily', type: 'decimal', precision: 30, scale: 2, transformer: numericTransformer })
|
|
21
|
-
daily: number;
|
|
22
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
|
2
|
-
import { Field, ObjectType } from '@nestjs/graphql';
|
|
3
|
-
|
|
4
|
-
@ObjectType()
|
|
5
|
-
@Entity()
|
|
6
|
-
export abstract class FlatcoinPriceParent {
|
|
7
|
-
@PrimaryGeneratedColumn({ name: 'id' })
|
|
8
|
-
id: number;
|
|
9
|
-
|
|
10
|
-
@Field()
|
|
11
|
-
@Column({ name: 'price_usd', type: 'numeric', precision: 30 })
|
|
12
|
-
priceUsd: string;
|
|
13
|
-
|
|
14
|
-
@Field()
|
|
15
|
-
@Column({ name: 'price_usd_formatted', type: 'decimal', precision: 10, scale: 2 })
|
|
16
|
-
priceUsdFormatted: number;
|
|
17
|
-
|
|
18
|
-
@Field()
|
|
19
|
-
@Column({ name: 'timestamp', type: 'numeric', precision: 25 })
|
|
20
|
-
timestamp: number;
|
|
21
|
-
|
|
22
|
-
@Column({ name: 'block_number', type: 'numeric', precision: 25 })
|
|
23
|
-
blockNumber: number;
|
|
24
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers';
|
|
2
|
-
|
|
3
|
-
class ColumnNumericTransformer {
|
|
4
|
-
to(data: number): number {
|
|
5
|
-
return data;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
from(data: string): number {
|
|
9
|
-
return parseFloat(data);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const numericTransformer = new ColumnNumericTransformer();
|
|
14
|
-
|
|
15
|
-
class ColumnBigNumberTransformer {
|
|
16
|
-
to(data?: BigNumber): bigint | undefined {
|
|
17
|
-
return data?.toBigInt();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
from(data?: bigint): BigNumber | null {
|
|
21
|
-
return data ? BigNumber.from(data) : null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const bigNumberTransformer = new ColumnBigNumberTransformer();
|
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"strict": true,
|
|
6
|
-
"strictPropertyInitialization": false,
|
|
7
|
-
"removeComments": false,
|
|
8
|
-
"noLib": false,
|
|
9
|
-
"lib": ["es2017", "es2020.bigint"],
|
|
10
|
-
"emitDecoratorMetadata": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"useUnknownInCatchVariables": false,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"target": "ES2021",
|
|
15
|
-
"sourceMap": false,
|
|
16
|
-
"outDir": "./dist",
|
|
17
|
-
"rootDir": "./src",
|
|
18
|
-
"skipLibCheck": true
|
|
19
|
-
},
|
|
20
|
-
"include": ["src/**/*"],
|
|
21
|
-
"exclude": ["node_modules", "**/*.spec.ts", "tests"]
|
|
22
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|