QubicTypeScript

getEventLogs

Queries archived event logs with filtering by identity, log type, tick range, and pagination.

Signature

archive.getEventLogs(request, opts?): Promise<Result<{ eventLogs: QueryEvent[], hits: Hits, validForTick: number }, QubicRpcError>>

Purpose

Retrieve filtered event logs for a tick range. Decode the data field of each event with decodeEvent from @qubic.org/events.

import { toIdentity } from "@qubic.org/types"

const result = await archive.getEventLogs({
  identity: toIdentity("CFBMEMZOIDEXQAUXYYSZIURADQLAPWPMNJXQSNVQZAHYVOPYUKKJBJUCTVJL"),
  startTick: 17_000_000,
  endTick: 17_001_000,
})
if (!result.ok) throw result.error

for (const event of result.value.eventLogs) {
  console.log(event.logType, event.tick)
}

Parameters

request is a GetEventLogsRequest object:

NameTypeDescription
identitystringFilter to events involving this identity
startTicknumberFirst tick of the range (inclusive)
endTicknumberLast tick of the range (inclusive)
logTypenumberFilter to a specific log type
pageSizenumberNumber of results per page
pageNumbernumberPage index (zero-based)
optsRequestOptionsOptional per-request overrides (signal, fetch)

Returns

Result<{ eventLogs: QueryEvent[], hits: Hits, validForTick: number }, QubicRpcError> — matching events, total hit count, and the tick at which the result was valid.

On this page