From ce290a3e637401714b1072a3eb454f01d6de7232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Wed, 18 May 2022 15:19:31 +0100 Subject: [PATCH] fix: set default market for fiat exchanges to EUR --- lib/plugins/common/ccxt.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugins/common/ccxt.js b/lib/plugins/common/ccxt.js index 41eac58e..ae463a30 100644 --- a/lib/plugins/common/ccxt.js +++ b/lib/plugins/common/ccxt.js @@ -9,6 +9,7 @@ const cex = require('../exchange/cex') const ftx = require('../exchange/ftx') const bitpay = require('../ticker/bitpay') const binance = require('../exchange/binance') +const logger = require('../../logger') const { BTC, BCH, DASH, ETH, LTC, ZEC } = COINS @@ -33,7 +34,8 @@ function buildMarket (fiatCode, cryptoCode, serviceName) { } const fiatSupported = ALL[serviceName].FIAT if (fiatSupported !== 'ALL_CURRENCIES' && !_.includes(fiatCode, fiatSupported)) { - throw new Error('Unsupported fiat: ' + fiatCode) + logger.info('Building a market for an unsupported fiat. Defaulting to EUR market') + return cryptoCode + '/' + 'EUR' } return cryptoCode + '/' + fiatCode }