aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js')
-rw-r--r--ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js b/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
deleted file mode 100644
index 27181d2f5..000000000
--- a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const {
- multiplyCurrencies,
- subtractCurrencies,
-} = require('../../../../../conversion-util')
-const ethUtil = require('ethereumjs-util')
-
-function calcMaxAmount ({ balance, gasTotal, selectedToken, tokenBalance }) {
- const { decimals } = selectedToken || {}
- const multiplier = Math.pow(10, Number(decimals || 0))
-
- return selectedToken
- ? multiplyCurrencies(
- tokenBalance,
- multiplier,
- {
- toNumericBase: 'hex',
- multiplicandBase: 16,
- }
- )
- : subtractCurrencies(
- ethUtil.addHexPrefix(balance),
- ethUtil.addHexPrefix(gasTotal),
- { toNumericBase: 'hex' }
- )
-}
-
-module.exports = {
- calcMaxAmount,
-}