aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/pending-tx.js')
-rw-r--r--ui/app/components/pending-tx.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 6ae0444e7..0bc995afb 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -74,18 +74,24 @@ PendingTx.prototype.getTotal = function () {
const { params = [] } = decodedData || {}
const { name, value } = params[1] || {}
const amountBn = name === '_value'
- ? new BN(value)
- : hexToBn(txParams.value)
-
+ ? value
+ : txParams.value
+
const USD = conversionUtil(amountBn, {
- fromFormat: 'BN',
+ fromNumericBase: 'hex',
+ toNumericBase: 'dec',
+ fromCurrency: 'ETH',
toCurrency: 'USD',
+ numberOfDecimals: 2,
conversionRate,
})
const ETH = conversionUtil(amountBn, {
- fromFormat: 'BN',
+ fromNumericBase: 'hex',
+ toNumericBase: 'dec',
+ fromCurrency: 'ETH',
toCurrency: 'ETH',
conversionRate,
+ numberOfDecimals: 6,
})
return {
@@ -109,15 +115,21 @@ PendingTx.prototype.getGasFee = function () {
const txFeeBn = gasBn.mul(gasPriceBn)
const USD = conversionUtil(txFeeBn, {
- fromFormat: 'BN',
- fromCurrency: 'GWEI',
+ fromNumericBase: 'BN',
+ toNumericBase: 'dec',
+ fromDenomination: 'WEI',
+ fromCurrency: 'ETH',
toCurrency: 'USD',
+ numberOfDecimals: 2,
conversionRate,
})
const ETH = conversionUtil(txFeeBn, {
- fromFormat: 'BN',
- fromCurrency: 'GWEI',
+ fromNumericBase: 'BN',
+ toNumericBase: 'dec',
+ fromDenomination: 'WEI',
+ fromCurrency: 'ETH',
toCurrency: 'ETH',
+ numberOfDecimals: 6,
conversionRate,
})