feat(quote): enforce expiry, bind quoteId to payload, display metadata - #287
Open
euniceamoni wants to merge 1 commit into
Open
feat(quote): enforce expiry, bind quoteId to payload, display metadata#287euniceamoni wants to merge 1 commit into
euniceamoni wants to merge 1 commit into
Conversation
- buildQuote() now returns a full snapshot: quoteId, source, timestamp, expiresAt (30s TTL), fromMeta/toMeta (currency flags + names), and canonical sendAmount rounded to 2 dp. - Added isQuoteExpired() and isQuoteStale() helpers to detect when a quote must be refreshed before submission. - SendMoney: quote is cleared immediately on any field edit; a 1-second countdown tracks expiry; handleSubmit re-validates via isQuoteExpired / isQuoteStale and binds quoteId into the transfer payload. - QuoteCard: shows currency corridor with flags, source tag, obtained-at timestamp, and color-coded expiry badge (normal / warning / expired). - test/services/quote.test.js: 84 new tests covering quote structure, expiry boundaries (fake timers), staleness (amount/from/to/swap), all 42 supported corridors, 2dp precision, MIN_FEE, quoteId uniqueness and JSON serialization, and regression coverage for the original expired/stale quote failure mode. - All 222 tests pass (128 pre-existing + 84 new).
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.
Description
Motivation
Changes Made
Type of Change
Testing
npm test)npm run build && npm run preview)Test Evidence
Screenshots (if applicable)
Before
After
Accessibility
Checklist
Related Issues
Fixes #
Additional Notes
Breaking Changes
closes #279