> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trdrs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Paging

> Order history and closed round-trips are keyset-paged, newest first.

Order history and closed round-trips are keyset-paged, newest first.

The loop is three lines of logic:

1. Call the route. Read `nextCursor` from the response.
2. If `nextCursor` is a string, pass it back verbatim on the next call.
3. If `nextCursor` is null, you have the last page.

```ts theme={null}
let cursor: string | null = null
do {
  const page = await get(`/api/account/orders/history${cursor ? `?cursor=${cursor}` : ''}`)
  rows.push(...page.orders)
  cursor = page.nextCursor
} while (cursor)
```

Cursors are opaque. Do not parse, build, or store them across sessions. A malformed cursor is
rejected with `400` rather than silently resetting you to page one, so a bug in your pager shows
up as an error instead of duplicate data.

Keyset paging means new rows arriving mid-scroll never shift your pages. You will not see the
same order twice because something filled while you were paging.
