indexing-handler-syntax

Registers event handlers and manages context API operations for HyperIndex-based indexers in TypeScript.

2|3|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/moose-code/polymarket-indexer --skill indexing-handler-syntax-moose-code
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: indexing-handler-syntax
Source: https://github.com/moose-code/polymarket-indexer/tree/main/.claude/skills/indexing-handler-syntax
Command: npx skills add https://github.com/moose-code/polymarket-indexer --skill indexing-handler-syntax-moose-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Providing a structured guide for writing and editing event handlers in HyperIndex-based indexers, including how to register handlers, use the context API, manage entity operations, and avoid common pitfalls.

Core Features & Use Cases

  • Handler registration patterns and best practices for event-driven indexers.
  • Context API usage for entity CRUD, getWhere queries, chain, log, and effects.
  • Debugging guidance and runtime ergonomics for reliable indexer behavior.

Quick Start

Register a new event handler using the provided Contract Event API and run the indexer to verify runtime integration.

Frequently Asked Questions about indexing-handler-syntax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register event handlers for HyperIndex indexers in TypeScript?β–Ό

To register event handlers for HyperIndex indexers, use the Contract Event API to map contract events to handler functions and run the indexer to verify runtime integration. This pattern ensures reliable event-driven indexer behavior.

What is the Context API in HyperIndex and how does it manage entity operations?β–Ό

The Context API in HyperIndex manages entity operations by providing CRUD methods, getWhere queries, chain interactions, and logging. It allows TypeScript indexers to safely read, write, and modify indexed entities during event handling.

Do I need top-level await in my TypeScript project to use HyperIndex handlers?β–Ό

Yes, you need top-level await in your TypeScript project to use HyperIndex handlers. The indexer runtime API requires a TypeScript ES Module project environment to properly execute and manage handler registration and runtime behavior.

How do I debug context API interactions and runtime behavior in HyperIndex?β–Ό

Debug context API interactions and runtime behavior in HyperIndex by utilizing the context.log method for runtime tracing and verifying entity CRUD operations. Following handler registration best practices prevents common pitfalls and ensures reliable indexer behavior.

What are common pitfalls when writing event handlers for HyperIndex indexers?β–Ό

Common pitfalls when writing event handlers for HyperIndex indexers include improper context API usage for entity CRUD, neglecting getWhere query constraints, and ignoring runtime ergonomics. Following structured handler registration patterns prevents these issues.