Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: walletd pending transaction sc amount #627

Merged
merged 1 commit into from
May 20, 2024
Merged
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
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
Loading