Skip to content

Commit

Permalink
Merge pull request ccxt#352 from ttodua/array-renames-pro
Browse files Browse the repository at this point in the history
`array` rename
  • Loading branch information
kroitor authored Jul 1, 2022
2 parents 318c567 + 8d64449 commit 3711725
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 67 deletions.
12 changes: 6 additions & 6 deletions js/ascendex.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ module.exports = class ascendex extends ccxt.ascendex {
rawData = [];
}
const trades = this.parseTrades (rawData, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
tradesArray = new ArrayCache (limit);
}
for (let i = 0; i < trades.length; i++) {
array.append (trades[i]);
tradesArray.append (trades[i]);
}
this.trades[symbol] = array;
client.resolve (array, messageHash);
this.trades[symbol] = tradesArray;
client.resolve (tradesArray, messageHash);
}

async watchOrderBook (symbol, limit = undefined, params = {}) {
Expand Down
12 changes: 6 additions & 6 deletions js/binance.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,14 @@ module.exports = class binance extends ccxt.binance {
const event = this.safeString (message, 'e');
const messageHash = lowerCaseId + '@' + event;
const trade = this.parseTrade (message, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
tradesArray = new ArrayCache (limit);
}
array.append (trade);
this.trades[symbol] = array;
client.resolve (array, messageHash);
tradesArray.append (trade);
this.trades[symbol] = tradesArray;
client.resolve (tradesArray, messageHash);
}

async watchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
Expand Down
12 changes: 6 additions & 6 deletions js/bitstamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ module.exports = class bitstamp extends ccxt.bitstamp {
const symbol = this.safeString (subscription, 'symbol');
const market = this.market (symbol);
const trade = this.parseTrade (data, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
this.trades[symbol] = array;
tradesArray = new ArrayCache (limit);
this.trades[symbol] = tradesArray;
}
array.append (trade);
client.resolve (array, channel);
tradesArray.append (trade);
client.resolve (tradesArray, channel);
}

async watchOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
Expand Down
20 changes: 10 additions & 10 deletions js/bitvavo.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ module.exports = class bitvavo extends ccxt.bitvavo {
const name = 'trades';
const messageHash = name + '@' + marketId;
const trade = this.parseTrade (message, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
tradesArray = new ArrayCache (limit);
}
array.append (trade);
this.trades[symbol] = array;
client.resolve (array, messageHash);
tradesArray.append (trade);
this.trades[symbol] = tradesArray;
client.resolve (tradesArray, messageHash);
}

async watchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
Expand Down Expand Up @@ -515,10 +515,10 @@ module.exports = class bitvavo extends ccxt.bitvavo {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
this.myTrades = new ArrayCache (limit);
}
const array = this.myTrades;
array.append (trade);
this.myTrades = array;
client.resolve (array, messageHash);
const tradesArray = this.myTrades;
tradesArray.append (trade);
this.myTrades = tradesArray;
client.resolve (tradesArray, messageHash);
}

handleSubscriptionStatus (client, message) {
Expand Down
24 changes: 12 additions & 12 deletions js/coinbasepro.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ module.exports = class coinbasepro extends ccxt.coinbasepro {
// therefore we resolve 'matches' here instead of 'match'
const type = 'matches';
const messageHash = type + ':' + marketId;
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const tradesLimit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (tradesLimit);
this.trades[symbol] = array;
tradesArray = new ArrayCache (tradesLimit);
this.trades[symbol] = tradesArray;
}
array.append (trade);
client.resolve (array, messageHash);
tradesArray.append (trade);
client.resolve (tradesArray, messageHash);
}
return message;
}
Expand All @@ -182,14 +182,14 @@ module.exports = class coinbasepro extends ccxt.coinbasepro {
const trade = this.parseWsTrade (message);
const type = 'myTrades';
const messageHash = type + ':' + marketId;
let array = this.myTrades;
if (array === undefined) {
let tradesArray = this.myTrades;
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'myTradesLimit', 1000);
array = new ArrayCacheBySymbolById (limit);
this.myTrades = array;
tradesArray = new ArrayCacheBySymbolById (limit);
this.myTrades = tradesArray;
}
array.append (trade);
client.resolve (array, messageHash);
tradesArray.append (trade);
client.resolve (tradesArray, messageHash);
}
return message;
}
Expand Down
14 changes: 7 additions & 7 deletions js/ndax.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,22 @@ module.exports = class ndax extends ccxt.ndax {
for (let i = 0; i < payload.length; i++) {
const trade = this.parseTrade (payload[i]);
const symbol = trade['symbol'];
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
tradesArray = new ArrayCache (limit);
}
array.append (trade);
this.trades[symbol] = array;
tradesArray.append (trade);
this.trades[symbol] = tradesArray;
updates[symbol] = true;
}
const symbols = Object.keys (updates);
for (let i = 0; i < symbols.length; i++) {
const symbol = symbols[i];
const market = this.market (symbol);
const messageHash = name + ':' + market['id'];
const array = this.safeValue (this.trades, symbol);
client.resolve (array, messageHash);
const tradesArray = this.safeValue (this.trades, symbol);
client.resolve (tradesArray, messageHash);
}
}

