Commit graph

105 commits

Author SHA1 Message Date
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
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
e316567e03
fix(gui): update feedback GitHub issue link (#359) 2025-05-25 23:47:45 +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
Binarybaron
8d048fe420 amend: add comma after new package.json entry 2025-05-19 01:17:33 +02:00
Binarybaron
5752676629 fix(ci): Extract gen-bindings-verbose from gen-bindings 2025-05-19 00:11:21 +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
Binarybaron
8ec58dcb1e fix(gui): Fetch alerts only once 2025-05-15 18:26:23 +02:00
b-enedict
31e68b2671
feat(gui): Add a Introduction for new users (#287)
* feat(gui): add IntroductionModal component

* feat(gui): add interactivity to IntroductionModal

* feat(gui): create SlideTemplate component for IntroductionModal Slides

* feat(gui): add generic slides to IntroductionModal with images and content

* feat(gui): add Slide with SwapStatusAlert to IntroductionModal

* feat(gui): show the introduction only on the first app start

* feat(gui): make external links functional

* fix(gui): update github link to link to active repo

* feat(gui): replace old images with new mockups and update Slide05 content

* feat(gui): add CardSelectionGroup and CardSelectionOption components for improved card selection UI

* feat(gui): add FiatPricePreference slide to IntroductionModal

* feat(gui): save user preference regarding fiat prices

I set the initial store configuration for fetching fiat prices to false to avoid any calls to coingecko without user consent

* refactor(gui): remove old Slide05 component for improved codebase maintenance

* fix(gui): add UnstoppableSwap logo to FiatPricePreference slide

* refactor(gui): update image imports and improve slide content for introduction modal

* fix(gui): introduce ExternalLink component and update Slide05 to use it for external navigation

* fix(gui): replace webp images for introduction with svg mockups for improved quality

* fix(gui): change order of introduction slides, to asking for fiat price preference at the end

* refactor(gui): implement CardSelectionContext for managing card selection state

* refactor: texts in intro modakl

* fix(gui): update currency fetching SVG for improved design and clarity

* feat(gui): added changelog entry for introduction

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-05-07 12:44:29 +02:00
Mohan
01f1e6f218
fix(gui): Feedback submit payload 2025-04-28 16:58:51 +02:00
Mohan
53a994e6dc
feat(gui): Display developer responses to feedback (#302) 2025-04-28 13:12:43 +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
Mohan
75f37a987b
fix(gui): Accept integrated Monero addresses 2025-04-18 02:01:25 +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
Raphael
24cfa71932
cli: log the reason we can't find tx_cancel (#289)
* cli: log the reason we can't find tx_cancel

When we can't find tx_cancel even though the cancel timelock
expired, we publish it ourselves.

However, some users had a problem where the tx_cancel wasn't
found even though it was already published.
This leads to the cli getting stuck in `CancelTimelockExpired`
when it should go to `BtcCancelled`.
This commit introduces an additional log statement that will
help us narrow down why that is.

* gui: update the documentation icon
2025-04-16 13:44:37 +02:00
Einliterflasche
012131c267
gui: add an icon that links to the documentation 2025-03-14 12:38:04 +01:00
Raphael
315272b50d
gui: update social media links (remove reddit, discord; add matrix) (#273) 2025-02-28 21:14:23 +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
Einliterflasche
799eb15411
GUI: warn against replace-by-fee for deposit transactions (#243)
* add alert in deposit page to warn against replace-by-fee
2025-01-07 12:15:43 +01:00
binarybaron
cf20891638
fix(gui): Fetch balance after swap is released, re-fetch database after progress event, change wording in progress page (#237) 2024-12-23 11:59:40 +01:00
Binarybaron
fd953b201b fix(gui): Incorrect entry in yarn.loc 2024-12-04 18:18:43 +01:00
Binarybaron
2a14add01a fix(gui): Incorrect entry in yarn.loc 2024-12-04 18:14:25 +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
e336051c1b
feat(gui): Display markup on "waiting for bitcoin deposit page" (#209)
* feat(gui): Display markup on "waiting for bitcoin deposit page"
* feat: Enable fetching of fiat rates by default
2024-11-26 14:18:20 +01:00
Binarybaron
bdb406a299 bump: sysinfo to 0.32.1, tauri deps to latest 2024-11-26 14:04:22 +01:00
binarybaron
b2e74df37e
feat: Maker avatar (#205)
- GUI: Changed terminology from "swap providers" to "makers"
- GUI: For each maker, we now display a unique deterministically generated avatar derived from the maker's public key
2024-11-25 20:15:09 +01:00
binarybaron
689dd89e72
feat(swap): Start wallets and tor client in parallel (#198)
CLI + GUI: At startup the wallets and tor client are started in parallel. This will speed up the startup time of the application.
2024-11-21 01:51:19 +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
binarybaron
5192114d6d
feat(gui): Build vite frontend using mode=production (#192) 2024-11-19 16:25:58 +01:00
Binarybaron
c5958c4dc1 fix(gui): If two asbs have the same relevancy score, sort by price 2024-11-19 16:25:01 +01:00
binarybaron
d953114c49
refactor(gui): Seperate background refresh logic (#193) 2024-11-19 15:03:55 +01:00
binarybaron
b409db35d0
fix(gui): Update Discord invite link (#190) 2024-11-19 14:58:03 +01:00
binarybaron
aa81f3c588
feat(gui): Switch to up-to-date asb, if current one is outdated (#189) 2024-11-17 23:14:36 +01:00
binarybaron
58800a5b53
feat(gui): Allow providers discovered via rendezvous to take priority (#177) 2024-11-16 12:29:02 +01:00
binarybaron
aca0d6aa74
feat(gui): Show up to 16 characters of peer id of asb (#176) 2024-11-16 12:28:09 +01:00
Binarybaron
826217c323 fix(gui): Start context as soon as we have a valid node for each blockchain 2024-11-15 00:14:54 +01:00
binarybaron
6f0d060263
feat(gui): Display progress of monero-wallet-rpc download (#170) 2024-11-14 19:20:45 +01:00
binarybaron
3540a029bd
feat(gui): Refer to external Github release page when download is ready (#169) 2024-11-14 19:02:10 +01:00
binarybaron
163f6fa94d
feat(gui): Connect to preset rendezvous nodes at startup (#162) 2024-11-14 17:04:27 +01:00
binarybaron
7ebe59bc8d
feat(gui): Deprioritize asbs running below 1.0.0-alpha.1 (#163) 2024-11-14 17:03:09 +01:00
binarybaron
e46be4a9ff
feat(gui): Refund swap in the background (#154)
Swaps will now be refunded as soon as the cancel timelock expires if the GUI is running but the swap dialog is not open.
2024-11-14 14:20:22 +01:00
binarybaron
4cf5cf719a
feat(gui): Display timelock status using a timeline (#153) 2024-11-14 13:33:20 +01:00
Einliterflasche
3e79bb3712
feat(GUI): Add settings for theme, fiat currency and remote nodes (#128) 2024-11-13 22:51:47 +01:00
binarybaron
eac435aba6
feat(gui): Display state page for inflight swap setup (#158)
We now display a "Starting swap with provider to lock ... BTC" page when the Bitcoin have been deposited and the swap setup is inflight.
2024-11-13 20:18:13 +01:00
binarybaron
c027e51087
refactor(swap): Upgrade libp2p to 0.53.2, reliable retry mechanisms (#109)
Our libp2p version is out of date, and we need to tackle the upgrade even though it's a significant undertaking. This'll also fix some other [issues](https://github.com/UnstoppableSwap/core/issues/95).

## This PR includes the following changes:
- Breaking network protocol change: The libp2p version has been upgraded to 0.53 which includes breaking network protocol changes. ASBs and CLIs will not be able to swap if one of them is on the old version.
- ASB: Transfer proofs will be repeatedly sent until they are acknowledged by the other party. This fixes a bug where it'd seem to Bob as if the Alice never locked the Monero. Forcing the swap to be refunded.
- CLI: Encrypted signatures will be repeatedly sent until they are acknowledged by the other party
- CLI+ASB: Libp2p network errors in request-response protocols are now propagated throught the event loop channels. This allows the caller to retry if an error occurs (e.g timeout)

Closes https://github.com/UnstoppableSwap/core/issues/101, https://github.com/UnstoppableSwap/core/issues/95
2024-11-11 00:14:42 +01:00
binarybaron
a116c27785
feat(gui): Use inbuild LazyStore feature of @tauri-apps/plugin-store (#150) 2024-11-10 20:46:24 +01:00
binarybaron
1867b009b9
fix(gui): Hide manual cancel and refund button (#142)
We no longer show the manual cancel and refund button. This functionality is currently not implemented in the GUI. The state machine should resume the swap as well. The functionality can be added back later.
2024-11-09 12:27:57 +01:00
binarybaron
3614b9f9d2
fix(gui): Link to github docs should be /dev-docs instead of /docs (#140) 2024-11-09 12:16:57 +01:00