diff options
Merge branch 'NewUI-flat' into MM-128-get-currentCurrency-from-state
Diffstat (limited to 'ui/app/selectors.js')
-rw-r--r-- | ui/app/selectors.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/app/selectors.js b/ui/app/selectors.js index 1cfbc3975..66b7c00e4 100644 --- a/ui/app/selectors.js +++ b/ui/app/selectors.js @@ -6,6 +6,7 @@ const selectors = { getSelectedAccount, getSelectedToken, getSelectedTokenExchangeRate, + getTokenExchangeRate, conversionRateSelector, transactionsSelector, accountsWithSendEtherInfoSelector, @@ -58,7 +59,15 @@ function getSelectedTokenExchangeRate (state) { return tokenExchangeRate } -function conversionRateSelector (state) { +function getTokenExchangeRate (state, tokenSymbol) { + const pair = `${tokenSymbol.toLowerCase()}_eth` + const tokenExchangeRates = state.metamask.tokenExchangeRates + const { rate: tokenExchangeRate = 0 } = tokenExchangeRates[pair] || {} + + return tokenExchangeRate +} + +function conversionRateSelector (state) { return state.metamask.conversionRate } |