[LWDM] feat(LIVE-29441): add wallet quote global outcomes#17336
Conversation
|
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Wallet API swap-quote contracts and wallet-side quote pipeline to introduce standardized “global outcome” error codes, align provider error codes with a shared enum, and adjust quote fetching behavior to match legacy “no quotes” semantics on non-OK HTTP responses.
Changes:
- Re-export and adopt new
ProviderErrorCodes/QuotesErrorCodesenums for provider errors and batch-level (“global”) quote outcomes. - Update wallet-side types and logic to use these enums (notably
computeQuotesErrors) and adjust tests accordingly. - Change
fetchQuotesto return an empty result on Axios HTTP errors (non-2xx responses) while still rethrowing cancellations and non-HTTP failures.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/types.ts | Re-exports new provider/global outcome enums from the exchange module package. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/service/types.ts | Tightens RawQuoteError.code typing to include ProviderErrorCodes. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/service/fetchQuotes.ts | Swallows non-OK HTTP Axios responses into { rawQuotes: [], providerErrors: [] }. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/service/fetchQuotes.test.ts | Adds unit coverage for the new HTTP-error and cancel/network error behaviors. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/normalizeQuote.ts | Removes deprecated single warning/error fields from normalized quote output. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/normalizer/normalizeQuote.test.ts | Updates assertions to only use warnings[] / errors[]. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/getQuotes.test.ts | Updates expectations to use QuotesErrorCodes and provider error enums. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/computeQuotesErrors.ts | Uses enums for noQuotes / amount bounds outcomes and for provider error matching. |
| libs/ledger-live-common/src/wallet-api/Exchange/quotes/computeQuotesErrors.test.ts | Updates tests to the new enum-based outcome codes and adds invalid-bound coverage. |
| libs/exchange-module/src/types.ts | Removes deprecated Quote.warning/Quote.error fields; introduces new enums and updates error types. |
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 |
99047a7 to
8af63d1
Compare
18b8f5a to
c44d199
Compare
8af63d1 to
90cf2a3
Compare
c44d199 to
2275160
Compare
90cf2a3 to
76860ca
Compare
2275160 to
459720c
Compare
76860ca to
5a297f9
Compare
459720c to
93534d7
Compare
5a297f9 to
60564b1
Compare
93534d7 to
f23d548
Compare
60564b1 to
d79b8b5
Compare
439d8a2 to
92c91db
Compare
a2481a2 to
4f8953a
Compare
92c91db to
4160842
Compare
4f8953a to
32305f4
Compare
| const currencyIds = [input.sendCurrencyId, input.receiveCurrencyId]; | ||
| for (const rule of VERSION_COMPATIBILITY_RULES) { | ||
| const requiredVersion = appVersion.platform === "lld" ? rule.lld : rule.llm; | ||
| if (!requiredVersion || compareVersions(appVersion.version, requiredVersion) >= 0) { | ||
| continue; |
There was a problem hiding this comment.
won't change anything here for now, since this whole check is currently under investigation with a potential removal
32305f4 to
37479da
Compare
37479da to
ee11db6
Compare
| deviceModelId?: string; | ||
| appVersion?: { | ||
| platform: QuotesAppPlatform; | ||
| version: string | null; | ||
| }; |
There was a problem hiding this comment.
Docs were in fact updated ✅
| providerErrors: QuoteProviderError[]; | ||
| warnings: QuotesWarning[]; |
There was a problem hiding this comment.
I'd rather think about removing comments from types, since the type should explain itself. Won't change this here...
ee11db6 to
368bde4
Compare
368bde4 to
5210095
Compare
|
| llm: string | null; | ||
| }; | ||
|
|
||
| const VERSION_COMPATIBILITY_RULES: VersionCompatibilityRule[] = [ |
There was a problem hiding this comment.
Currently hardcoded just to be aligned with current Swap - but this can most likely be removed. If necessary in the future this should be handled with a remote-config / feature flag like it is done in Swap live-app.
| const currencyIds = [input.sendCurrencyId, input.receiveCurrencyId]; | ||
| for (const rule of VERSION_COMPATIBILITY_RULES) { | ||
| const requiredVersion = appVersion.platform === "lld" ? rule.lld : rule.llm; | ||
| if (!requiredVersion || compareVersions(appVersion.version, requiredVersion) >= 0) { | ||
| continue; |
There was a problem hiding this comment.
won't change anything here for now, since this whole check is currently under investigation with a potential removal



Jira: https://ledgerhq.atlassian.net/browse/LIVE-29445
Description:
Add Error handling for local and global errors in the Wallet Quotes logic
Stack (managed by stac-man)