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

    Interface BlockRange

    Block range parameters for filtering blockchain events and transactions.

    Used to specify a range of blocks when querying blockchain data. Both parameters are optional - omitting fromBlock starts from genesis, omitting toBlock goes to the latest block. Be cautious with large ranges as they may result in heavy RPC loads or timeouts.

    // Get events from the last 1000 blocks
    const currentBlock = await vana.protocol.getBlockNumber();
    const events = await vana.protocol.getEvents({
    blockRange: {
    fromBlock: currentBlock - 1000n,
    toBlock: currentBlock
    }
    });

    // Get all historical events (use with caution)
    const allEvents = await vana.protocol.getEvents({
    blockRange: {
    fromBlock: 0n
    // toBlock omitted = up to latest
    }
    });
    interface BlockRange {
        fromBlock?: bigint;
        toBlock?: bigint;
    }
    Index

    Properties

    Properties

    fromBlock?: bigint

    Starting block number

    toBlock?: bigint

    Ending block number