queryEvents

abstract suspend fun queryEvents(filter: EventFilter, before: String? = null, after: String? = null, first: Int? = null, last: Int? = null): Result<QueryEventsQuery.Data?, SuiError>

Queries for events on the Sui network based on a specified filter.

This method supports bidirectional pagination.

Return

A Result which is either:

  • Ok: Containing a nullable QueryEventsQuery.Data object. This object includes a list of events and cursors for pagination.

  • Err: Containing a SuiError object with a list of GraphQLErrors.

Parameters

filter

The EventFilter to apply to the query, such as filtering by sender or move module.

before

An optional cursor for backward pagination. Fetches the page of events before this cursor.

after

An optional cursor for forward pagination. Fetches the page of events after this cursor.

first

An optional integer specifying the number of events to return when paginating forward (used with after).

last

An optional integer specifying the number of events to return when paginating backward (used with before).