aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-03 16:03:31 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-03 16:03:31 +0800
commit35875863d2feafc1f653e17e0f58efc2f18ddc46 (patch)
tree5d40581a08201b3f37c7b31fe2aab4675d827f6b /ui/app/components/send
parent516c1869b0f366a42282a66e14185ce630f883dd (diff)
parentc14ec4191741c444dcf5b7c3e177c17a10374c16 (diff)
downloadtangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.gz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.bz2
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.lz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.xz
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.zst
tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.zip
Fix merge conflicts. Modify send workflow
Diffstat (limited to 'ui/app/components/send')
-rw-r--r--ui/app/components/send/send-utils.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/app/components/send/send-utils.js b/ui/app/components/send/send-utils.js
index d8211930d..71bfb2668 100644
--- a/ui/app/components/send/send-utils.js
+++ b/ui/app/components/send/send-utils.js
@@ -2,6 +2,7 @@ const {
addCurrencies,
conversionUtil,
conversionGTE,
+ multiplyCurrencies,
} = require('../../conversion-util')
const {
calcTokenAmount,
@@ -31,7 +32,7 @@ function isBalanceSufficient ({
{
value: totalAmount,
fromNumericBase: 'hex',
- conversionRate: amountConversionRate,
+ conversionRate: amountConversionRate || conversionRate,
fromCurrency: primaryCurrency,
},
)
@@ -62,7 +63,16 @@ function isTokenBalanceSufficient ({
return tokenBalanceIsSufficient
}
+function getGasTotal (gasLimit, gasPrice) {
+ return multiplyCurrencies(gasLimit, gasPrice, {
+ toNumericBase: 'hex',
+ multiplicandBase: 16,
+ multiplierBase: 16,
+ })
+}
+
module.exports = {
+ getGasTotal,
isBalanceSufficient,
isTokenBalanceSufficient,
}