tardis-dev
Advanced tools
Comparing version 13.1.14 to 13.1.15
@@ -122,12 +122,12 @@ "use strict"; | ||
okex: (localTimestamp) => shouldUseOkexV5Mappers(localTimestamp) | ||
? new okex_1.OkexV5BookChangeMapper('okex') | ||
? new okex_1.OkexV5BookChangeMapper('okex', isRealTime(localTimestamp)) | ||
: new okex_1.OkexBookChangeMapper('okex', 'spot', localTimestamp.valueOf() >= new Date('2020-04-10').valueOf()), | ||
'okex-futures': (localTimestamp) => shouldUseOkexV5Mappers(localTimestamp) | ||
? new okex_1.OkexV5BookChangeMapper('okex-futures') | ||
? new okex_1.OkexV5BookChangeMapper('okex-futures', isRealTime(localTimestamp)) | ||
: new okex_1.OkexBookChangeMapper('okex-futures', 'futures', localTimestamp.valueOf() >= new Date('2019-12-05').valueOf()), | ||
'okex-swap': (localTimestamp) => shouldUseOkexV5Mappers(localTimestamp) | ||
? new okex_1.OkexV5BookChangeMapper('okex-swap') | ||
? new okex_1.OkexV5BookChangeMapper('okex-swap', isRealTime(localTimestamp)) | ||
: new okex_1.OkexBookChangeMapper('okex-swap', 'swap', localTimestamp.valueOf() >= new Date('2020-02-08').valueOf()), | ||
'okex-options': (localTimestamp) => shouldUseOkexV5Mappers(localTimestamp) | ||
? new okex_1.OkexV5BookChangeMapper('okex-options') | ||
? new okex_1.OkexV5BookChangeMapper('okex-options', isRealTime(localTimestamp)) | ||
: new okex_1.OkexBookChangeMapper('okex-options', 'option', localTimestamp.valueOf() >= new Date('2020-02-08').valueOf()), | ||
@@ -134,0 +134,0 @@ huobi: (localTimestamp) => localTimestamp.valueOf() >= new Date('2020-07-03').valueOf() |
@@ -15,6 +15,7 @@ import { BookChange, BookTicker, DerivativeTicker, Exchange, Liquidation, OptionSummary, Trade } from '../types'; | ||
private readonly _exchange; | ||
constructor(_exchange: Exchange); | ||
private readonly _usePublicBooksChannel; | ||
constructor(_exchange: Exchange, _usePublicBooksChannel: boolean); | ||
canHandle(message: any): boolean; | ||
getFilters(symbols?: string[]): { | ||
channel: "books-l2-tbt"; | ||
channel: any; | ||
symbols: string[] | undefined; | ||
@@ -21,0 +22,0 @@ }[]; |
@@ -50,4 +50,5 @@ "use strict"; | ||
class OkexV5BookChangeMapper { | ||
constructor(_exchange) { | ||
constructor(_exchange, _usePublicBooksChannel) { | ||
this._exchange = _exchange; | ||
this._usePublicBooksChannel = _usePublicBooksChannel; | ||
} | ||
@@ -58,2 +59,5 @@ canHandle(message) { | ||
} | ||
if (this._usePublicBooksChannel) { | ||
return message.arg.channel === 'books'; | ||
} | ||
return message.arg.channel === 'books-l2-tbt'; | ||
@@ -63,2 +67,10 @@ } | ||
symbols = (0, handy_1.upperCaseSymbols)(symbols); | ||
if (this._usePublicBooksChannel) { | ||
return [ | ||
{ | ||
channel: `books`, | ||
symbols | ||
} | ||
]; | ||
} | ||
return [ | ||
@@ -65,0 +77,0 @@ { |
@@ -9,3 +9,3 @@ "use strict"; | ||
super(...arguments); | ||
this.wssURL = 'wss://ws.okex.com:8443/ws/v5/public'; | ||
this.wssURL = 'wss://ws.okx.com:8443/ws/v5/public'; | ||
} | ||
@@ -12,0 +12,0 @@ mapToSubscribeMessages(filters) { |
{ | ||
"name": "tardis-dev", | ||
"version": "13.1.14", | ||
"version": "13.1.15", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=12" |
@@ -177,7 +177,7 @@ import { ONE_SEC_IN_MS } from '../handy' | ||
shouldUseOkexV5Mappers(localTimestamp) | ||
? new OkexV5BookChangeMapper('okex') | ||
? new OkexV5BookChangeMapper('okex', isRealTime(localTimestamp)) | ||
: new OkexBookChangeMapper('okex', 'spot', localTimestamp.valueOf() >= new Date('2020-04-10').valueOf()), | ||
'okex-futures': (localTimestamp: Date) => | ||
shouldUseOkexV5Mappers(localTimestamp) | ||
? new OkexV5BookChangeMapper('okex-futures') | ||
? new OkexV5BookChangeMapper('okex-futures', isRealTime(localTimestamp)) | ||
: new OkexBookChangeMapper('okex-futures', 'futures', localTimestamp.valueOf() >= new Date('2019-12-05').valueOf()), | ||
@@ -187,7 +187,7 @@ | ||
shouldUseOkexV5Mappers(localTimestamp) | ||
? new OkexV5BookChangeMapper('okex-swap') | ||
? new OkexV5BookChangeMapper('okex-swap', isRealTime(localTimestamp)) | ||
: new OkexBookChangeMapper('okex-swap', 'swap', localTimestamp.valueOf() >= new Date('2020-02-08').valueOf()), | ||
'okex-options': (localTimestamp: Date) => | ||
shouldUseOkexV5Mappers(localTimestamp) | ||
? new OkexV5BookChangeMapper('okex-options') | ||
? new OkexV5BookChangeMapper('okex-options', isRealTime(localTimestamp)) | ||
: new OkexBookChangeMapper('okex-options', 'option', localTimestamp.valueOf() >= new Date('2020-02-08').valueOf()), | ||
@@ -194,0 +194,0 @@ |
@@ -54,3 +54,3 @@ import { asNumberIfValid, upperCaseSymbols } from '../handy' | ||
export class OkexV5BookChangeMapper implements Mapper<OKEX_EXCHANGES, BookChange> { | ||
constructor(private readonly _exchange: Exchange) {} | ||
constructor(private readonly _exchange: Exchange, private readonly _usePublicBooksChannel: boolean) {} | ||
@@ -61,2 +61,6 @@ canHandle(message: any) { | ||
} | ||
if (this._usePublicBooksChannel) { | ||
return message.arg.channel === 'books' | ||
} | ||
return message.arg.channel === 'books-l2-tbt' | ||
@@ -68,2 +72,11 @@ } | ||
if (this._usePublicBooksChannel) { | ||
return [ | ||
{ | ||
channel: `books` as any, | ||
symbols | ||
} | ||
] | ||
} | ||
return [ | ||
@@ -70,0 +83,0 @@ { |
@@ -6,3 +6,3 @@ import { inflateRawSync } from 'zlib' | ||
export class OkexRealTimeFeed extends RealTimeFeedBase { | ||
protected wssURL = 'wss://ws.okex.com:8443/ws/v5/public' | ||
protected wssURL = 'wss://ws.okx.com:8443/ws/v5/public' | ||
@@ -9,0 +9,0 @@ protected mapToSubscribeMessages(filters: Filter<string>[]): any[] { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1393593
25550