diff --git a/lib/plugins/exchange/kraken/kraken.js b/lib/plugins/exchange/kraken/kraken.js index 0ccdc035..20da7d73 100644 --- a/lib/plugins/exchange/kraken/kraken.js +++ b/lib/plugins/exchange/kraken/kraken.js @@ -1,5 +1,6 @@ // Note: Using DeX3/npm-kraken-api to adjust timeout time const Kraken = require('kraken-api') +const _ = require('lodash/fp') const common = require('../../common/kraken') @@ -19,11 +20,14 @@ function trade (account, type, cryptoAtoms, fiatCode, cryptoCode) { const kraken = new Kraken(account.apiKey, account.privateKey, {timeout: 30000}) const amount = common.toUnit(cryptoAtoms, cryptoCode) const amountStr = amount.toFixed(6) - const pair = PAIRS[cryptoCode][fiatCode] + const pair = _.includes(fiatCode, ['USD', 'EUR']) + ? PAIRS[cryptoCode][fiatCode] + : PAIRS[cryptoCode]['EUR'] + var orderInfo = { - pair: pair, - type: type, + pair, + type, ordertype: 'market', volume: amountStr, expiretm: '+60'