feat: display fee on admin
This commit is contained in:
parent
c3c5292123
commit
1bbd68f429
6 changed files with 25 additions and 3 deletions
|
|
@ -172,7 +172,7 @@ function advancedBatch (data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function simplifiedBatch (data) {
|
function simplifiedBatch (data) {
|
||||||
const fields = ['txClass', 'id', 'created', 'machineName',
|
const fields = ['txClass', 'id', 'created', 'machineName', 'fee',
|
||||||
'cryptoCode', 'cryptoAtoms', 'fiat', 'fiatCode', 'phone', 'toAddress',
|
'cryptoCode', 'cryptoAtoms', 'fiat', 'fiatCode', 'phone', 'toAddress',
|
||||||
'txHash', 'dispense', 'error', 'status', 'fiatProfit', 'cryptoAmount']
|
'txHash', 'dispense', 'error', 'status', 'fiatProfit', 'cryptoAmount']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,17 @@ const CANCEL_CASH_IN_TRANSACTION = gql`
|
||||||
const getCryptoAmount = tx =>
|
const getCryptoAmount = tx =>
|
||||||
coinUtils.toUnit(new BigNumber(tx.cryptoAtoms), tx.cryptoCode).toNumber()
|
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 = '') =>
|
const formatAddress = (cryptoCode = '', address = '') =>
|
||||||
coinUtils.formatCryptoAddress(cryptoCode, address).replace(/(.{5})/g, '$1 ')
|
coinUtils.formatCryptoAddress(cryptoCode, address).replace(/(.{5})/g, '$1 ')
|
||||||
|
|
||||||
|
|
@ -129,6 +140,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
|
||||||
.minus(cashInFee)
|
.minus(cashInFee)
|
||||||
.toFixed(2, 1) // ROUND_DOWN
|
.toFixed(2, 1) // ROUND_DOWN
|
||||||
const crypto = getCryptoAmount(tx)
|
const crypto = getCryptoAmount(tx)
|
||||||
|
const cryptoFee = getCryptoFeeAmount(tx)
|
||||||
const exchangeRate = BigNumber(fiat)
|
const exchangeRate = BigNumber(fiat)
|
||||||
.div(crypto)
|
.div(crypto)
|
||||||
.toFixed(2, 1) // ROUND_DOWN
|
.toFixed(2, 1) // ROUND_DOWN
|
||||||
|
|
@ -369,6 +381,12 @@ const DetailsRow = ({ it: tx, timezone }) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{tx.txClass === 'cashIn' && (
|
||||||
|
<div className={classes.blockFee}>
|
||||||
|
<Label>Network Fee</Label>
|
||||||
|
{cryptoFee} {tx.fiatCode}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={classes.sessionId}>
|
<div className={classes.sessionId}>
|
||||||
<Label>Session ID</Label>
|
<Label>Session ID</Label>
|
||||||
<CopyToClipboard>{tx.id}</CopyToClipboard>
|
<CopyToClipboard>{tx.id}</CopyToClipboard>
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,9 @@ export default {
|
||||||
transactionId: {
|
transactionId: {
|
||||||
width: 280
|
width: 280
|
||||||
},
|
},
|
||||||
|
blockFee: {
|
||||||
|
width: 140
|
||||||
|
},
|
||||||
sessionId: {
|
sessionId: {
|
||||||
width: 215
|
width: 215
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ const GET_TRANSACTIONS = gql`
|
||||||
errorCode
|
errorCode
|
||||||
deviceId
|
deviceId
|
||||||
fiat
|
fiat
|
||||||
|
fee
|
||||||
cashInFee
|
cashInFee
|
||||||
fiatCode
|
fiatCode
|
||||||
cryptoAtoms
|
cryptoAtoms
|
||||||
|
|
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"version": "8.1.9",
|
"version": "8.1.10",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"description": "bitcoin atm client server protocol module",
|
"description": "bitcoin atm client server protocol module",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"version": "8.1.9",
|
"version": "8.1.10",
|
||||||
"license": "./LICENSE",
|
"license": "./LICENSE",
|
||||||
"author": "Lamassu (https://lamassu.is)",
|
"author": "Lamassu (https://lamassu.is)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue