tx.commission_percentage added
This commit is contained in:
parent
038a22aba7
commit
03279c8d2c
7 changed files with 140 additions and 42 deletions
|
|
@ -32,6 +32,15 @@ const PONG_TTL = '1 week'
|
|||
const tradesQueues = {}
|
||||
|
||||
function plugins (settings, deviceId) {
|
||||
function getCommissionForTx (tx) {
|
||||
const direction = _.get('direction', tx)
|
||||
const cryptoCode = _.get('cryptoCode', tx)
|
||||
const cryptoConfig = configManager.scoped(cryptoCode, deviceId, settings.config)
|
||||
|
||||
if (direction === 'cashIn') return /* cashInCommission */ BN(cryptoConfig.cashInCommission).div(100)
|
||||
if (direction === 'cashOut') return /* cashOutCommission */ BN(cryptoConfig.cashOutCommission).div(100)
|
||||
}
|
||||
|
||||
function buildRates (tickers) {
|
||||
const config = configManager.machineScoped(deviceId, settings.config)
|
||||
const cryptoCodes = config.cryptoCurrencies
|
||||
|
|
@ -783,7 +792,8 @@ function plugins (settings, deviceId) {
|
|||
buy,
|
||||
sell,
|
||||
notificationsEnabled,
|
||||
notifyOperator
|
||||
notifyOperator,
|
||||
getCommissionForTx
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue