[LWD] feat(pay-card-request): plug MAD stablecoin selection (LIVE-36254) - #20942
Conversation
Web Tools Build Status
|
There was a problem hiding this comment.
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
categoriesfilter 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
deriveRequestReceiveDatato 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.
Mobile Bundle Checks🚀 main.ios.jsbundle bundle size decreased (61.8mb -> 61.4mb). Thanks ❤️ Desktop Bundle Checks🚀 renderer bundle size decreased (15.5mb -> 15.3mb). Thanks ❤️ |
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 |
|



📝 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
currencyIdsquery param, producing a DADA/v1/assetsrequest 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.categoriesfilter through the shared MAD infra (useAssetsData,modularDialogslice,useModularDialogData,AssetAndAccountDrawer,useOpenAssetFlow) — additive/optional, no impact on other flows.usePayTabRequestReceive) and Add stablecoin (usePayTabDepositOptions) actions to open MAD withcategories: [Stablecoins].deriveRequestReceiveData.🔗 Context