Skip to content

feat(wallet): implement wallet transaction history - #1368

Open
kishore08-07 wants to merge 1 commit into
develfrom
kishore/transaction-history
Open

feat(wallet): implement wallet transaction history #1368
kishore08-07 wants to merge 1 commit into
develfrom
kishore/transaction-history

Conversation

@kishore08-07

@kishore08-07 kishore08-07 commented Jul 28, 2026

Copy link
Copy Markdown
Member
  • Added useQueryWalletHistory hook to fetch paginated transaction history from daemon
  • Added TxHistoryTable component to render sortable and expandable transaction rows
  • Added TxHistoryContent container for handling loading states and batch pagination
  • Added TxHistoryOverlay full-screen dialog for viewing complete history
  • Integrated inline Recent Activity section into MainWalletPage
  • Added translation keys in en
  • Added comprehensive unit tests

Closes #515

- Add useQueryWalletHistory hook to fetch paginated transaction history from daemon
- Add TxHistoryTable component to render sortable and expandable transaction rows
- Add TxHistoryContent container for handling loading states and batch pagination
- Add TxHistoryOverlay full-screen dialog for viewing complete history
- Integrate inline Recent Activity section into MainWalletPage
- Add translation keys
- Add comprehensive unit tests

Signed-off-by: kishore08-07 <kishorebsm8@gmail.com>
@kishore08-07 kishore08-07 self-assigned this Jul 28, 2026
Copilot AI review requested due to automatic review settings July 28, 2026 16:00
@kishore08-07 kishore08-07 added enhancement New feature or request SoB Issues, PRs, tasks, and discussions related to Summer of Bitcoin. labels Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 89.58% (🎯 85%) 4629 / 5167
🟢 Statements 89.18% (🎯 85%) 5078 / 5694
🟢 Functions 87.25% (🎯 85%) 1663 / 1906
🟢 Branches 81.02% (🎯 80%) 3074 / 3794
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/MainWalletPage.tsx 96.15% 100% 91.66% 96% 163
src/components/wallet/TxHistoryContent.tsx 100% 89.47% 100% 100%
src/components/wallet/TxHistoryOverlay.tsx 100% 100% 100% 100%
src/components/wallet/TxHistoryTable.tsx 92.53% 57.62% 89.47% 92.42% 165-166, 291-294
src/hooks/useQueryWalletHistory.ts 85.71% 90% 50% 100% 32
Generated in workflow #3492 for commit d2d7e74 by the Vitest Coverage Report Action

@kishore08-07 kishore08-07 changed the title feat(wallet): implement transaction history feat(wallet): implement wallet transaction history Jul 28, 2026
@kishore08-07
kishore08-07 marked this pull request as ready for review July 28, 2026 16:11

