aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/conversion-util.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-27 00:06:34 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-27 03:25:33 +0800
commit220da24f9ab4a57a10bc1fc3e249c511a98ecb46 (patch)
treefbfc5162c1ebd3a57df604dff47375d081b7930c /ui/app/conversion-util.js
parent0d8f21ad58cc50c635974ee9ce487ce98993ea38 (diff)
downloadtangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar.gz
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar.bz2
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar.lz
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar.xz
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.tar.zst
tangerine-wallet-browser-220da24f9ab4a57a10bc1fc3e249c511a98ecb46.zip
Change min gas price to 0.1 GWEI
Diffstat (limited to 'ui/app/conversion-util.js')
-rw-r--r--ui/app/conversion-util.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js
index 2f3fb1678..39215cf1b 100644
--- a/ui/app/conversion-util.js
+++ b/ui/app/conversion-util.js
@@ -51,7 +51,7 @@ const toNormalizedDenomination = {
}
const toSpecifiedDenomination = {
WEI: bigNumber => bigNumber.times(BIG_NUMBER_WEI_MULTIPLIER).round(),
- GWEI: bigNumber => bigNumber.times(BIG_NUMBER_GWEI_MULTIPLIER).round(),
+ GWEI: bigNumber => bigNumber.times(BIG_NUMBER_GWEI_MULTIPLIER).round(1),
}
const baseChange = {
hex: n => n.toString(16),
@@ -169,9 +169,34 @@ const conversionGreaterThan = (
return firstValue.gt(secondValue)
}
+const conversionGTE = (
+ { ...firstProps },
+ { ...secondProps },
+) => {
+ const firstValue = converter({ ...firstProps })
+ const secondValue = converter({ ...secondProps })
+ return firstValue.greaterThanOrEqualTo(secondValue)
+}
+
+const conversionLTE = (
+ { ...firstProps },
+ { ...secondProps },
+) => {
+ const firstValue = converter({ ...firstProps })
+ const secondValue = converter({ ...secondProps })
+ return firstValue.lessThanOrEqualTo(secondValue)
+}
+
+const toNegative = (n, options = {}) => {
+ return multiplyCurrencies(n, -1, options)
+}
+
module.exports = {
conversionUtil,
addCurrencies,
multiplyCurrencies,
conversionGreaterThan,
+ conversionGTE,
+ conversionLTE,
+ toNegative,
} \ No newline at end of file