Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions exchange/binance_futures.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ module.exports = class BinanceFutures {

async initUserWebsocket() {
let response;
const me = this;

try {
response = await this.ccxtClient.fapiPublicPostListenKey();
} catch (e) {
Expand All @@ -540,8 +542,7 @@ module.exports = class BinanceFutures {
this.logger.error(`${me.getName()}: invalid listenKey response: ${JSON.stringify(response)}`);
return undefined;
}

const me = this;

var ws = new WebSocket(`${this.getBaseWebsocketUrl()}/ws/${response.listenKey}`);
ws.onerror = function(e) {
me.logger.info(`${me.getName()}: Connection error: ${String(e)}`);
Expand Down