Skip to content

[LWD] feat(pay-card-request): plug MAD stablecoin selection (LIVE-36254) - #20942

Draft
mcayuelas-ledger wants to merge 1 commit into
feat/pay-card-request-LIVE-36233-qr-codefrom
feat/pay-card-request-LIVE-36254-mad-asset-account
Draft

[LWD] feat(pay-card-request): plug MAD stablecoin selection (LIVE-36254)#20942
mcayuelas-ledger wants to merge 1 commit into
feat/pay-card-request-LIVE-36233-qr-codefrom
feat/pay-card-request-LIVE-36254-mad-asset-account

Conversation

@mcayuelas-ledger

@mcayuelas-ledger mcayuelas-ledger commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Plugs the Modular Asset Drawer (MAD) into the Pay tab so the Request (receive) and Add stablecoin (deposit) actions let the user pick an asset, its network and an account — restricted to stablecoins.

Problem: the first approach fed the full stablecoin currency-id list (hundreds of ids across every network) into MAD's currencyIds query param, producing a DADA /v1/assets request URL long enough to break the call.

Solution: filter MAD by the stablecoin category server-side (categories=stablecoins) instead of enumerating ids. Short URL, all stablecoins across networks, network-selection step preserved.

  • Thread an optional categories filter through the shared MAD infra (useAssetsData, modularDialog slice, useModularDialogData, AssetAndAccountDrawer, useOpenAssetFlow) — additive/optional, no impact on other flows.
  • Wire the Pay Request (usePayTabRequestReceive) and Add stablecoin (usePayTabDepositOptions) actions to open MAD with categories: [Stablecoins].
  • Derive the receive primitives (address / asset / network / icons) from the selected account via deriveRequestReceiveData.

Stacked on top of #20938 (base branch feat/pay-card-request-LIVE-36233-qr-code).

🔗 Context

Copilot AI lite review requested due to automatic review settings August 19, 2026 13:54
@live-github-bot live-github-bot Bot added the desktop Has changes in LLD label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-nq970hq3h-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 integrates the Modular Asset Drawer (MAD) into Ledger Wallet Desktop’s Pay tab “Request (receive)” and “Add stablecoin (deposit)” actions, filtering selectable assets via the server-side categories=stablecoins query parameter to avoid overlong request URLs while preserving network/account selection.

Changes:

  • Thread an optional categories filter through the aggregated-assets hook (useAssetsData) and the desktop modular dialog Redux + hooks plumbing.
  • Update Pay tab “Request” and “Deposit receive” entry points to open MAD filtered to AssetCategory.Stablecoins.
  • Add deriveRequestReceiveData to derive request/receive primitives from the selected account, with accompanying unit tests.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
features/platform/aggregated-assets/src/hooks/useAssetsData.ts Forwards optional categories to the underlying aggregated-assets infinite query.
features/platform/aggregated-assets/src/hooks/useAssetsData.test.ts Adds coverage to verify categories is forwarded correctly.
apps/ledger-live-desktop/src/renderer/reducers/modularDialog.ts Extends modular dialog params/state to store and select categories.
apps/ledger-live-desktop/src/mvvm/features/PayTab/index.tsx Removes stablecoin-id list plumbing; deposit flow no longer enumerates currency ids.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/usePayTabRequestReceive.ts Opens MAD via useOpenAssetAndAccount filtered to stablecoins; populates dialog from selected account.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/usePayTabDepositOptions.ts Opens asset flow filtered by stablecoin category (server-side) instead of passing large currency id lists.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/deriveRequestReceiveData.ts New helper to derive address/asset/network/icon props from selected account/parentAccount.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/tests/usePayTabRequestReceive.test.ts Adds unit tests for MAD stablecoin filtering and success/close behavior.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/tests/usePayTabDepositOptions.test.tsx Updates test expectations to assert category-based filtering.
apps/ledger-live-desktop/src/mvvm/features/PayTab/hooks/tests/deriveRequestReceiveData.test.ts Adds unit tests for token vs native account derivation behavior.
apps/ledger-live-desktop/src/mvvm/features/ModularDialog/Web3AppWebview/AssetAndAccountDrawer.tsx Adds categories support to the asset+account drawer params and dispatch payload.
apps/ledger-live-desktop/src/mvvm/features/ModularDialog/hooks/useOpenAssetFlow.tsx Extends openAssetFlow to accept optional categories and forward them to the dialog.
apps/ledger-live-desktop/src/mvvm/features/ModularDialog/hooks/useModularDialogData.ts Reads categories from redux and forwards them into useAssetsData.
apps/ledger-live-desktop/src/mvvm/features/ModularDialog/hooks/tests/useModularDialogData.test.ts Adds coverage verifying category forwarding into useAssetsData.
.changeset/pay-mad-stablecoin-selection.md Adds changeset entries for the desktop app and aggregated-assets feature package.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@live-github-bot

live-github-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Mobile Bundle Checks

Comparing 8b4e3f4 against f95f4d5.

🚀 main.ios.jsbundle bundle size decreased (61.8mb -> 61.4mb). Thanks ❤️
🚀 main.android.jsbundle bundle size decreased (61.8mb -> 61.5mb). Thanks ❤️

Desktop Bundle Checks

Comparing 8b4e3f4 against f95f4d5.

🚀 renderer bundle size decreased (15.5mb -> 15.3mb). Thanks ❤️

@github-actions

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
desktop-main 2.3 MB - - -
desktop-preloader 7.1 KB - - -
desktop-renderer 81.1 MB - - -
desktop-webviewDappPreloader 36.9 KB - - -
desktop-webviewPreloader 200.0 B - - -
desktop-workers 36.8 KB - - -
mobile 127.0 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.3 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 2.2 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 - -
🗜️ Gzip Size - - -
📄 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 81.1 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 29.7 MB - -
🎨 CSS 184.6 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.2 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 36.9 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 36.9 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 - -
🗜️ Gzip Size - - -
📄 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 36.8 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 36.8 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 127.0 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 111.6 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 15.4 MB - -

Generated by Rsdoctor GitHub Action

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Has changes in LLD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants