Skip to content

Add cursor pagination to fetchTipEvents #16

Description

@Abioladory123

Summary

fetchTipEvents takes a startLedger and a limit and returns whatever fits.
There is no cursor, so a caller that receives a full page has no way to ask for
the next one except by guessing a new start ledger, which risks either skipping
events or reprocessing them.

The RPC returns paging information the function currently discards.

Acceptance criteria

  • The function accepts a cursor and returns one for the next page when more
    events are available.
  • Paging through a range yields every event exactly once.
  • The paging contract is documented with an example loop in the README.

Getting started

Fork this repository, clone your fork, and add this repo as upstream:

git clone https://github.com/<your-username>/novatip-sdk.git
cd novatip-sdk
git remote add upstream https://github.com/Novatip/novatip-sdk.git
npm install

Create a branch for this issue:

git checkout -b feat/events-pagination

Suggested commit message:

feat: support paging through tip events

Run npm run lint, npm run typecheck, and npm run build before pushing, then open a pull request from your fork against main and link this issue. See the contributing guide for the full workflow.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions