mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-03 08:07:21 +00:00
filter transaction history for issued tokens and paid invoices
This commit is contained in:
1 parent
4a278d29e6
commit
3fbdf1fc60
1 file changed
+17
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user