feat(dashboard,backend): implement real-time swap calculator (#1219) … - #1270
Merged
Ceejaytech25 merged 2 commits intoOct 1, 2026
Conversation
|
@melvilmz 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! 🚀 |
melvilmz
force-pushed
the
feat/issue-1219-1209-swap-calculator-worker-graceful-shutdown
branch
from
September 25, 2026 08:58
73d91aa to
2dab4c6
Compare
…aboratory#1219) and worker graceful shutdown (ceejaylaboratory#1209)
melvilmz
force-pushed
the
feat/issue-1219-1209-swap-calculator-worker-graceful-shutdown
branch
from
September 25, 2026 09:14
2dab4c6 to
0897dc6
Compare
Contributor
|
Nice implementation, LGTM! 🚀 Great work on this contribution — the approach is clean and well thought out. Thanks for contributing to AnchorPoint! |
…swap-calculator-worker-graceful-shutdown
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.
🚀 Pull Request: Real-Time Asset Swap & FX Quote Calculator (#1219) & Worker Graceful Shutdown (#1209)
📌 Summary
This PR addresses two critical issues in a single unified branch:
[Dashboard/SEP38] Implement Real-Time Asset Swap & FX Quote Calculator ([Dashboard/SEP38] Implement Real-Time Asset Swap & FX Quote Calculator #1219):
dashboard/src/components/fetching live SEP-38 prices.USDC,EURC,XLM,USDT,ARST,BTC,ETH), instant input debouncing (350ms), quick asset flip toggle, quick percentage presets (25%,50%,75%,100%), live fee breakdown, and a 30-second live countdown timer with auto-refresh and expired indicator.GET /sep38/pricesendpoint compliant with SEP-38 specifications in sep38.route.ts.[Backend/Workers] Add Worker Graceful Shutdown Handlers to Prevent Job Corruption ([Backend/Workers] Add Worker Graceful Shutdown Handlers to Prevent Job Corruption #1209):
SIGTERMandSIGINTsignal listeners.worker.close()), disconnecting queue connections, and exiting cleanly.🛠️ Changes Breakdown
1. Dashboard: SEP-38 Swap Calculator
SwapCalculator.tsx: Interactive FX exchange rate calculator with sell/buy inputs, asset selectors, fee computation, expiration countdown bar, and execute swap callbacks.SwapCalculator.test.tsx: Validates initial rendering, input debouncing, live rate computation, asset flipping, countdown timers, and swap execution.sep38.route.ts: AddedGET /sep38/pricesendpoint to query exchange rates against supported SEP-38 anchor assets.2. Backend: Worker Graceful Shutdown Handlers
graceful-shutdown.ts: ExportssetupWorkerGracefulShutdownmanaging BullMQWorker/Queueteardown, process signal traps (SIGTERM/SIGINT), and 15s timeout protection (process.exit(1)fallback on deadlock).contract-queue.worker.ts: Registered graceful shutdown on worker launch.fee-report.worker.ts: Registered graceful shutdown on worker launch.webhook.worker.ts: Registered graceful shutdown on worker launch.graceful-shutdown.test.ts: 5 dedicated unit tests verifying signal registration, timeout escalation, cleanup execution, and error resilience.3. Repository Stability & Build Verification
tsc,vite build).🧪 Testing Matrix
dashboard/src/components/SwapCalculator.test.tsxdashboard/src/components/Sep38QuotePanel.test.tsxbackend/src/workers/__tests__/graceful-shutdown.test.tsbackend/src/workers/__tests__/fee-report.worker.test.tsbackend/src/api/routes/sep38.route.test.tsbackendBuild (npm run build)tsccompilation with 0 errorsdashboardBuild (npm run build)🔗 Related Issues