From a8d6cddba99cb6f1b5adb743b861bb1e10cff5fb Mon Sep 17 00:00:00 2001 From: Neal Conner Date: Mon, 26 Feb 2018 17:09:52 +0000 Subject: [PATCH] Trade on EUR Bitstamp if fiat other than USD/EUR (#102) * Trade on EUR Bitstamp if fiat other than USD/EUR * Don't mutate fiatCode --- lib/plugins/exchange/bitstamp/bitstamp.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugins/exchange/bitstamp/bitstamp.js b/lib/plugins/exchange/bitstamp/bitstamp.js index 9a120724..6a111ce4 100644 --- a/lib/plugins/exchange/bitstamp/bitstamp.js +++ b/lib/plugins/exchange/bitstamp/bitstamp.js @@ -22,7 +22,9 @@ function handleErrors (data) { throw err } -function trade (type, account, cryptoAtoms, fiatCode, cryptoCode) { +function trade (type, account, cryptoAtoms, _fiatCode, cryptoCode) { + const fiatCode = _fiatCode === 'USD' ? 'USD' : 'EUR' + try { const market = common.buildMarket(fiatCode, cryptoCode) const options = {amount: cryptoAtoms.shift(-SATOSHI_SHIFT).toFixed(8)}