v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
42
packages/server/lib/plugins/exchange/itbit.js
Normal file
42
packages/server/lib/plugins/exchange/itbit.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
const _ = require('lodash/fp')
|
||||
|
||||
const { ORDER_TYPES } = require('./consts')
|
||||
const { COINS } = require('@lamassu/coins')
|
||||
|
||||
const ORDER_TYPE = ORDER_TYPES.LIMIT
|
||||
const { BTC, ETH, USDT, LN } = COINS
|
||||
const CRYPTO = [BTC, ETH, USDT, LN]
|
||||
const FIAT = ['USD']
|
||||
const DEFAULT_FIAT_MARKET = 'USD'
|
||||
const AMOUNT_PRECISION = 4
|
||||
const REQUIRED_CONFIG_FIELDS = [
|
||||
'clientKey',
|
||||
'clientSecret',
|
||||
'userId',
|
||||
'walletId',
|
||||
'currencyMarket',
|
||||
]
|
||||
|
||||
const loadConfig = account => {
|
||||
const mapper = {
|
||||
clientKey: 'apiKey',
|
||||
clientSecret: 'secret',
|
||||
userId: 'uid',
|
||||
}
|
||||
const mapped = _.mapKeys(key => (mapper[key] ? mapper[key] : key))(
|
||||
_.omit(['walletId'], account),
|
||||
)
|
||||
return { ...mapped, timeout: 3000 }
|
||||
}
|
||||
const loadOptions = ({ walletId }) => ({ walletId })
|
||||
|
||||
module.exports = {
|
||||
loadOptions,
|
||||
loadConfig,
|
||||
DEFAULT_FIAT_MARKET,
|
||||
REQUIRED_CONFIG_FIELDS,
|
||||
CRYPTO,
|
||||
FIAT,
|
||||
ORDER_TYPE,
|
||||
AMOUNT_PRECISION,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue