fix: add missing modules
fix: use correct methods
This commit is contained in:
parent
aff8fe373b
commit
d92dd1e968
1 changed files with 4 additions and 2 deletions
|
|
@ -2,6 +2,8 @@ const _ = require('lodash/fp')
|
||||||
const pgp = require('pg-promise')()
|
const pgp = require('pg-promise')()
|
||||||
|
|
||||||
const db = require('../../db')
|
const db = require('../../db')
|
||||||
|
const BN = require('../../bn')
|
||||||
|
const { utils: coinUtils } = require('lamassu-coins')
|
||||||
const machineLoader = require('../../machine-loader')
|
const machineLoader = require('../../machine-loader')
|
||||||
const tx = require('../../tx')
|
const tx = require('../../tx')
|
||||||
const cashInTx = require('../../cash-in/cash-in-tx')
|
const cashInTx = require('../../cash-in/cash-in-tx')
|
||||||
|
|
@ -128,9 +130,9 @@ function simplifiedBatch (data) {
|
||||||
const getCryptoAmount = it => coinUtils.toUnit(BN(it.cryptoAtoms), it.cryptoCode).toString()
|
const getCryptoAmount = it => coinUtils.toUnit(BN(it.cryptoAtoms), it.cryptoCode).toString()
|
||||||
|
|
||||||
const getProfit = it => {
|
const getProfit = it => {
|
||||||
const getCommissionFee = it => BN(it.commissionPercentage).mul(BN(it.fiat))
|
const getCommissionFee = it => BN(it.commissionPercentage).times(BN(it.fiat))
|
||||||
if (!it.cashInFee) return getCommissionFee(it)
|
if (!it.cashInFee) return getCommissionFee(it)
|
||||||
return getCommissionFee(it).add(BN(it.cashInFee))
|
return getCommissionFee(it).plus(BN(it.cashInFee))
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCashOutStatus = it => {
|
const getCashOutStatus = it => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue