Fixed bitstamp coin scaling (#167)

The coin scaling for the bistamp excahnge was using a satoshi scaling for ETH when it should have been using wei.
This commit is contained in:
Rafael Taranto 2018-09-19 12:56:22 -03:00 committed by Josh Harvey
parent 38aa006ecc
commit de4a675a43
4 changed files with 13 additions and 14 deletions

View file

@ -1,5 +1,3 @@
const coinUtils = require('../../coin-utils')
const PAIRS = {
BTC: {
USD: 'XXBTZUSD',
@ -27,10 +25,4 @@ const PAIRS = {
}
}
module.exports = {PAIRS, toUnit}
function toUnit (cryptoAtoms, cryptoCode) {
const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode)
const unitScale = cryptoRec.unitScale
return cryptoAtoms.shift(-unitScale)
}
module.exports = {PAIRS}