feat: extend /governance/dreps with status, voting power, metadata + new query params#457
Open
slowbackspace wants to merge 3 commits into
Open
feat: extend /governance/dreps with status, voting power, metadata + new query params#457slowbackspace wants to merge 3 commits into
slowbackspace wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…new query params
Augments the paginated /governance/dreps response so wallets can render and rank
DReps without a follow-up call per row. Each DRep now also returns has_script,
amount, retired, expired, last_active_epoch, and an embedded metadata object
matching the shape of /dreps/{drep_id}/metadata. Deprecated fields (active,
active_epoch) are intentionally omitted from this enriched response.
New query parameters:
- order_by=amount (in addition to existing order=asc|desc)
- retired=true|false
- expired=true|false
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
293aed4 to
e0812be
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Cardano Governance GET /governance/dreps OpenAPI specification to support richer DRep list rendering in clients by adding new response fields and additional query parameters for sorting and filtering.
Changes:
- Expanded
/governance/drepsresponse items with status/voting power fields (amount,has_script,retired,expired,last_active_epoch) and embeddedmetadata. - Added new query parameters to
/governance/dreps:order_by=amount,retired, andexpired, and clarifiedordersemantics relative toorder_by. - Regenerated published OpenAPI artifacts (YAML/JSON/docs), TypeScript generated types, and updated schema snapshot.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/tests/snapshots/get-schema-for-endpoint.test.ts.snap | Snapshot updated to reflect new query params and enriched /governance/dreps response schema. |
| src/schemas/governance/dreps.yaml | Source schema updated with new fields and embedded metadata object. |
| src/paths/api/governance/dreps/index.yaml | Added order_by, retired, expired query params and updated order description. |
| src/generated-types.ts | Regenerated TS types for new query params and response fields. |
| openapi.yaml | Regenerated OpenAPI YAML with new params/response schema. |
| openapi.json | Regenerated OpenAPI JSON with new params/response schema. |
| docs/blockfrost-openapi.yaml | Regenerated docs OpenAPI YAML. |
| blockfrost-openapi.yaml | Regenerated packaged OpenAPI YAML. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
97861d5 to
afc59c7
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Enriches the paginated
/governance/drepsresponse so wallets can render a useful, sortable, filterable DRep list in a single call instead of1 + 2Nround-trips against/dreps,/dreps/{id}, and/dreps/{id}/metadata.Response changes (additive)
Each row in
/governance/drepsnow includes:has_script,amount,retired,expired,last_active_epoch— previously only available on/dreps/{drep_id}metadata— embedded{ url, hash, json_metadata, bytes, error? }matching the shape of/dreps/{drep_id}/metadata. Fields arenullwhen the DRep has no registration anchor (e.g.drep_always_abstain,drep_always_no_confidence); when an anchor exists but off-chain content could not be fetched,erroris populated.Deprecated fields (
active,active_epoch) intentionally not included.New query params
?order_by=amount— sort by voting power. Combines with the existing?order=asc|desc.?retired=true|false— filter by registration state.?expired=true|false— filter by activity state.When
retired/expiredfilters are present, each page still returns up tocountmatching rows (filter → sort → limit).Test plan
yarn lintpassesyarn testpasses🤖 Generated with Claude Code