Creates an event helper for a configured AftermathApi.
The API instance used by the JSON-RPC event query method.
Fetches every event page until the callback returns an empty page or a
null cursor.
This method does not perform I/O itself. fetchEventsFunc receives the
current EventId cursor and a page limit and may use any supported source.
The default limit is 256 events per call. The method preserves page order
and does not deduplicate events.
The page fetcher and optional per-page limit.
All events returned by the callback.
Fetches and casts one page of events with the legacy JSON-RPC client.
A JSON-RPC event filter, an optional EventId cursor and
page limit, and a caster for the raw event shape. The cursor's eventSeq
value is sent as a string, as required by JSON-RPC.
The cast events from this page and nextCursor. The cursor is
null when JSON-RPC reports no later page.
Remaining JSON-RPC surface — see
AftermathApi.jsonRpcClient. suix_queryEvents has no
SuiGrpcClient equivalent: the only gRPC path is the raw
ledgerService.ListEvents, whose filter model and cursor differ from
SuiEventFilter / EventId, and whose events carry BCS bytes instead of
the parsedJson that every eventFromEventOnChain caster reads. Porting
it would change this helper's semantics, so it still goes through
JSON-RPC and will stop working when that is removed from fullnodes
(scheduled for mid-October 2026).
If no jsonRpcClient was passed to AftermathApi, since it
is optional there.
Fetches pages until events fall outside a millisecond time window.
This method does not perform I/O itself. It calls fetchEventsFunc with an
EventId cursor and a page limit, so the callback determines the transport
and query. It keeps events in page order, stops before the first event whose
timestamp is more than timeMs milliseconds older than Date.now(), and
stops after 20 pages even when the callback keeps returning a cursor.
Events without a timestamp are not treated as stale.
The page fetcher, time window in milliseconds, and optional per-page limit. The limit defaults to 256 events.
Events collected within the time window.
Always throws because event subscriptions are not implemented by this helper.
The wallet address and event callback that the removed subscription API would have used. Neither value is read.
Not implemented. gRPC's
SubscriptionService.SubscribeEvents is the replacement — reach it via
AftermathApi["client"].subscriptionService — or poll
EventsApiHelpers.fetchCastEventsWithCursor.
StaticcastCasts one event when its type matches the requested Move type.
This is a local operation. By default it uses substring matching; set
exactMatch to true to require the event type to equal the resolved type.
The caster runs only for a matching event.
The raw Sui event to inspect.
A Move type string or a callback that returns one.
Converts the raw event into the caller's event type.
OptionalexactMatch: boolean
Whether to require exact type equality. Defaults to
false.
The cast event for a match, otherwise undefined.
StaticcreateBuilds a fully qualified Move event type string.
This is a local string operation and performs no network I/O. When
wrapperType is provided, the result is wrapperType<package::module::event>.
The method does not validate the individual type segments.
The published package address, such as 0x2.
The Move module name.
The event struct name or inner type expression.
OptionalwrapperType: string
Optional outer Move type, such as SomeWrapper.
The assembled Move type string.
StaticfindFinds and casts the first matching event in one transaction response.
This is a local operation with no network I/O. A transaction without an
events array is treated as having no matching events.
The transaction response to inspect.
A Move type string or a callback that returns one.
Converts the raw matching event.
The first cast match, or undefined when the transaction has no
matching event.
StaticfindFinds and casts the first matching event across transaction responses.
This is a local operation with no network I/O. Transactions and their events are searched in array order, and the method stops after the first match.
The transaction responses to inspect.
A Move type string or a callback that returns one.
Converts the raw matching event.
The first cast match, or undefined when no transaction matches.
StaticfindFinds and casts the first event whose type contains the requested Move type.
This is a local operation with no network I/O. The event array remains in caller order, and the caster runs only for the first matching event.
The event array, Move type string or resolver, and caster.
The first cast match, or undefined when no event matches.
StaticfindFinds and casts every event whose type contains the requested Move type.
This is a local operation with no network I/O. The result is an array in
the same order as events; no match produces an empty array.
The event array, Move type string or resolver, and caster.
All cast matches, or an empty array when no event matches.
StaticsuiReturns an event when its type contains the requested Move type.
This is a local check and performs no network I/O. A callback event type is resolved when the method runs. Matching is substring-based, so a wrapped event type also matches its inner type.
The event to inspect.
A Move type string or a callback that returns one.
The original event when it matches, otherwise undefined.
Queries, paginates, and locally casts Sui events.
Most methods coordinate a caller-provided page fetcher and do not choose a transport.
fetchCastEventsWithCursoris the exception: it performs network I/O through the optional JSON-RPC client because the gRPC client has no equivalent forsuix_queryEvents.