Skip to content

Commit

Permalink
fix: walletd pending transaction sc amount
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed May 20, 2024
1 parent 0a0bab0 commit e43d0d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-plants-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'walletd': patch
---

Unconfirmed transactions rows now show their siacoin amount and fees. Closes https://github.com/SiaFoundation/walletd/issues/123
20 changes: 12 additions & 8 deletions apps/walletd/contexts/events/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e43d0d4

Please sign in to comment.