return chainClient().transactions.build(builderFunction)
}
+const getTransaction = (params) => {
+
+ return (dispatch) => {
+ const promise = chainClient().transactions.getTransaction(params)
+
+ promise.then(
+ (resp) => {
+ if(resp.status == 'fail'){
+ dispatch({type: 'ERROR', payload: { 'message': resp.msg}})
+ }else{
+ resp.data = [resp.data]
+ dispatch({
+ type: `RECEIVED_${type.toUpperCase()}_ITEMS`,
+ param: resp
+ })
+ }
+ }
+ ).catch(error=>{
+ if(error.body){
+ dispatch({type: 'ERROR', payload: { 'message': error.body.msg}})
+ }
+ else throw error
+ })
+
+ return promise
+ }
+}
+
export default {
...list,
...form,
decode,
getAddresses,
estimateGas,
- buildTransaction
+ buildTransaction,
+ getTransaction
}
})
const mapDispatchToProps = ( dispatch ) => ({
- fetchItem: (id) => dispatch(actions.fetchItems({id: `${id}`}))
+ fetchItem: (id) => dispatch(actions.getTransaction({tx_id: `${id}`}))
})
export default connect(
Object.assign({}, params, {detail: true}),
{cb}),
+ getTransaction: (params, cb) => shared.query(client, 'transactions', '/get-transaction',
+ params, {cb}),
+
queryAll: (params, processor, cb) => shared.queryAll(client, 'transactions', params, processor, cb),
build: (builderBlock, cb) => {