Skip to content

Commit

Permalink
since + limit added to parseTrades / parseOrders
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Dec 10, 2017
1 parent 0c45204 commit 10dd424
Show file tree
Hide file tree
Showing 261 changed files with 457 additions and 457 deletions.
2 changes: 1 addition & 1 deletion js/_1btcxe.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module.exports = class _1btcxe extends Exchange {
'currency': market['id'],
}, params));
let trades = this.omit (response['transactions'], 'request_currency');
return this.parseTrades (trades, market);
return this.parseTrades (trades, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/acx.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ module.exports = class acx extends Exchange {
}, params));
// looks like they switched this endpoint off
// it returns 503 Service Temporarily Unavailable always
// return this.parseTrades (response, market);
// return this.parseTrades (response, market, since, limit);
return response;
}

Expand Down
2 changes: 1 addition & 1 deletion js/base/Exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ module.exports = class Exchange {

parseOrders (orders, market = undefined, since = undefined, limit = undefined) {
let result = Object.values (orders).map (order => this.parseOrder (order, market))
return this.filterBySinceLimit (result, since, limit)
result = this.filterBySinceLimit (result, since, limit)
}

filterOrdersBySymbol (orders, symbol = undefined) {
Expand Down
8 changes: 4 additions & 4 deletions js/binance.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ module.exports = class binance extends Exchange {
// 'endTime': 789, // Timestamp in ms to get aggregate trades until INCLUSIVE.
// 'limit': 500, // default = maximum = 500
let response = await this.publicGetAggTrades (this.extend (request, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

parseOrderStatus (status) {
Expand Down Expand Up @@ -578,7 +578,7 @@ module.exports = class binance extends Exchange {
if (limit)
request['limit'] = limit;
let response = await this.privateGetAllOrders (this.extend (request, params));
return this.parseOrders (response, market);
return this.parseOrders (response, market, since, limit);
}

async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
Expand All @@ -589,7 +589,7 @@ module.exports = class binance extends Exchange {
let response = await this.privateGetOpenOrders (this.extend ({
'symbol': market['id'],
}, params));
return this.parseOrders (response, market);
return this.parseOrders (response, market, since, limit);
}

async cancelOrder (id, symbol = undefined, params = {}) {
Expand Down Expand Up @@ -625,7 +625,7 @@ module.exports = class binance extends Exchange {
if (limit)
request['limit'] = limit;
let response = await this.privateGetMyTrades (this.extend (request, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

commonCurrencyCode (currency) {
Expand Down
2 changes: 1 addition & 1 deletion js/bit2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module.exports = class bit2c extends Exchange {
let response = await this.publicGetExchangesPairTrades (this.extend ({
'pair': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitbay.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module.exports = class bitbay extends Exchange {
let response = await this.publicGetIdTrades (this.extend ({
'id': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitcoincoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = class bitcoincoid extends Exchange {
let response = await this.publicGetPairTrades (this.extend ({
'pair': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
10 changes: 5 additions & 5 deletions js/bitfinex.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ module.exports = class bitfinex extends Exchange {
let response = await this.publicGetTradesSymbol (this.extend ({
'symbol': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) {
Expand All @@ -329,7 +329,7 @@ module.exports = class bitfinex extends Exchange {
request['timestamp'] = parseInt (since / 1000);
}
let response = await this.privatePostMytrades (this.extend (request, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down Expand Up @@ -411,9 +411,9 @@ module.exports = class bitfinex extends Exchange {
async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
let response = await this.privatePostOrders (params);
let orders = this.parseOrders (response);
let orders = this.parseOrders (response, undefined, since, limit);
if (symbol)
return this.filterBy (orders, 'symbol', symbol);
orders = this.filterBy (orders, 'symbol', symbol);
return orders;
}

Expand All @@ -423,7 +423,7 @@ module.exports = class bitfinex extends Exchange {
if (limit)
request['limit'] = limit;
let response = await this.privatePostOrdersHist (this.extend (request, params));
let orders = this.parseOrders (response);
let orders = this.parseOrders (response, undefined, since, limit);
if (symbol)
return this.filterBy (orders, 'symbol', symbol);
return orders;
Expand Down
2 changes: 1 addition & 1 deletion js/bitfinex2.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ module.exports = class bitfinex2 extends bitfinex {
request['limit'] = limit;
}
let response = await this.publicGetTradesSymbolHist (this.extend (request, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitflyer.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ module.exports = class bitflyer extends Exchange {
let response = await this.publicGetExecutions (this.extend ({
'product_code': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bithumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module.exports = class bithumb extends Exchange {
'currency': market['base'],
'count': 100, // max = 100
}, params));
return this.parseTrades (response['data'], market);
return this.parseTrades (response['data'], market, since, limit);
}

createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitlish.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ module.exports = class bitlish extends Exchange {
let response = await this.publicGetTradesHistory (this.extend ({
'pair_id': market['id'],
}, params));
return this.parseTrades (response['list'], market);
return this.parseTrades (response['list'], market, since, limit);
}

async fetchBalance (params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitmarket.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ module.exports = class bitmarket extends Exchange {
let response = await this.publicGetJsonMarketTrades (this.extend ({
'market': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

parseOHLCV (ohlcv, market = undefined, timeframe = '90m', since = undefined, limit = undefined) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitmex.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ module.exports = class bitmex extends Exchange {
let response = await this.publicGetTrade (this.extend ({
'symbol': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bitso.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module.exports = class bitso extends Exchange {
let response = await this.publicGetTrades (this.extend ({
'book': market['id'],
}, params));
return this.parseTrades (response['payload'], market);
return this.parseTrades (response['payload'], market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
4 changes: 2 additions & 2 deletions js/bitstamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports = class bitstamp extends Exchange {
'pair': market['id'],
'time': 'minute',
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchBalance (params = {}) {
Expand Down Expand Up @@ -277,7 +277,7 @@ module.exports = class bitstamp extends Exchange {
let pair = market ? market['id'] : 'all';
let request = this.extend ({ 'pair': pair }, params);
let response = await this.privatePostOpenOrdersPair (request);
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchOrder (id, symbol = undefined, params = {}) {
Expand Down
4 changes: 2 additions & 2 deletions js/bitstamp1.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = class bitstamp1 extends Exchange {
let response = await this.publicGetTransactions (this.extend ({
'time': 'minute',
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchBalance (params = {}) {
Expand Down Expand Up @@ -214,7 +214,7 @@ module.exports = class bitstamp1 extends Exchange {
let pair = market ? market['id'] : 'all';
let request = this.extend ({ 'id': pair }, params);
let response = await this.privatePostOpenOrdersId (request);
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async fetchOrder (id, symbol = undefined, params = {}) {
Expand Down
6 changes: 3 additions & 3 deletions js/bittrex.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ module.exports = class bittrex extends Exchange {
}, params));
if ('result' in response) {
if (typeof response['result'] != 'undefined')
return this.parseTrades (response['result'], market);
return this.parseTrades (response['result'], market, since, limit);
}
throw new ExchangeError (this.id + ' fetchTrades() returned undefined response');
}
Expand Down Expand Up @@ -402,7 +402,7 @@ module.exports = class bittrex extends Exchange {
request['market'] = market['id'];
}
let response = await this.marketGetOpenorders (this.extend (request, params));
let orders = this.parseOrders (response['result'], market);
let orders = this.parseOrders (response['result'], market, since, limit);
return this.filterOrdersBySymbol (orders, symbol);
}

Expand Down Expand Up @@ -541,7 +541,7 @@ module.exports = class bittrex extends Exchange {
request['market'] = market['id'];
}
let response = await this.accountGetOrderhistory (this.extend (request, params));
let orders = this.parseOrders (response['result'], market);
let orders = this.parseOrders (response['result'], market, since, limit);
return this.filterOrdersBySymbol (orders, symbol);
}

Expand Down
2 changes: 1 addition & 1 deletion js/bl3p.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = class bl3p extends Exchange {
let response = await this.publicGetMarketTrades (this.extend ({
'market': market['id'],
}, params));
let result = this.parseTrades (response['data']['trades'], market);
let result = this.parseTrades (response['data']['trades'], market, since, limit);
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion js/btcbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports = class btcbox extends Exchange {
if (numSymbols > 1)
request['coin'] = market['id'];
let response = await this.publicGetOrders (this.extend (request, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/btcchina.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ module.exports = class btcchina extends Exchange {
if (market['plus']) {
return this.parseTradesPlus (response['trades'], market);
}
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/btcmarkets.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = class btcmarkets extends Exchange {
// 'since': 59868345231,
'id': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
4 changes: 2 additions & 2 deletions js/btctradeua.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ module.exports = class btctradeua extends Exchange {
trades.push (response[i]);
}
}
return this.parseTrades (trades, market);
return this.parseTrades (trades, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down Expand Up @@ -293,7 +293,7 @@ module.exports = class btctradeua extends Exchange {
'symbol': market['id'],
}, params));
let orders = response['your_open_orders'];
return this.parseOrders (orders, market);
return this.parseOrders (orders, market, since, limit);
}

nonce () {
Expand Down
2 changes: 1 addition & 1 deletion js/btcturk.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module.exports = class btcturk extends Exchange {
let response = await this.publicGetTrades (this.extend ({
'pairSymbol': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

parseOHLCV (ohlcv, market = undefined, timeframe = '1d', since = undefined, limit = undefined) {
Expand Down
2 changes: 1 addition & 1 deletion js/btcx.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = class btcx extends Exchange {
'id': market['id'],
'limit': 1000,
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bter.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module.exports = class bter extends Exchange {
let response = await this.publicGetTradeHistoryId (this.extend ({
'id': market['id'],
}, params));
return this.parseTrades (response['data'], market);
return this.parseTrades (response['data'], market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/bxinth.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module.exports = class bxinth extends Exchange {
let response = await this.publicGetTrade (this.extend ({
'pairing': market['id'],
}, params));
return this.parseTrades (response['trades'], market);
return this.parseTrades (response['trades'], market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/ccex.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ module.exports = class ccex extends Exchange {
'type': 'both',
'depth': 100,
}, params));
return this.parseTrades (response['result'], market);
return this.parseTrades (response['result'], market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
4 changes: 2 additions & 2 deletions js/cex.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ module.exports = class cex extends Exchange {
let response = await this.publicGetTradeHistoryPair (this.extend ({
'pair': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down Expand Up @@ -386,7 +386,7 @@ module.exports = class cex extends Exchange {
for (let i = 0; i < orders.length; i++) {
orders[i] = this.extend (orders[i], { 'status': 'open' });
}
return this.parseOrders (orders, market);
return this.parseOrders (orders, market, since, limit);
}

nonce () {
Expand Down
2 changes: 1 addition & 1 deletion js/coincheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = class coincheck extends Exchange {
throw new NotSupported (this.id + ' fetchTrades () supports BTC/JPY only');
let market = this.market (symbol);
let response = await this.publicGetTrades (params);
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/coinfloor.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module.exports = class coinfloor extends Exchange {
let response = await this.publicGetIdTransactions (this.extend ({
'id': market['id'],
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
2 changes: 1 addition & 1 deletion js/coingi.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ module.exports = class coingi extends Exchange {
'pair': market['id'],
'maxCount': 128,
}, params));
return this.parseTrades (response, market);
return this.parseTrades (response, market, since, limit);
}

async createOrder (symbol, type, side, amount, price = undefined, params = {}) {
Expand Down
Loading

0 comments on commit 10dd424

Please sign in to comment.