Cursors and Pages
Every list returns the same envelope, so one loop pages through any of them.
Rows sit under a key named for the feed, beside the fields below.
| Field | Means |
|---|---|
next_cursor | Pass it back as cursor for the next page. Set on every page with rows, null on an empty one |
tip.block_height | The newest block served. On Index it is the height committed for the event type you read, so two reads can differ; /blocks and /transactions stay on the ingest tip (source_block_height) |
tip.finalized_height | Rows at or below it never reorg |
reorgs | Rows to undo since your last page: Reorgs |
Subgraph tables answer with rows, a numeric cursor and their own tip:
The SDK's walk() follows the cursor for you.
Over HTTP, pass next_cursor back as cursor on Index and subgraph routes.
| Surface | Page size | Order |
|---|---|---|
| Index | limit, default 200, max 1000 | Oldest first; order=desc for newest first on events and ft/nft transfers |
| Streams | limit, default 100, max 1000 | Fixed by the cursor, no order param |
| Subgraph tables | _limit, default 50, max 1000 | _id, or _sort=<column>&_order=asc|desc |
| Index also takes | Effect |
|---|---|
from_cursor | Exclusive start; not with cursor |
from_height, to_height | A height range |
wait | Holds an empty page open (max 25 s) until new data commits; an older instance answers 400, so fall back to polling |
contract_id | A comma-separated set, max 20, on one cursor |
tx_context=true | Puts tx_sender, tx_type, tx_status, tx_contract_id and tx_function_name on every event; for print it is the only place the sender lives |
On Index, a page shorter than limit is the last when to_height is at or below tip.block_height. Subgraph reads cover sorting and search.
These subgraph-table requests return 400, not a clamp:
- A
_limitthat is not an integer, or is0, negative or over 1000. - An
_orderother thanascordesc. - A bare
limit,orderorsort.
A cursor is <block_height>:<event_index>. Store it as an opaque string; it sorts in chain order.
Both bounds of a reorg's orphaned_range use it, tracking decoded-event positions. On transaction-keyed feeds (/transactions, /contract-calls), compare by the block-height part.
Branch on code, not on the message.
| Field | Is |
|---|---|
request_id | Matches the X-Request-Id header, sent on every response; quote it in any report |
feedback.url | Where to report a gap |
Report a gap with the request_id: Report a Problem.