Skip to main content
import { LogFilterSchema } from 'voltaire-effect/LogFilter'
import * as S from 'effect/Schema'

const filter = S.decodeSync(LogFilterSchema)({
  fromBlock: 19000000n,
  toBlock: 19000100n,
  address: '0x1234...5678',
  topics: ['0xddf252ad...']  // Transfer event
})

Parameters

ParameterTypeDescription
fromBlockbigint | 'earliest' | 'latest' | 'pending'Start block
toBlockbigint | 'earliest' | 'latest' | 'pending'End block
addressAddress | Address[]Contract(s)
topics(Hash | Hash[] | null)[]Topic filters (up to 4)
blockhashHashSpecific block (exclusive with fromBlock/toBlock)

Topic Matching

// AND: topic[0]=A AND topic[1]=B
{ topics: ['0xaaa...', '0xbbb...'] }

// OR: topic[0]=A OR topic[0]=B
{ topics: [['0xaaa...', '0xbbb...']] }

// Wildcard: any topic[0], topic[1]=B
{ topics: [null, '0xbbb...'] }