Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei committed Dec 15, 2022
1 parent 8d1dcca commit e1b77ba
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/pro/zb.js
Expand Up @@ -3,8 +3,8 @@
// ---------------------------------------------------------------------------

const zbRest = require ('../zb.js');
const { ExchangeError, AuthenticationError } = require ('../base/errors');
const { ArrayCache } = require ('./base/Cache');
const { ExchangeError, AuthenticationError, NotSupported } = require ('../base/errors');
const { ArrayCache, ArrayCacheByTimestamp } = require ('./base/Cache');

// ---------------------------------------------------------------------------

Expand All @@ -20,7 +20,10 @@ module.exports = class zb extends zbRest {
},
'urls': {
'api': {
'ws': 'wss://api.{hostname}/websocket',
'ws': {
'spot': 'wss://api.{hostname}/websocket',
'contract': 'wss://fapi.{hostname}/ws/public/v1',
},
},
},
'options': {
Expand Down Expand Up @@ -303,7 +306,7 @@ module.exports = class zb extends zbRest {
const market = this.market (symbol);
const data = this.safeValue (message, 'data');
const type = this.safeString (message, 'type');
let trades = undefined;
let trades = [];
if (type === 'Whole') {
// contract trades
for (let i = 0; i < data.length; i++) {
Expand Down Expand Up @@ -347,7 +350,7 @@ module.exports = class zb extends zbRest {
messageHash = market['id'] + '.' + 'Depth';
}
const orderbook = await this.watchPublic (url, messageHash, symbol, this.handleOrderBook, limit, params);
return orderbook.limit (limit);
return orderbook.limit ();
}

parseWsTrade (trade, market = undefined) {
Expand Down

0 comments on commit e1b77ba

Please sign in to comment.