This commit is contained in:
Josh Harvey 2017-06-24 18:52:55 +03:00
parent 45e6e2b82d
commit 2779dcd6f3
5 changed files with 34 additions and 20 deletions

View file

@ -1,5 +1,5 @@
const Kraken = require('kraken-api')
const common = require('../common/kraken')
const common = require('../../common/kraken')
var PAIRS = common.PAIRS
@ -17,11 +17,11 @@ function trade (account, type, cryptoAtoms, fiatCode, cryptoCode) {
const kraken = new Kraken(account.apiKey, account.privateKey)
const amount = common.toUnit(cryptoAtoms, cryptoCode)
if (amount.lte('0.01')) {
const err = new Error('Order size too small')
err.name = 'orderTooSmall'
return Promise.reject(err)
}
// if (amount.lte('0.01')) {
// const err = new Error('Order size too small')
// err.name = 'orderTooSmall'
// return Promise.reject(err)
// }
const amountStr = amount.toFixed(6)
const pair = PAIRS[cryptoCode][fiatCode]