Skip to content

[LWDM] feat(LIVE-29443): add swap status wallet api#17456

Merged
philipptpunkt merged 1 commit into
developfrom
feat/LIVE-29443-swap-transaction-status-api
Jun 5, 2026
Merged

[LWDM] feat(LIVE-29443): add swap status wallet api#17456
philipptpunkt merged 1 commit into
developfrom
feat/LIVE-29443-swap-transaction-status-api

Conversation

@philipptpunkt

@philipptpunkt philipptpunkt commented May 13, 2026

Copy link
Copy Markdown
Contributor

Jira: https://ledgerhq.atlassian.net/browse/LIVE-29443

Description:

Add Wallet API endpoint for Swap Transaction Status. This is groundwork for new Transaction Status screen/overlay for Swap.

Stack (managed by stac-man)

@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 13, 2026
@live-github-bot live-github-bot Bot changed the title feat(LIVE-29443): add swap status wallet api [LWDM] feat(LIVE-29443): add swap status wallet api May 13, 2026
@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

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

@github-actions

github-actions Bot commented May 13, 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.6 MB -
desktop-preloader 7.1 KB -
desktop-renderer 74.9 MB -
desktop-webviewDappPreloader 36.9 KB -
desktop-webviewPreloader 200.0 B -
desktop-workers 36.8 KB -
mobile 252.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.6 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 74.9 MB - -
📄 JavaScript 28.0 MB - -
🎨 CSS 170.1 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 36.9 KB - -
📄 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 - -
📄 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 - -
📄 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 252.2 MB - -
📄 JavaScript 106.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 145.5 MB - -

Generated by Rsdoctor GitHub Action

@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from b2884e8 to a2481a2 Compare May 21, 2026 12:25
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 1c96d5e to 82e5a53 Compare May 21, 2026 12:25
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from a2481a2 to 4f8953a Compare May 21, 2026 14:28
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 82e5a53 to 985f9da Compare May 21, 2026 14:28
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from 4f8953a to 32305f4 Compare May 21, 2026 15:23
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 985f9da to 55b448d Compare May 21, 2026 15:23
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from 32305f4 to 37479da Compare May 28, 2026 14:03
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 55b448d to 658e5c1 Compare May 28, 2026 14:03
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from 37479da to ee11db6 Compare May 29, 2026 08:44
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 658e5c1 to 37455e8 Compare May 29, 2026 08:44
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from ee11db6 to 368bde4 Compare May 29, 2026 09:07
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 37455e8 to 2498456 Compare May 29, 2026 09:07
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29441-wallet-quote-global-outcomes branch from 368bde4 to 5210095 Compare June 1, 2026 09:19
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 2498456 to 13411ab Compare June 1, 2026 09:19
Base automatically changed from feat/LIVE-29441-wallet-quote-global-outcomes to develop June 1, 2026 14:36
@philipptpunkt philipptpunkt marked this pull request as ready for review June 3, 2026 08:17
@philipptpunkt philipptpunkt requested a review from a team as a code owner June 3, 2026 08:17
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 7281e11 to 76f1854 Compare June 4, 2026 08:49

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 21 out of 21 changed files in this pull request and generated 2 comments.

Comment thread libs/ledger-live-common/src/wallet-api/Exchange/transactionStatus/types.ts Outdated
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 76f1854 to 8404e7b Compare June 4, 2026 10:17
Copilot AI review requested due to automatic review settings June 4, 2026 12:25
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 8404e7b to c7a9028 Compare June 4, 2026 12:25

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 26 out of 26 changed files in this pull request and generated 1 comment.

@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from c7a9028 to 049d467 Compare June 4, 2026 12:52
Copilot AI review requested due to automatic review settings June 4, 2026 13:55
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 049d467 to dc5de56 Compare June 4, 2026 13:55

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 26 out of 26 changed files in this pull request and generated 1 comment.

Comment on lines +38 to +42
if (parsed.protocol !== "https:" && parsed.protocol !== "ledgerlive:") {
return undefined;
}
return trimmed;
}
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from dc5de56 to 00176c9 Compare June 5, 2026 08:06
: undefined;
}

function getPositiveAmount(amount: string | undefined): string | undefined {

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.

nit It would be more easy to me to do:

Suggested change
function getPositiveAmount(amount: string | undefined): string | undefined {
function isAmountGreaterThanZero(amount: string | undefined): boolean {
try {
return new BigNumber(amount).isGreaterThan(0);
} finally {
return false;
}

Because, getPositiveAmount seems like you extract the positive value
But matter of taste actually, what you did is good

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

return new BigNumber(positiveFinalAmount).times(new BigNumber(10).pow(toMagnitude)).toFixed();
}

function getTransactionStatusValue(status: string | undefined): TransactionStatusValue | undefined {

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.

nit I dont know if TransactionStatus is a enum here, but I so, you can do

function isTransactionStatus(value: string): TransactionStatusValue | undefined {
  return value in TransactionStatus ? value : undefined;
}

Plus you wont edit code with new TransactionStatus

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extracted this check/helper function into a separate file ✅

liviuciulinaru
liviuciulinaru previously approved these changes Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 09:55
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 00176c9 to 775a6f2 Compare June 5, 2026 09:55

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 27 out of 27 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

libs/ledger-live-common/src/exchange/swap/index.ts:33

  • isSwapOperationPending currently treats expired as pending because only finished/refunded are considered terminal. In this PR, exchange/transactionStatus/statusController.ts treats TransactionStatus.Expired as terminal, so leaving it pending here causes inconsistent terminal logic and can trigger unnecessary polling/updates for expired swaps.

// A swap operation is considered pending if it is not in a finishedOK or finishedKO state
export const isSwapOperationPending: (status: string) => boolean = status =>
  !operationStatusList.finishedOK.includes(status) &&
  !operationStatusList.finishedKO.includes(status);

Comment thread libs/ledger-live-common/src/exchange/transactionStatus/parseParams.test.ts Outdated
@philipptpunkt philipptpunkt force-pushed the feat/LIVE-29443-swap-transaction-status-api branch from 775a6f2 to 0a78795 Compare June 5, 2026 10:14
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Code Smells (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@philipptpunkt philipptpunkt merged commit a100396 into develop Jun 5, 2026
84 of 85 checks passed
@philipptpunkt philipptpunkt deleted the feat/LIVE-29443-swap-transaction-status-api branch June 5, 2026 12:16
@koda-apps

koda-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

👋 Hi @philipptpunkt — heads up: this PR was merged with code formatting issues that weren't caught before merge.

We recently enforced oxfmt (ledger-live) formatting across the repo, but the changes here landed unformatted — most likely because the local setup didn't run the formatter on commit (missing mise, or a hook that didn't fire).

No action needed on this PR (the formatting will be/has been corrected separately), but please take a moment to verify your local setup so future PRs format automatically:

  • ✅ Make sure mise is installed and activated in your shell
  • ✅ Run the repo bootstrap so the pre-commit hooks are wired up correctly
  • ✅ Confirm oxfmt runs on commit (your editor/hook should auto-format staged files)

ℹ️ For full context and setup details, see this Slack message

Thanks! 🙏

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 shared-lib Label added for automated tagging of PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants