Skip to content

feat: Soroban contract event subscription + invoice comparison (#119, #120)#175

Open
pugsleyonesimus-dev wants to merge 1 commit into
OpenLedger-Foundation:mainfrom
pugsleyonesimus-dev:feat/contract-events-invoice-comparison
Open

feat: Soroban contract event subscription + invoice comparison (#119, #120)#175
pugsleyonesimus-dev wants to merge 1 commit into
OpenLedger-Foundation:mainfrom
pugsleyonesimus-dev:feat/contract-events-invoice-comparison

Conversation

@pugsleyonesimus-dev
Copy link
Copy Markdown

closes #167
closes #168

feat(events): implement useContractEvents hook with 10s RPC polling

  • Add getContractEvents() to lib/stellar/client.ts using rpc.getEvents API
  • Parse event XDR to extract tokenId, amount, participantAddress
  • Track last processed ledger as cursor to avoid reprocessing
  • Invalidate TanStack Query caches per event type (funded/repaid/yield)
  • Show wallet-relevant toasts via sonner (respects notificationPreferences)
  • Mock event generator for NEXT_PUBLIC_ENABLE_MOCK_DATA=true mode
  • Mount via ContractEventSubscriber in marketplace + investor dashboard layouts

feat(comparison): invoice side-by-side comparison feature

  • Add comparisonList: string[] to invoiceStore with toggleComparison/remove/clear
  • Add compare toggle button to InvoiceCard (max 3, disabled when full)
  • Build ComparisonBar fixed bottom component with invoice chips + share URL
  • Build ComparisonTable modal with 10 metric rows and best-value green highlight
  • Shareable URLs via ?compare=id1,id2,id3 query param

Closes #119
Closes #120

…edger-Foundation#119, OpenLedger-Foundation#120)

feat(events): implement useContractEvents hook with 10s RPC polling
- Add getContractEvents() to lib/stellar/client.ts using rpc.getEvents API
- Parse event XDR to extract tokenId, amount, participantAddress
- Track last processed ledger as cursor to avoid reprocessing
- Invalidate TanStack Query caches per event type (funded/repaid/yield)
- Show wallet-relevant toasts via sonner (respects notificationPreferences)
- Mock event generator for NEXT_PUBLIC_ENABLE_MOCK_DATA=true mode
- Mount via ContractEventSubscriber in marketplace + investor dashboard layouts

feat(comparison): invoice side-by-side comparison feature
- Add comparisonList: string[] to invoiceStore with toggleComparison/remove/clear
- Add compare toggle button to InvoiceCard (max 3, disabled when full)
- Build ComparisonBar fixed bottom component with invoice chips + share URL
- Build ComparisonTable modal with 10 metric rows and best-value green highlight
- Shareable URLs via ?compare=id1,id2,id3 query param

Closes OpenLedger-Foundation#119
Closes OpenLedger-Foundation#120
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@pugsleyonesimus-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Soroban Event Subscription for Live Updates Implement Invoice Comparison Feature

1 participant