Expand Down
12 changes: 6 additions & 6 deletions js/ripio.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ module.exports = class ripio extends ccxt.ripio {
const messageHash = this.safeString (subscription, 'messageHash');
const market = this.market (symbol);
const trade = this.parseTrade (data, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
this.trades[symbol] = array;
tradesArray = new ArrayCache (limit);
this.trades[symbol] = tradesArray;
}
array.append (trade);
client.resolve (array, messageHash);
tradesArray.append (trade);
client.resolve (tradesArray, messageHash);
}

async watchTicker (symbol, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/test/Exchange/test.watchOHLCV.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = async (exchange, symbol) => {
]

if (skippedExchanges.includes (exchange.id)) {
log (exchange.id, method, 'test skipped')
log (exchange.id, method + '() test skipped')
return
}

Expand Down
2 changes: 1 addition & 1 deletion js/test/Exchange/test.watchOrderBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = async (exchange, symbol) => {
]

if (skippedExchanges.includes (exchange.id)) {
log (exchange.id, method, 'test skipped')
log (exchange.id, method + '() test skipped')
return
}

Expand Down
4 changes: 2 additions & 2 deletions js/test/Exchange/test.watchTicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ module.exports = async (exchange, symbol) => {
]

if (skippedExchanges.includes (exchange.id)) {
log (exchange.id, method, 'test skipped')
log (exchange.id, method + '() test skipped')
return
}

if (!exchange.has[method]) {
log (exchange.id, method, 'is not supported or not implemented yet')
log (exchange.id, method + '() is not supported')
return
}

Expand Down
2 changes: 1 addition & 1 deletion js/test/Exchange/test.watchTrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = async (exchange, symbol) => {
]

if (skippedExchanges.includes (exchange.id)) {
log (exchange.id, method, 'test skipped')
log (exchange.id, method + '() test skipped')
return
}

Expand Down
12 changes: 6 additions & 6 deletions js/zb.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ module.exports = class zb extends ccxt.zb {
const market = this.market (symbol);
const data = this.safeValue (message, 'data');
const trades = this.parseTrades (data, market);
let array = this.safeValue (this.trades, symbol);
if (array === undefined) {
let tradesArray = this.safeValue (this.trades, symbol);
if (tradesArray === undefined) {
const limit = this.safeInteger (this.options, 'tradesLimit', 1000);
array = new ArrayCache (limit);
tradesArray = new ArrayCache (limit);
}
for (let i = 0; i < trades.length; i++) {
array.append (trades[i]);
tradesArray.append (trades[i]);
}
this.trades[symbol] = array;
client.resolve (array, channel);
this.trades[symbol] = tradesArray;
client.resolve (tradesArray, channel);
}

async watchOrderBook (symbol, limit = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion python/ccxtpro/test/exchange/test_watch_ohlcv.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def test_watch_ohlcv(exchange, symbol):
now = exchange.milliseconds()
return response
else:
print(exchange.id, method, 'is not supported or not implemented yet')
print(exchange.id, method + '() is not supported')


__all__ = ['test_watch_ohlcv']
2 changes: 1 addition & 1 deletion python/ccxtpro/test/exchange/test_watch_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def test_watch_ticker(exchange, symbol):
now = exchange.milliseconds()
return response
else:
print(exchange.id, method, 'is not supported or not implemented yet')
print(exchange.id, method + '() is not supported or not implemented yet')


__all__ = ['test_watch_ticker']
2 changes: 1 addition & 1 deletion python/ccxtpro/test/exchange/test_watch_trades.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def test_watch_trades(exchange, symbol):
now = exchange.milliseconds()
return response
else:
print(exchange.id, method, 'is not supported or not implemented yet')
print(exchange.id, method + '() is not supported or not implemented yet')


__all__ = ['test_watch_trades']

0 comments on commit 3711725

Please sign in to comment.