Skip to content

Conversation

@bordalix
Copy link
Collaborator

@bordalix bordalix commented Oct 30, 2025

Do not merge, requires arkade-os/boltz-swap#32 and release on new boltz-swap version.

Summary by CodeRabbit

  • New Features

    • Added refunded status display for swaps with a visible indicator and "Swap refunded" message.
    • Enhanced preimage display to show "N/A" when preimage is missing.
  • Chores

    • Updated minor package versions.
  • Cleanup

    • Removed unused icon assets to trim the UI bundle.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

Adds UI handling and display for refunded submarine swaps: SwapsList shows "Refunded" status for submarine swaps marked refunded; Boltz Swap screen renders a "Swap refunded" message and falls back to "N/A" for missing preimage. Also removes two unused icon imports and bumps two package versions.

Changes

Cohort / File(s) Summary
Submarine swap refund UI
src/components/SwapsList.tsx, src/screens/Apps/Boltz/Swap.tsx
Adds refunded detection for submarine swaps and conditional rendering: SwapsList shows Stat as "Refunded"; Boltz Swap renders a green InfoIcon + "Swap refunded" line and displays preimage as N/A when missing.
Housekeeping
src/screens/Apps/Index.tsx
Removes two unused icon imports (InvadersIcon, CoinflipIcon).
Dependency bumps
package.json
Updates two dependency versions (minor patch bumps) with no other manifest changes.

Sequence Diagram(s)

sequenceDiagram
    participant Data as Swap data (store/API)
    participant SwapsList as SwapsList.tsx
    participant SwapScreen as Boltz/Swap.tsx
    Note over Data,SwapsList: Swap includes fields: type, refunded, status, preimage
    Data->>SwapsList: provide swap list
    alt swap.type == "submarine" and swap.refunded == true
        SwapsList->>SwapsList: render Stat -> "Refunded"
    else
        SwapsList->>SwapsList: render Stat -> original status
    end
    Data->>SwapScreen: provide swapInfo
    alt swap.type != "reverse" and swap.refunded == true
        SwapScreen->>SwapScreen: render InfoIcon + "Swap refunded"
    end
    alt swapInfo.preimage falsy
        SwapScreen->>SwapScreen: display "Preimage: N/A"
    else
        SwapScreen->>SwapScreen: display actual preimage
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Small, localized UI conditionals across two components.
  • Low-risk import removal and package version bumps.
  • Areas to peek at during review:
    • Ensure swap.refunded is set consistently by upstream logic.
    • Verify styling/spacing of the new InfoIcon/FlexRow matches design system.
    • Confirm package bumps don't require code changes or lockfile adjustments.

Possibly related PRs

Suggested reviewers

  • louisinger

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'UI tweaks on refunded failed submarine swaps' directly and clearly summarizes the main changes in the changeset. The modifications across SwapsList.tsx and Swap.tsx specifically add UI handling for refunded submarine swaps, including new visual indicators and status displays. The title is concise, specific, and accurately reflects the primary objective of the pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refund_swaps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 30, 2025

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: c1dce8b
Status: ✅  Deploy successful!
Preview URL: https://80f25083.arkade-wallet.pages.dev
Branch Preview URL: https://refund-swaps.arkade-wallet.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 30, 2025

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: c1dce8b
Status: ✅  Deploy successful!
Preview URL: https://630b907a.wallet-bitcoin.pages.dev
Branch Preview URL: https://refund-swaps.wallet-bitcoin.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/SwapsList.tsx (1)

17-48: Consider using a distinct icon for refunded swaps.

The refunded status currently uses the same SwapFailedIcon as failed swaps (line 48). This might confuse users since a refunded swap is not necessarily a failed swap—it's an intentional recovery action. Consider using a different icon or visual treatment to distinguish refunded swaps from truly failed ones.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf48f7d and 69aa5ef.

📒 Files selected for processing (2)
  • src/components/SwapsList.tsx (1 hunks)
  • src/screens/Apps/Boltz/Swap.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/components/SwapsList.tsx (1)
