refactor: exchanges config validation and error handling
This commit is contained in:
parent
60a19af1a8
commit
dabe21f834
6 changed files with 34 additions and 20 deletions
|
|
@ -18,6 +18,9 @@ const loadConfig = (account) => {
|
|||
}
|
||||
|
||||
const loadOptions = () => ({ expiretm: '+60' })
|
||||
const isConfigValid = ({ apiKey, privateKey }) => apiKey && privateKey
|
||||
const isConfigValid = options => {
|
||||
const requiredOptions = _.pick(['apiKey', 'privateKey'], options)
|
||||
return _.isEqual(options, requiredOptions)
|
||||
}
|
||||
|
||||
module.exports = { loadOptions, loadConfig, isConfigValid, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue