import { Dispatch } from 'redux' ; import { VtxconfigAuthorizeAndSetWeb3 , VtxconfigReset , VtxconfigSetAllowedNet , VtxconfigSetWeb3 } from '../actions/actions' ; import { Authorization } from '../actions/actionTypes' ; export const init = ( dispatch , web3 ) : void => { dispatch ( VtxconfigSetWeb3 ( web3 ) ) ; dispatch ( VtxconfigReset ( ) ) ; } ; export const authorizeAndSetWeb3 = async ( dispatch , authorization ) : Promise < void > => { let cb ; const ret = new Promise < void > ( ( ok , ko ) : void => { cb = ok ; } ) ; dispatch ( VtxconfigAuthorizeAndSetWeb3 ( authorization , cb ) ) ; return ret ; } ; export const setWeb3 = ( dispatch , web3 ) : void => { dispatch ( VtxconfigSetWeb3 ( web3 ) ) ; } ; export const reset = ( dispatch ) : void => { dispatch ( VtxconfigReset ( ) ) ; } ; export const start = ( dispatch ) : void => { dispatch ( VtxconfigReset ( ) ) ; } ; export const setAllowedNet = ( dispatch , net_id , genesis_hash ) : void => { dispatch ( VtxconfigSetAllowedNet ( net_id , genesis_hash ) ) ; } ;