tardis-dev 18.0.1 → 18.0.2
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/README.md +1 -1
- package/dist/debug.d.ts +12 -2
- package/dist/debug.d.ts.map +1 -1
- package/dist/debug.js +2 -1
- package/dist/debug.js.map +1 -1
- package/dist/handy.d.ts +3 -1
- package/dist/handy.d.ts.map +1 -1
- package/dist/handy.js +72 -86
- package/dist/handy.js.map +1 -1
- package/dist/realtimefeeds/mexc.d.ts +0 -7
- package/dist/realtimefeeds/mexc.d.ts.map +1 -1
- package/dist/realtimefeeds/mexc.js +2 -70
- package/dist/realtimefeeds/mexc.js.map +1 -1
- package/dist/realtimefeeds/mexcprotobuf.d.ts +43 -0
- package/dist/realtimefeeds/mexcprotobuf.d.ts.map +1 -0
- package/dist/realtimefeeds/mexcprotobuf.js +294 -0
- package/dist/realtimefeeds/mexcprotobuf.js.map +1 -0
- package/dist/realtimefeeds/realtimefeed.d.ts +3 -3
- package/dist/realtimefeeds/realtimefeed.d.ts.map +1 -1
- package/dist/realtimefeeds/realtimefeed.js +3 -3
- package/dist/realtimefeeds/realtimefeed.js.map +1 -1
- package/dist/worker.js +2 -2
- package/dist/worker.js.map +1 -1
- package/package.json +3 -7
- package/src/debug.ts +16 -1
- package/src/external-modules.d.ts +5 -0
- package/src/handy.ts +93 -89
- package/src/realtimefeeds/mexc.ts +2 -72
- package/src/realtimefeeds/mexcprotobuf.ts +364 -0
- package/src/realtimefeeds/realtimefeed.ts +5 -5
- package/src/worker.ts +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import dbg from 'debug'
|
|
2
1
|
import WebSocket, { createWebSocketStream } from 'ws'
|
|
3
2
|
import type { ClientRequestArgs } from 'http'
|
|
4
3
|
import { PassThrough, Writable } from 'stream'
|
|
5
4
|
import { setTimeout as sleep } from 'node:timers/promises'
|
|
5
|
+
import { createDebug, type DebugLogger } from '../debug.ts'
|
|
6
6
|
import { getProxyAgent, ONE_SEC_IN_MS, optimizeFilters } from '../handy.ts'
|
|
7
7
|
import { createManagedRealTimeIterator, mergeRealTime, type ManagedRealTimeIterator } from '../realtimeiterator.ts'
|
|
8
8
|
import { Exchange, Filter } from '../types.ts'
|
|
@@ -34,7 +34,7 @@ export abstract class RealTimeFeedBase implements RealTimeFeedIterable {
|
|
|
34
34
|
return createManagedRealTimeIterator(this._stream(), () => this._close())
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
protected readonly debug:
|
|
37
|
+
protected readonly debug: DebugLogger
|
|
38
38
|
protected abstract readonly wssURL: string
|
|
39
39
|
protected readonly throttleSubscribeMS: number = 0
|
|
40
40
|
protected readonly manualSnapshotsBuffer: any[] = []
|
|
@@ -53,7 +53,7 @@ export abstract class RealTimeFeedBase implements RealTimeFeedIterable {
|
|
|
53
53
|
private readonly _onError?: (error: Error) => void
|
|
54
54
|
) {
|
|
55
55
|
this._filters = optimizeFilters(filters)
|
|
56
|
-
this.debug =
|
|
56
|
+
this.debug = createDebug(`tardis-dev:realtime:${_exchange}`)
|
|
57
57
|
|
|
58
58
|
this._wsClientOptions = {
|
|
59
59
|
headers: {
|
|
@@ -479,7 +479,7 @@ export abstract class MultiConnectionRealTimeFeedBase implements RealTimeFeedIte
|
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
export abstract class PoolingClientBase implements RealTimeFeedIterable {
|
|
482
|
-
protected readonly debug:
|
|
482
|
+
protected readonly debug: DebugLogger
|
|
483
483
|
private _tid: NodeJS.Timeout | undefined = undefined
|
|
484
484
|
private _outputStream: PassThrough | undefined
|
|
485
485
|
|
|
@@ -488,7 +488,7 @@ export abstract class PoolingClientBase implements RealTimeFeedIterable {
|
|
|
488
488
|
private readonly _poolingIntervalSeconds: number,
|
|
489
489
|
protected readonly onError?: (error: Error) => void
|
|
490
490
|
) {
|
|
491
|
-
this.debug =
|
|
491
|
+
this.debug = createDebug(`tardis-dev:pooling-client:${exchange}`)
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
[Symbol.asyncIterator](): ManagedRealTimeIterator<any> {
|
package/src/worker.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import dbg from 'debug'
|
|
2
1
|
import { existsSync } from 'node:fs'
|
|
3
2
|
import { isMainThread, parentPort, workerData } from 'worker_threads'
|
|
3
|
+
import { createDebug } from './debug.ts'
|
|
4
4
|
import { forEachConcurrent } from './foreachconcurrent.ts'
|
|
5
5
|
import { addMinutes, download, formatDateToPath, optimizeFilters, sha256, wait, cleanTempFiles } from './handy.ts'
|
|
6
6
|
import type { DataFeedCompression } from './options.ts'
|
|
7
7
|
import { Exchange, Filter } from './types.ts'
|
|
8
|
-
const debug =
|
|
8
|
+
const debug = createDebug('tardis-dev')
|
|
9
9
|
|
|
10
10
|
const DEFAULT_DATA_FEED_SLICE_SIZE = 1
|
|
11
11
|
|