* feat(protocol): Early Bitcoin refund
Alice can choose to let Bob refund his Bitcoin early (before TxCancel timelock expires)
* feat: Let Bob check for TxEarlyRefund
* fix: compile errors
feat(alice): if we cannot lock Monero within 2 minutes, early refund bitcoin
* satisfy clippy
* fix(gui): Emit tauri event when Bitcoin is early refunded
* tests progress
* rename AliceStates
* progress: working prototype!
* add unit tests for tx_early_refund construction (tx_early_refund_can_be_constructed_and_signed, tx_early weight check)
* fix compile error in swap/tests/alice_zero_xmr_early_refund.rs
* only make [`tx_early_refund_sig_bob`] optional in state machine, not message machine
* feat: working integration test alice_zero_xmr_early_refund.rs
* fix tests
* add changelog entry, add integration test with broken monero-wallet-rpc simulation
* amend
* amend changelog
* nitpick
* feat(gui): Bump MIN_ASB_VERSION to 2.0.0
* feat(bob): explicitly check for tx_early_rewfund
* refactor(bob): Assume tx_early_refund will not be published if timelock has expired
* add todo
* refactor
* refactor(swap): Differentiate between BtcRefundPublished, BtcEarlyRefundPublished, BtcEarlyRefunded and BtcRefunded
* refactor: move weight of tx_early into TX_EARLY_REFUND_WEIGHT const
* efactor(swap): Differentiate between BtcRefundPublished,BtcEarlyRefundPublished, BtcEarlyRefunded and BtcRefunded
* small refactors
* nitpciks
* dprint fmt
* add context to get_raw_transaction
* refactor: remove duplicated code in watch_for_redeem_btc, dprint fmt
* fix: parse -5 electrum transaction not found error correctly
* refactor: send btc_refund_finalized flag to tauri with BtcRefunded state
* remove uncessary .context
* dprint dfmt
* remove unused import
* refactor: explicitly mark state3.expired_timelocks(...) as transient error when locking Monero
* use .context instead of ok_or_else(...)
* fix: in get_raw_transaction also check for "missing transaction"
* add 4 different types of tauri events for different refund states
* display BobStateName.BtcEarlyRefunded as done state
* add global bottom to DialogContentText
* fix(gui): Add missing padding in SwapDialog
* proof of concept: electrum load balancer
* load balancer progress
* wrap Mutex<Vec<Arc<BdkElectrumClient<Client>>>> in electrum_balancer in another Arc, free locks as fast as possible
* refactor
* refactor(electrum balancer): use OnceCell to do lazy initilization
* tests
* refactor(electrum): enhance error handling with MultiError for comprehensive failure analysis
This commit introduces a robust MultiError system for the Electrum balancer that collects
and exposes all individual node failures, enabling better error analysis and decision making.
Key improvements:
- Add MultiError struct with methods for inspecting all collected errors from failed nodes
- Modify electrum_balancer::call() to return MultiError instead of single Error
- Enhance Client::get_tx() to properly detect transaction-not-found across multiple nodes
- Add call_async_with_multi_error() method for detailed async error analysis
- Improve error tracing and logging throughout the Bitcoin wallet operations
- Add comprehensive test coverage for MultiError functionality and edge cases
- Remove obsolete should_retry_on_error() logic in favor of MultiError inspection
The MultiError type maintains backward compatibility through automatic conversion to Error
while providing rich error analysis capabilities for callers that need detailed failure
information. This particularly improves handling of transaction-not-found scenarios where
different nodes may return different error formats.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add changelog entry for electrum node balancing
* refactors of electrum balancer
* only warn if .check_for_tx_early_refund fails
* clippy
* remove verbose message
* use AtomicUsize
* final touches
* log libp2p crates
* merge master
* display LinearProgressWithSubtitle as indeterminate if progress=100%
* let broadcast return a MultiError, log all libp2p crates
* nitpick
* make clippy happy
* log "kind" for join_all load balancer
* add kind to join_all method, show warning alert if alice takes a long time to redeem Bitcoin
* parse multierrors correctly
* fmt
---------
Co-authored-by: Claude <noreply@anthropic.com>
* task(gui): update to mui v5
* task(gui): use sx prop instead of system props
* task(gui): update to mui v6 and replace makeStyles with sx prop
* task(gui): update to mui v7
* task(gui): update react
* fix(gui): fix import
* task(gui): adjust theme and few components to fix migration introduced styling errors
* fix(gui): animation issues with text field animations
* fix(gui): remove 'darker' theme and make 'dark' theme the default
- with the new update 'dark' theme is already quite dark and therefore a 'darker' theme not necessary
- the default theme is set to 'dark' now in settings initialization
* feat(tooling): Upgrade dprint to 0.50.0, eslint config, prettier, justfile commands
- Upgrade dprint to 0.50.0
- Use sane default eslint config (fairly permissive)
- `dprint fmt` now runs prettier for the `src-gui` folder
- Added `check_gui_eslint`, `check_gui_tsc` and `check_gui` commands
* refactor: fix a few eslint errors
* dprint fmt
* fix tsc complains
* nitpick: small spacing issue
---------
Co-authored-by: Binarybaron <binarybaron@protonmail.com>
Co-authored-by: Mohan <86064887+binarybaron@users.noreply.github.com>
* feat(wallet): Use mempool.space as a secondary fee estimation source
* fix: warn if mempool client cannot be instantiated
* make clippy happy
* nitpick: rename clippy_check to clippy in justfile
* rename `estimate_fee_rate_from_mempool` to `estimate_fee_rate_from_histogram` for clarity
* dprint fmt
* make clippy happy
* change teacing level back to debug!
* change log levels
* refactors
* refactor: estimate_fee and min_relay_fee
* serde camel case
Co-authored-by: Byron Hambly <byron@hambly.dev>
* refactors
* Add comments, use Weight struct where possible
* fmt, fix testrs
* dont fallback to bitcoin::MAX, fail instead
* make mempool space optional
* fmt
* refactor: use estimate_fee(...) in max_giveable(...)
* refactor max_giveable(...)
* refactor max_giveeable to return fee as well, remove safety margin for fee
* fix compile
* fmtr
* fix(integration test): Use pre-calculated cancel / punish fees for assert_alice_punished
* fix(integration test): Use real fees for asserts
* sync wallet before transaction_fee call
* split send_to_address into sweep_balance_to_address_dynamic_fee
---------
Co-authored-by: Byron Hambly <byron@hambly.dev>
* refactor(gui): Simplify FeedbackDialog component and enhance feedback submission process
- Consolidated state management for feedback input using a custom hook.
- Improved user interface for feedback submission by including clearer instructions
- Removed redundant code and improved overall component structure for better maintainability.
* refactor(gui): Enhance FeedbackDialog layout and add mail link
* feat(gui): Add error handling in feedback submission
* feat(docs): Add brand identity to docs
* feat(docs): Add Send Feedback page
* feat(tauri): build base for log export feature
* feat(tauri): update save_txt_files to use HashMap for file content
* feat(gui): Implement log export functionality
* fix(gui): adjust feedback dialog link to show docs page with instructions for mail feedback
* fix(gui): minor style adjustments to export logs button
* feat(gui, tauri): enhance log export functionality to include zip file naming
* fix(docs): clarify docs section about exporting logs
* feat(gui): initialize selected swap in SwapSelectDropDown with most recent swap
* fix(gui): parse logs correctly for saving to log file
* fix(gui): ensure to use the most recent swap info by using a specialized hook
* fmr
---------
Co-authored-by: Binarybaron <binarybaron@protonmail.com>
* bump(rust): Toolchain to 1.82
* bump(tauri): Bump some Tauri peer-dependencies
* fix(gui): Prefer maker with known version, bump MIN_ASB_VERSION to 1.1.0-rc.3
* amend: CHANGELOG.md