Bug Fixes

This commit is contained in:
Luis Fernando Molina committed 2020-02-09 16:35:17 +01:00
1 parent 82bc086e92
commit b1af6e078c
131 files changed
+8597 -1930

No files matched your search

+5 -5
View File
@@ -1,6 +1,6 @@
"use strict";
/* ------------------------------------------------------------------------ */
// ----------------------------------------------------------------------------
const functions = require ('./functions')
@@ -411,7 +411,7 @@ module.exports = class Exchange {
}
setSandboxMode (enabled) {
if (!!enabled) {
if (!!enabled) { // eslint-disable-line no-extra-boolean-cast
if ('test' in this.urls) {
if (typeof this.urls['api'] === 'string') {
this.urls['api_backup'] = this.urls['api']
@@ -637,7 +637,7 @@ module.exports = class Exchange {
'limits': this.limits,
'precision': this.precision,
}, this.fees['trading'], market))
this.markets = deepExtend (this.markets, indexBy (values, 'symbol'))
this.markets = indexBy (values, 'symbol')
this.marketsById = indexBy (markets, 'id')
this.markets_by_id = this.marketsById
this.symbols = Object.keys (this.markets).sort ()
@@ -1026,9 +1026,9 @@ module.exports = class Exchange {
return this.markets;
}
filterBySinceLimit (array, since = undefined, limit = undefined) {
filterBySinceLimit (array, since = undefined, limit = undefined, key = 'timestamp') {
if (since !== undefined && since !== null)
array = array.filter (entry => entry.timestamp >= since)
array = array.filter (entry => entry[key] >= since)
if (limit !== undefined && limit !== null)
array = array.slice (0, limit)
return array