filter transaction history for issued tokens and paid invoices

This commit is contained in:
lemonknowsall committed 2025-10-31 21:17:34 -07:00
1 parent 4a278d29e6
commit 3fbdf1fc60
1 file changed
+17 -1
+17 -1
View File
@@ -21,7 +21,23 @@ export function useHistoryManager({
try {
setIsLoadingHistory(true);
const entries = await coco.history.getPaginatedHistory(0, 50); // TODO: show entire history
setHistoryEntries(entries);
// Filter out unpaid quotes: only show completed transactions
// - Mint quotes: only show 'ISSUED' (completed)
// - Melt quotes: only show 'PAID' (completed)
// - Send/Receive: show all (no state field)
const filteredEntries = entries.filter((entry) => {
if (entry.type === 'mint') {
return entry.state === 'ISSUED';
}
if (entry.type === 'melt') {
return entry.state === 'PAID';
}
// Send and receive entries don't have a state field, show all
return true;
});
setHistoryEntries(filteredEntries);
} catch (err) {
console.error('Failed to load history:', err);
} finally {