aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pending-tx.js30
1 files changed, 10 insertions, 20 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index a0d59207d..ab425abf5 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -85,6 +85,8 @@ PendingTx.prototype.render = function () {
const txFeeBn = gasBn.mul(gasPriceBn)
+ const amountBn = hexToBn(txParams.value)
+
// TODO: insufficient balance should be handled on send screen
// const maxCost = txFeeBn.add(amountBn)
// const balanceBn = hexToBn(balance)
@@ -97,39 +99,27 @@ PendingTx.prototype.render = function () {
const endOfToAddress = txParams.to.slice(txParams.to.length - 4)
const gasFeeInUSD = conversionUtil(txFeeBn, {
- fromNumericBase: 'BN',
- toNumericBase: 'dec',
- fromDenomination: 'WEI',
- fromCurrency: 'ETH',
+ fromFormat: 'BN',
+ fromCurrency: 'GWEI',
toCurrency: 'USD',
- numberOfDecimals: 2,
conversionRate,
})
const gasFeeInETH = conversionUtil(txFeeBn, {
- fromNumericBase: 'BN',
- toNumericBase: 'dec',
- fromDenomination: 'WEI',
- fromCurrency: 'ETH',
+ fromFormat: 'BN',
+ fromCurrency: 'GWEI',
toCurrency: 'ETH',
- numberOfDecimals: 6,
conversionRate,
})
- const totalInUSD = conversionUtil(txParams.value, {
- fromNumericBase: 'hex',
- toNumericBase: 'dec',
- fromCurrency: 'ETH',
+ const totalInUSD = conversionUtil(amountBn, {
+ fromFormat: 'BN',
toCurrency: 'USD',
- numberOfDecimals: 2,
conversionRate,
})
- const totalInETH = conversionUtil(txParams.value, {
- fromNumericBase: 'hex',
- toNumericBase: 'dec',
- fromCurrency: 'ETH',
+ const totalInETH = conversionUtil(amountBn, {
+ fromFormat: 'BN',
toCurrency: 'ETH',
conversionRate,
- numberOfDecimals: 6,
})
this.inputs = []