ccxt 4.2.35 → 4.2.37

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/cjs/ccxt.js CHANGED
@@ -176,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
176
176
 
177
177
  //-----------------------------------------------------------------------------
178
178
  // this is updated by vss.js when building
179
- const version = '4.2.35';
179
+ const version = '4.2.37';
180
180
  Exchange["default"].ccxtVersion = version;
181
181
  const exchanges = {
182
182
  'ace': ace,
@@ -1069,9 +1069,9 @@ class Exchange {
1069
1069
  }
1070
1070
  handleMessage(client, message) { } // stub to override
1071
1071
  // ping (client) {} // stub to override
1072
- // ping (client) {
1073
- // return undefined;
1074
- // }
1072
+ ping(client) {
1073
+ return undefined;
1074
+ }
1075
1075
  client(url) {
1076
1076
  this.clients = this.clients || {};
1077
1077
  if (!this.clients[url]) {
@@ -144,9 +144,12 @@ class Client {
144
144
  this.onError(new errors.RequestTimeout('Connection to ' + this.url + ' timed out due to a ping-pong keepalive missing on time'));
145
145
  }
146
146
  else {
147
+ let message;
147
148
  if (this.ping) {
148
- this.send(this.ping(this))
149
- .catch((error) => {
149
+ message = this.ping(this);
150
+ }
151
+ if (message) {
152
+ this.send(message).catch((error) => {
150
153
  this.onError(error);
151
154
  });
152
155
  }