@zkp2p/indexer-schema
v0.5.0
Published
ZKP2P Indexer GraphQL schema and TypeScript types
Keywords
Readme
@zkp2p/indexer-schema
GraphQL schema and TypeScript types for the ZKP2P indexer. Single source of truth for all downstream consumers (SDK, curator, etc.).
Install
pnpm add @zkp2p/indexer-schemaUsage
TypeScript Types
import { Deposit, Intent, QuoteCandidate, DepositStatus } from '@zkp2p/indexer-schema';
// Or import types only
import type { MethodCurrency, MakerStats } from '@zkp2p/indexer-schema/types';Raw SDL String
import { schemaSDL } from '@zkp2p/indexer-schema';Schema File (for codegen configs)
schema: node_modules/@zkp2p/indexer-schema/dist/schema.graphqlExported Types
Domain entities: Deposit, DepositPaymentMethod, MethodCurrency, Intent, QuoteCandidate, WhitelistEntry, ReferralFeeDistribution
Stats: TakerStats, TakerPlatformStats, MakerStats, MakerRolling90DayStats, MakerPeerPayStats, MakerPeerPayPlatformStats, MakerPeerPayRolling90DayStats, DailyPlatformVolume, PlatformDailyStats, MakerDailySnapshot, MakerPlatformStats, MakerCurrencyStats, ManagerStats, ManagerAggregateStats, ManagerDailySnapshot
Rate management: RateManager, RateManagerRate
Price/Profit: PriceSnapshot, MakerProfitSnapshot
Activity: DepositFundActivity, DepositDailySnapshot
Daily cursors: GlobalDailyCursor, PlatformDailyCursor, MakerDailyCursor, ManagerDailyCursor, DepositDailyCursor, DailyPlatformVolumeCursor, DailyCapitalSweepCursor
Enums: DepositStatus, IntentStatus, PriceSnapshotStatus, ProfitStatus
Breaking Change Detection
The indexer CI runs check-schema-breaking.js on every PR that touches schema/. It fails if any fields, types, or enum values are removed or have incompatible type changes unless the schema package is bumped to the next minor version.
When making intentional breaking changes:
- Bump the package version (minor for breaking)
- Update downstream consumers before merging
- Confirm the CI check reports the intentional version bump
Codegen Example
# codegen.yml
schema: node_modules/@zkp2p/indexer-schema/dist/schema.graphql
generates:
src/__generated__/types.ts:
plugins:
- typescript
- typescript-operations