diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 09:38:46 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 09:38:46 +0800 |
commit | a50f0ca997bf3ea09a4ac2c12e406385ba252eb7 (patch) | |
tree | 3172c4a04a06d85555ffc44d43d4e833c2d460b6 /packages/instant/src/redux/actions.ts | |
parent | 39ae21d6939b43fbae0669219801b2bab140da9c (diff) | |
parent | 12bc6f5d5816a3c1c5ed03b23ce67a1be4e72f39 (diff) | |
download | dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.gz dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.bz2 dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.lz dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.xz dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.zst dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/metamask-connect-flow
Diffstat (limited to 'packages/instant/src/redux/actions.ts')
-rw-r--r-- | packages/instant/src/redux/actions.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts index c41c5054b..fc89e3d0e 100644 --- a/packages/instant/src/redux/actions.ts +++ b/packages/instant/src/redux/actions.ts @@ -2,7 +2,7 @@ import { BuyQuote } from '@0x/asset-buyer'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; -import { ActionsUnion, Asset } from '../types'; +import { ActionsUnion, AddressAndEthBalanceInWei, Asset } from '../types'; export interface PlainAction<T extends string> { type: T; @@ -21,6 +21,11 @@ function createAction<T extends string, P>(type: T, data?: P): PlainAction<T> | } export enum ActionTypes { + SET_ACCOUNT_STATE_LOADING = 'SET_ACCOUNT_STATE_LOADING', + SET_ACCOUNT_STATE_LOCKED = 'SET_ACCOUNT_STATE_LOCKED', + SET_ACCOUNT_STATE_ERROR = 'SET_ACCOUNT_STATE_ERROR', + SET_ACCOUNT_STATE_READY = 'SET_ACCOUNT_STATE_READY', + UPDATE_ACCOUNT_ETH_BALANCE = 'UPDATE_ACCOUNT_ETH_BALANCE', UPDATE_ETH_USD_PRICE = 'UPDATE_ETH_USD_PRICE', UPDATE_SELECTED_ASSET_AMOUNT = 'UPDATE_SELECTED_ASSET_AMOUNT', SET_BUY_ORDER_STATE_NONE = 'SET_BUY_ORDER_STATE_NONE', @@ -40,6 +45,12 @@ export enum ActionTypes { } export const actions = { + setAccountStateLoading: () => createAction(ActionTypes.SET_ACCOUNT_STATE_LOADING), + setAccountStateLocked: () => createAction(ActionTypes.SET_ACCOUNT_STATE_LOCKED), + setAccountStateError: () => createAction(ActionTypes.SET_ACCOUNT_STATE_ERROR), + setAccountStateReady: (address: string) => createAction(ActionTypes.SET_ACCOUNT_STATE_READY, address), + updateAccountEthBalance: (addressAndBalance: AddressAndEthBalanceInWei) => + createAction(ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE, addressAndBalance), updateEthUsdPrice: (price?: BigNumber) => createAction(ActionTypes.UPDATE_ETH_USD_PRICE, price), updateSelectedAssetAmount: (amount?: BigNumber) => createAction(ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT, amount), setBuyOrderStateNone: () => createAction(ActionTypes.SET_BUY_ORDER_STATE_NONE), |