tardis-dev 13.24.1 → 13.25.0
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/consts.d.ts +4 -4
- package/dist/consts.d.ts.map +1 -1
- package/dist/consts.js +4 -0
- package/dist/consts.js.map +1 -1
- package/dist/mappers/binance.d.ts +1 -0
- package/dist/mappers/binance.d.ts.map +1 -1
- package/dist/mappers/binance.js +1 -1
- package/dist/mappers/gateiofutures.d.ts +2 -0
- package/dist/mappers/gateiofutures.d.ts.map +1 -1
- package/dist/mappers/gateiofutures.js +3 -0
- package/dist/mappers/gateiofutures.js.map +1 -1
- package/dist/mappers/index.d.ts.map +1 -1
- package/dist/mappers/index.js +16 -5
- package/dist/mappers/index.js.map +1 -1
- package/dist/mappers/okex.d.ts +20 -2
- package/dist/mappers/okex.d.ts.map +1 -1
- package/dist/mappers/okex.js +11 -2
- package/dist/mappers/okex.js.map +1 -1
- package/dist/mappers/woox.d.ts.map +1 -1
- package/dist/mappers/woox.js +4 -0
- package/dist/mappers/woox.js.map +1 -1
- package/dist/realtimefeeds/deribit.d.ts +1 -1
- package/dist/realtimefeeds/deribit.d.ts.map +1 -1
- package/dist/realtimefeeds/deribit.js +8 -1
- package/dist/realtimefeeds/deribit.js.map +1 -1
- package/dist/realtimefeeds/okex.d.ts +15 -5
- package/dist/realtimefeeds/okex.d.ts.map +1 -1
- package/dist/realtimefeeds/okex.js +38 -14
- package/dist/realtimefeeds/okex.js.map +1 -1
- package/package.json +1 -1
- package/src/consts.ts +4 -0
- package/src/mappers/binance.ts +2 -1
- package/src/mappers/gateiofutures.ts +6 -0
- package/src/mappers/index.ts +17 -5
- package/src/mappers/okex.ts +17 -3
- package/src/mappers/woox.ts +4 -0
- package/src/realtimefeeds/deribit.ts +8 -1
- package/src/realtimefeeds/okex.ts +65 -8
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import { inflateRawSync } from 'zlib'
|
|
2
1
|
import crypto from 'crypto'
|
|
3
2
|
import { wait } from '../handy'
|
|
4
3
|
import { Filter } from '../types'
|
|
5
|
-
import { RealTimeFeedBase } from './realtimefeed'
|
|
4
|
+
import { MultiConnectionRealTimeFeedBase, RealTimeFeedBase } from './realtimefeed'
|
|
6
5
|
|
|
7
|
-
export class OkexRealTimeFeed extends
|
|
8
|
-
protected
|
|
6
|
+
export class OkexRealTimeFeed extends MultiConnectionRealTimeFeedBase {
|
|
7
|
+
protected *_getRealTimeFeeds(exchange: string, filters: Filter<string>[], timeoutIntervalMS?: number, onError?: (error: Error) => void) {
|
|
8
|
+
const nonBusinessFilters = filters.filter((f) => f.channel !== 'trades-all')
|
|
9
|
+
|
|
10
|
+
if (nonBusinessFilters.length > 0) {
|
|
11
|
+
yield new OkexSingleRealTimeFeed('wss://ws.okx.com:8443/ws/v5/public', exchange, nonBusinessFilters, timeoutIntervalMS, onError)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const businessFilters = filters.filter((f) => f.channel === 'trades-all')
|
|
15
|
+
|
|
16
|
+
if (businessFilters.length > 0) {
|
|
17
|
+
yield new OkexSingleRealTimeFeed('wss://ws.okx.com:8443/ws/v5/business', exchange, businessFilters, timeoutIntervalMS, onError)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class OkexSingleRealTimeFeed extends RealTimeFeedBase {
|
|
23
|
+
constructor(
|
|
24
|
+
protected wssURL: string,
|
|
25
|
+
exchange: string,
|
|
26
|
+
filters: Filter<string>[],
|
|
27
|
+
timeoutIntervalMS: number | undefined,
|
|
28
|
+
onError?: (error: Error) => void
|
|
29
|
+
) {
|
|
30
|
+
super(exchange, filters, timeoutIntervalMS, onError)
|
|
31
|
+
}
|
|
9
32
|
|
|
10
33
|
private _hasCredentials = process.env.OKX_API_KEY !== undefined
|
|
11
34
|
|
|
@@ -78,11 +101,45 @@ export class OkexRealTimeFeed extends RealTimeFeedBase {
|
|
|
78
101
|
}
|
|
79
102
|
}
|
|
80
103
|
|
|
81
|
-
export class OKCoinRealTimeFeed extends
|
|
82
|
-
|
|
104
|
+
export class OKCoinRealTimeFeed extends OkexSingleRealTimeFeed {
|
|
105
|
+
constructor(exchange: string, filters: Filter<string>[], timeoutIntervalMS: number | undefined, onError?: (error: Error) => void) {
|
|
106
|
+
super('wss://real.okcoin.com:8443/ws/v5/public', exchange, filters, timeoutIntervalMS, onError)
|
|
107
|
+
}
|
|
83
108
|
}
|
|
84
109
|
|
|
85
|
-
export class OkexOptionsRealTimeFeed extends
|
|
110
|
+
export class OkexOptionsRealTimeFeed extends MultiConnectionRealTimeFeedBase {
|
|
111
|
+
protected *_getRealTimeFeeds(exchange: string, filters: Filter<string>[], timeoutIntervalMS?: number, onError?: (error: Error) => void) {
|
|
112
|
+
const nonBusinessFilters = filters.filter((f) => f.channel !== 'trades-all')
|
|
113
|
+
|
|
114
|
+
if (nonBusinessFilters.length > 0) {
|
|
115
|
+
yield new OkexOptionsSingleRealTimeFeed(
|
|
116
|
+
'wss://ws.okx.com:8443/ws/v5/public',
|
|
117
|
+
exchange,
|
|
118
|
+
nonBusinessFilters,
|
|
119
|
+
timeoutIntervalMS,
|
|
120
|
+
onError
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const businessFilters = filters.filter((f) => f.channel === 'trades-all')
|
|
125
|
+
|
|
126
|
+
if (businessFilters.length > 0) {
|
|
127
|
+
yield new OkexOptionsSingleRealTimeFeed('wss://ws.okx.com:8443/ws/v5/business', exchange, businessFilters, timeoutIntervalMS, onError)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
class OkexOptionsSingleRealTimeFeed extends OkexSingleRealTimeFeed {
|
|
133
|
+
constructor(
|
|
134
|
+
protected wssURL: string,
|
|
135
|
+
exchange: string,
|
|
136
|
+
filters: Filter<string>[],
|
|
137
|
+
timeoutIntervalMS: number | undefined,
|
|
138
|
+
onError?: (error: Error) => void
|
|
139
|
+
) {
|
|
140
|
+
super(wssURL, exchange, filters, timeoutIntervalMS, onError)
|
|
141
|
+
}
|
|
142
|
+
|
|
86
143
|
private _defaultIndexes = ['BTC-USD', 'ETH-USD']
|
|
87
144
|
|
|
88
145
|
private _channelRequiresIndexNotSymbol(channel: string) {
|
|
@@ -114,7 +171,7 @@ export class OkexOptionsRealTimeFeed extends OkexRealTimeFeed {
|
|
|
114
171
|
return {
|
|
115
172
|
channel: filter.channel,
|
|
116
173
|
instId: filter.channel !== 'opt-summary' ? finalSymbol : undefined,
|
|
117
|
-
|
|
174
|
+
instFamily: filter.channel === 'opt-summary' ? finalSymbol : undefined
|
|
118
175
|
}
|
|
119
176
|
})
|
|
120
177
|
})
|