feat: binance exchange support

This commit is contained in:
José Oliveira 2022-05-10 11:28:21 +01:00
parent 81702e2132
commit 0fc7ffefb1
10 changed files with 77 additions and 7 deletions

View file

@ -0,0 +1,20 @@
const { COINS } = require('@lamassu/coins')
const _ = require('lodash/fp')
const { ORDER_TYPES } = require('./consts')
const ORDER_TYPE = ORDER_TYPES.MARKET
const { BTC, BCH, XMR, ETH, LTC, ZEC } = COINS
const CRYPTO = [BTC, ETH, LTC, ZEC, BCH, XMR]
const FIAT = ['USD', 'EUR']
const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey']
const loadConfig = (account) => {
const mapper = {
'privateKey': 'secret'
}
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
return { ...mapped, timeout: 3000 }
}
module.exports = { loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE }

View file

@ -10,7 +10,9 @@ const FIAT = ['USD']
const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey']
const loadConfig = (account) => {
const mapper = {}
const mapper = {
'privateKey': 'secret'
}
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
return { ...mapped, timeout: 3000 }
}

View file

@ -10,7 +10,9 @@ const FIAT = ['USD', 'EUR']
const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey']
const loadConfig = (account) => {
const mapper = {}
const mapper = {
'privateKey': 'secret'
}
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
return { ...mapped, timeout: 3000 }
}

View file

@ -10,7 +10,9 @@ const FIAT = ['USD']
const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey']
const loadConfig = (account) => {
const mapper = {}
const mapper = {
'privateKey': 'secret'
}
const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account)
return { ...mapped, timeout: 3000 }
}