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:
parent
38aa006ecc
commit
de4a675a43
4 changed files with 13 additions and 14 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue