[LWDM] feat(LIVE-29441): add wallet quote warning metadata#17315
Conversation
|
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
This PR extends the swap quotes Wallet API contract to attach richer warning/error metadata to quotes and to separate per-provider rejection rows from batch-level “global” errors, with corresponding updates in ledger-live-common’s quote fetching/normalization pipeline.
Changes:
- Extend the quotes contract with
QuoteWarningCodes/QuoteErrorCodes,quote.warnings[]/quote.errors[], and a newGetQuotesResponse.providerErrorsfield alongside digestedGetQuotesResponse.errors. - Add new wallet-side producers for warnings/errors (
buildQuoteWarnings,buildQuoteErrors) and a batch-level error digester (computeQuotesErrors) wired intogetQuotes. - Update quote fetching to return
providerErrors(renamed fromerrors) and adjust unit tests accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/types.ts | Re-export new quote error/warning code enums and additional public types. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/service/types.ts | Rename FetchQuotesResult.errors to providerErrors. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/service/fetchQuotes.ts | Split aggregator response into rawQuotes + providerErrors. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/unrealisticQuote.ts | Use QuoteWarningCodes.UNREALISTIC_QUOTE instead of a string literal. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/unrealisticQuote.test.ts | Update tests to assert enum-based warning codes. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/normalizeQuote.ts | Populate warnings[]/errors[] and mirror first entry into deprecated warning/error. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/normalizeQuote.test.ts | Add coverage for new warning variants and array mirroring; update error/warning assertions to enum/object shapes. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/computeQuoteStatus.ts | Remove legacy warning/error computation entrypoints. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/buildQuoteWarnings.ts | New warning producers (version incompatibility, Nano S incompatibility, high value loss, unknown fiat price, unrealistic quote). |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/buildQuoteErrors.ts | New error producer for quote-level errors (currently fees balance). |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/getQuotes.ts | Return { quotes, providerErrors, errors } and compute global errors from provider rejections. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/getQuotes.test.ts | Update mocks/assertions for providerErrors + digested errors. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/computeQuotesErrors.ts | New batch-level error digester (noQuotes / amountTooLow / amountTooHigh). |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/computeQuotesErrors.test.ts | Unit tests for the global error digester behavior. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts | New file with provider error types/codes (currently unused). |
| libs/exchange-module/src/types.ts | Update public Wallet API types: new enums, new providerErrors, new QuotesError, new warnings/errors arrays, and error object shape. |
| .changeset/young-seals-scream.md | Changeset bumping @ledgerhq/live-common and @ledgerhq/wallet-api-exchange-module minors for contract evolution. |
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 7 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-mainPath:
📁 desktop-preloaderPath:
📁 desktop-rendererPath:
📁 desktop-webviewDappPreloaderPath:
📁 desktop-webviewPreloaderPath:
📁 desktop-workersPath:
📁 mobilePath:
Generated by Rsdoctor GitHub Action |
26dffb1 to
0e0b83a
Compare
17e42df to
99047a7
Compare
0e0b83a to
d395f3f
Compare
99047a7 to
8af63d1
Compare
| emptyProviderData, | ||
| ); | ||
| expect(quote.id).toBeUndefined(); | ||
| }); |
There was a problem hiding this comment.
what do you think about this ?
d395f3f to
b0a3192
Compare
8af63d1 to
90cf2a3
Compare
b0a3192 to
834a81b
Compare
90cf2a3 to
76860ca
Compare
834a81b to
c1ac6bc
Compare
76860ca to
5a297f9
Compare
60564b1 to
d79b8b5
Compare
d79b8b5 to
cc2e89e
Compare
cc2e89e to
a100684
Compare
a100684 to
439d8a2
Compare
439d8a2 to
92c91db
Compare
92c91db to
4160842
Compare
|



Jira: https://ledgerhq.atlassian.net/browse/LIVE-29445
Description: Add Warnings and groundwork for Errors for Quotes on Wallet API
Stack (managed by stac-man)