refactor: replace custom field function with const and move update trade logic inside a function

This commit is contained in:
José Oliveira 2021-06-10 22:25:14 +01:00 committed by Josh Harvey
parent f45c783876
commit 8567b7887c
6 changed files with 25 additions and 19 deletions

View file

@ -9,6 +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 loadConfig = (account) => {
const mapper = {
@ -19,6 +20,5 @@ const loadConfig = (account) => {
}
const loadOptions = () => ({ expiretm: '+60' })
const loadTradeId = (options, id) => _.assign({ userref: id }, options)
module.exports = { loadTradeId, loadOptions, loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }
module.exports = { CUSTOM_KEY, loadOptions, loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }