Commit graph

3198 commits

Author SHA1 Message Date
Mohan
a654ee43f5
docs(maker): document new electrum and fee options (#401) 2025-06-12 13:08:32 +02:00
Mohan
c12742c77b
fix(tests): Electrum balancer unit test (#399) 2025-06-12 13:06:05 +02:00
Mohan
742acca444
chore(ci): add flatpak build (#398)
* chore(ci): add flatpak build

* fmt changelog
2025-06-12 13:04:56 +02:00
Mohan
835552c834
docs: add Tauri signature verification guide (#396)
* docs: add Tauri signature verification guide

* fix
2025-06-12 11:00:57 +02:00
unstoppableswap-botty
1b3fb6730e
Prepare release 2.0.0-beta.2 (#394)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-06-11 21:27:23 +02:00
Mohan
0ac4bbabe3
fix(bob): Only warn if .expired_timelock(..) check fails in BtcLocked state (#393) 2025-06-11 21:12:21 +02:00
unstoppableswap-botty
1fed703b22
Prepare release 2.0.0-beta.1 (#392)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-06-11 20:48:29 +02:00
Mohan
07f935bfbc
feat(protocol): Early Bitcoin refund (#344)
* 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>
2025-06-11 20:40:16 +02:00
наб
8aad1bdf75
Reduce final useAppSelector((s) => s.settings.X) to useSettings((s) => s.X) (#390) 2025-06-08 01:55:29 +02:00
b-enedict
430a22fbf6
refactor(gui): Update MUI to v7 (#383)
* 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>
2025-06-06 22:31:33 +02:00
Mohan
2ba69ba340
fix(asb): send zero quote on failure (#379)
* fix(asb): send zero quote on failure

* static function for BidQuote::ZERO
2025-06-06 15:02:31 +02:00
Binarybaron
119db50c11 amend: event_loop.rs quote failure logging 2025-06-05 00:17:01 +02:00
Raphael
3b3bea8531
feat(asb): Take ongoing swaps into consideration when crafting quote (#245)
* Subtract monero that is reversed for ongoing swaps from the quote volume

* Also reserve monero tx fee

* dprint fmt

* Add todo for better XMR management

* fix dprint lint

* Warn instead of fail, default to 0 quote when reserved funds exceed monero balance

* Add more information to warning

* Add changelog entry

* feat(monero-sys): Initial commit. Regtest integration test. Wrapper around basic Wallet functions, depends on monero#9464

* merge master, extract logic into unreserved_monero_balance

* fmt

* remove shit

* revert

* refactor

* make clippy happy, add comments

* Split code into smaller portions, add unit tests

* refactor, add unit tests

* fmt

* reorder functions

* fix compile error, max timeout of 10s for mutex lock

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-06-05 00:15:42 +02:00
unstoppableswap-botty
b49b5bdbd6
Release version 1.1.7 (#377)
* Prepare release 1.1.7

* amend: CHANGELOG

---------

Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-06-04 16:36:37 +02:00
Mohan
b6bfc2e128
fix(monero): Conservative Monero fee for max giveable calcuation (#376)
Increased from 0.000016 XMR to 0.003 XMR
2025-06-04 16:32:32 +02:00
unstoppableswap-botty
708dee16c9
Prepare release 1.1.4 (#375)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-06-04 14:03:10 +02:00
Binarybaron
0307fa6f59 dprint fmt 2025-06-03 11:09:50 +02:00
Mohan
63de5d407d
refactor(wallet): Optimize Bitcoin timelock subscriptions for BDK upgrade (#374) 2025-06-03 11:06:51 +02:00
unstoppableswap-botty
3c7f863b3b
Prepare release 1.1.3 (#367) 2025-05-31 23:33:26 +02:00
Binarybaron
f7529b8b5c amend: Add changelog entry for --trace flag 2025-05-31 13:16:19 +02:00
Mohan
a33ebfbb3a
feat(asb): add trace flag for stdout (#366)
* fix(asb): include trace option in raw arguments

* feat(asb): Add --trace flag
2025-05-31 13:09:46 +02:00
Mohan
274c630aba
fix(swap): tx_lock_spending_fee was estimated to be zero if utxos less than dust limit (#363)
* fix(swap): tx_lock_spending_fee was estimated to be zero if we had less funds than dust limit

* fix
2025-05-28 17:43:27 +02:00
Mohan
091ba57547
feat(wallet): Use mempool histogram for fee estimation (#358)
* 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>
2025-05-27 15:41:24 +02:00
b-enedict
854b14939e
feat(gui): Feedback quick fixes (#331)
* 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>
2025-05-27 12:55:20 +02:00
Mohan
60d2ee9f7e
docs(dev): switch test instructions to nextest (#361) 2025-05-27 11:05:49 +02:00
Binarybaron
0515f4e6ec fix(dprint): Ignore .git folder 2025-05-26 21:05:28 +02:00
Binarybaron
96b61d33c6 fix(monero wallet): Properly delete temporary monitoring wallet 2025-05-26 21:04:52 +02:00
Binarybaron
80ea9a60a9 fix(monero wallet): Check if wallet already exists by JsonRpcError Error Code 2025-05-26 19:02:17 +02:00
Mohan
e1a053a6fc
feat(cli): remove monitoring wallet on startup (#360) 2025-05-26 18:49:10 +02:00
Mohan
e316567e03
fix(gui): update feedback GitHub issue link (#359) 2025-05-25 23:47:45 +02:00
Mohan
2133e33ca1
feat(asb, cli): Add safety margin to chosen Bitcoin fee for pre-signed transactions (#355) 2025-05-24 22:25:05 +02:00
unstoppableswap-botty
24a011d411
Release version 1.1.2 (#354)
* Prepare release 1.1.2

* amend: Add changelog for increase in allowed Bitcoin fee

---------

Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-05-24 20:47:02 +02:00
Mohan
7f72779680
Increase Bitcoin lock tx fee limit (#349) 2025-05-23 01:08:03 +02:00
Mohan
65f6761c5e
docs: add PR title examples (#350) 2025-05-23 00:53:48 +02:00
Mohan
8d0af2f8b7
refactor(cli): Remove obsolete RPC server (#346) 2025-05-21 18:43:02 +02:00
Mohan
7ef8b1c643
Update docs for external bitcoin address (#341)
* docs: document external address option

* amend: dprint fmt
2025-05-21 09:44:08 +02:00
Mohan
c2fea91390
Fix use of TempDir::keep (#336) 2025-05-21 09:07:27 +02:00
unstoppableswap-botty
840edc3d9e
Prepare release 1.1.1 (#338)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-20 15:11:34 +02:00
Mohan
96eba3f224
docs: add repo overview (#337) 2025-05-20 14:59:37 +02:00
Mohan
0e25cb86f0
fix(swap): Add retry logic for Bitcoin wallet sync (#333) 2025-05-20 14:21:39 +02:00
Raphael
2e2759a318
Add justfile (#335) 2025-05-20 14:18:33 +02:00
Raphael
c4fb2cbd48
feat: log enviroment info (#332) 2025-05-20 12:57:57 +02:00
unstoppableswap-botty
01bac41625
Prepare release 1.1.0 (#329) 2025-05-19 14:52:27 +02:00
Mohan
e66881d6eb
fix: Issues with 1.1.0-rc (#328)
* 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
2025-05-19 12:43:27 +02:00
unstoppableswap-botty
0c4de7e4cd
Prepare release 1.1.0-rc.3 (#327)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-19 01:20:54 +02:00
Binarybaron
2b285f482a revert: delete rc.1, rc.2 releases 2025-05-19 01:18:22 +02:00
Binarybaron
8d048fe420 amend: add comma after new package.json entry 2025-05-19 01:17:33 +02:00
unstoppableswap-botty
4f3447eaad
Prepare release 1.1.0-rc.2 (#326) 2025-05-19 00:33:12 +02:00
Binarybaron
5752676629 fix(ci): Extract gen-bindings-verbose from gen-bindings 2025-05-19 00:11:21 +02:00
unstoppableswap-botty
008260a839
Prepare release 1.1.0-rc.1 (#325)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-18 23:02:19 +02:00