diff --git a/js/base/Exchange.js b/js/base/Exchange.js index e4075a27af6fe..2d4034643f7cd 100644 --- a/js/base/Exchange.js +++ b/js/base/Exchange.js @@ -93,6 +93,8 @@ module.exports = class Exchange { this.substituteCommonCurrencyCodes = true // reserved this.parseBalanceFromOpenOrders = false // some exchanges return balance updates from order API endpoints + this.fetchImplementation = fetch + this.timeout = 10000 // milliseconds this.verbose = false this.debug = false @@ -275,7 +277,7 @@ module.exports = class Exchange { this.executeRestRequest = function (url, method = 'GET', headers = undefined, body = undefined) { let promise = - fetch (url, { 'method': method, 'headers': headers, 'body': body, 'agent': this.tunnelAgent || null, timeout: this.timeout}) + this.fetchImplementation (url, { 'method': method, 'headers': headers, 'body': body, 'agent': this.tunnelAgent || null, timeout: this.timeout}) .catch (e => { if (isNode) throw new ExchangeNotAvailable ([ this.id, method, url, e.type, e.message ].join (' '))