aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-utils.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-01 10:55:36 +0800
committerDan <danjm.com@gmail.com>2018-05-01 11:00:38 +0800
commite488c0eeeace80708285fa5e7d83f3fa219a86c8 (patch)
treea89245303d26bb346d24362e49c1c0a79d9a29fb /ui/app/components/send/send-utils.js
parent954394f81090b1a6a4afe55243caa3671b88addc (diff)
downloadtangerine-wallet-browser-e488c0eeeace80708285fa5e7d83f3fa219a86c8.tar.gz
tangerine-wallet-browser-e488c0eeeace80708285fa5e7d83f3fa219a86c8.tar.zst
tangerine-wallet-browser-e488c0eeeace80708285fa5e7d83f3fa219a86c8.zip
Delete dead send code.
Diffstat (limited to 'ui/app/components/send/send-utils.js')
-rw-r--r--ui/app/components/send/send-utils.js78
1 files changed, 0 insertions, 78 deletions
diff --git a/ui/app/components/send/send-utils.js b/ui/app/components/send/send-utils.js
deleted file mode 100644
index 71bfb2668..000000000
--- a/ui/app/components/send/send-utils.js
+++ /dev/null
@@ -1,78 +0,0 @@
-const {
- addCurrencies,
- conversionUtil,
- conversionGTE,
- multiplyCurrencies,
-} = require('../../conversion-util')
-const {
- calcTokenAmount,
-} = require('../../token-util')
-
-function isBalanceSufficient ({
- amount = '0x0',
- gasTotal = '0x0',
- balance,
- primaryCurrency,
- amountConversionRate,
- conversionRate,
-}) {
- const totalAmount = addCurrencies(amount, gasTotal, {
- aBase: 16,
- bBase: 16,
- toNumericBase: 'hex',
- })
-
- const balanceIsSufficient = conversionGTE(
- {
- value: balance,
- fromNumericBase: 'hex',
- fromCurrency: primaryCurrency,
- conversionRate,
- },
- {
- value: totalAmount,
- fromNumericBase: 'hex',
- conversionRate: amountConversionRate || conversionRate,
- fromCurrency: primaryCurrency,
- },
- )
-
- return balanceIsSufficient
-}
-
-function isTokenBalanceSufficient ({
- amount = '0x0',
- tokenBalance,
- decimals,
-}) {
- const amountInDec = conversionUtil(amount, {
- fromNumericBase: 'hex',
- })
-
- const tokenBalanceIsSufficient = conversionGTE(
- {
- value: tokenBalance,
- fromNumericBase: 'dec',
- },
- {
- value: calcTokenAmount(amountInDec, decimals),
- fromNumericBase: 'dec',
- },
- )
-
- return tokenBalanceIsSufficient
-}
-
-function getGasTotal (gasLimit, gasPrice) {
- return multiplyCurrencies(gasLimit, gasPrice, {
- toNumericBase: 'hex',
- multiplicandBase: 16,
- multiplierBase: 16,
- })
-}
-
-module.exports = {
- getGasTotal,
- isBalanceSufficient,
- isTokenBalanceSufficient,
-}