src/components/Text.tsx (2)
  • Text (25-79)
  • TextSecondary (91-97)
src/screens/Apps/Boltz/Swap.tsx (3)
src/components/FlexRow.tsx (1)
  • FlexRow (16-45)
src/icons/Info.tsx (1)
  • InfoIconDark (16-27)
src/components/Text.tsx (1)
  • TextSecondary (91-97)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (5)
src/components/SwapsList.tsx (1)

58-69: Clarify the relationship between swap.refunded and swap.status.

The status display logic shows "Refunded" when the refunded flag is true (line 69), but statusDict already maps 'transaction.refunded' to 'Refunded' (line 34). This means if swap.status === 'transaction.refunded', the computed status variable would already be 'Refunded'.

Is there a scenario where swap.refunded === true but swap.status !== 'transaction.refunded'? If not, the explicit check on line 69 might be redundant. If such a scenario exists (e.g., the refund completed but the status hasn't synchronized yet), consider adding a comment to explain this edge case.

src/screens/Apps/Boltz/Swap.tsx (4)

23-24: LGTM!

The new imports are correctly added and used in the refunded UI branch below.


45-45: Verify type safety for the refunded property.

Similar to SwapsList.tsx, this code accesses swapInfo.refunded which depends on the upcoming boltz-swap release. Ensure TypeScript recognizes this property to prevent compilation errors.


56-56: Good defensive coding for missing preimage.

Displaying 'N/A' when the preimage is unavailable improves the user experience and prevents showing undefined or empty values.


102-106: LGTM!

The refunded UI branch is well-implemented with appropriate visual treatment (green color) and clear messaging. The use of alignItems='flex-start' ensures proper alignment between the icon and text.

const prefix = swap.type === 'reverse' ? '+' : '-'
const amount = `${prefix} ${config.showBalance ? prettyAmount(sats) : prettyHide(sats)}`
const when = window.innerWidth < 400 ? prettyAgo(swap.createdAt) : prettyDate(swap.createdAt)
const refunded = swap.type === 'submarine' && swap.refunded
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify type safety for the refunded property.

The code accesses swap.refunded which is expected from the upcoming boltz-swap release (dependency noted in PR description). Ensure that TypeScript recognizes this property to avoid compilation errors. You may need to update the boltz-swap package version or add a type assertion if the types haven't been released yet.

Run the following script to check the current boltz-swap type definitions:


🏁 Script executed:

#!/bin/bash
# Check the current version and look for 'refunded' in type definitions

# Check package.json for boltz-swap version
jq -r '.dependencies["@arkade-os/boltz-swap"] // .devDependencies["@arkade-os/boltz-swap"] // "not found"' package.json

# Search for refunded property in type definitions
fd -e ts -e tsx -e d.ts . node_modules/@arkade-os/boltz-swap -x cat {} | grep -n "refunded"

Length of output: 127



🏁 Script executed:

#!/bin/bash
# Check package.json for exact dependency names related to boltz
cat package.json | grep -A5 -B5 "boltz"

# Look for any boltz-related packages in node_modules
if [ -d "node_modules" ]; then
  find node_modules -maxdepth 2 -type d -name "*boltz*" 2>/dev/null | head -20
else
  echo "node_modules directory not found"
fi

# Check SwapsList.tsx file for imports and type annotations
echo "=== SwapsList.tsx imports and type annotations ==="
cat src/components/SwapsList.tsx | head -80

Length of output: 3438


🏁 Script executed:

#!/bin/bash
# Also check if there's a types file in the current project for boltz
find . -type f \( -name "*.d.ts" -o -name "*boltz*" \) | grep -v node_modules | head -20

Length of output: 19


🌐 Web query:

@arkade-os/boltz-swap PendingSubmarineSwap refunded property

💡 Result:

Short answer: In that package the refunded property indicates whether the on‑chain side of a failed Submarine Swap has been refunded (i.e., the refund transaction was created/broadcast/confirmed). It corresponds to Boltz’s swap state where the chain funds were returned (transaction.refunded / refund completed). [1][2]

Sources:

  • @arkade-os/boltz-swap (npm package info). [1]
  • Boltz API docs — Claims & Refunds / Swap lifecycle (explains refund behavior and the transaction.refunded state). [2]

Do you want me to fetch the package’s TypeScript source to show the exact interface/type definition?


🌐 Web query:

arkade-os/boltz-swap GitHub type definitions PendingSubmarineSwap

💡 Result:

I couldn't find the repo source on GitHub, but the TypeScript types for @arkade-os/boltz-swap are published in the npm package (and mirrored on jsDelivr). Check the package's .d.ts files in the npm package (or via the jsDelivr CDN) to find the PendingSubmarineSwap type. Sources: npm package page and jsDelivr package listing. [1][2]

If you want, I can fetch and paste the exact PendingSubmarineSwap type definition from the package — tell me which package version to inspect (or I can use the latest).
Sources:
[1] https://www.npmjs.com/package/@arkade-os/boltz-swap
[2] https://www.jsdelivr.com/package/npm/@arkade-os/boltz-swap


🌐 Web query:

@arkade-os/boltz-swap 0.2.6 npm package PendingSubmarineSwap interface

💡 Result:

Do you want the TypeScript definition (fields and types) for PendingSubmarineSwap from @arkade-os/boltz-swap v0.2.6, or an example of its runtime shape/usage?


🌐 Web query:

boltz-swap refunded property release notes changelog

💡 Result:

Here are Boltz changelog/release-note pages that mention refunds/rescue/refunded-swap features:

  • "Introducing Taproot Swaps" — Immediate Cooperative Refunds (Backend v3.4.0, Web App v1.3.0). (blog.boltz.exchange)
  • boltz-backend release v3.10.0 — adds rescue files to allow swaps to be refunded with only refund keys. (newreleases.io)
  • Boltz API / Docs — Claims & Refunds (detailed refund procedures for Submarine/Chain swaps, rescue/refund file workflows). (api.docs.boltz.exchange)
  • Boltz support article — how to claim refunds via the Web App (refund page / refund workflow). (support.boltz.exchange)

If you meant a specific API field named "refunded" (or a particular PR/commit), tell me the repo or filename and I’ll fetch the exact changelog/commit.

Citations:


🌐 Web query:

site:npmjs.com @arkade-os/boltz-swap versions

💡 Result:

Latest published version: 0.1.4 (published 4 days ago). [1]

Source: npm package page for @arkade-os/boltz-swap. [1]


Version mismatch prevents access to refunded type definitions.

The latest published version of @arkade-os/boltz-swap on npm is 0.1.4, but package.json specifies 0.2.6. The refunded property used at line 63 does not exist in version 0.1.4, so TypeScript cannot validate the type safety. Either:

  1. Ensure @arkade-os/boltz-swap version 0.2.6 is published to npm before merging, or
  2. Verify the correct version number in package.json and update the code accordingly.
🤖 Prompt for AI Agents
In src/components/SwapsList.tsx around line 63, the code accesses swap.refunded
which is only present in @arkade-os/boltz-swap v0.2.6 but package.json currently
points to a version that is not published (npm shows v0.1.4), causing TypeScript
to fail; fix by either updating package.json to a published package version that
contains the refunded property (or publish v0.2.6 to npm) so TS can resolve
correct types, or change the code to be compatible with the published version
(remove/refactor access to refunded, or add a runtime guard/feature-detect like
'const refunded = swap.type === "submarine" && "refunded" in swap &&
swap.refunded' and adjust typings) and then run install/tsc to confirm types
pass.

@cloudflare-workers-and-pages
Copy link

Deploying wallet-signet with  Cloudflare Pages  Cloudflare Pages

Latest commit: c1dce8b
Status: ✅  Deploy successful!
Preview URL: https://35bab832.wallet-23u.pages.dev
Branch Preview URL: https://refund-swaps.wallet-23u.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69aa5ef and c1dce8b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/screens/Apps/Index.tsx (0 hunks)
💤 Files with no reviewable changes (1)
  • src/screens/Apps/Index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test

Comment on lines +7 to +8
"@arkade-os/boltz-swap": "0.2.7",
"@arkade-os/sdk": "0.3.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify dependency versions exist and are secure.

The PR is marked "Do not merge" pending the external boltz-swap release (arkade-os/boltz-swap#32), yet both @arkade-os/boltz-swap and @arkade-os/sdk are already bumped. Please verify:

  1. These specific versions exist and are published to npm
  2. No known security advisories or vulnerabilities affect these versions
  3. Whether the external PR Rolling over fails #32 has been released, thereby unblocking this PR

🌐 Web query:

Latest version of @arkade-os/boltz-swap package and any security advisories

💡 Result:

  • Latest (npm registry): @arkade-os/boltz-swap — version 0.1.4 (published ~Oct 30, 2025). [1][2]
  • Other registries/tools show differing tags (e.g. jsDelivr lists 0.2.6; Socket.dev lists 0.1.8 and several alphas) — suggest verifying the registry you use. [3][4]
  • Security advisories: no public security advisories found for this package repository (no SECURITY.md / no published advisories); I recommend running npm audit and scanning the package before use. [5][1]

Sources:
[1] npm package page for @arkade-os/boltz-swap.
[2] Libraries.io/npm package listing for @arkade-os/boltz-swap.
[3] jsDelivr package listing for @arkade-os/boltz-swap.
[4] Socket.dev package page for @arkade-os/boltz-swap (versions/alerts).
[5] GitHub repo security view (no published advisories).


🌐 Web query:

Latest version of @arkade-os/sdk package and any security advisories

💡 Result:

Latest published npm version: 0.2.3. [1][2]

Security advisories:

  • No public security advisory listed for the @arkade-os/sdk package itself on npm. [1]
  • The project has recent dependency updates (changelogs note fixes for dependency vulnerabilities). [2]
  • Some transitive dependencies used by JS/TS projects (notably esbuild) have had CVEs in 2024–2025 — if your project bundles or depends on esbuild variants, consider upgrading those to patched versions (see Snyk/CVE details). [3][4]

Sources:
[1] npm package page for @arkade-os/sdk.
[2] Socket / package analysis & project docs (arkade-os ts-sdk).
[3] Snyk entry for esbuild vulnerabilities (CVE listings).
[4] evanw/esbuild GitHub issue discussing recent CVEs.

Would you like me to: a) check the package's GitHub repo for any open security issues or advisories, or b) run an npm audit of your project (you can paste your package-lock or yarn.lock)?


These dependency versions do not exist on the npm registry yet.

The versions being bumped to are not currently published:

  • @arkade-os/boltz-swap 0.2.7 does not exist (latest on npm is 0.1.4 as of Oct 30, 2025)
  • @arkade-os/sdk 0.3.4 does not exist (latest on npm is 0.2.3)

This aligns with the PR's "Do not merge" status pending the external boltz-swap release. Confirm that these versions will be published before merging this PR, otherwise the installation will fail. Once the external PR (#32 for boltz-swap) is released and these versions are available on npm, this PR can proceed.

@bordalix bordalix merged commit 077667a into master Nov 3, 2025
6 checks passed
bordalix added a commit that referenced this pull request Nov 3, 2025
* UI tweaks on refunded failed submarine swaps

* lint

* update dependencies

* update dependencies
@coderabbitai coderabbitai bot mentioned this pull request Nov 3, 2025
bordalix added a commit that referenced this pull request Nov 3, 2025
* fix send/receive subdust

* lint

* UI tweaks on refunded failed submarine swaps (#207)

* UI tweaks on refunded failed submarine swaps

* lint

* update dependencies

* update dependencies

* use env vars

* update readme

* fix swap color

* Guard against invalid environment variable values.
@coderabbitai coderabbitai bot mentioned this pull request Nov 12, 2025
@bordalix bordalix deleted the refund_swaps branch November 26, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants