Overview
Every DAS list method (getAssetsByOwner, getAssetsByGroup, getAssetsByCreator, getAssetsByAuthority, searchAssets, getTokenAccounts, getNftEditions and getSignaturesForAsset) returns results in pages. You can page in three ways:
Use one method per request. Mixing
page with cursor, before or after, or cursor with before or after, returns -32602.
Limits
limitsets the page size. The maximum and the default are both 1,000.pagestarts at 1.page: 0is rejected.- Batch methods (
getAssetBatch,getAssetProofBatch) take at most 1,000 IDs.
Page numbers
Passpage and limit. The response echoes page:
limit.
Cursors
When you send nopage, before or after, the API pages by cursor and returns a cursor value with each page. Pass it back to get the next page:
id, which is the default.
Ranges
before and after take asset IDs and return the assets between them. For example, after alone continues from a known asset ID:
id.
Sorting
Methods that list assets acceptsortBy:
id works only with page numbers. Combining it with cursor, before or after returns -32602.
Rust SDK
The OrbitFlare Rust SDK can page for you.pages takes any list request and walks it to the end: by cursor when results are sorted by id, and by page number when you sort by anything else or set .page(). getSignaturesForAsset always pages by number, and a request with before or after returns its one range and stops.
collect_items loads every page into one Vec. To handle each page as it arrives, call next_page in a loop instead, as in the getAssetsByGroup example.
List requests take .page(), .limit(), .cursor(), .before(), .after() and .sort_by(). The same rules apply as for raw requests: use one paging style per request, and sort by id when you use a cursor or range.