Vana SDK - v2.2.2
    Preparing search index...

    Interface PaginationResult<T>

    Pagination result containing items and metadata for navigating large datasets.

    This interface standardizes paginated responses across the SDK, providing consistent metadata for implementing pagination UI components and handling multi-page data fetching. Supports both offset-based and cursor-based pagination.

    // Fetching paginated user files
    async function getAllUserFiles(userAddress: string): Promise<File[]> {
    const allFiles: File[] = [];
    let cursor: string | undefined;

    do {
    const result: PaginationResult<File> = await vana.data.getUserFiles({
    owner: userAddress,
    pagination: { limit: 50, cursor }
    });

    allFiles.push(...result.items);
    cursor = result.nextCursor;

    console.log(`Fetched ${result.count} of ${result.total} files`);
    } while (result.hasMore);

    return allFiles;
    }
    interface PaginationResult<T> {
        items: T[];
        total: number;
        count: number;
        hasMore: boolean;
        nextCursor?: string;
    }

    Type Parameters

    • T
    Index

    Properties

    items: T[]

    Array of items

    total: number

    Total number of items available

    count: number

    Number of items returned

    hasMore: boolean

    Whether there are more items available

    nextCursor?: string

    Cursor for next page