Handle high precision bitpay response numbers

This commit is contained in:
Rafael Taranto 2019-06-04 17:24:09 -03:00 committed by Josh Harvey
parent 2c0d843dcd
commit a051a34429
5 changed files with 5 additions and 5 deletions

View file

@ -10,7 +10,7 @@ exports.SUPPORTED_MODULES = ['ticker']
function findCurrency (fxRates, fiatCode) {
const rates = _.find(_.matchesProperty('code', fiatCode), fxRates)
if (!rates || !rates.rate) throw new Error(`Unsupported currency: ${fiatCode}`)
return BN(rates.rate)
return BN(rates.rate.toString())
}
exports.ticker = function ticker (account, fiatCode, cryptoCode) {