-
Notifications
You must be signed in to change notification settings - Fork 13
UI tweaks on refunded failed submarine swaps #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Deploying wallet-mutinynet with
|
| Latest commit: |
c1dce8b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://80f25083.arkade-wallet.pages.dev |
| Branch Preview URL: | https://refund-swaps.arkade-wallet.pages.dev |
Deploying wallet-bitcoin with
|
| Latest commit: |
c1dce8b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://630b907a.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://refund-swaps.wallet-bitcoin.pages.dev |
There was a problem hiding this 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
SwapFailedIconas 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
📒 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 betweenswap.refundedandswap.status.The status display logic shows "Refunded" when the
refundedflag is true (line 69), butstatusDictalready maps'transaction.refunded'to'Refunded'(line 34). This means ifswap.status === 'transaction.refunded', the computedstatusvariable would already be'Refunded'.Is there a scenario where
swap.refunded === truebutswap.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 therefundedproperty.Similar to SwapsList.tsx, this code accesses
swapInfo.refundedwhich 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 -80Length 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 -20Length 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:
- 1: https://blog.boltz.exchange/p/introducing-taproot-swaps-putting?utm_source=openai
- 2: https://newreleases.io/project/github/BoltzExchange/boltz-backend/release/v3.10.0?utm_source=openai
- 3: https://api.docs.boltz.exchange/claiming-swaps.html?utm_source=openai
- 4: https://support.boltz.exchange/hc/center/articles/1732545653-what-can-i-do-if-my-swap-s-lightning-payment-is-pending?utm_source=openai
🌐 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:
- Ensure @arkade-os/boltz-swap version 0.2.6 is published to npm before merging, or
- 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.
Deploying wallet-signet with
|
| Latest commit: |
c1dce8b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://35bab832.wallet-23u.pages.dev |
| Branch Preview URL: | https://refund-swaps.wallet-23u.pages.dev |
There was a problem hiding this 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
| "@arkade-os/boltz-swap": "0.2.7", | ||
| "@arkade-os/sdk": "0.3.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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:
- These specific versions exist and are published to npm
- No known security advisories or vulnerabilities affect these versions
- 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-swap0.2.7 does not exist (latest on npm is 0.1.4 as of Oct 30, 2025)@arkade-os/sdk0.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.
* UI tweaks on refunded failed submarine swaps * lint * update dependencies * update dependencies
* 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.
Do not merge, requires arkade-os/boltz-swap#32 and release on new boltz-swap version.
Summary by CodeRabbit
New Features
Chores
Cleanup