Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// Contracts is the list of contract addresses to listen to (Log.Address).
// If empty, listens to all contracts.
Contracts []common.Address
// Topics is the list of event topics to listen to.
// Maps to eth_getLogs topics parameter: [[A, B], [C], null, [D]]
// Logical relation: (Topic0 in [A, B]) AND (Topic1 in [C])
Topics [][]common.Hash
}
Filter defines the scanning rules for the scanner. It is used both for generating RPC request parameters and for local Bloom Filter checks.
func (*Filter) AddContract ¶
AddContract adds contract addresses to listen to
func (*Filter) IsHeavy ¶
IsHeavy determines if the filter is too complex for efficient local Bloom Filter checks. Rule of thumb: Bloom filter tends to saturate if topics at any position > 20 or contracts > 20.
func (*Filter) MatchesBloom ¶
MatchesBloom uses the local Bloom Filter to quickly check if a block might contain matching logs. Returns false if it definitely doesn't contain matching logs (Safe to Skip). Returns true if it might contain matching logs (Need to Fetch).
Click to show internal directories.
Click to hide internal directories.