feat: bitfinex implementation
This commit is contained in:
parent
80291637c0
commit
98c48ba853
6 changed files with 68 additions and 4 deletions
21
lib/plugins/exchange/bitfinex.js
Normal file
21
lib/plugins/exchange/bitfinex.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const { COINS } = require('@lamassu/coins')
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const { ORDER_TYPES } = require('./consts')
|
||||
|
||||
const ORDER_TYPE = ORDER_TYPES.MARKET
|
||||
const { BTC, ETH, LTC, BCH, USDT, LN } = COINS
|
||||
const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN]
|
||||
const FIAT = ['USD', 'EUR']
|
||||
const AMOUNT_PRECISION = 8
|
||||
const REQUIRED_CONFIG_FIELDS = ['key', 'secret']
|
||||
|
||||
const loadConfig = (account) => {
|
||||
const mapper = {
|
||||
'key': 'apiKey',
|
||||
}
|
||||
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
|
||||
return { ...mapped, timeout: 3000 }
|
||||
}
|
||||
|
||||
module.exports = { loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE, AMOUNT_PRECISION }
|
||||
Loading…
Add table
Add a link
Reference in a new issue