chore: update big number package
This commit is contained in:
parent
8aa18dd21c
commit
ea44478b48
30 changed files with 186 additions and 144 deletions
|
|
@ -40,8 +40,8 @@ function getCurrencyRates (ticker, fiatCode, cryptoCode) {
|
|||
return ticker.fetchTicker(symbol)
|
||||
.then(res => ({
|
||||
rates: {
|
||||
ask: BN(res.ask),
|
||||
bid: BN(res.bid)
|
||||
ask: new BN(res.ask),
|
||||
bid: new BN(res.bid)
|
||||
}
|
||||
}))
|
||||
} catch (e) {
|
||||
|
|
@ -52,7 +52,7 @@ function getCurrencyRates (ticker, fiatCode, cryptoCode) {
|
|||
function findCurrencyRates (fxRates, fiatCode) {
|
||||
const rates = _.find(_.matchesProperty('code', fiatCode), fxRates)
|
||||
if (!rates || !rates.rate) throw new Error(`Unsupported currency: ${fiatCode}`)
|
||||
return BN(rates.rate.toString())
|
||||
return new BN(rates.rate.toString())
|
||||
}
|
||||
|
||||
module.exports = { ticker }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue