Function attachIterable

  • Attach asIterable() to a Paged result so it can be consumed with for await.

    Type Parameters

    • T

    Parameters

    • paged: Paged<T>
    • OptionalfetchNext: ((cursor?: any) => Promise<Paged<T>>)
        • (cursor?): Promise<Paged<T>>
        • Parameters

          • Optionalcursor: any

          Returns Promise<Paged<T>>

    Returns Paged<T>

    const page = await client.listTokens({ limit: 50 });
    const it = attachIterable(page).asIterable();
    for await (const t of it) {
    console.log(t.symbol, t.address);
    }