feat: resolved frontend issues - #899
Merged
Merged
Conversation
…rorg#888) - Add MaxBuyQuantityPanel with 1–10000 number input (blank = no limit) - Show current maxBuyQuantity fetched from key detail API - Submit via set_max_buy_quantity contract function - Show helper text 'Limits the number of keys a single wallet can buy in one transaction' - Add useSetMaxBuyQuantityMutation with success toast and query invalidation
…on (accesslayerorg#887) - Add price impact calculation (simulated_price - spot_price) / spot_price * 100 - Add KeySimulationTool with debounced fetch (300ms), loading skeleton and error handling - Show +10.00% for positive impact, 0.00% for zero impact - Show 'Unable to simulate price' on fetch error and hide impact value - Add simulateBuy endpoint GET /keys/:keyId/simulate?quantity=N
…sslayerorg#886) - Call GET /keys/:keyId/simulate?quantity=N on quantity change with 300ms debounce - Display per-key price and row subtotal next to each quantity input - Show overall batch total summing all row subtotals - Show loading spinner per row while simulation is fetching - Disable batch submit button while any simulation is pending
|
@BaseDev-Eth 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.
fd4b615 feat(dashboard): add max buy quantity configuration input (Closes #888) – src/components/common/MaxBuyQuantityPanel.tsx:1, src/hooks/useCreatorContractActions.ts:105, src/pages/CreatorDashboardPage.tsx:6
Max Buy Per Transaction section in settings tab shows maxBuyQuantity from courseService.getCourse value, input 1-10000 blank = 0 on-chain, calls set_max_buy_quantity via useSetMaxBuyQuantityMutation with success toast, helper text Limits the number of keys a single wallet can buy in one transaction.
183b309 feat(simulation): add key simulation tool (Closes #887) – src/utils/priceImpact.utils.ts:1, src/components/common/KeySimulationTool.tsx:1, src/services/course.service.ts:317
calculatePriceImpact = (simulated_price - spot_price)/spot_price100, formatPriceImpact shows +10.00% / 0.00%, debounced fetch 300ms via courseService.simulateBuy GET /keys/:keyId/simulate?quantity=N, skeleton data-testid="simulation-skeleton" while loading, error Unable to simulate price hides data-testid="price-impact", quantity input data-testid="simulation-quantity-input".
337e7a4 feat(batch-buy): add simulate endpoint calls (Closes #886) – src/components/common/BatchBuyModal.tsx:1
Per-row GET /keys/:keyId/simulate?quantity=N with 300ms debounce on handleQuantityChange, per-key price data-testid="per-key-price-${idx}" and subtotal data-testid="row-subtotal-${idx}", overall data-testid="batch-total" sums simulated totals, spinner data-testid="simulation-spinner-${idx}" per row, submit data-testid="batch-buy-confirm" disabled while anySimulationPending.