Skip to content

fix: implement API pagination for contract event fetching (#214)#219

Merged
Mosas2000 merged 1 commit intomainfrom
fix/214-api-pagination
Mar 8, 2026
Merged

fix: implement API pagination for contract event fetching (#214)#219
Mosas2000 merged 1 commit intomainfrom
fix/214-api-pagination

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Summary

Resolves #214 — Contract event fetching was limited to 50 results with no API pagination.

Changes

RecentTips.jsx

  • Added API_LIMIT constant and pagination state (apiOffset, hasMore, loadingMore, totalApiEvents)
  • Initial fetch at offset=0; new loadMoreTips callback fetches next page and appends results
  • "Load More Tips" button appears when more events are available
  • Displays total event count from API

TipHistory.jsx

  • Same pagination pattern as RecentTips
  • loadMoreTips callback fetches next page, filters by user address, and appends
  • "Load More Activity" button with event count display

Leaderboard.jsx

  • Auto-paginates through up to 10 pages (500 events) on initial load for accurate rankings
  • loadMoreEvents callback fetches additional pages and rebuilds leaderboard stats
  • "Load More Events for Accurate Rankings" button when more data exist- "Load More Events for Accurate Rankings" button when more data exist- "Load More Events for Accurate ndle API errors gracefully
  • Loading states shown during pagination
  • Buttons disabled during loading to pre- Buttons disabches
  • No lint errors

- RecentTips: add Load More button to fetch beyond initial 50 events
- TipHistory: add Load More button with offset-based API pagination
- Leaderboard: auto-paginate up to 500 events (10 pages) for accurate
  rankings, with manual Load More for additional data
- All components now display total event counts from the API
- Replaced hardcoded limit=50&offset=0 with configurable API_LIMIT constant
@Mosas2000 Mosas2000 merged commit 0d741e1 into main Mar 8, 2026
0 of 3 checks passed
@Mosas2000 Mosas2000 deleted the fix/214-api-pagination branch March 8, 2026 11:29
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.

Contract event fetching limited to 50 results with no API pagination

1 participant