@dhedge/backend-flatcoin-core 0.1.5 → 0.1.6
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/chunk-DSJHHCBP.mjs +26 -0
- package/dist/{chunk-YD2VGIAX.js.map → chunk-DSJHHCBP.mjs.map} +1 -1
- package/dist/chunk-S2FWJ7OG.mjs +21 -0
- package/dist/entity/{index.js → index.mjs} +5 -3
- package/dist/entity/{index.js.map → index.mjs.map} +1 -1
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/{index.js → index.mjs} +3 -2
- package/entity/package.json +1 -1
- package/package.json +10 -10
- package/utils/package.json +1 -1
- package/dist/chunk-YD2VGIAX.js +0 -39
- package/dist/index.js +0 -1
- /package/dist/{index.js.map → chunk-S2FWJ7OG.mjs.map} +0 -0
- /package/dist/entity/{index.d.ts → index.d.mts} +0 -0
- /package/dist/{index.d.ts → index.d.mts} +0 -0
- /package/dist/utils/{index.d.ts → index.d.mts} +0 -0
- /package/dist/utils/{index.js.map → index.mjs.map} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/utils/column.numeric.transformer.ts
|
|
2
|
+
import { BigNumber } from "ethers";
|
|
3
|
+
var ColumnNumericTransformer = class {
|
|
4
|
+
to(data) {
|
|
5
|
+
return data;
|
|
6
|
+
}
|
|
7
|
+
from(data) {
|
|
8
|
+
return parseFloat(data);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var numericTransformer = new ColumnNumericTransformer();
|
|
12
|
+
var ColumnBigNumberTransformer = class {
|
|
13
|
+
to(data) {
|
|
14
|
+
return data == null ? void 0 : data.toBigInt();
|
|
15
|
+
}
|
|
16
|
+
from(data) {
|
|
17
|
+
return data ? BigNumber.from(data) : null;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var bigNumberTransformer = new ColumnBigNumberTransformer();
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
numericTransformer,
|
|
24
|
+
bigNumberTransformer
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-DSJHHCBP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/column.numeric.transformer.ts"],"sourcesContent":["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":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/column.numeric.transformer.ts"],"sourcesContent":["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":";AAAA,SAAS,iBAAiB;AAE1B,IAAM,2BAAN,MAA+B;AAAA,EAC7B,GAAG,MAAsB;AACvB,WAAO;AAAA,EACT;AAAA,EAEA,KAAK,MAAsB;AACzB,WAAO,WAAW,IAAI;AAAA,EACxB;AACF;AAEO,IAAM,qBAAqB,IAAI,yBAAyB;AAE/D,IAAM,6BAAN,MAAiC;AAAA,EAC/B,GAAG,MAAsC;AACvC,WAAO,6BAAM;AAAA,EACf;AAAA,EAEA,KAAK,MAAiC;AACpC,WAAO,OAAO,UAAU,KAAK,IAAI,IAAI;AAAA,EACvC;AACF;AAEO,IAAM,uBAAuB,IAAI,2BAA2B;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
5
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
6
|
+
};
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result)
|
|
13
|
+
__defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
__commonJS,
|
|
19
|
+
__decorateClass
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-S2FWJ7OG.mjs.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__decorateClass,
|
|
3
2
|
numericTransformer
|
|
4
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DSJHHCBP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "../chunk-S2FWJ7OG.mjs";
|
|
5
7
|
|
|
6
8
|
// src/entity/apy.ts
|
|
7
9
|
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
@@ -106,4 +108,4 @@ export {
|
|
|
106
108
|
FlatcoinPriceOneYear,
|
|
107
109
|
FlatcoinPriceParent
|
|
108
110
|
};
|
|
109
|
-
//# sourceMappingURL=index.
|
|
111
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/entity/apy.ts","../../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"],"sourcesContent":["import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';\nimport { Field, Float, ObjectType } from '@nestjs/graphql';\nimport { numericTransformer } from '../utils';\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 { 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"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/entity/apy.ts","../../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"],"sourcesContent":["import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';\nimport { Field, Float, ObjectType } from '@nestjs/graphql';\nimport { numericTransformer } from '../utils';\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 { 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"],"mappings":";;;;;;;;AAAA,SAAS,QAAQ,QAAQ,8BAA8B;AACvD,SAAS,OAAO,OAAO,kBAAkB;AAKlC,IAAM,MAAN,MAAU;AAejB;AAbE;AAAA,EADC,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAAA,GAD3B,IAEX;AAIA;AAAA,EAFC,MAAM,MAAM,OAAO,EAAE,UAAU,MAAM,CAAC;AAAA,EACtC,OAAO,EAAE,MAAM,WAAW,MAAM,WAAW,WAAW,IAAI,OAAO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,IAAM,sBAAN,cAAkC,oBAAoB;AAAC;AAAjD,sBAAN;AAAA,EADNC,QAAO,EAAE,MAAM,qBAAqB,CAAC;AAAA,GACzB;;;AEJb,SAAS,UAAAC,eAAc;AAIhB,IAAM,wBAAN,cAAoC,oBAAoB;AAAC;AAAnD,wBAAN;AAAA,EADNC,QAAO,EAAE,MAAM,qBAAqB,CAAC;AAAA,GACzB;;;ACJb,SAAS,UAAAC,eAAc;AAIhB,IAAM,uBAAN,cAAmC,oBAAoB;AAAC;AAAlD,uBAAN;AAAA,EADNC,QAAO,EAAE,MAAM,qBAAqB,CAAC;AAAA,GACzB;;;ACJb,SAAS,UAAAC,eAAc;AAIhB,IAAM,uBAAN,cAAmC,oBAAoB;AAAC;AAAlD,uBAAN;AAAA,EADNC,QAAO,EAAE,MAAM,qBAAqB,CAAC;AAAA,GACzB;;;ACJb,SAAS,UAAAC,eAAc;AAIhB,IAAM,gBAAN,cAA4B,oBAAoB;AAAC;AAA3C,gBAAN;AAAA,EADNC,QAAO,EAAE,MAAM,kBAAkB,CAAC;AAAA,GACtB;","names":["Entity","Entity","PrimaryGeneratedColumn","Column","Field","ObjectType","PrimaryGeneratedColumn","Field","Column","ObjectType","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity","Entity"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":[""],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bigNumberTransformer,
|
|
3
3
|
numericTransformer
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DSJHHCBP.mjs";
|
|
5
|
+
import "../chunk-S2FWJ7OG.mjs";
|
|
5
6
|
export {
|
|
6
7
|
bigNumberTransformer,
|
|
7
8
|
numericTransformer
|
|
8
9
|
};
|
|
9
|
-
//# sourceMappingURL=index.
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
package/entity/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhedge/backend-flatcoin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Backend Flatcoin Core",
|
|
5
|
-
"type": "
|
|
6
|
-
"main": "dist/index.
|
|
7
|
-
"types": "dist/index.d.
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.mts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/index.d.
|
|
11
|
-
"default": "./dist/index.
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
12
12
|
},
|
|
13
13
|
"./entity": {
|
|
14
|
-
"types": "./dist/entity/index.d.
|
|
15
|
-
"default": "./dist/entity/index.
|
|
14
|
+
"types": "./dist/entity/index.d.mts",
|
|
15
|
+
"default": "./dist/entity/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"./utils": {
|
|
18
|
-
"types": "./dist/utils/index.d.
|
|
19
|
-
"default": "./dist/utils/index.
|
|
18
|
+
"types": "./dist/utils/index.d.mts",
|
|
19
|
+
"default": "./dist/utils/index.mjs"
|
|
20
20
|
},
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
package/utils/package.json
CHANGED
package/dist/chunk-YD2VGIAX.js
DELETED
|
@@ -1,39 +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/utils/column.numeric.transformer.ts
|
|
14
|
-
import { BigNumber } from "ethers";
|
|
15
|
-
var ColumnNumericTransformer = class {
|
|
16
|
-
to(data) {
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
from(data) {
|
|
20
|
-
return parseFloat(data);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var numericTransformer = new ColumnNumericTransformer();
|
|
24
|
-
var ColumnBigNumberTransformer = class {
|
|
25
|
-
to(data) {
|
|
26
|
-
return data == null ? void 0 : data.toBigInt();
|
|
27
|
-
}
|
|
28
|
-
from(data) {
|
|
29
|
-
return data ? BigNumber.from(data) : null;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var bigNumberTransformer = new ColumnBigNumberTransformer();
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
__decorateClass,
|
|
36
|
-
numericTransformer,
|
|
37
|
-
bigNumberTransformer
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-YD2VGIAX.js.map
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|