feat: add Po-Rep contracts indexer#241
Open
tmaciej-neti wants to merge 3 commits intomainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an on-chain Po-Rep contracts indexer to persist provider and deal state into the application database, and wires it into the NestJS app.
Changes:
- Introduces a Po-Rep indexer module with cron-driven runner base class plus provider/deal runners that ingest
viemlogs. - Adds new Prisma models + migrations for indexer runs, storage providers, provider capabilities, deals, and deal requirements.
- Adds Prisma BigInt update-merge helper and new Po-Rep environment variables.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/utils/prisma.ts |
Adds helper to merge Prisma BigInt field update operations. |
src/po-rep-indexer/runners/abstract-po-rep-indexer.runner.ts |
Base cron runner: fetches logs, applies DB ops in a transaction, records indexing progress. |
src/po-rep-indexer/runners/po-rep-providers-indexer.runner.ts |
Indexes SP registry events into provider + capabilities tables. |
src/po-rep-indexer/runners/po-rep-deals-indexer.runner.ts |
Indexes PoRep market events into deal + requirements tables. |
src/po-rep-indexer/po-rep-indexer.utils.ts |
Creates viem clients per chain and validates Po-Rep config via zod. |
src/po-rep-indexer/po-rep-indexer.types.ts |
Declares Po-Rep-related types for config and viem public client. |
src/po-rep-indexer/po-rep-indexer.module.ts |
Registers runners and provides recent/archive RPC clients via DI. |
src/po-rep-indexer/po-rep-indexer.constants.ts |
Defines DI tokens, supported chains, and config schema. |
src/po-rep-indexer/abis/*.abi.ts |
Adds typed ABI constants for the indexed contracts. |
src/app.module.ts |
Wires the indexer module into the main application. |
prisma/schema.prisma |
Adds Po-Rep tables and enum to the Prisma schema. |
prisma/migrations/*/migration.sql |
Creates the new Po-Rep DB tables and enum. |
.env.example |
Documents Po-Rep-related configuration keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also fix automatic review issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.