getFilterChanges
Returns a list of event logs since the filter was created.
Note: getFilterChanges
is only compatible with events.
Import
ts
import { getFilterLogs } from 'viem/public'
Usage
ts
import { createEventFilter, getFilterLogs } from 'viem/public'
import { publicClient } from '.'
const filter = await createEventFilter(publicClient, {
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
event: 'Transfer(address,address,uint256)',
})
// ...
const logs = await getFilterLogs(publicClient, { filter })
// [{ ... }, { ... }, { ... }]
Returns
A list of event logs.
Parameters
filter
- Type:
Filter
An event filter.
ts
const filter = await createEventFilter(publicClient)
const logs = await getFilterChanges(publicClient, {
filter,
})