Documentation
    Preparing search index...

    Type Alias QueryRequestParams

    Parameters for a store query request, as specified in the Waku Store v3 RFC.

    type QueryRequestParams = {
        abortSignal?: AbortSignal;
        contentTopics: string[];
        includeData: boolean;
        messageHashes?: Uint8Array[];
        paginationCursor?: Uint8Array;
        paginationForward: boolean;
        paginationLimit?: number;
        peerId?: PeerId;
        pubsubTopic: string;
        timeEnd?: Date;
        timeStart?: Date;
    }
    Index

    Properties

    abortSignal?: AbortSignal

    An optional AbortSignal to cancel the query. When the signal is aborted, the query will stop processing and return early.

    contentTopics: string[]

    The content topics to filter the messages. The query will only return messages that have a content topic included in this array. This field MUST be populated together with the pubsubTopic field for content topic filtering to be applied. If either contentTopics or pubsubTopic is not provided or empty, no content topic filtering will be applied.

    includeData: boolean

    Whether to include the full message data in the response.

    • true: The response will include the message content and associated pubsub topic for each matching message.
    • false: The response will only include the message hashes for each matching message.
    true
    
    messageHashes?: Uint8Array[]

    The message hashes to lookup. If provided, the query will be a message hash lookup query and will only return messages that match the specified hashes. If not provided or empty, the query will be a content filtered query based on the other filter parameters.

    undefined
    
    paginationCursor?: Uint8Array

    The cursor to start the query from. The cursor represents the message hash of the last message returned in the previous query. The query will start from the message immediately following the cursor, excluding the message at the cursor itself. If not provided, the query will start from the beginning or end of the store, depending on the paginationForward option.

    undefined
    
    paginationForward: boolean

    The direction of pagination.

    • true: Forward pagination, starting from the oldest message and moving towards the newest.
    • false: Backward pagination, starting from the newest message and moving towards the oldest.
    false
    
    paginationLimit?: number

    The maximum number of messages to retrieve per page. If not provided, the store's default pagination limit will be used.

    undefined
    
    peerId?: PeerId

    The service node to use for queries. Will fail if:

    • this peer is not in the peer store.
    • we are not connected to this peer No fallback is done. Overrides any other peer selection option.

    Expected to be used with [[PeerManagerEventNames.StoreConnect]] so that we know we are connected to this peer before doing the store query.

    Only use if you know what you are doing.

    pubsubTopic: string

    The pubsub topic to query. This field is mandatory. The query will only return messages that were published on this specific pubsub topic.

    timeEnd?: Date

    The end time for the time range filter. The query will only return messages with a timestamp strictly less than timeEnd. If not provided, no end time filtering will be applied.

    timeStart?: Date

    The start time for the time range filter. The query will only return messages with a timestamp greater than or equal to timeStart. If not provided, no start time filtering will be applied.