> ## 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

> Page through order history and closed round trips with a cursor, newest first.

Order history and closed round trips come back one page at a time, newest first. Each page carries
a cursor that fetches the next one. Use this page when you read an account's full history.

The loop has three steps:

1. Call the route and read `nextCursor` from the response.
2. If `nextCursor` is a string, send it back unchanged as `cursor` 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)
```

Treat a cursor as opaque. Don't parse it, build one, or keep it between sessions. A malformed cursor
is refused with `400` rather than quietly starting you from page one, so a bug in your pager shows
up as an error instead of duplicate rows.

Each page starts after the last row of the one before, so new rows arriving while you page never
shift your pages. You won't see the same order twice because something filled while you were
reading.
