import Yoshi from "@yoshi-ai/sdk";const yoshi = new Yoshi();// Auto-pagination with the SDKconst allTransactions = [];for await (const tx of yoshi.transactions.list({ limit: 100 })) { allTransactions.push(tx);}console.log(`Fetched ${allTransactions.length} transactions`);
The SDKs handle pagination automatically with async iterators. Use manual pagination only if you’re calling the API directly.
Don’t parse the cursor. It’s an opaque string — its format may change without notice.Don’t store cursors long-term. Cursors are designed for sequential traversal within a single session. They may become invalid over time.Don’t assume stable ordering across pages. If new items are added while you’re paginating, you may see them on a later page or miss them. For transactions, new items typically appear at the beginning of the list.Handle invalid cursors. If a cursor is expired or malformed, the API returns a 400 error: