Implement creator vesting schedule endpointsfeat(vesting): add vesting schedule endpoints for creator token release tracking - #979
Open
Daveeee-tech wants to merge 1 commit into
Conversation
|
@Daveeee-tech 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.
closes #909
Summary
Adds API endpoints exposing vesting schedule data for creator key allocations, reading from Soroban on-chain state and caching for fast responses.
Scope
GET /keys/:id/vesting — returns vesting config, cliff, duration, and current claimable amount.
Vesting data is fetched from the Soroban contract and cached with a 60s TTL to keep response times low.
Cache is invalidated on the VestingClaimed contract event, so claims are reflected promptly instead of waiting out the TTL.
Vesting endpoints are restricted to creator-only access, enforced via JWT.
Adds a claimed-history endpoint returning past claim transactions (with tx hashes) for a given key.
Implementation Notes
Cache invalidation is event-driven (listening for VestingClaimed) rather than purely TTL-based, to avoid serving stale claimable amounts right after a claim.
Creator-only authorization is enforced at the endpoint/middleware level via JWT, not left to the client.
Testing
Unit tests for cliff/duration/claimable-amount calculation against known vesting configs.
Integration test confirming cache is served within TTL and invalidated correctly on a VestingClaimed event.
Auth tests confirming non-creator JWTs are rejected on vesting and claimed-history endpoints.
Claimed-history test confirming returned transactions match on-chain claim events, including tx hashes.
Load/latency check confirming cached responses stay under 200ms.