WIP
This commit is contained in:
parent
45e6e2b82d
commit
2779dcd6f3
5 changed files with 34 additions and 20 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue