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
This commit is contained in:
Neal Conner 2018-02-26 17:09:52 +00:00 committed by Josh Harvey
parent a2d168644f
commit a8d6cddba9

View file

@ -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)}