feature: add transactionId in get transactions query

This commit is contained in:
George Lima 2018-12-19 15:29:45 -03:00
parent fee6dca6dc
commit c3f43c9e85
3 changed files with 20 additions and 17 deletions

View File

@ -46,20 +46,23 @@ export const TransactionDailyComponent = ({
<Wrapper>
<Day value={transactionsDate} />
<TransactionsWrapper>
{transactions.map(({
date, type, address, amount,
}, idx) => (
<Fragment key={`${address}-${type}-${amount}-${date}`}>
<TransactionItemComponent
type={type}
date={date}
address={address || ''}
amount={amount}
zecPrice={zecPrice}
/>
{idx < transactions.length - 1 && <Divider />}
</Fragment>
))}
{transactions.map(
({
date, type, address, amount, transactionId,
}, idx) => (
<Fragment key={`${address}-${type}-${amount}-${date}`}>
<TransactionItemComponent
transactionId={transactionId}
type={type}
date={date}
address={address || ''}
amount={amount}
zecPrice={zecPrice}
/>
{idx < transactions.length - 1 && <Divider />}
</Fragment>
),
)}
</TransactionsWrapper>
</Wrapper>
);

View File

@ -41,9 +41,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
// eslint-disable-next-line
if (addressesErr) return dispatch(loadWalletSummaryError({ error: addressesErr.message }));
const [transactionsErr, transactions = []] = await eres(
rpc.listtransactions(),
);
const [transactionsErr, transactions] = await eres(rpc.listtransactions());
if (transactionsErr) {
return dispatch(
@ -59,6 +57,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
addresses,
transactions: flow([
arr => arr.map(transaction => ({
transactionId: transaction.txid,
type: transaction.category,
date: new Date(transaction.time * 1000).toISOString(),
address: transaction.address,

View File

@ -42,6 +42,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
loadTransactionsSuccess({
list: flow([
arr => arr.map(transaction => ({
transactionId: transaction.txid,
type: transaction.category,
date: new Date(transaction.time * 1000).toISOString(),
address: transaction.address,