diff --git a/lib/new-admin/services/transactions.js b/lib/new-admin/services/transactions.js index 4cdd182a..2cac4b8f 100644 --- a/lib/new-admin/services/transactions.js +++ b/lib/new-admin/services/transactions.js @@ -172,7 +172,7 @@ function advancedBatch (data) { } function simplifiedBatch (data) { - const fields = ['txClass', 'id', 'created', 'machineName', + const fields = ['txClass', 'id', 'created', 'machineName', 'fee', 'cryptoCode', 'cryptoAtoms', 'fiat', 'fiatCode', 'phone', 'toAddress', 'txHash', 'dispense', 'error', 'status', 'fiatProfit', 'cryptoAmount'] diff --git a/new-lamassu-admin/src/pages/Transactions/DetailsCard.js b/new-lamassu-admin/src/pages/Transactions/DetailsCard.js index fe0e208c..6a0fffef 100644 --- a/new-lamassu-admin/src/pages/Transactions/DetailsCard.js +++ b/new-lamassu-admin/src/pages/Transactions/DetailsCard.js @@ -89,6 +89,17 @@ const CANCEL_CASH_IN_TRANSACTION = gql` const getCryptoAmount = tx => coinUtils.toUnit(new BigNumber(tx.cryptoAtoms), tx.cryptoCode).toNumber() +const getCryptoFeeAmount = tx => { + const feeAmount = coinUtils + .toUnit(new BigNumber(tx.cryptoAtoms), tx.cryptoCode) + .toNumber() + + return new BigNumber(feeAmount) + .times(tx.rawTickerPrice) + .toNumber() + .toFixed(2, 1) +} + const formatAddress = (cryptoCode = '', address = '') => coinUtils.formatCryptoAddress(cryptoCode, address).replace(/(.{5})/g, '$1 ') @@ -129,6 +140,7 @@ const DetailsRow = ({ it: tx, timezone }) => { .minus(cashInFee) .toFixed(2, 1) // ROUND_DOWN const crypto = getCryptoAmount(tx) + const cryptoFee = getCryptoFeeAmount(tx) const exchangeRate = BigNumber(fiat) .div(crypto) .toFixed(2, 1) // ROUND_DOWN @@ -369,6 +381,12 @@ const DetailsRow = ({ it: tx, timezone }) => { )} + {tx.txClass === 'cashIn' && ( +