Created
April 12, 2018 12:09
-
-
Save GrandSchtroumpf/8ccd416aa35b8809b8063e1be9bde6f6 to your computer and use it in GitHub Desktop.
The NGRX actions to work with Ethereum accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Action } from '@ngrx/store'; | |
/** | |
* TYPES | |
*/ | |
export const GET_ACCOUNTS = '[Eth] Get Accounts'; | |
export const GET_ACCOUNTS_SUCCESS = '[Eth] Get Accounts Success'; | |
export const SELECT_ACCOUNT = '[Eth] Select Account'; | |
export const ETH_ERROR = '[Eth] Error'; | |
/** | |
* ACTIONS | |
*/ | |
export class GetAccounts implements Action { | |
readonly type = GET_ACCOUNTS; | |
} | |
export class GetAccountsSuccess implements Action { | |
readonly type = GET_ACCOUNTS_SUCCESS; | |
constructor(public payload: string[]){} | |
} | |
export class SelectAccount implements Action { | |
readonly type = SELECT_ACCOUNT; | |
constructor(public payload: string) {} | |
} | |
export class EthError implements Action { | |
readonly type = ETH_ERROR; | |
constructor(public payload: any) {} | |
} | |
export type AccountsActions = | |
| GetAccounts | |
| GetAccountsSuccess | |
| SelectAccount | |
| EthError; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment