Refactored some exchange code
This commit is contained in:
parent
54a231ab60
commit
134eaaa518
20 changed files with 141 additions and 643 deletions
21
lib/plugins/exchange/kraken.js
Normal file
21
lib/plugins/exchange/kraken.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const common = require('../common/ccxt')
|
||||
const _ = require('lodash/fp')
|
||||
const consts = require('./consts')
|
||||
const ORDER_TYPE = consts.ORDER_TYPES.MARKET
|
||||
const FIAT = common.FIAT['kraken']
|
||||
const CRYPTO = common.CRYPTO['kraken']
|
||||
|
||||
const loadConfig = (account) => {
|
||||
const mapper = {
|
||||
'privateKey': 'secret'
|
||||
}
|
||||
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
|
||||
return { ...mapped, timeout: 3000 }
|
||||
}
|
||||
|
||||
const loadOptions = () => ({ expiretm: '+60' })
|
||||
const isConfigValid = ({ apiKey, privateKey }) => apiKey && privateKey
|
||||
|
||||
const amountPrecision = () => 6
|
||||
|
||||
module.exports = { amountPrecision, loadOptions, loadConfig, isConfigValid, CRYPTO, FIAT, ORDER_TYPE }
|
||||
Loading…
Add table
Add a link
Reference in a new issue