Feat/839 842 factory endpoints - #895
Merged
Jayy4rl merged 5 commits intoJul 26, 2026
Merged
Conversation
…te endpoints Adds four read endpoints under /api/v1/factory: admin-history and events (both requireApiKey-protected), defaults, and vault-creation-rate. admin-history and defaults need data the indexer never captured, so this also wires up the previously-unhandled adm_xfr and def_upd factory events: adm_xfr now writes to a new factory_admin_history table, and def_upd is recorded to indexed_events.parsed_data so /defaults can read it back. Closes StellarYield#839, closes StellarYield#840, closes StellarYield#841, closes StellarYield#842
…eries Ties on recorded_at/ledger are possible when multiple factory events land in the same ledger, which would make pagination order nondeterministic.
|
@hardcordev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Adds four read endpoints under /api/v1/factory: admin transfer history,
vault creation rate, default vault parameters, and a paginated factory
event log.
Why this touches the indexer
#839 and #841 read from factory_admin_history and indexed_events.parsed_data
respectively, but the indexer never parsed the contract's
adm_xfr(admin_transferred) or
def_upd(defaults_updated) events — so those tableswould stay empty/null forever. This PR adds the missing parsers and wiring,
following the same pattern as the existing zkme_upd/role_grt handlers.
Changes
factory_admin_historytable (old_admin, new_admin, ledger,recorded_at) + index.
parseAdminTransferredEvent/parseDefaultsUpdatedEvent, wiredinto
processEvent. adm_xfr writes tofactory_admin_history; def_upd isrecorded to
indexed_events.parsed_data. Documented in docs/events.md.GET /api/v1/factory/admin-history— all transfers, recorded_at DESC,requireApiKey.
GET /api/v1/factory/vault-creation-rate— { last24h, last7d, last30d }vault counts by created_at.
GET /api/v1/factory/defaults— { defaultAsset, defaultZkmeVerifier,defaultCooperator }, nulls if no def_upd indexed yet.
GET /api/v1/factory/events— paginated (page/pageSize, max 100),ledger DESC, filtered to the factory contract, requireApiKey.
Testing
rolling-window counts, null-defaults case, pagination).
in the existing event-fixture suite.
npx tsc --noEmit: no new type errors (pre-existing unrelated errors indead legacy files untouched by this PR).
in services/user.ts, DB-less e2e tests) are unchanged by this diff — none
are in files this PR touches.
Closes #839, closes #840, closes #841, closes #842