const roleLabel = (entry: HistoryEntry, t: TFunction) => {
const role = historyRole(entry)
return role ? t(`tx_history.role_${role}`) : t('tx_history.role_unknown')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the fallback be the raw value instead of role_unknown?

@theborakompanioni

theborakompanioni commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Just notes and first raw thoughts while during manual tests:

  • When blocks are mined, confirmations does not increase, so while it would have been nice, it is not useful information and should not be disabled (for now!)
  • Add ability to reload?
  • Automatically reload on new utxo set hash?
  • Add link to sidebar (to content as page, not the dialog)
  • Dont show history immediately, add in accordion similar to legacy ui (?)
image
  • Add header title and description, e.g. "Transaction History (Experimental)"? (Remove sr-only)
  • Add "add demo entry" button in overlay (as other table based overlays have?)
  • Briefly shows "No transactions found" before "Loading"
image

The following are problems in joinmarket-ng and should be reported:

  • When doing a collaborative transaction, confirmations is 1 (also notice confirmed_at), when it should be 0, network is testnet when it should be regtest (other deposit tx were correctly identified as regtest)
{
  "timestamp": "2026-07-29T00:16:33.160301",
  "completed_at": "2026-07-29T00:16:42.210479",
  "confirmed_at": "2026-07-29T00:16:42.210479",
  "role": "taker",
  "success": true,
  "failure_reason": "",
  "confirmations": 1,
  "txid": "c29ef1f8855301906865b41278208556b930c28b0981e87cc8f94f72f33c082e",
  "cj_amount": 123456,
  "peer_count": 2,
  "counterparty_nicks": "J5BGMMqBMRLfq1jy,J5EEjo97pRtdgsGH",
  "fee_received": 0,
  "txfee_contribution": 0,
  "total_maker_fees_paid": 0,
  "mining_fee_paid": 451,
  "net_fee": -451,
  "source_mixdepth": 0,
  "destination_address": "bcrt1qxnvk25x9d4hxelc0lkqdn9cupkkthzl4czem5d",
  "change_address": "bcrt1q74cvsalryhcup0uj2r9pl5y8nfdlvgt40h66j2",
  "utxos_used": "1a84a1b0a651ed48fb92e0f31323191f1c46b235eb2d706750335be2e2d63691:0",
  "broadcast_method": "random-peer",
  "network": "testnet",
  "source": "protocol"
}
  • A "deposit" has cj_amount and source_mixdepth, when it is not a collaborative transaction.
{
  "timestamp": "2026-07-29T00:09:13",
  "completed_at": "2026-07-29T00:09:13",
  "confirmed_at": "2026-07-29T00:09:13",
  "role": "deposit",
  "success": true,
  "failure_reason": "",
  "confirmations": 310,
  "txid": "9a74a1b0a651ed48fb92e0f31323191f1c46b235eb2d706750335be2e2d63691",
  "cj_amount": 5000000000,
  "peer_count": null,
  "counterparty_nicks": "",
  "fee_received": 0,
  "txfee_contribution": 0,
  "total_maker_fees_paid": 0,
  "mining_fee_paid": 0,
  "net_fee": 0,
  "source_mixdepth": 0,
  "destination_address": "bcrt1qt8nd5dwmagnyppf3u5n9tah5xe9phqrxl5cs8x",
  "change_address": "",
  "utxos_used": "",
  "broadcast_method": "",
  "network": "regtest",
  "source": "onchain"
}
  • It seems "non-collaborative" sends are not included or history reponse is not updated accordingly?

"column_confirmations": "Confs.",
"column_txid": "Txid",
"role_maker": "Maker",
"role_taker": "CoinJoin",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term "CoinJoin" has not yet been present anywhere. Can we find a different term?
"Collaborative transaction" is probably to long for a label. Simply "Taker" would be okay for the first draft?

"column_net_fee": "Net Fee",
"column_confirmations": "Confs.",
"column_txid": "Txid",
"role_maker": "Maker",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"role_maker": "Maker",
"label_role_maker": "Maker",

Can the keys be prefixed with label_

"column_amount": "Amount",
"column_net_fee": "Net Fee",
"column_confirmations": "Confs.",
"column_txid": "Txid",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"column_txid": "Txid",
"column_txid": "Transaction",

"error_loading": "Failed to load transaction history.",
"copy_txid_success": "Transaction ID copied.",
"copy_txid_error": "Failed to copy transaction ID.",
"column_date": "Date",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other table components use heading_ or column_title_ as prefix.
(Should be aligned, but at least not introduce a third pattern)

taker: 'default',
send: 'used-empty',
deposit: 'deposit',
}

@theborakompanioni theborakompanioni Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Labels should be distinguishable, i.e. have different colors
Image

<Dialog open={open} onOpenChange={() => onOpenChange(false)} {...dialogProps}>
<DialogContent className="data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom flex h-dvh max-h-dvh! max-w-screen! flex-col overflow-hidden rounded-none border-none">
<DialogHeader className="px-2">
<DialogTitle className="sr-only flex items-center gap-2">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<DialogTitle className="sr-only flex items-center gap-2">
<DialogTitle className="flex items-center gap-2">

<DialogHeader className="px-2">
<DialogTitle className="sr-only flex items-center gap-2">
<PageTitle title={t('tx_history.overlay_title')} />
</DialogTitle>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</DialogTitle>
</DialogTitle>
<DialogDescription>{t('tx_history.overlay_subtitle')}</DialogDescription>

?

const queryOptions = wallethistoryOptions({
client,
path: { walletname: walletFileName || '' },
query: { limit },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ability to pass utxosHashHex from useJamWalletInfoContext to auto-reload on change?

enabled = true,
}: UseQueryWalletHistoryProps): UseQueryWalletHistoryResult {
const client = useApiClient()
const jmSession = useStore(jmSessionStore, (state) => state.state?.session)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request SoB Issues, PRs, tasks, and discussions related to Summer of Bitcoin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction history

3 participants