What problem does it solve?
HyperIndex handlers run twice — a parallel preload pass and a sequential pass — so any direct fetch or RPC call inside a handler double-executes and blocks parallelization. This Skill shows how to route all external I/O through the Effect API so calls are deduplicated, cached, and rate-limited correctly.
Core Features & Use Cases
- Effect Definition with createEffect: Wrap external calls in typed effects with S schema validation for input and output, plus cache and rateLimit options.
- RPC Batching with viem: Configure transports with batch: true so the preload pass collapses concurrent reads into a few JSON-RPC requests.
- Cross-Chain Caching Control: Use the crossChain option to choose between one shared global cache or per-chain caches with access to context.chain.id.
- Use Case: When indexing a Transfer event, call context.effect(getTokenMetadata, address) to fetch ERC-20 name, symbol, and decimals once per token instead of once per event.
Quick Start
Ask the AI to refactor a handler that fetches token metadata via RPC into a createEffect definition called through context.effect with caching enabled.