Skip to content

[LWDM] feat(LIVE-29441): add wallet quote warning metadata#17315

Merged
philipptpunkt merged 1 commit into
developfrom
feat/LIVE-29441-wallet-quote-warnings
May 28, 2026
Merged

[LWDM] feat(LIVE-29441): add wallet quote warning metadata#17315
philipptpunkt merged 1 commit into
developfrom
feat/LIVE-29441-wallet-quote-warnings

Conversation

@philipptpunkt

@philipptpunkt philipptpunkt commented May 11, 2026

Copy link
Copy Markdown
Contributor

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)

Copilot AI review requested due to automatic review settings May 11, 2026 08:47
@philipptpunkt philipptpunkt requested review from a team as code owners May 11, 2026 08:47
@live-github-bot live-github-bot Bot added common Has changes in live-common shared-lib Label added for automated tagging of PRs labels May 11, 2026
@live-github-bot live-github-bot Bot changed the title feat(LIVE-29441): add wallet quote warning metadata [LWDM] feat(LIVE-29441): add wallet quote warning metadata May 11, 2026
@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

⚠️ E2E tests are required

Changes detected require e2e testing before merge (even before asking for any review).

🖥️ Desktop

-> Run Desktop E2E

  • Select "Run workflow"
  • Branch: feat/LIVE-29441-wallet-quote-warnings
  • Device: nanoSP or stax

📱 Mobile

-> Run Mobile E2E

  • Select "Run workflow"
  • Branch: feat/LIVE-29441-wallet-quote-warnings
  • Device: nanoX

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-ahtf3gm9j-ledger-hq-prd.vercel.app
Native Storybook Build ⏭️ Skipped
React Storybook Build ⏭️ Skipped

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 new GetQuotesResponse.providerErrors field alongside digested GetQuotesResponse.errors.
  • Add new wallet-side producers for warnings/errors (buildQuoteWarnings, buildQuoteErrors) and a batch-level error digester (computeQuotesErrors) wired into getQuotes.
  • Update quote fetching to return providerErrors (renamed from errors) 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.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts Outdated
Comment thread libs/exchange-module/src/types.ts
@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Change
desktop-main 2.5 MB -
desktop-preloader 7.1 KB -
desktop-renderer 77.4 MB -
desktop-webviewDappPreloader 37.0 KB -
desktop-webviewPreloader 200.0 B -
desktop-workers 37.0 KB -
mobile 222.2 MB -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.5 MB - -
📄 JavaScript 2.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 77.4 MB - -
📄 JavaScript 30.5 MB - -
🎨 CSS 193.4 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 46.7 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 37.0 KB - -
📄 JavaScript 37.0 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 200.0 B - -
📄 JavaScript 200.0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 37.0 KB - -
📄 JavaScript 37.0 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 222.2 MB - -
📄 JavaScript 106.6 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 115.7 MB - -

Generated by Rsdoctor GitHub Action

@philipptpunkt philipptpunkt force-pushed the feat/LIVE-24415-move-formatting-to-wallet branch from 26dffb1 to 0e0b83a Compare May 11, 2026 13:50
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 17e42df to 99047a7 Compare May 11, 2026 13:50
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-24415-move-formatting-to-wallet branch from 0e0b83a to d395f3f Compare May 11, 2026 14:13
Copilot AI review requested due to automatic review settings May 11, 2026 14:13
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 99047a7 to 8af63d1 Compare May 11, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts Outdated
emptyProviderData,
);
expect(quote.id).toBeUndefined();
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about this ?

@philipptpunkt philipptpunkt force-pushed the feat/LIVE-24415-move-formatting-to-wallet branch from d395f3f to b0a3192 Compare May 11, 2026 14:35
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 8af63d1 to 90cf2a3 Compare May 11, 2026 14:35
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-24415-move-formatting-to-wallet branch from b0a3192 to 834a81b Compare May 11, 2026 14:59
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 90cf2a3 to 76860ca Compare May 11, 2026 14:59
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-24415-move-formatting-to-wallet branch from 834a81b to c1ac6bc Compare May 12, 2026 10:46
Copilot AI review requested due to automatic review settings May 12, 2026 10:46
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 76860ca to 5a297f9 Compare May 12, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts Outdated
Comment thread libs/exchange-module/src/types.ts
Comment thread libs/exchange-module/src/types.ts Outdated
Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/computeQuotesErrors.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/quotes/buildProviderErrors.ts Outdated
Comment thread libs/exchange-module/src/types.ts
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from a100684 to 439d8a2 Compare May 21, 2026 13:13
Copilot AI review requested due to automatic review settings May 21, 2026 14:20
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 439d8a2 to 92c91db Compare May 21, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.

Comment thread apps/wallet-cli/src/commands/swap/quote.ts Outdated
Comment thread libs/exchange-module/src/types.ts Outdated
Comment thread libs/exchange-module/src/types.ts Outdated
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-warnings branch from 92c91db to 4160842 Compare May 21, 2026 15:23
@sonarqubecloud

Copy link
Copy Markdown

@philipptpunkt philipptpunkt merged commit 3fe416e into develop May 28, 2026
134 of 136 checks passed
@philipptpunkt philipptpunkt deleted the feat/LIVE-29441-wallet-quote-warnings branch May 28, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM shared-lib Label added for automated tagging of PRs wallet-cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants