Fix bitpay.js

This commit is contained in:
Neal Conner 2017-12-15 20:22:13 -05:00 committed by Josh Harvey
parent e232a7713e
commit 5757364d0f

View file

@ -2,11 +2,8 @@ const axios = require('axios')
const BN = require('../../../bn') const BN = require('../../../bn')
function ticker (account, fiatCode, cryptoCode) { function ticker (account, fiatCode, cryptoCode) {
if (!_.includes(cryptoCode, ['BTC', 'BCH'])) {
return Promise.reject('Unsupported crypto: ' + cryptoCode)
}
return axios.get('https://bitpay.com/api/rates/' + cryptoCode '/' + fiatCode) return axios.get('https://bitpay.com/api/rates/' + cryptoCode + '/' + fiatCode)
.then(r => { .then(r => {
const data = r.data const data = r.data
const price = BN(data.rate) const price = BN(data.rate)