Support ZEC

This commit is contained in:
Josh Harvey 2017-06-24 01:33:10 +03:00
parent 9b51565303
commit 45e6e2b82d
10 changed files with 105 additions and 47 deletions

View file

@ -1,16 +1,7 @@
const Kraken = require('kraken-api')
const coinmath = require('../common/kraken')
const common = require('../common/kraken')
var PAIRS = {
BTC: {
USD: 'XXBTZUSD',
EUR: 'XXBTZEUR'
},
ETH: {
USD: 'XETHZUSD',
EUR: 'XETHZEUR'
}
}
var PAIRS = common.PAIRS
module.exports = {buy, sell}
@ -23,8 +14,8 @@ function sell (account, cryptoAtoms, fiatCode, cryptoCode) {
}
function trade (account, type, cryptoAtoms, fiatCode, cryptoCode) {
const kraken = new Kraken(account.key, account.secret)
const amount = coinmath.toUnit(cryptoAtoms, 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')