feat: add creator revenue, supply cap, dividend, and timelock panels - #124
Merged
Chucks1093 merged 2 commits intoAug 27, 2026
Merged
Conversation
Adds four dashboard panels backed by shared API + react-query hooks that follow the existing lib/api normalize-and-fetch conventions. Supply cap configuration (StellarState#106) - SupplyCapSettings renders in a new creator-only Settings tab and shows the current cap, circulating supply, and remaining mintable. - The number input is pre-filled with the current cap; Save stays disabled unless the value is a positive integer >= circulatingSupply and changed. - A 409 from the server is surfaced as an inline error rather than a toast, so the creator can correct the value in place. updateKeySupplyCap tags conflicts via isApiConflictError; a plain tagged Error is used instead of a class so the module keeps only type-level exports and existing vi.spyOn(api, ...) call sites are unaffected. - Renders "No cap set" for both the placeholder and the stats when the cap is null. The pre-existing read-only SupplyCapSection in BuyKeyPanel is left untouched; it serves buyers, not creators. Creator revenue (StellarState#105) - CreatorRevenueSection shows total/buy/sell royalty stat cards and a recharts bar chart of the trailing 12 months, with a loading skeleton and a "No revenue yet" empty state when tradeCount is zero. - Months are sliced to the most recent 12 so an over-long API response cannot stretch the axis. - Chart values are mirrored into an sr-only list. Recharts renders values only inside the SVG and on hover, so this is what makes the amounts reachable by screen readers and assertable in tests. Dividend distribution (StellarState#109) - DistributeDividendsPanel previews perKeyAmount as amount / circulatingSupply, shows holder count and circulating keys, and reports totalDistributed plus perKeyAmount in the success toast. - Submit is disabled when the amount is non-positive, when circulating supply is zero (division would be undefined), or while signing. Timelock proposals (StellarState#104) - TimelockProposalsPanel adds a Timelock tab to the admin dashboard listing pending proposals with change type, payload summary, proposedAt, and executionNotBefore, split from a separate Completed section. - A 1s ticker drives the countdown to the execution window and gates the Execute button, so a proposal becomes executable without a reload. The interval only runs while pending proposals exist. useCountdown was not reused because it ticks per minute and omits seconds. - Cancel requires confirmation before firing, then the list refetches. Testing - 22 tests across the four panels covering every acceptance criterion. - vitest.setup.ts stubs ResizeObserver, which jsdom lacks and recharts' ResponsiveContainer subscribes to on mount. This is the repo's first recharts usage, so no chart could render under test without it. Closes StellarState#104 Closes StellarState#105 Closes StellarState#106 Closes StellarState#109
|
@davidugorji 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 dashboard panels backed by shared API + react-query hooks following existing
lib/apiconventions.22 tests added covering every acceptance criterion. Full rationale is in the commit message.
Notes for review:
SupplyCapSection(read-only, inBuyKeyPanel) is untouched — it serves buyers. Add a supply cap configuration panel on the creator dashboard to set and display the key's minting limit #106 is a separate creator-facing settings component.vitest.setup.tsgains aResizeObserverstub: jsdom lacks it and recharts'ResponsiveContainerneeds it. This is the repo's first recharts usage.distribute_dividendcontract function". There is no Soroban invoke layer in this repo (lib/stellar/only wraps Freighter, and buy/burn/vesting all go through the backend), so this posts to/keys/:keyId/distribute-dividendand assumes the backend relays. Happy to rework if direct browser-side signing is wanted.devis already red before this branch: 43tscerrors and 7 failing test files. Verified viagit stashthat the identical 7 files fail on pristinedev— no regressions added here.Closes #104
Closes #105
Closes #106
Closes #109