<!-- XE-0058 · api/openapi: GET /pending and GET /accounts silently return only 100 items while the spec promises all and declares no offset/limit (Medium) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0058>. The page is the record; this is the same page for reading.*

XE-0058 · Bounty

# api/openapi: GET /pending and GET /accounts silently return only 100 items while the spec promises all and declares no offset/limit (Medium)

Accepted
claimed Medium
[xe#78](https://github.com/xeprotocol/xe/issues/78)
filed 2026-10-26 20:34 UTC
by BoomGone

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   Node / API

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-10 11:38 UTC

Told
:   2026-11-10 00:15 UTC

### Patches

- [xe#124](https://github.com/xeprotocol/xe/pull/124) open by arturbarszcz78
  fix(api,node,store): optimize GET /accounts pagination, prevent full-chain deserialization, and align pagination contract (#70, #78)

### History

- [61389](https://bounty.xe.network/log/61389) 2026-11-10 00:15 UTC reply.mirrored
- [61346](https://bounty.xe.network/log/61346) 2026-11-10 00:15 UTC reply.sent
- [17821](https://bounty.xe.network/log/17821) 2026-11-07 16:08 UTC proposal.adopted
- [17820](https://bounty.xe.network/log/17820) 2026-11-07 16:08 UTC ticket.award
- [17819](https://bounty.xe.network/log/17819) 2026-11-07 16:07 UTC proposal.rejected
- [6890](https://bounty.xe.network/log/6890) 2026-11-05 13:45 UTC proposal.created
- [1815](https://bounty.xe.network/log/1815) 2026-11-02 19:16 UTC proposal.created
- [1469](https://bounty.xe.network/log/1469) 2026-11-02 10:11 UTC note.added
- [736](https://bounty.xe.network/log/736) 2026-10-29 14:22 UTC note.added
- [735](https://bounty.xe.network/log/735) 2026-10-29 14:22 UTC ticket.facts area
- [591](https://bounty.xe.network/log/591) 2026-10-29 14:04 UTC github.labels
- [415](https://bounty.xe.network/log/415) 2026-10-29 14:04 UTC ticket.status triaging → accepted

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

### Report

- Suggested tier: Medium ("inconsistent API responses", data silently missing), Minor if seen as docs only
- Area: HTTP API list endpoints, OpenAPI document
- Found: 2026-10-26, node `xe/92d83d1`, repo master `9787859`, openapi.json 1.0.0

## Summary

`GET /pending` is documented as "All pending sends: Returns every unreceived send known to the node, across all accounts" and `GET /accounts` as "List all accounts". In openapi.json neither operation declares any parameter, and the response is a bare array with no total, cursor or next link.

The handlers run `parsePagination` (`api/handler.go:604`), which defaults `limit` to 100 (`defaultPageLimit`, line 575\) and caps it at 1000\. Both endpoints therefore return exactly 100 items by default and drop the rest with no signal. The other list endpoints (`/frontiers`, `/conflicts`, `/directory`, `/reputation`, `/leases`) declare `offset` and `limit` and say "paginated"; these two do not.

## Evidence

Live, 2026-10-26, through `https://test.network/api/v1`:

```
GET /pending            -> 100 items
GET /pending?offset=100 -> 100 items, 0 overlap with the first page
GET /pending?limit=1000 -> 1000 items
GET /accounts            -> 100 items
GET /accounts?offset=100 -> 100 items, 0 overlap with the first page
```

#65 reports 11,467 pending receives on the network, so the default response shows under 1% of what the docs say it returns.

openapi.json (1.0.0):

- `/pending` GET: `parameters: []`, summary "All pending sends", description "Returns every unreceived send known to the node, across all accounts.", 200 description "All unreceived sends."
- `/accounts` GET: `parameters: []`, summary "List all accounts".

Code (`api/handler.go`, master `9787859`):

```
func (h *Handler) handleGetAllPending(w http.ResponseWriter, r *http.Request) {
	offset, limit := parsePagination(r)
	page := paginateSlice(h.node.GetAllPending(), offset, limit)
```

```
func (h *Handler) handleGetAllAccounts(w http.ResponseWriter, r *http.Request) {
	offset, limit := parsePagination(r)
```

## Steps to reproduce

```
curl -s https://test.network/api/v1/pending | jq length                 # 100
curl -s 'https://test.network/api/v1/pending?offset=100' | jq length    # 100, different items
curl -s https://test.network/api/v1/accounts | jq length                # 100
curl -s 'https://test.network/api/v1/accounts?offset=100' | jq length   # 100, different items
```

## Impact

- Any client, explorer or monitoring script that trusts the contract ("every unreceived send", "all accounts") silently works on a 100 item sample: totals, supply checks, "is my send still pending" scans across all accounts, and account counts are all wrong without any error.
- Clients generated from openapi.json cannot page at all, because `offset` and `limit` are not declared, and there is no way to learn the total.
- No fund risk.

## Suggested fix

1. Declare `offset` and `limit` on `/pending` and `/accounts` in openapi.json, and reword "every" / "all" to "paginated, 100 by default, 1000 max".
2. Ideally return a total (or a `next` offset), as `/statechain/blocks` already does with `block_count`.

## Payout

XE address: `6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc` (same as #75).

### Thread

**XE desk**team2026-11-10 00:15 UTCgithub

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is
updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0058.
