fix: config validation for exchanges
This commit is contained in:
parent
dabe21f834
commit
a8085f3f1d
3 changed files with 10 additions and 6 deletions
|
|
@ -19,8 +19,9 @@ const loadConfig = (account) => {
|
|||
}
|
||||
|
||||
const isConfigValid = options => {
|
||||
const requiredOptions = _.pick(['key', 'secret', 'clientId'], options)
|
||||
return _.isEqual(options, requiredOptions)
|
||||
const requiredOptions = ['key', 'secret', 'clientId']
|
||||
const givenOptions = _.pick(requiredOptions, options)
|
||||
return _.isEqual(_.keys(givenOptions), requiredOptions)
|
||||
}
|
||||
|
||||
module.exports = { loadConfig, isConfigValid, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue