@dhedge/backend-flatcoin-core 0.1.12 → 0.1.13
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/.eslintrc.cjs +25 -0
- package/.github/workflows/checks.yml +27 -0
- package/.github/workflows/publish.yml +25 -0
- package/.prettierrc +5 -0
- package/package.json +13 -24
- package/src/entity/apy.ts +22 -0
- package/src/entity/flatcoin.price.one.day.ts +5 -0
- package/src/entity/flatcoin.price.one.month.ts +5 -0
- package/src/entity/flatcoin.price.one.week.ts +5 -0
- package/src/entity/flatcoin.price.one.year.ts +5 -0
- package/src/entity/flatcoin.price.parent.ts +24 -0
- package/src/entity/flatcoin.price.ts +5 -0
- package/src/entity/index.ts +7 -0
- package/src/index.ts +2 -0
- package/src/utils/column.numeric.transformer.ts +25 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.json +22 -0
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -139
- package/dist/index.js.map +0 -1
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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.cjs'],
|
|
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1,25 @@
|
|
|
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
ADDED
package/package.json
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhedge/backend-flatcoin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Backend Flatcoin Core",
|
|
5
5
|
"type": "module",
|
|
6
|
-
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"default": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"/dist"
|
|
17
|
-
],
|
|
18
|
-
"sideEffects": false,
|
|
6
|
+
|
|
19
7
|
"dependencies": {
|
|
20
8
|
"@nestjs/graphql": "^12.0.9",
|
|
21
9
|
"typeorm": "^0.3.17",
|
|
@@ -25,17 +13,17 @@
|
|
|
25
13
|
"@swc/core": "^1.3.90",
|
|
26
14
|
"@types/dedent": "^0.7.0",
|
|
27
15
|
"@types/fs-extra": "^11.0.1",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
17
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
30
18
|
"dedent": "^0.7.0",
|
|
31
|
-
"eslint": "^8.
|
|
32
|
-
"eslint-config-prettier": "^
|
|
33
|
-
"eslint-plugin-prettier": "^
|
|
19
|
+
"eslint": "^8.0.1",
|
|
20
|
+
"eslint-config-prettier": "^8.3.0",
|
|
21
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
34
22
|
"execa": "^7.1.1",
|
|
35
23
|
"fs-extra": "^11.1.1",
|
|
36
|
-
"prettier": "3.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
24
|
+
"prettier": "^2.3.2",
|
|
25
|
+
"typescript": "^5.0.0",
|
|
26
|
+
"rimraf": "5.0.5"
|
|
39
27
|
},
|
|
40
28
|
"repository": {
|
|
41
29
|
"type": "git",
|
|
@@ -45,10 +33,11 @@
|
|
|
45
33
|
"scripts": {
|
|
46
34
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
47
35
|
"lint-fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
48
|
-
"build": "
|
|
36
|
+
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
49
37
|
"typecheck": "tsc --noEmit",
|
|
50
38
|
"precommit": "npm run lint && npm run typecheck && npm run test",
|
|
51
|
-
"prepublish": "npm run build",
|
|
39
|
+
"prepublish:npm": "npm run build",
|
|
40
|
+
"publish:npm": "npm publish",
|
|
52
41
|
"test": "vitest run --coverage"
|
|
53
42
|
}
|
|
54
43
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -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';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './column.numeric.transformer';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare abstract class FlatcoinPriceParent {
|
|
2
|
-
id: number;
|
|
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 };
|
package/dist/index.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// src/entity/flatcoin.price.one.day.ts
|
|
14
|
-
import { Entity as Entity2 } from "typeorm";
|
|
15
|
-
|
|
16
|
-
// src/entity/flatcoin.price.parent.ts
|
|
17
|
-
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
|
18
|
-
import { Field, ObjectType } from "@nestjs/graphql";
|
|
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
|
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"]}
|