kleros/foresight/indexer-filters
Claude Code and agent skill by kleros/foresight
- community
Checking that the SKILL.md file is still in the repository.
Use when filtering events by indexed parameters to reduce processing volume. The `where` option supports static filters, dynamic per-chain functions, contract address filtering, and conditional enable/disable.
Install
npx vskill@latest install kleros/foresight/indexer-filtersSKILL.md
The same SKILL.md was published earlier as enviodev/hyperindex/indexer-filters.
Event Filters (where)
The where handler option filters events by indexed parameters and restricts the per-event block range. Works with or without wildcard: true.
The filter value is a { params?, block? } record. params can be a single object (AND-conjunction across indexed parameters) or an array of objects (OR across multiple AND-conjunctions). block.number._gte (or block.height._gte on Fuel) promotes to the event's startBlock and overrides the contract-level start_block from config.yaml.
Single Object Form
Array Form — Static Filters (OR)
Each entry in the params array is OR'd together. Within a single entry, fields are AND'd. Arrays in a field position match any value in the array.
Function Form — Dynamic Per-Chain
Return a filter based on the current chain. The callback receives { chain } where chain.id is the chain ID and chain.<ContractName>.addresses exposes the indexed addresses of the event's own contract on that chain. Return false to skip the chain entirely (no events processed), or true to allow all events. To filter, return a {params: ...} object where params is a single record or an array of records:
Function with chain.<Contract>.addresses — Filter by Registered Contracts
For dynamically registered contracts, use chain.<ContractName>.addresses to filter by their addresses. Only the event's own contract is exposed:
Per-Event startBlock via block.number._gte
Use where.block as a sibling of params to restrict an event to blocks at or after a given number. Overrides the contract's start_block from config.yaml — useful for narrowing a single event without touching the whole contract.
Use a switch on chain.id to pick the startBlock only, so the shared params filter isn't duplicated per chain. The default: never branch makes TypeScript flag any chain added to config.yaml but not handled here:
On Fuel, key the block range on block.height instead of block.number. SVM has no event handlers. Only _gte is accepted on event filters. The block filter is only valid at the top level of where, not nested inside params array entries.
Filter Semantics
- Filter fields inside each
paramsentry correspond to the event's indexed parameters only - Multiple entries in the
paramsarray → OR (match any) - Multiple fields in one entry → AND (match all)
- Array value in a field → match any value in the array
block.number._gte(EVM) /block.height._gte(Fuel) → per-event startBlock, overrides contractstart_blockreturn false→ skip the chain entirely (no events processed for that chain)return true→ accept all events (no filtering, default topic0-only selection)
If something is unclear, use theenvio-docsskill to search and read the latest documentation.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapps/indexer/.claude/skills/indexer-filters/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kleros/foresight/indexer-filters)