What problem does it solve?
Writing blockchain event handlers for HyperIndex requires knowing the exact handler registration signature, the context entity CRUD API, and framework-specific pitfalls like read-only entities and _id relationship fields. This Skill provides that reference so handlers compile and behave correctly on the first pass.
Core Features & Use Cases
- Handler Registration: Documents
indexer.onEvent with contract, event, wildcard, where, and fields options, including typed block and transaction field selection.
- Context Entity API: Covers
get, getOrThrow, getOrCreate, getWhere operators (_eq, _gt, _lt, _gte, _lte, _in), and sync set/deleteUnsafe writes.
- Pitfall Guidance: Explains entity ID uniqueness across chains, spread-based updates on read-only entities,
_id suffix relationships, and decimal normalization.
- Use Case: When adding a Transfer event handler for an ERC-20 contract, follow the registration pattern, query existing entities with
getWhere, and update them with spread syntax, then run pnpm codegen and pnpm tsc --noEmit to verify.
Quick Start
Write a HyperIndex event handler for my contract's Transfer event that updates a balance entity using the context API.