tardis-dev
Advanced tools
Comparing version 13.8.0 to 13.8.1
@@ -6,2 +6,10 @@ "use strict"; | ||
const realtimefeed_1 = require("./realtimefeed"); | ||
const binanceHttpOptions = { | ||
timeout: 10 * 1000, | ||
retry: { | ||
limit: 10, | ||
statusCodes: [408, 429, 500], | ||
maxRetryAfter: 120 * 1000 | ||
} | ||
}; | ||
class BinanceRealTimeFeedBase extends realtimefeed_1.MultiConnectionRealTimeFeedBase { | ||
@@ -33,3 +41,3 @@ *_getRealTimeFeeds(exchange, filters, timeoutIntervalMS, onError) { | ||
const openInterestResponse = (await handy_1.httpClient | ||
.get(`${this._httpURL}/openInterest?symbol=${instrument.toUpperCase()}`, { timeout: 10000 }) | ||
.get(`${this._httpURL}/openInterest?symbol=${instrument.toUpperCase()}`, binanceHttpOptions) | ||
.json()); | ||
@@ -92,3 +100,3 @@ const openInterestMessage = { | ||
let currentWeightLimit = 0; | ||
const exchangeInfoResponse = await handy_1.httpClient.get(`${this._httpURL}/exchangeInfo`, { timeout: 10000, retry: 5 }); | ||
const exchangeInfoResponse = await handy_1.httpClient.get(`${this._httpURL}/exchangeInfo`, binanceHttpOptions); | ||
const exchangeInfo = JSON.parse(exchangeInfoResponse.body); | ||
@@ -130,6 +138,3 @@ const REQUEST_WEIGHT_LIMIT_ENV = `${this._exchange.toUpperCase().replace(/-/g, '_')}_REQUEST_WEIGHT_LIMIT`; | ||
} | ||
const depthSnapshotResponse = await handy_1.httpClient.get(`${this._httpURL}/depth?symbol=${symbol.toUpperCase()}&limit=1000`, { | ||
timeout: 10000, | ||
retry: 10 | ||
}); | ||
const depthSnapshotResponse = await handy_1.httpClient.get(`${this._httpURL}/depth?symbol=${symbol.toUpperCase()}&limit=1000`, binanceHttpOptions); | ||
const snapshot = { | ||
@@ -136,0 +141,0 @@ stream: `${symbol}@depthSnapshot`, |
{ | ||
"name": "tardis-dev", | ||
"version": "13.8.0", | ||
"version": "13.8.1", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=12" |
@@ -6,2 +6,11 @@ import { Writable } from 'stream' | ||
const binanceHttpOptions = { | ||
timeout: 10 * 1000, | ||
retry: { | ||
limit: 10, | ||
statusCodes: [408, 429, 500], | ||
maxRetryAfter: 120 * 1000 | ||
} | ||
} | ||
abstract class BinanceRealTimeFeedBase extends MultiConnectionRealTimeFeedBase { | ||
@@ -50,5 +59,4 @@ protected abstract wssURL: string | ||
} | ||
const openInterestResponse = (await httpClient | ||
.get(`${this._httpURL}/openInterest?symbol=${instrument.toUpperCase()}`, { timeout: 10000 }) | ||
.get(`${this._httpURL}/openInterest?symbol=${instrument.toUpperCase()}`, binanceHttpOptions) | ||
.json()) as any | ||
@@ -132,3 +140,3 @@ | ||
const exchangeInfoResponse = await httpClient.get(`${this._httpURL}/exchangeInfo`, { timeout: 10000, retry: 5 }) | ||
const exchangeInfoResponse = await httpClient.get(`${this._httpURL}/exchangeInfo`, binanceHttpOptions) | ||
@@ -197,6 +205,6 @@ const exchangeInfo = JSON.parse(exchangeInfoResponse.body) | ||
const depthSnapshotResponse = await httpClient.get(`${this._httpURL}/depth?symbol=${symbol.toUpperCase()}&limit=1000`, { | ||
timeout: 10000, | ||
retry: 10 | ||
}) | ||
const depthSnapshotResponse = await httpClient.get( | ||
`${this._httpURL}/depth?symbol=${symbol.toUpperCase()}&limit=1000`, | ||
binanceHttpOptions | ||
) | ||
@@ -203,0 +211,0 @@ const snapshot = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1576477
28944