fix: set default market for fiat exchanges to EUR

This commit is contained in:
Sérgio Salgado 2022-05-18 18:31:45 +01:00
parent f25ff92e25
commit b7a62fbf0a

View file

@ -8,6 +8,7 @@ const binanceus = require('../exchange/binanceus')
const cex = require('../exchange/cex') const cex = require('../exchange/cex')
const ftx = require('../exchange/ftx') const ftx = require('../exchange/ftx')
const bitpay = require('../ticker/bitpay') const bitpay = require('../ticker/bitpay')
const logger = require('../../logger')
const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT } = COINS const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT } = COINS
const ALL = { const ALL = {
@ -30,7 +31,8 @@ function buildMarket (fiatCode, cryptoCode, serviceName) {
} }
const fiatSupported = ALL[serviceName].FIAT const fiatSupported = ALL[serviceName].FIAT
if (fiatSupported !== 'ALL_CURRENCIES' && !_.includes(fiatCode, fiatSupported)) { 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 return cryptoCode + '/' + fiatCode
} }