From e232a7713e6c12c6d20385544979f67b504f05fa Mon Sep 17 00:00:00 2001 From: Neal Conner Date: Fri, 15 Dec 2017 19:29:55 -0500 Subject: [PATCH] Add BCH to bitpay.js --- lib/plugins/ticker/bitpay/bitpay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/ticker/bitpay/bitpay.js b/lib/plugins/ticker/bitpay/bitpay.js index 8bb49126..1a48c863 100644 --- a/lib/plugins/ticker/bitpay/bitpay.js +++ b/lib/plugins/ticker/bitpay/bitpay.js @@ -2,11 +2,11 @@ const axios = require('axios') const BN = require('../../../bn') function ticker (account, fiatCode, cryptoCode) { - if (cryptoCode !== 'BTC') { + if (!_.includes(cryptoCode, ['BTC', 'BCH'])) { return Promise.reject('Unsupported crypto: ' + cryptoCode) } - return axios.get('https://bitpay.com/api/rates/' + fiatCode) + return axios.get('https://bitpay.com/api/rates/' + cryptoCode '/' + fiatCode) .then(r => { const data = r.data const price = BN(data.rate)