@tradejs/infra 1.0.3 → 1.0.4
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/timescale.d.mts +2 -23
- package/dist/timescale.d.ts +2 -23
- package/package.json +2 -2
package/dist/timescale.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool } from 'pg';
|
|
2
|
-
import { KlineChartData } from '@tradejs/types';
|
|
2
|
+
import { DerivativesInterval, KlineChartData, DerivativesRow, SpreadRow } from '@tradejs/types';
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
var __pgPool__: Pool | undefined;
|
|
@@ -15,27 +15,6 @@ type CandleRow = {
|
|
|
15
15
|
volume?: number | null;
|
|
16
16
|
turnover?: number | null;
|
|
17
17
|
};
|
|
18
|
-
type DerivativesInterval = '15m' | '1h';
|
|
19
|
-
type DerivativesRow = {
|
|
20
|
-
symbol: string;
|
|
21
|
-
interval: DerivativesInterval;
|
|
22
|
-
ts: Date;
|
|
23
|
-
openInterest?: number | null;
|
|
24
|
-
fundingRate?: number | null;
|
|
25
|
-
liqLong?: number | null;
|
|
26
|
-
liqShort?: number | null;
|
|
27
|
-
liqTotal?: number | null;
|
|
28
|
-
source?: string | null;
|
|
29
|
-
};
|
|
30
|
-
type SpreadRow = {
|
|
31
|
-
symbol: string;
|
|
32
|
-
interval: DerivativesInterval;
|
|
33
|
-
ts: Date;
|
|
34
|
-
binancePrice?: number | null;
|
|
35
|
-
coinbasePrice?: number | null;
|
|
36
|
-
spread?: number | null;
|
|
37
|
-
source?: string | null;
|
|
38
|
-
};
|
|
39
18
|
declare const toRows: (symbol: string, interval: number, data: KlineChartData) => CandleRow[];
|
|
40
19
|
declare function upsertCandles(rows: CandleRow[]): Promise<void>;
|
|
41
20
|
declare function upsertDerivatives(rows: DerivativesRow[]): Promise<void>;
|
|
@@ -65,4 +44,4 @@ declare function findContinuityGap(symbol: string, interval: number): Promise<{
|
|
|
65
44
|
diffSeconds: number;
|
|
66
45
|
} | null>;
|
|
67
46
|
|
|
68
|
-
export { type CandleRow,
|
|
47
|
+
export { type CandleRow, deleteCandles, findContinuityGap, getCandlesRange, getDataEdges, getDerivativesRangeForSymbols, getDerivativesSummary, getSpreadRangeForSymbols, getSpreadSummary, toRows, upsertCandles, upsertDerivatives, upsertSpreadRows, waitForDbReady };
|
package/dist/timescale.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool } from 'pg';
|
|
2
|
-
import { KlineChartData } from '@tradejs/types';
|
|
2
|
+
import { DerivativesInterval, KlineChartData, DerivativesRow, SpreadRow } from '@tradejs/types';
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
var __pgPool__: Pool | undefined;
|
|
@@ -15,27 +15,6 @@ type CandleRow = {
|
|
|
15
15
|
volume?: number | null;
|
|
16
16
|
turnover?: number | null;
|
|
17
17
|
};
|
|
18
|
-
type DerivativesInterval = '15m' | '1h';
|
|
19
|
-
type DerivativesRow = {
|
|
20
|
-
symbol: string;
|
|
21
|
-
interval: DerivativesInterval;
|
|
22
|
-
ts: Date;
|
|
23
|
-
openInterest?: number | null;
|
|
24
|
-
fundingRate?: number | null;
|
|
25
|
-
liqLong?: number | null;
|
|
26
|
-
liqShort?: number | null;
|
|
27
|
-
liqTotal?: number | null;
|
|
28
|
-
source?: string | null;
|
|
29
|
-
};
|
|
30
|
-
type SpreadRow = {
|
|
31
|
-
symbol: string;
|
|
32
|
-
interval: DerivativesInterval;
|
|
33
|
-
ts: Date;
|
|
34
|
-
binancePrice?: number | null;
|
|
35
|
-
coinbasePrice?: number | null;
|
|
36
|
-
spread?: number | null;
|
|
37
|
-
source?: string | null;
|
|
38
|
-
};
|
|
39
18
|
declare const toRows: (symbol: string, interval: number, data: KlineChartData) => CandleRow[];
|
|
40
19
|
declare function upsertCandles(rows: CandleRow[]): Promise<void>;
|
|
41
20
|
declare function upsertDerivatives(rows: DerivativesRow[]): Promise<void>;
|
|
@@ -65,4 +44,4 @@ declare function findContinuityGap(symbol: string, interval: number): Promise<{
|
|
|
65
44
|
diffSeconds: number;
|
|
66
45
|
} | null>;
|
|
67
46
|
|
|
68
|
-
export { type CandleRow,
|
|
47
|
+
export { type CandleRow, deleteCandles, findContinuityGap, getCandlesRange, getDataEdges, getDerivativesRangeForSymbols, getDerivativesSummary, getSpreadRangeForSymbols, getSpreadSummary, toRows, upsertCandles, upsertDerivatives, upsertSpreadRows, waitForDbReady };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/infra",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Server-only infrastructure adapters for Redis, Timescale, ML, logging, and IO.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tradejs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@grpc/grpc-js": "^1.10.7",
|
|
52
52
|
"@grpc/proto-loader": "^0.7.13",
|
|
53
|
-
"@tradejs/types": "^1.0.
|
|
53
|
+
"@tradejs/types": "^1.0.4",
|
|
54
54
|
"chalk": "4.1.2",
|
|
55
55
|
"ioredis": "5.8.0",
|
|
56
56
|
"pg": "8.16.3",
|