aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-01 10:50:37 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-01 10:50:37 +0800
commit3f918622bcce21ba104e0f13e71247796345ab0f (patch)
treefe0e6dd540871a17abe1274fa2c7e4a1ad40d90b /packages/instant/src/redux
parent6091ee732d208eaf9889087b8308dfd0427b9be5 (diff)
downloaddexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.gz
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.bz2
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.lz
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.xz
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.zst
dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.zip
feat: implement basic erc20 token selector
Diffstat (limited to 'packages/instant/src/redux')
-rw-r--r--packages/instant/src/redux/actions.ts2
-rw-r--r--packages/instant/src/redux/reducer.ts12
2 files changed, 2 insertions, 12 deletions
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts
index eadd8b42c..813c5e819 100644
--- a/packages/instant/src/redux/actions.ts
+++ b/packages/instant/src/redux/actions.ts
@@ -43,7 +43,7 @@ export const actions = {
createAction(ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT, amount),
updateBuyOrderState: (orderState: OrderState) => createAction(ActionTypes.UPDATE_BUY_ORDER_STATE, orderState),
updateLatestBuyQuote: (buyQuote?: BuyQuote) => createAction(ActionTypes.UPDATE_LATEST_BUY_QUOTE, buyQuote),
- updateSelectedAsset: (assetData?: string) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, assetData),
+ updateSelectedAsset: (asset: Asset) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, asset),
setAvailableAssets: (availableAssets: Asset[]) => createAction(ActionTypes.SET_AVAILABLE_ASSETS, availableAssets),
setQuoteRequestStatePending: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_PENDING),
setQuoteRequestStateFailure: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_FAILURE),
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index c0a8c1771..57d95167a 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -14,7 +14,6 @@ import {
OrderProcessState,
OrderState,
} from '../types';
-import { assetUtils } from '../util/asset';
import { BigNumberInput } from '../util/big_number_input';
import { Action, ActionTypes } from './actions';
@@ -108,18 +107,9 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State =>
latestErrorDisplayStatus: DisplayStatus.Hidden,
};
case ActionTypes.UPDATE_SELECTED_ASSET:
- const newSelectedAssetData = action.data;
- let newSelectedAsset: Asset | undefined;
- if (!_.isUndefined(newSelectedAssetData)) {
- newSelectedAsset = assetUtils.createAssetFromAssetDataOrThrow(
- newSelectedAssetData,
- state.assetMetaDataMap,
- state.network,
- );
- }
return {
...state,
- selectedAsset: newSelectedAsset,
+ selectedAsset: action.data,
};
case ActionTypes.RESET_AMOUNT:
return {