aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send.selectors.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-22 16:10:06 +0800
committerDan <danjm.com@gmail.com>2018-05-31 07:24:31 +0800
commit166fda58777748141859c0a674a5fce454cfc3d3 (patch)
treeb8f743c927ff55ee02be61b013d3c726711381c3 /ui/app/components/send_/send.selectors.js
parent17909465f283179aad39166b1191dbaba3770bf6 (diff)
downloadtangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.gz
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.bz2
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.lz
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.xz
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.zst
tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.zip
Simplify gas estimate actions and add local estimateGasPriceFromRecentBlocks method.
Diffstat (limited to 'ui/app/components/send_/send.selectors.js')
-rw-r--r--ui/app/components/send_/send.selectors.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/components/send_/send.selectors.js b/ui/app/components/send_/send.selectors.js
index c5ae1ab7f..850328e10 100644
--- a/ui/app/components/send_/send.selectors.js
+++ b/ui/app/components/send_/send.selectors.js
@@ -3,6 +3,9 @@ const abi = require('human-standard-token-abi')
const {
multiplyCurrencies,
} = require('../../conversion-util')
+const {
+ estimateGasPriceFromRecentBlocks,
+} = require('./send.utils')
const selectors = {
accountsWithSendEtherInfoSelector,
@@ -18,8 +21,10 @@ const selectors = {
getForceGasMin,
getGasLimit,
getGasPrice,
+ getGasPriceFromRecentBlocks,
getGasTotal,
getPrimaryCurrency,
+ getRecentBlocks,
getSelectedAccount,
getSelectedAddress,
getSelectedIdentity,
@@ -124,6 +129,10 @@ function getGasPrice (state) {
return state.metamask.send.gasPrice
}
+function getGasPriceFromRecentBlocks (state) {
+ return estimateGasPriceFromRecentBlocks(state.metamask.recentBlocks)
+}
+
function getGasTotal (state) {
return state.metamask.send.gasTotal
}
@@ -133,6 +142,10 @@ function getPrimaryCurrency (state) {
return selectedToken && selectedToken.symbol
}
+function getRecentBlocks (state) {
+ return state.metamask.recentBlocks
+}
+
function getSelectedAccount (state) {
const accounts = state.metamask.accounts
const selectedAddress = getSelectedAddress(state)