refactor: simplify getting pegged fiat currencies

This commit is contained in:
siiky 2023-11-22 18:06:02 +00:00
parent 8eb1c3006f
commit 63f40da632

View file

@ -38,9 +38,7 @@ function _getRates (settings, fiatCode, cryptoCode) {
}
function buildTicker (fiatCode, cryptoCode, tickerName) {
fiatCode = _.includes(fiatCode, _.keys(PEGGED_FIAT_CURRENCIES))
? PEGGED_FIAT_CURRENCIES[fiatCode]
: fiatCode
fiatCode = _.defaultTo(fiatCode, _.get([fiatCode], PEGGED_FIAT_CURRENCIES))
cryptoCode = coinUtils.getEquivalentCode(cryptoCode)
if (tickerName === 'bitpay') return bitpay.ticker(fiatCode, cryptoCode)