Paging getSignaturesForAddress with before/until
Last updated:
At a glance
| Property | Value |
|---|---|
| Order | Newest to oldest |
| Maximum per call | 1,000 signatures |
| before | Start searching backwards from this signature |
| until | Stop at this signature, if reached before the limit |
| Without before | The search starts from the highest max confirmed block |
What you see
getSignaturesForAddress returns exactly 1,000 entries (or your limit) and older transactions you know about are not among them. Repeating the call returns the same newest page again.
Why this happens
Solana's reference says the result is "ordered from newest to oldest transaction", and limit caps a call at 1,000 signatures. before means "start searching backwards from this transaction signature"; without it, "the search starts from the top of the highest max confirmed block" — which is why an unchanged call keeps returning the newest page. until means "search until this transaction signature, if found before limit reached", so it bounds a walk from the other side. Paging is therefore a backwards walk: each call's oldest signature becomes the next call's before.
What to do
- First call: no before, limit up to 1,000. Next calls: before = the last (oldest) signature of the previous page.
- For incremental sync, pass until = the newest signature you processed last time, so the walk stops where your stored history begins.
- Stop when a page comes back with fewer entries than your limit, or empty: the walk has reached the oldest signature this node returns.
- Store the cursor signature, not a count or a slot — signatures are the only cursor the method accepts.
When this is not our problem
The page size, the order and the before/until cursors are part of Solana's RPC method itself and behave the same on every node, whoever operates it, Triport included. How far back a walk reaches depends on what the node retains; that is covered on the empty-history page linked below.
FAQ
- How do I get more than 1,000 transactions for a Solana address?
- Page backwards: pass the oldest signature of each page as before on the next call, until a page returns fewer entries than your limit.
- What is the difference between before and until?
- before sets where the backwards search starts; until sets the signature where it stops.