fixed file names

This commit is contained in:
José Oliveira 2021-01-18 16:17:59 +00:00 committed by Josh Harvey
parent a881527a1f
commit f572fc0a7e
3 changed files with 2 additions and 2 deletions

View file

@ -0,0 +1,28 @@
const _ = require('lodash/fp')
const CRYPTO = {
bitstamp: ['BTC', 'ETH', 'LTC', 'BCH'],
itbit: ['BTC', 'ETH', 'LTC', 'BCH'],
kraken: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH'],
coinbase: ['BTC', 'ETH', 'LTC', 'BCH', 'ZEC', 'DASH']
}
const FIAT = {
bitstamp: ['USD', 'EUR'],
itbit: ['USD'],
kraken: ['USD', 'EUR']
}
module.exports = { verifyCurrencies }
function verifyCurrencies (exchangeName, fiatCode, cryptoCode) {
if (!_.includes(cryptoCode, CRYPTO[exchangeName])) {
throw new Error('Unsupported crypto: ' + cryptoCode)
}
if (!(exchangeName === 'coinbase')) { // coinbase is only used for ticker and it's expected to support most of the fiat
if (!_.includes(fiatCode, FIAT[exchangeName])) {
throw new Error('Unsupported fiat: ' + fiatCode)
}
}
return cryptoCode + '/' + fiatCode
}