diff --git a/lib/plugins/exchange/ccxt.js b/lib/plugins/exchange/ccxt.js index 087d3d6c..a0f5904e 100644 --- a/lib/plugins/exchange/ccxt.js +++ b/lib/plugins/exchange/ccxt.js @@ -14,14 +14,14 @@ function trade (side, account, tradeEntry, exchangeName) { const exchangeConfig = ALL[exchangeName] if (!exchangeConfig) throw Error('Exchange configuration not found') - const { CUSTOM_KEY, loadOptions, loadConfig = _.noop, REQUIRED_CONFIG_FIELDS, ORDER_TYPE, AMOUNT_PRECISION } = exchangeConfig + const { USER_REF, loadOptions, loadConfig = _.noop, REQUIRED_CONFIG_FIELDS, ORDER_TYPE, AMOUNT_PRECISION } = exchangeConfig if (!isConfigValid(account, REQUIRED_CONFIG_FIELDS)) throw Error('Invalid config') const symbol = buildMarket(fiatCode, cryptoCode, exchangeName) const precision = _.defaultTo(DEFAULT_AMOUNT_PRECISION, AMOUNT_PRECISION) const amount = toUnit(cryptoAtoms, cryptoCode).toFixed(precision) const accountOptions = _.isFunction(loadOptions) ? loadOptions(account) : {} - const withCustomKey = CUSTOM_KEY ? { [CUSTOM_KEY]: tradeId } : {} + const withCustomKey = USER_REF ? { [USER_REF]: tradeId } : {} const options = _.assign(accountOptions, withCustomKey) const exchange = new ccxt[exchangeName](loadConfig(account)) diff --git a/lib/plugins/exchange/kraken.js b/lib/plugins/exchange/kraken.js index 0f95d205..61c0d3d8 100644 --- a/lib/plugins/exchange/kraken.js +++ b/lib/plugins/exchange/kraken.js @@ -9,7 +9,7 @@ const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT] const FIAT = ['USD', 'EUR'] const AMOUNT_PRECISION = 6 const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] -const CUSTOM_KEY = 'userref' +const USER_REF = 'userref' const loadConfig = (account) => { const mapper = { @@ -21,4 +21,4 @@ const loadConfig = (account) => { const loadOptions = () => ({ expiretm: '+60' }) -module.exports = { CUSTOM_KEY, loadOptions, loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION } +module.exports = { USER_REF, loadOptions, loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }