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

@ -3,6 +3,7 @@ const Kraken = require('kraken-api')
const _ = require('lodash/fp')
const common = require('../../common/kraken')
const coinUtils = require('../../../coin-utils')
var PAIRS = common.PAIRS
@ -18,7 +19,7 @@ function sell (account, cryptoAtoms, fiatCode, cryptoCode) {
function trade (account, type, cryptoAtoms, fiatCode, cryptoCode) {
const kraken = new Kraken(account.apiKey, account.privateKey, {timeout: 30000})
const amount = common.toUnit(cryptoAtoms, cryptoCode)
const amount = coinUtils.toUnit(cryptoAtoms, cryptoCode)
const amountStr = amount.toFixed(6)
const pair = _.includes(fiatCode, ['USD', 'EUR'])