-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Currently, the SDK does not provide a way to fetch all active payment channels for a user (payer or merchant). Instead of modifying the smart contract, we can use The Graph to index payment channels and query them efficiently.
Proposed Solution
- Deploy a subgraph
- Index
ChannelCreated,ChannelRedeemed, andChannelClosedevents. - Store channels between payers and merchants.
- Index
- Update the SDK
- Add a function to query the subgraph for a list of open channels by payer.
- Add a function to query the subgraph for a list of open channels with merchant.
- Expose API for Frontend
- Allow frontends to easily fetch all open channels for a user without scanning on-chain data.
Benefits
- Cheaper & Faster - No additional gas costs for storage, and queries are nearly instant.
- Better User Experience - Fetch all active channels in a single GraphQL query.
- Scalable - Easily extendable to add more analytics, filtering, or historical data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels