feat: compliance endpoints, retention policy, and vault resync (closes #802 #803 #804 #805) - #901
Merged
Jayy4rl merged 1 commit intoJul 26, 2026
Conversation
…sync script - Issue StellarYield#802: GET /api/v1/admin/compliance/users/:address/summary Returns user activity summary for compliance review (KYC, AML, deposits, withdrawals, yield, vault count, first/last activity from indexed_events). - Issue StellarYield#803: GET /api/v1/admin/compliance/vaults/:contractId/status Returns vault compliance status (kycEnforced, blacklistActive, emergency, paused, lastPauseAt). - Issue StellarYield#804: GET/PATCH /api/v1/admin/retention-policy Runtime-configurable data retention policy (events, positions, audit logs). Persisted to app_config key/value table. Non-positive values return 400. - Issue StellarYield#805: backend/src/scripts/resync-vault.ts Script to resync a vault's on-chain fields (total_assets, total_supply) after an indexer bug. Accepts --contractId, exits non-zero on failure. - Migration 029: adds emergency column to vaults, vault_blacklisted_addresses table, and app_config key/value table with default retention values.
|
@jajafwangshak86-ops 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.
Summary
Adds compliance review endpoints, data retention policy configuration, and a vault resync script as requested in issues #802–#805.
Changes
Issue #802 — User activity summary for compliance review
GET /api/v1/admin/compliance/users/:address/summaryaddress,kycVerified,amlFlagged,totalDeposited,totalWithdrawn,totalYieldClaimed,vaultCount,firstActivity,lastActivityindexed_events; all fields present even for users with no on-chain activity.Issue #803 — Vault compliance status endpoint
GET /api/v1/admin/compliance/vaults/:contractId/statuskycEnforced(zkmeVerifier set & not zero address),blacklistActive(≥1 blacklisted address),emergency,paused,lastPauseAtIssue #804 — Data retention policy configuration
GET /api/v1/admin/retention-policy— returns current policy (defaults: 90/365/365 days)PATCH /api/v1/admin/retention-policy— partial update, positive integers only, returns 400 on invalid inputapp_configkey/value table; takes effect on next scheduled pruning runIssue #805 — Vault resync script
backend/src/scripts/resync-vault.ts— accepts--contractId <id>, callsreadTotalAssets/readTotalSupply, upserts viaVaultServicenpm run resync-vaultadded to package.jsonMigration
029_compliance_retention.sql— addsemergencycolumn to vaults,vault_blacklisted_addressestable, andapp_configtable with default retention values.Closes #802
Closes #803
Closes #804
Closes #805