Skip to content
LogoLogo

getFilterChanges

Returns a list of logs or hashes based on a Filter since the last time it was called.

A Filter can be created from the following actions:

Usage

Blocks

import {  } from './client'
 
const  = await .createBlockFilter() 
const  = await .getFilterChanges({  })
 
Output: ["0x10d86dc08ac2f18f00ef0daf7998dcc8673cbcf1f1501eeb2fac1afd2f851128", ...]

Contract Events

import {  } from './client'
 
const  = await .createContractEventFilter({ 
  : '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
  : wagmiAbi,
  : 'Transfer'
})
const  = await .getFilterChanges({  })
 
Output: [{ ... }, { ... }, { ... }]

Raw Events

import {  } from 'viem'
import {  } from './client'
 
const  = await .createEventFilter({ 
  : '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
  : ('event Transfer(address indexed, address indexed, uint256)'),
})
const  = await .getFilterChanges({  })
 
Output: [{ ... }, { ... }, { ... }]

Transactions

import {  } from './client'
 
const  = await .createPendingTransactionFilter() 
const  = await .getFilterChanges({  })
 
Output: ["0x89b3aa1c01ca4da5d15eca9fab459d062db5c0c9b76609acb0741901f01f6d19", ...]

Returns

Log[]

If the filter was created with createContractEventFilter or createEventFilter, it returns a list of logs.

OR

"0x${string}"[]

If the filter was created with createPendingTransactionFilter, it returns a list of transaction hashes.

OR

"0x${string}"[]

If the filter was created with createBlockFilter, it returns a list of block hashes.

Parameters

filter

A created filter.

const  = await .createPendingTransactionFilter()
const  = await .getFilterChanges({
  , 
})

JSON-RPC Method