fixed file names
This commit is contained in:
parent
a881527a1f
commit
f572fc0a7e
3 changed files with 2 additions and 2 deletions
28
lib/plugins/common/ccxt.js
Normal file
28
lib/plugins/common/ccxt.js
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue