import { Dispatch } from 'redux' ; import { TxAdd , TxFollow , TxRemove , TxSend } from '../actions/actions' ; import { TxInfos } from '../../state/txs' ; import { get_tx_id } from '../../utils/get_tx_id' ; export const addTransaction = ( dispatch , tx_hash , tx_infos ? ) : void => { dispatch ( TxAdd ( tx_hash , tx_infos || { } ) ) ; } ; export const removeTransaction = ( dispatch , tx_hash ) : void => { dispatch ( TxRemove ( tx_hash ) ) ; } ; export const sendTransaction = ( dispatch , tx_infos ) : number => { const tx_id = get_tx_id ( ) ; dispatch ( TxSend ( tx_infos , tx_id ) ) ; return tx_id ; } ; export const followTransaction = ( dispatch , tx_hash ) : number => { const tx_id = get_tx_id ( ) ; dispatch ( TxFollow ( tx_hash , tx_id ) ) ; return tx_id ; } ;