From 5cc7132d8b750ebb09c18a2f41670ec4d082a5c2 Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Fri, 17 May 2024 18:25:21 -0400 Subject: [PATCH] fix: walletd pending transaction sc amount --- .changeset/tender-plants-live.md | 5 +++++ apps/walletd/contexts/events/index.tsx | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 .changeset/tender-plants-live.md diff --git a/.changeset/tender-plants-live.md b/.changeset/tender-plants-live.md new file mode 100644 index 000000000..2b35821cd --- /dev/null +++ b/.changeset/tender-plants-live.md @@ -0,0 +1,5 @@ +--- +'walletd': patch +--- + +Unconfirmed transactions rows now show their siacoin amount and fees. Closes https://github.com/SiaFoundation/walletd/issues/123 diff --git a/apps/walletd/contexts/events/index.tsx b/apps/walletd/contexts/events/index.tsx index 55bde3735..40e14524e 100644 --- a/apps/walletd/contexts/events/index.tsx +++ b/apps/walletd/contexts/events/index.tsx @@ -58,14 +58,18 @@ export function useEventsMain() { if (!responseEvents.data || !responseTxPool.data) { return null } - const dataTxPool: EventData[] = responseTxPool.data.map((e) => ({ - id: e.id, - timestamp: 0, - pending: true, - type: e.type, - isMature: false, - amount: new BigNumber(e.received).minus(e.sent), - })) + const dataTxPool: EventData[] = responseTxPool.data.map((e) => { + const event: EventData = { + id: e.id, + timestamp: 0, + pending: true, + type: e.type, + isMature: false, + amountSc: new BigNumber(e.received).minus(e.sent), + fee: e.raw.minerFees[0] ? new BigNumber(e.raw.minerFees[0]) : undefined, + } + return event + }) const dataEvents: EventData[] = responseEvents.data.map((e, index) => { let amountSc = new BigNumber(0) let amountSf = 0