Calls a list method page by page and yields each item.
for await (const subaccount of paginate((p) => subaccounts.listSubaccounts(p), { limit: 100 })) { console.log(subaccount.id);} Copy
for await (const subaccount of paginate((p) => subaccounts.listSubaccounts(p), { limit: 100 })) { console.log(subaccount.id);}
a list method, called with params plus the next page's cursor or offset
params
cursor
offset
the first page's parameters (filters and limit); string literals keep their literal type, so enum filters such as state: 'failed' type-check
limit
state: 'failed'
Calls a list method page by page and yields each item.