Skip to content

getFilterLogs

Returns a list of event logs since the filter was created.

Note: getFilterLogs is only compatible with event filters.

Usage

example.ts
import { parseAbiItem } from "cive";
import { publicClient } from "./client";
 
const filter = await publicClient.createEventFilter({

  address: "cfx:...",
  event: parseAbiItem(
    "event Transfer(address indexed, address indexed, uint256)"
  ),
});
const logs = await publicClient.getFilterLogs({ filter });
[{ ... }, { ... }, { ... }]

Returns

Log[]

A list of event logs.

Parameters

filter

An event filter.

const filter = await publicClient.createEventFilter();
const logs = await publicClient.getFilterChanges({
  filter, 
});

JSON-RPC Method

cfx_getFilterLogs