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

    Interface ConsistencyOptions

    Consistency options for read operations.

    Controls data freshness requirements and source selection. Essential for read-after-write consistency when data must reflect recent transactions.

    // Ensure data includes a recent transaction
    const files = await vana.data.getUserFiles({ owner }, {
    minBlock: receipt.blockNumber,
    waitForSync: 30000 // Wait up to 30s
    });
    interface ConsistencyOptions {
        minBlock?: number;
        waitForSync?: number;
        source?: DataSource;
        signal?: AbortSignal;
    }
    Index

    Properties

    minBlock?: number

    Minimum block number the data source must have indexed.

    Operation will fail or wait (if waitForSync set) until source reaches this block. Critical for ensuring recently created data is visible.

    waitForSync?: number

    Maximum milliseconds to wait for data source to sync to minBlock.

    If not set, operation fails immediately when source is behind. Useful for critical operations where waiting is preferable to failure.

    undefined (no waiting)
    
    source?: DataSource

    Explicitly select data source.

    Useful for debugging or when specific consistency guarantees are needed. Not all methods support all sources - unsupported selections will error.

    'auto'
    
    signal?: AbortSignal

    AbortSignal for cancelling long-running operations.

    Particularly useful with waitForSync to cancel polling operations. Properly cleans up timers and pending requests when aborted.

    const controller = new AbortController();
    const promise = vana.data.getUserFiles(
    { owner },
    { waitForSync: 30000, signal: controller.signal }
    );

    // Cancel after 5 seconds
    setTimeout(() => controller.abort(), 5000);