Skip to content

feat: compliance endpoints, retention policy, and vault resync (closes #802 #803 #804 #805) - #901

Merged
Jayy4rl merged 1 commit into
StellarYield:mainfrom
jajafwangshak86-ops:feat/compliance-retention-endpoints
Jul 26, 2026
Merged

feat: compliance endpoints, retention policy, and vault resync (closes #802 #803 #804 #805)#901
Jayy4rl merged 1 commit into
StellarYield:mainfrom
jajafwangshak86-ops:feat/compliance-retention-endpoints

Conversation

@jajafwangshak86-ops

@jajafwangshak86-ops jajafwangshak86-ops commented Jul 26, 2026

Copy link
Copy Markdown

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/summary
  • Returns: address, kycVerified, amlFlagged, totalDeposited, totalWithdrawn, totalYieldClaimed, vaultCount, firstActivity, lastActivity
  • Derives timestamps from indexed_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/status
  • Returns: kycEnforced (zkmeVerifier set & not zero address), blacklistActive (≥1 blacklisted address), emergency, paused, lastPauseAt

Issue #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 input
  • Persisted to app_config key/value table; takes effect on next scheduled pruning run

Issue #805 — Vault resync script

  • backend/src/scripts/resync-vault.ts — accepts --contractId <id>, calls readTotalAssets/readTotalSupply, upserts via VaultService
  • npm run resync-vault added to package.json
  • Exits non-zero on invalid input or RPC failure

Migration

  • 029_compliance_retention.sql — adds emergency column to vaults, vault_blacklisted_addresses table, and app_config table with default retention values.

Closes #802
Closes #803
Closes #804
Closes #805

…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.
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Jayy4rl
Jayy4rl merged commit aa2d836 into StellarYield:main Jul 26, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants