<!-- XE-16988 · [Low] client.GetLeases returns at most 100 leases with no pagination — silently truncated · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16988>. The page is the record; this is the same page for reading.*

XE-16988 · Bounty

# \[Low\] client.GetLeases returns at most 100 leases with no pagination — silently truncated

Closed · duplicate
—
[xe#699](https://github.com/xeprotocol/xe/issues/699)
filed 2026-11-17 08:12 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770268](https://bounty.xe.network/log/770268) 2026-11-22 23:26 UTC reply.mirror\_failed
- [769995](https://bounty.xe.network/log/769995) 2026-11-22 23:26 UTC proposal.adopted
- [769994](https://bounty.xe.network/log/769994) 2026-11-22 23:26 UTC reply.sent
- [769993](https://bounty.xe.network/log/769993) 2026-11-22 23:26 UTC ticket.status new → closed
- [769070](https://bounty.xe.network/log/769070) 2026-11-22 23:25 UTC proposal.adopted
- [769069](https://bounty.xe.network/log/769069) 2026-11-22 23:25 UTC ticket.facts area
- [769068](https://bounty.xe.network/log/769068) 2026-11-22 23:25 UTC proposal.adopted
- [769067](https://bounty.xe.network/log/769067) 2026-11-22 23:25 UTC ticket.facts
- [769066](https://bounty.xe.network/log/769066) 2026-11-22 23:25 UTC proposal.adopted
- [769065](https://bounty.xe.network/log/769065) 2026-11-22 23:25 UTC ticket.facts
- [766344](https://bounty.xe.network/log/766344) 2026-11-22 23:17 UTC note.added
- [766332](https://bounty.xe.network/log/766332) 2026-11-22 23:17 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-16988) · [JSON](https://bounty.xe.network/v1/tickets/XE-16988) · [markdown](https://bounty.xe.network/XE-16988.md)

### Report

## Summary

`client.GetLeases` returns at most 100 leases with no pagination — silently truncated. The server paginates and returns a bare array with no total, and the SDK issues a single `GET /leases` with no params and returns the one page as if complete.

## Root Cause

- Server `handleGetLeases` (`api/handler.go:808`) paginates via `parsePagination` (default limit 100\) and returns a bare array with **no total**.
- SDK `GetLeases` (`client/client.go:142`) issues a single `GET /leases` with no params and returns the one page as if complete.
- Contrast `GetChain` (`client/client.go:35`), which loops over pages (pageLimit 1000, offset loop).

## Verification

Executed PoC against the real `api.Handler` (httptest \+ fake backend):

```
GetLeases: backend=250 SDK returned=100 (silently truncated, no total in response)
```

## Note on related reports

Searched `GetLeases pagination client` and `leases truncated 100 limit SDK` — no hits. Distinct from #647 (GetChain loop termination) and #390 (server ignores `?offset=` on `/blocks/recent` — different endpoint, server-side mechanism).

## Suggested fix

Loop over pages in `GetLeases` like `GetChain` does, or return the total/pagination metadata so callers can detect truncation.

### Thread

**Joseph Denne**team2026-11-22 23:26 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-16988 and says what differs; it is read like any other.
