Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"redux-localstorage-filter": "^0.1.1",
"redux-observable": "^0.16.0",
"rxjs": "^5.4.3",
"shuffle-array": "^1.0.1",
"simple-line-icons": "^2.4.1",
"sockjs-client": "^1.1.4",
"styled-components": "^2.1.2",
Expand Down Expand Up @@ -129,6 +130,7 @@
"@types/redux-localstorage-debounce": "^0.1.4",
"@types/redux-localstorage-filter": "^0.1.4",
"@types/rx": "^4.1.1",
"@types/shuffle-array": "^0.0.28",
"@types/sockjs-client": "^1.0.32",
"@types/url-join": "^0.8.2",
"@types/url-template": "^2.0.28",
Expand All @@ -147,4 +149,4 @@
"typescript": "^2.8.3",
"typescript-react-intl": "^0.1.7"
}
}
}
14 changes: 13 additions & 1 deletion src/app/lib/genesisAPI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import queryString from 'query-string';
import urlJoin from 'url-join';
import urlTemplate from 'url-template';
import { IUIDResponse, ILoginRequest, ILoginResponse, IRefreshResponse, IRowRequest, IRowResponse, IPageResponse, IBlockResponse, IMenuResponse, IContentRequest, IContentResponse, IContentTestRequest, IContentJsonRequest, IContentJsonResponse, ITableResponse, ISegmentRequest, ITablesResponse, IDataRequest, IDataResponse, ISectionsRequest, ISectionsResponse, IHistoryRequest, IHistoryResponse, INotificationsRequest, IParamResponse, IParamsRequest, IParamsResponse, IRefreshRequest, IParamRequest, ITemplateRequest, IContractRequest, IContractResponse, IContractsResponse, ITableRequest, TConfigRequest, ISystemParamsRequest, ISystemParamsResponse, IContentHashRequest, IContentHashResponse, TTxCallRequest, TTxCallResponse, TTxStatusRequest, TTxStatusResponse, ITxStatus } from 'genesis/api';
import { IUIDResponse, ILoginRequest, ILoginResponse, IRefreshResponse, IRowRequest, IRowResponse, IPageResponse, IBlockResponse, IMenuResponse, IContentRequest, IContentResponse, IContentTestRequest, IContentJsonRequest, IContentJsonResponse, ITableResponse, ISegmentRequest, ITablesResponse, IDataRequest, IDataResponse, ISectionsRequest, ISectionsResponse, IHistoryRequest, IHistoryResponse, INotificationsRequest, IParamResponse, IParamsRequest, IParamsResponse, IRefreshRequest, IParamRequest, ITemplateRequest, IContractRequest, IContractResponse, IContractsResponse, ITableRequest, TConfigRequest, ISystemParamsRequest, ISystemParamsResponse, IContentHashRequest, IContentHashResponse, TTxCallRequest, TTxCallResponse, TTxStatusRequest, TTxStatusResponse, ITxStatus, ITxInfoMultiple, TTxInfoMultipleRequest, TTxInfoMultipleResponse } from 'genesis/api';

export type TRequestMethod =
'get' |
Expand Down Expand Up @@ -304,6 +304,18 @@ class GenesisAPI {
public txStatus = <T>(params: TTxStatusRequest<T>) => this._txStatus({
hashes: Object.keys(params).map(l => params[l])
}) as Promise<TTxStatusResponse<T>>

private _txInfoMultiple = this.setSecuredEndpoint<{ hashes: string[] }, { [hash: string]: ITxInfoMultiple; }>('get', 'txinfomultiple', {
requestTransformer: request => ({
data: JSON.stringify({
hashes: request.hashes
})
}),
responseTransformer: response => response.results
});
public txInfoMultiple = <T>(params: TTxInfoMultipleRequest<T>) => this._txInfoMultiple({
hashes: Object.keys(params).map(l => params[l])
}) as Promise<TTxInfoMultipleResponse<T>>
}

export default GenesisAPI;
2 changes: 1 addition & 1 deletion src/app/modules/tx/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import { ITransactionCall, ITxError, ITransaction } from 'genesis/tx';
const actionCreator = actionCreatorFactory('tx');
export const txCall = actionCreator<ITransactionCall>('TX_CALL');
export const txAuthorize = actionCreator.async<{}, string, void>('TX_AUTHORIZE');
export const txExec = actionCreator.async<ITransactionCall, ITransaction[], ITxError>('TX_EXEC');
export const txExec = actionCreator.async<ITransactionCall, ITransaction[], ITxError>('TX_EXEC');
2 changes: 1 addition & 1 deletion src/app/modules/tx/epics/txCallEpic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import { Epic } from 'modules';
import { Observable } from 'rxjs';
import { txCall, txAuthorize, txExec } from '../actions';
import { txCall, txExec, txAuthorize } from '../actions';
import { isType } from 'typescript-fsa';
import keyring from 'lib/keyring';

Expand Down
Loading