Commit graph

107 commits

Author SHA1 Message Date
Mohan
742acca444
chore(ci): add flatpak build (#398)
* chore(ci): add flatpak build

* fmt changelog
2025-06-12 13:04:56 +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
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
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
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
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
unstoppableswap-botty
3c7f863b3b
Prepare release 1.1.3 (#367) 2025-05-31 23:33:26 +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
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
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
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
unstoppableswap-botty
4f3447eaad
Prepare release 1.1.0-rc.2 (#326) 2025-05-19 00:33:12 +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
Raphael
3f4cbddf23
upgrade(swap): Concurrent syncing, bdk upgrade, refactors (#180)
* upgrade sqlx to 0.8, add bdk_wallet and bdk_electrum

The new dependencies are part of the bdk upgrade and
include the improved wallet code.
They, too, depend on sqlite3.
However, they use a newer version than we currently use via sqlx.
This necessitated the sqlx upgrade.
This entailed trivial changes (use Pool directly instead of pool.acquire()).
We might have to fix the CI as well, I kept getting compile
errors from the macro until I ran swap/sqlx_dev_setup.sh.

* move old wallet code to extra module

* fix fee estimation for old client

* bump bitcoin crate, add new wallet constructor

* remove unused old Client, move code around for better readibility

* make Wallet generic over Persister (database) and move more code around for readibility

* add script history, start reimplementing client methods

* update some imports

* cargo fmt

* Add comments, fix fee estimation, address generation and status_of_script

* redo state update and wallet sync

* fix bitcoin address validation and more imports, use Amount everywhere

* fix tx cancel, lock, punish, redeem, refund

* fix bitcoin::Address de-/serialisation

* fix more address validation

* fix more address parsing and validation, also some more imports

* cargo fmt

* fix wallet initialization, start wallet migration

* fail test instead of ignoring it

* perform full scan on creation, load from db if it exists

* add more wallet info, fix wallet initialization

* fix: default to null in config

* migrate from old wallet if needed

* change something

* fix some tests

* temporarily patch bdk_wallet and bdk_electrum

* fix more tests

* fix missing rustls

* asb: only start tor client if register_hidden_service=true in the config

* fix: use p2wsh_signature_hash instead of p2wpkh_signature_hash

* fix some bitcoin address parsing and fee rate parsing

* dprint fmt

* add bitcoin-harness to this project and update to the new bitcoin version

* fix max_givible again

* create electrum client separately from wallet, clean up some code

* add comment

* ignore .env.development

* log config file path on ./asb config

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

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

This reverts commit 14a5b4c348a109d2524657ffeba306422458ea44.

* upgrade to rust toolchain 1.81

* Use new bdk update for code from master

* fix

* remove

* fix: add empty .gitmodules file to fix Docker build

* fix: clean up submodule references

* fix: properly declare monero submodule with ignore flag

* fix(wallet, bdk): only reveal new address if absolutely necessary

* fix: private keys not loaded into bdk wallet

* refactor: sync wallet progress log

* dprint fmt

* refactor: move bitcoin-harness to outside repo

* refactor: remove redundant log message

* Display sync progress

* Remove redundant arg to  swap/tests/harness/mod.rs function

* fix: call rustls::crypto:💍:default_provider()

* dprint fmt

* refactor: remove debug code

* refactor: move old bdk wallet export to own function, clear log messages

* remove old migr for testnets (checksum mismatch), remove balance and stringified last revealed addresses from migration export

* use revalidate_network function, remove redundant drop

* Display progress of background tasks, TauriBackgroundProgressHandle struct

* fix: almost satisfy clippy

* fix: gen-bindings error

* feat: add BackgroundRefund background type

* feat: use builder pattern for constructing Bitcoin wallet

* dprint ftm

* sync electrum in seperate thread

* do not allow user to start sync while sync is in progress

* remove redundant log message

* display random buffer in AlertWithLinearProgress progress

* fix: use TauriContextStatusEvent.Available), dont show syncing wallet spinner if not syncing

* differentiate between TestWalletBuilder and WalletBuilder

* satisfy clippy

* remove custom BackgroundRefund event, move into background process architecture

* refactor

* dprint fmt

* progress: get unit tests compiling

* fix: bitcoin unit tests specify const values like sync_interval

* fix: get unit tests passing

* make clippy happy

* feat: display full sync progress, fix unit test import issues

* dprint fmt

* make clippy happy, use u32 for target_block and not usize

* always spawn tor for asb

* refactor: remove gen_background_progress_id and just use Uuid::new_v4()

* refactor(hooks.ts): clarify comment on useConservativeBitcoinSyncProgress

* fix typo

* refactor: do not let WalletBuilder take entire env struct

* dprint fmt

* refactor: remove default feature from workspace patch of bdk

* first try for concurrent syncing

* refactor: concurrent syncing

* fix(wallet.rs): Safely convert FeeRate from btc / kb to sats / kwu

* feat(wallet.rs): persist published Bitcoin transactions without requiring re-scan

This allows us to compute an updated Bitcoin balance without requiring a re-scan

* refactor(wallet.rs): use just 5 concurrent sync requests

* refactor: display snackbar error when Wallet refresh fails

* fix: add missing space

* dprint fmt

* refactor: fancy traits for the CumulativeProgress struct, allow limiting amount of callback calls

* make clippy happy

* dprint fmt

* refactor: clearly differntiate between SyncMutex and TokioMutex, use traits for converting to Arc<Mutex<_>>, move sync_ext into own moid

* fix: skip syncing if no spks in wallet

* fix: update bdk.sh to test migration from old wallet (pre 1.0.0 bdk) to new bdk

* fix: increase bitcoin_lock_confirmed_timeout in RegTest env to 5 minutes

* refactor: avoid usize where possible, create persistence only after full scan, transmit assumed_total for full scan to tauri, add some icons to progress displays

* make clippy happy

* fix(ci): change rust toolchain 1.81

* fix(cross compilation arm): use ring instead of aws-lc-rs

* fmt

* ignore failing rendezvous tests

* fix printing_status_change_doesnt_spam_on_same_status

* fix: given_bitcoin_address_network_mismatch_then_error test

* ignore list_sellers_should_report_all_registered_asbs_with_a_quote test

* feat: add tor icon

* refactor(wallet.rs): reorder struct by abstraction level

* refactor(bitcoin wallet): chunk size for syncing

* fix(integration tests): decrease sync interval to 3s

* fix(integration tests): parse_rpc_err method to take new bdk error, not old one

* add changelog entry

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
Co-authored-by: Mohan <86064887+binarybaron@users.noreply.github.com>
2025-05-18 22:54:03 +02:00
unstoppableswap-botty
0f2c406915
Prepare release 1.0.0-rc.21 (#318)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-15 19:39:53 +02:00
unstoppableswap-botty
75f48e35af
Prepare release 1.0.0-rc.20 (#315)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-14 21:07:29 +02:00
unstoppableswap-botty
66313ad91f
Prepare release 1.0.0-rc.19 (#305)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-04-28 17:03:18 +02:00
unstoppableswap-botty
3cf2337bfb
Prepare release 1.0.0-rc.18 (#304) 2025-04-28 15:52:48 +02:00
Raphael
e8084d65ec
feat(gui): Review logs before sending feedback (#301)
* add review buttons that open the attached logs before submitting feedback
* add redact switches to redact transaction id's from attached logs
2025-04-23 15:09:19 +02:00
Raphael
3fa31ba139
feat(gui): Tor toggle (#300)
* re-add tor info box, show switch for toggling tor

* add use_tor to TauriSettings, only initialize tor client when it's true

* add warning log message when not using tor client

* change the label text of the switch, fail to align switch with SettingsBox icons

* move Tor settings to SettingsBox
2025-04-22 16:36:09 +02:00
unstoppableswap-botty
ffe103cb49
Prepare release 1.0.0-rc.17 (#297)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-04-18 02:06:09 +02:00
Mohan
9ddf2daafe
feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291)
This diff introduces a new "approvals" mechanism that alters the swap flow by requiring explicit user intervention before the Bitcoin lock transaction is broadcast. Previously, the Bitcoin lock was executed automatically without any user prompt. Now, the backend defines `ApprovalRequestType` (e.g. a `PreBtcLock` variant with details like `btc_lock_amount`, `btc_network_fee`, and `xmr_receive_amount`) and `ApprovalEvent` (with statuses such as `Pending`, `Resolved`, and `Rejected`). The method `request_approval()` in the `TauriHandle` struct uses a oneshot channel and concurrent timeout handling via `tokio::select!` to wait for the user's decision. Based on the outcome—explicit approval or timeout/rejection—the approval event is emitted through the `emit_approval()` helper, thereby gating the subsequent broadcast of the Bitcoin lock transaction.

On the UI side, changes have been made to reflect the new flow; the modal (for example, in `SwapSetupInflightPage.tsx`) now displays the swap details along with explicit action buttons that call `resolveApproval()` via RPC when clicked. The Redux store, selectors, and hooks like `usePendingPreBtcLockApproval()` have been updated to track and display these approval events. As a result, the overall functionality now requires the user to explicitly approve the swap offer before proceeding, ensuring they are aware of the swap's key parameters and that the locking of funds occurs only after their confirmation.
2025-04-18 01:51:55 +02:00
unstoppableswap-botty
ab5f93ff44
Prepare release 1.0.0-rc.16 (#294) 2025-04-17 22:00:52 +02:00
unstoppableswap-botty
8d4f714015
Prepare release 1.0.0-rc.14 (#290)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-04-16 15:10:24 +02:00
Ian McKenzie
7debdeabb0 Run cargo fmt in src-tauri 2025-02-18 18:42:56 -08:00
unstoppableswap-botty
dfe1a28267
Prepare release 1.0.0-rc.13 (#259) 2025-01-24 02:54:38 +01:00
Mohan
c9d3536f36
fix(gui): Button to open data directory (#256) 2025-01-22 16:29:11 +01:00
Einliterflasche
9e27c6548b
docs: generally improve docs and add maker page (#242)
* improve introduction and installation docs

* add some maker documentation

* improve maker docs

* Add network section, explain multiaddr, move docker commands into table

* Finally fix src-gui/.gitignore

* Fix .env.development

* Refine cancel, refund, punish explanation

* Add to changelog

* Make donation addresses copyable

* Apply suggestions
2025-01-21 16:05:05 +01:00
unstoppableswap-botty
3e6b25a0c8
Prepare release 1.0.0-rc.12 (#252) 2025-01-16 11:46:02 +01:00
unstoppableswap-botty
27e8467ac5
Prepare release 1.0.0-rc.11 (#236) 2024-12-23 00:33:51 +01:00
unstoppableswap-botty
b7631d2d47
Prepare release 1.0.0-rc.10 (#226) 2024-12-05 17:16:15 +01:00
Binarybaron
23ccee1436 Revert "Prepare release 1.0.0-rc.9 (#224)"
This reverts commit e11dbed14d.
2024-12-05 16:51:37 +01:00
unstoppableswap-botty
e11dbed14d
Prepare release 1.0.0-rc.9 (#224) 2024-12-04 18:48:42 +01:00
unstoppableswap-botty
1dca3b852b
Prepare release 1.0.0-rc.8 (#223)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-12-04 16:23:29 +01:00
binarybaron
d53c12d64e
feat(asb, cli): Listen on onion address, dial onion addresses (#203)
This pull requests
- Adds rust native support for the `asb` to listen on an onion service. Previously we were depedent on a seperately running `torc` client. Instead we now use [arti](https://tpo.pages.torproject.net/core/arti/), a rust implementation of the tor protocol.
- Removes the `tor.control_port` and `tor.socks5_port` property from the config of the `asb`
- Adds a new `tor.register_hidden_service` boolean property to the config of the `asb` which when enabled automatically runs a hidden service at startup
- Adds a new `tor.hidden_service_num_intro_points` config property to specify how many introduction points to register the onion service at
- Adds support for the `cli` to dial onion addresses

This is dependent on https://github.com/umgefahren/libp2p-tor/pull/24

Closes https://github.com/UnstoppableSwap/core/issues/16
2024-12-03 21:24:33 +01:00
binarybaron
0f32ad195f
feat(gui): Release .deb binaries, allow auto updater to function with deb installations (#219) 2024-12-02 15:02:04 +01:00
binarybaron
13b3ecc638
feat(gui): Enforce minimum window size (#216) 2024-11-29 20:42:35 +01:00
binarybaron
82631a39d7
fix(gui): Do not release .deb binaries 2024-11-26 15:05:54 +01:00
unstoppableswap-botty
9b4e8540b5
Prepare release 1.0.0-rc.7 (#210)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-26 14:57:32 +01:00
Binarybaron
bdb406a299 bump: sysinfo to 0.32.1, tauri deps to latest 2024-11-26 14:04:22 +01:00
Binarybaron
6684082736 feat(gui): Release .deb release binaries 2024-11-26 13:31:19 +01:00
unstoppableswap-botty
92f6efc34b
Prepare release 1.0.0-rc.6 (#200)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-21 11:20:51 +01:00
binarybaron
6cd228fada
feat(swap): Use art_client to dial over Tor (#196)
- Upgrade `sqlx` to `0.8`
- Use `arti_client@0.24` in combination with [`libp2p-community-tor`](https://crates.io/crates/libp2p-community-tor/0.4.1). https://github.com/umgefahren/libp2p-tor/pull/18 was required for this.
- Display spinner in GUI while Tor circuits are being established
- Remove unused dependencies (`once_cell`, `tauri-plugin-devtools`, `digest`, `hyper`, `itertools`, `erased_serde`)
- Bundle roboto font from npm registry
2024-11-21 01:00:36 +01:00
unstoppableswap-botty
d0108fd857
Prepare release 1.0.0-rc.5 (#195)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-19 17:28:21 +01:00
unstoppableswap-botty
56363da214
Prepare release 1.0.0-rc.4 (#187) 2024-11-17 17:07:38 +01:00
binarybaron
82c4b600c8
fix(ci): Use ubuntu-22.04 to build GUI, enable preview builds, revert 1.0.0-rc.3 (#185)
* fix(ci): Use ubuntu-22.04 to build GUI

* Revert "Prepare release 1.0.0-rc.3 (#184)"

This reverts commit 6bf90eb28e.
2024-11-17 12:42:57 +01:00
unstoppableswap-botty
6bf90eb28e
Prepare release 1.0.0-rc.3 (#184)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-17 12:21:38 +01:00