-
Notifications
You must be signed in to change notification settings - Fork 159
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
cln: Boltz auto-send #1366
cln: Boltz auto-send #1366
Conversation
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe recent updates primarily enhance the functionality and user interface of the Boltz swap feature within an application. Key improvements include the introduction of an "Auto Send" option, concurrent data fetching for efficiency, UI adjustments for better layout and information display, including QR codes, and the addition of necessary models and service methods to support these features. These changes aim to streamline the swap process and improve the overall user experience. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
15fb0a5
to
c4934f5
Compare
@coderabbitai review |
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (14)
- backend/controllers/shared/boltz.js (1 hunks)
- frontend/index.html (1 hunks)
- server/controllers/shared/boltz.ts (1 hunks)
- src/app/shared/components/ln-services/boltz/boltz-root.component.ts (2 hunks)
- src/app/shared/components/ln-services/boltz/swap-modal/swap-modal.component.html (2 hunks)
- src/app/shared/components/ln-services/boltz/swap-modal/swap-modal.component.ts (7 hunks)
- src/app/shared/components/ln-services/boltz/swap-status/swap-status.component.html (1 hunks)
- src/app/shared/components/ln-services/boltz/swap-status/swap-status.component.ts (1 hunks)
- src/app/shared/components/navigation/side-navigation/side-navigation.component.html (1 hunks)
- src/app/shared/models/alertData.ts (2 hunks)
- src/app/shared/models/boltzModels.ts (1 hunks)
- src/app/shared/services/boltz.service.ts (4 hunks)
- src/app/shared/services/consts-enums-functions.ts (1 hunks)
- src/app/shared/theme/styles/theme-mode-dark.scss (1 hunks)
Files not summarized due to errors (1)
- frontend/index.html: Error: Message exceeds token limit
Files skipped from review due to trivial changes (1)
- src/app/shared/services/consts-enums-functions.ts
Additional comments: 14
src/app/shared/components/ln-services/boltz/swap-status/swap-status.component.ts (1)
- 15-18: The introduction of
acceptZeroConf
,qrWidth
,screenSize
, andscreenSizeEnum
properties, along with the implementation ofOnInit
, are well-aligned with the PR's objectives to enhance the Boltz swap feature. The logic to adjustqrWidth
based on screen size is a thoughtful addition for improving UI responsiveness.src/app/shared/models/boltzModels.ts (1)
- 1-18: The addition of
BlockHeight
andBoltzInfo
interfaces is crucial for supporting the new auto send feature and enhancing the application's data handling capabilities for Boltz swaps. These interfaces are well-defined and align with the PR's objectives.src/app/shared/components/ln-services/boltz/swap-status/swap-status.component.html (1)
- 10-68: The adjustments made to the layout and the conditional rendering based on
acceptZeroConf
are well-implemented. These changes enhance the user interface by providing a more dynamic display of swap details and improving the QR code display logic based on screen size and address availability. This aligns with the PR's goal to improve the Boltz swap feature's user experience.src/app/shared/components/ln-services/boltz/boltz-root.component.ts (1)
- 72-90: Refactoring the
onSwap
method to useforkJoin
for concurrent fetching ofboltzInfo
andserviceInfo
is a significant improvement. This approach enhances performance by reducing waiting time for sequential HTTP requests. The error handling and dispatching of alerts are correctly implemented, ensuring that users are informed of any issues during the swap process. This change aligns with the PR's objectives to enhance the Boltz functionality.src/app/shared/components/navigation/side-navigation/side-navigation.component.html (1)
- 13-15: Adding
fxLayout="row" fxFlex="100" fxLayoutAlign="start center"
to the<span>
element within the side navigation component is a minor but effective change. It ensures consistent alignment and spacing for the navigation icons and text, contributing to a more polished and user-friendly interface.src/app/shared/services/boltz.service.ts (2)
- 18-27: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [11-24]
The addition of
BoltzInfo
to imports, the newboltzInfo
property, and theboltzInfoChanged
BehaviorSubject are well-implemented. These changes are essential for managing and broadcasting Boltz information throughout the application, supporting the new features introduced in this PR.
- 48-59: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [51-66]
The introduction of the
getBoltzInfo
method and the simplification of theserviceInfo
method are significant improvements. These methods enhance the service's ability to fetch and manage Boltz-related information efficiently. The modification of theswapIn
method signature to include theautoSend
parameter aligns with the PR's objective to introduce an auto send feature for swaps, ensuring that the application's backend can handle this new functionality correctly.src/app/shared/models/alertData.ts (1)
- 4-10: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [7-185]
The addition of
BoltzInfo
to the imports and its inclusion in theSwapAlert
interface are crucial for supporting the new features related to Boltz swaps. These changes enable the application to handle and display alerts related to Boltz information more effectively, enhancing the user experience and aligning with the PR's objectives.src/app/shared/components/ln-services/boltz/swap-modal/swap-modal.component.ts (1)
- 49-64: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [28-195]
The addition of the
boltzInfo
property, the introduction of theisAutoSendCompatible
boolean property, and the inclusion of anautoSend
control in the form are significant enhancements to theSwapModalComponent
. These changes effectively integrate the auto send feature into the swap modal, allowing users to automatically send swapped assets to a predefined address. The logic to determine compatibility with the auto send feature based on the Boltz version is a thoughtful detail that ensures backward compatibility. These modifications align well with the PR's objectives to streamline the swap process and improve the user experience.src/app/shared/components/ln-services/boltz/swap-modal/swap-modal.component.html (2)
- 35-40: The addition of the
mat-slide-toggle
for the "Auto Send" feature is correctly implemented and follows Angular and Material Design best practices. The conditional rendering based ondirection
andisAutoSendCompatible
ensures that the feature is displayed only when applicable, enhancing the user experience.- 96-96: The update to the
rtl-boltz-swap-status
component to bind[acceptZeroConf]
toinputFormGroup?.controls?.acceptZeroConf.value
is correctly implemented. This ensures that the component receives the correct value foracceptZeroConf
, allowing for accurate display and functionality within the swap modal.src/app/shared/theme/styles/theme-mode-dark.scss (1)
- 226-228: The addition of a
stroke
property to the.boltz-icon
class with the value of$primary-darker
is a good practice for maintaining consistency and ease of theme management. Ensure that the$primary-darker
variable is consistently used across the theme for similar purposes.frontend/index.html (2)
- 15-15: The addition of the CSS block introduces a comprehensive set of custom properties for styling. Ensure these styles are consistent with the existing design language of the application and test the UI across different browsers and devices for compatibility.
- 18-18: The inclusion of script tags for
runtime
,polyfills
, andmain
JavaScript modules is standard for Angular applications. Ensure that themain.js
module contains the necessary logic for the new auto-send feature and the bug fix implementation.
0e53a04
to
0429b9e
Compare
c4340a1
to
f0293c0
Compare
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.
The address is still shown if the swap is being paid internally, which makes the user think the swap still needs to be paid. Only show the lockup transaction in this case, which is included in the response:
- Added auto send option for Swap In - Checking compatiblity with v2.0.0 and above
f0293c0
to
9db447d
Compare
* rm .DS_Store * Add watchfrontenddev command for npm * Fix toggle issues in sidenav (pinning and on page refresh) * Add copy-to-clipboard fallback if navigator.clipboard is not available (#1336) * add copy-to-clipboard fallback if navigator.clipboard is not available * amend copy fallback * clipboard copy lint fixes and frontend build * fix: add missing boltz state `transaction.lockupFailed` (#1349) * fix: boltzd docs link (#1354) * exit gracefully (#1356) * allow for eclair updated relayed audit format (#1363) * feat: add boltz service to cln (#1352) * lint fix * Request Params Cleanup * cln: Boltz auto-send (#1366) * Bug-fix (CLN Boltz): Hide claim tx id and routing fee for non-zero conf reverse swap * cln: Boltz auto-send - Added auto send option for Swap In - Checking compatiblity with v2.0.0 and above * Test import fixes * Update help.component.ts (#1379) Fixed broken link under "Help" -> "Node Settings" * Backend config fix (#1382) * Updating Common Application Configuration * Fixed get RTL Conf * Update Application Settings * application and settings case change * Unified config models * Default node update * 2FA and Password reset * Final application settings update * Config Settings and Authentication case fixed * Node Setting Fix * Fiat currency Symbol fix * CLN: Fiat symbol fix * All: Fiat symbol fix * Update node settings * Services UI fix * CLN: Removed child node settings * All: Removed child node settings * Test fixes * mempool links for onchain information (#1383) * Tests fix Tests fix * UI for Block Explorer Configuration (#1385) * Bump fee with mempool information (#1386) * Mempool openchannel minfee (#1388) Open channel model block if min fee is higher * Show error on login screen if rune is incorrect and getinfo throws error (#1391) * cln: Removed channel lookup call for update policy (#1392) * ECL: On-chain Transactions, Invoice and Payments pagination (#1393) Done most of the UI changes to accommodate pagination on transactions, payments and invoices tables but true pagination cannot be implemented till total number of records are missing from the API response. Once the issue ACINQ/eclair#2855 is fixed, I will uncomment pagination changes in the frontend. * lnd: Onchain CPFP (#1394) - UTXO label bug fix - Warning on utxo label for "sweep" in text. * Bug fixes after testing * Testing bug fixes (#1401) * Bug fix 2: lnd: Link channel point to explorer and show fee on close channel too * lnd: explorer link on pending channels * Node lookup link on view channel peer pubkey * Testing bug fixes (#1402) * Bug fix 2: lnd: Link channel point to explorer and show fee on close channel too * lnd: explorer link on pending channels * Node lookup link on view channel peer pubkey * test fixes * ng update to v18.0.x * Updating install with --legacy-peer-deps --------- Co-authored-by: Grzegorz Kućmierz <[email protected]> Co-authored-by: lacksfish <[email protected]> Co-authored-by: jackstar12 <[email protected]> Co-authored-by: Kilian <[email protected]> Co-authored-by: Taylor King <[email protected]> Co-authored-by: Fishcake <[email protected]> Co-authored-by: Ant <[email protected]>
Summary by CodeRabbit