Skip to content

Commit 58ff3ea

Browse files
committed
feat(mobile): remove legacy swap form implementation
Removes the legacy swap form UI and related swap logic from mobile app, including: - Removed legacy SwapFormNavigator and related screens - Removed swap reducer and actions - Cleaned up swap-related utilities and types - Removed unused provider icons and components - Updated navigation structure to use LiveApp swap flow - Cleaned up exchange swap logic in ledger-live-common
1 parent f91b5ce commit 58ff3ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+78
-4442
lines changed

.changeset/rotten-brooms-drive.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"ledger-live-desktop": minor
3+
"live-mobile": minor
4+
"@ledgerhq/live-common": minor
5+
"@ledgerhq/live-cli": minor
6+
---
7+
8+
chore: removed swap legacy

apps/cli/src/commands-index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import portfolio from "./commands/live/portfolio";
5757
import synchronousOnboarding from "./commands/live/synchronousOnboarding";
5858
import user from "./commands/live/user";
5959
import version from "./commands/live/version";
60-
import swap from "./commands/ptx/swap";
6160

6261
export default {
6362
bot,
@@ -119,5 +118,4 @@ export default {
119118
synchronousOnboarding,
120119
user,
121120
version,
122-
swap,
123121
};

apps/cli/src/commands/ptx/swap.ts

Lines changed: 0 additions & 299 deletions
This file was deleted.

apps/ledger-live-desktop/src/renderer/components/DeviceAction/index.tsx

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ import {
6969
DeviceInfo,
7070
DeviceModelInfo,
7171
} from "@ledgerhq/types-live";
72-
import {
73-
ExchangeRate,
74-
ExchangeSwap,
75-
InitSwapResult,
76-
} from "@ledgerhq/live-common/exchange/swap/types";
72+
import { ExchangeRate, ExchangeSwap } from "@ledgerhq/live-common/exchange/swap/types";
7773
import { Transaction, TransactionStatus } from "@ledgerhq/live-common/generated/types";
7874
import { AppAndVersion } from "@ledgerhq/live-common/hw/connectApp";
7975
import { Device } from "@ledgerhq/types-devices";
@@ -137,9 +133,6 @@ type States = PartialNullable<{
137133
deviceStreamingProgress: number;
138134
displayUpgradeWarning: boolean;
139135
passWarning: () => void;
140-
initSwapRequested: boolean;
141-
initSwapError: Error;
142-
initSwapResult: InitSwapResult | null;
143136
installingLanguage: boolean;
144137
languageInstallationRequested: boolean;
145138
signMessageRequested: AnyMessage;
@@ -250,9 +243,6 @@ export const DeviceActionDefaultRendering = <R, H extends States, P>({
250243
transactionChecksOptIn,
251244
displayUpgradeWarning,
252245
passWarning,
253-
initSwapRequested,
254-
initSwapError,
255-
initSwapResult,
256246
completeExchangeStarted,
257247
completeExchangeResult,
258248
completeExchangeError,
@@ -512,27 +502,6 @@ export const DeviceActionDefaultRendering = <R, H extends States, P>({
512502
}
513503
}
514504

515-
if (initSwapRequested && !initSwapResult && !initSwapError) {
516-
const { transaction, exchange, exchangeRate } = request as {
517-
transaction: Transaction;
518-
exchange: ExchangeSwap;
519-
exchangeRate: ExchangeRate;
520-
};
521-
const { amountExpectedTo, estimatedFees } = hookState;
522-
return renderSwapDeviceConfirmation({
523-
modelId,
524-
type,
525-
transaction,
526-
exchangeRate,
527-
exchange,
528-
amountExpectedTo: amountExpectedTo ?? undefined,
529-
estimatedFees: estimatedFees ?? undefined,
530-
swapDefaultTrack,
531-
stateSettings,
532-
walletState,
533-
});
534-
}
535-
536505
if (allowOpeningRequestedWording || requestOpenApp) {
537506
// requestOpenApp for Nano S 1.3.1 (need to ask user to open the app.)
538507
const wording = allowOpeningRequestedWording || requestOpenApp || "";

0 commit comments

Comments
 (0)