diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-26 05:51:49 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 12:51:37 +0800 |
commit | 5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58 (patch) | |
tree | 17e4223f56f3a73944b60be5ec28e8bc98c8eefd /ui/app/reducers/metamask.js | |
parent | 5aaa2d679b00a7a78338b9b72fa72397ad945b35 (diff) | |
download | tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar.gz tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar.bz2 tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar.lz tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar.xz tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.tar.zst tangerine-wallet-browser-5cbbb476b3eb7a5fd70b014b2a1a83fea7092b58.zip |
ShapeShift Integration
Diffstat (limited to 'ui/app/reducers/metamask.js')
-rw-r--r-- | ui/app/reducers/metamask.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 323539eef..85ac3e201 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -19,6 +19,8 @@ function reduceMetamask (state, action) { lastUnreadNotice: undefined, frequentRpcList: [], addressBook: [], + tokenExchangeRates: {}, + coinOptions: {}, }, state.metamask) switch (action.type) { @@ -132,6 +134,25 @@ function reduceMetamask (state, action) { conversionDate: action.value.conversionDate, }) + case actions.PAIR_UPDATE: + const { value: { marketinfo: pairMarketInfo } } = action + return extend(metamaskState, { + tokenExchangeRates: { + ...metamaskState.tokenExchangeRates, + [pairMarketInfo.pair]: pairMarketInfo, + }, + }) + + case actions.SHAPESHIFT_SUBVIEW: + const { value: { marketinfo, coinOptions } } = action + return extend(metamaskState, { + tokenExchangeRates: { + ...metamaskState.tokenExchangeRates, + [marketinfo.pair]: marketinfo, + }, + coinOptions, + }) + default: return metamaskState |