85 Commits

Author SHA1 Message Date
binarybaron
3143a02d06
fix(asb): Check for updates in background (#215) 2024-11-29 20:37:33 +01:00
Einliterflasche
d9d12fabec
Merge pull request #214 from UnstoppableSwap/docs/fix-links
fix(docs): update links that pointed to docs/ to dev-docs/
2024-11-29 16:17:43 +01:00
einliterflasche
a333725577 remove sqlx cache data from git 2024-11-29 16:14:04 +01:00
einliterflasche
a67814868c update more links from docs/ to dev-docs/ 2024-11-29 16:11:40 +01:00
binarybaron
72d324780e
fix(gui): Only refund swaps in the background that haven't been refunded yet (#212) 2024-11-26 17:55:17 +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
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
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
a051cffb66
fix(swap): Disable verbose libp2p logging 2024-11-21 11:11:48 +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
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
binarybaron
81f41183ae
feat(asb): Change log level of rendezvous register logs to TRACE (#188) 2024-11-19 14:57:49 +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 6bf90eb28e00bedec042827b0354363e401bba02.
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
binarybaron
3085eee19f
feat(swap): Log tracing in rolling log files (#155)
We now log verbose messages to hourly rotating `tracing*.log` which are kept for 24 hours. General logs are written to `swap-all.log`.
2024-11-16 21:54:02 +01:00
unstoppableswap-botty
56102fa379
Prepare release 1.0.0-rc.2 (#179) 2024-11-16 13:01:44 +01:00
unstoppableswap-botty
38e07c9937
Prepare release 1.0.0-rc.1 (#175)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-15 14:51:07 +01:00
unstoppableswap-botty
afdf310890
Prepare release 1.0.0-alpha.3 (#174)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-15 00:26:07 +01:00
unstoppableswap-botty
2b47904120
Prepare release 1.0.0-alpha.2 (#171)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-14 19:33:15 +01:00
binarybaron
6f0d060263
feat(gui): Display progress of monero-wallet-rpc download (#170) 2024-11-14 19:20:45 +01:00
unstoppableswap-botty
2138f36f21
Prepare release 1.0.0-alpha.1 (#167)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-11-14 17:05:50 +01:00
binarybaron
9f4c28c9c4
fix(gui, windows): Hide monero-wallet-rpc console window (#161) 2024-11-14 15:02:08 +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
6b6737c056
feat(consensus): Increase refund window from 72 to 144 blocks (#130) 2024-11-13 19:53:17 +01:00
Binarybaron
ec25181581 fix(clippy): Use .expect(..) instead of unwrap 2024-11-13 16:16:33 +01:00
binarybaron
f1fabcf8e3
fix(asb): Accept cooperative redeem request in both AliceState::BtcPunishable and AliceState::BtcPunished (#156)
Alice will accept a cooperative redeem request in both `AliceState::BtcPunishable` and `AliceState::BtcPunished` states. This allows Bob to request a cooperative redeem even if `tx_punish` has not been confirmed yet.
2024-11-13 15:33:27 +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
8c3adbf1ab
feat(asb): Retry locking Monero (#143) 2024-11-10 17:51:05 +01:00
binarybaron
f3fbf80e28
fix(swap): Change default electrum testnet server (#144) 2024-11-09 16:04:28 +01:00
binarybaron
3c551c86b2
fix(dev-docs): Update links to dev-docs
The Github documentation has been moved from /docs to /dev-docs

Closes https://github.com/UnstoppableSwap/core/issues/129
2024-11-09 12:20:58 +01:00
Binarybaron
3aa12cf16a fix(dev-docs): Update links to dev-docs. The Github documentation has been moved from /docs to /dev-docs 2024-11-09 12:19:28 +01:00
binarybaron
bd3fca7e41
feat(gui): Allow to select from recently used monero addresses (#139)
* feat(gui): Allow user to select from recently used monero addresses in textfield
2024-11-09 12:11:00 +01:00
binarybaron
90584a211d
Revert "Prepare release 0.13.5 (#107)" (#121)
Reverts UnstoppableSwap/core#107 due to https://github.com/UnstoppableSwap/core/issues/95
2024-10-16 23:55:26 +02:00
Einliterflasche
c91adb3ac8
feat(tauri): Allow export of wallet descriptors (#118) 2024-10-15 14:22:35 +02:00
Einliterflasche
639f540876
feat(tauri): send tauri event on btc balance change (#113)
Closes #43. This PR creates a new event, which is emitted by the watcher daemon when the BTC balance changes. Then, on the guest side, we simply update the balance when this event is received.
2024-10-13 18:01:29 +02:00
binarybaron
ec86fa13cd
fix(tauri): Emit 'Initiated' progress event once swap lock is aquired (#112)
* fix(tauri): Emit 'Initiated' progress event once swap lock is aquired
2024-10-11 20:17:46 +06:00
binarybaron
83f831ccac
feat(gui, tauri): Accept --testnet flag, default to mainnet (#106)
This PR tackles #92 

- Add the `tauri-plugin-cli` (only on desktop)
- Check in the frontend if the `--testnet` flag is set. If it's set we pass `testnet=true` to the `initialize_context` command on invokation
- We add the `vite-plugin-top-level-await` to allow top level await in all browsers
- Remove the `bitcoin_confirmation_target` from settings for simplicity
2024-10-10 14:51:56 +02:00
unstoppableswap-botty
9e94dca7aa
Prepare release 0.13.5 (#107)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2024-10-09 18:53:11 +02:00
binarybaron
119b8714ef fix(tauri): Let watcher sleep even if we fail to get current swaps 2024-10-09 16:46:29 +02:00
binarybaron
8f33fe5b41
feat(tauri, gui): Send event on changes to details, timelocks and tx_lock confirmations (#100)
- Send event when new swap state is inserated into database. The event only has the `swap_id` attached. The frontend then sends a request to the `get_swap_info` command to retrieve the updated version
- Send event when the Bitcoin lock transaction gets a new confirmation 
- A new `watcher` daemon runs contineously and sends an event when the timelock updated. The event has the the `swap_id` and the timelock attached
- Display logs on `ProcessExitedPage` (if swap was stopped prematurely)
- Rename `CliLogEmittedEvent` to `TauriLogEvent`
- Apply env_filter to tracing terminal writer to silence logging from other crates
- Add `.env.*` files in `src-gui` to `.gitingore`

Closes #93 and #12
2024-10-09 15:06:57 +02:00
binarybaron
253e0b0cf6
feat(gui, tauri): Save settings in Tauri storage (#102)
- Implemented dual persistence strategy:
  - **User Settings**: Persisted across app restarts using `tauri-plugin-store`.
  - **Transient State**: Persisted across page reloads using `sessionStorage`.
- Added `settingsSlice` reducer for managing persistent user settings.
- Updated Redux store configuration to handle multiple persistence layers.
- Added a new Settings page in the GUI where users can specify custom Electrum RPC URLs for Bitcoin and Monero node URLs.
  - Users can input their preferred Electrum server (`ssl://host:port`) and Monero daemon (`http://host:port`).
  - Input fields include validation to ensure correct URL formats.
  - Settings persist across application restarts using Tauri's storage plugin.
  - A reset option is available to revert to default settings.
- Improved the Daemon Controller in the Help page:
  - Renamed `RpcControlBox` to `DaemonControlBox` for clarity.
  - Users can now start the daemon manually if it isn't running or has failed.
  - Added a "Restart GUI" button to apply new settings immediately.
  - Displayed the daemon's status within the controller.
- Upgraded Tauri and related plugins to stable version `2.0.0`:
  - Updated `tauri`, `tauri-build`, and `tauri-utils` to `2.0.0`.
  - Ensured compatibility with the latest stable release.
- Updated Tauri plugins to version `2.0.0`:
  - `tauri-plugin-clipboard-manager`
  - `tauri-plugin-shell`
  - Added new plugins:
    - `tauri-plugin-store` for settings persistence.
    - `tauri-plugin-process` to enable application relaunch.
- Deferred Context initialization until explicitly triggered from the frontend.
  - Moved Context setup from the `setup` function to a new `initialize_context` Tauri command.
  - Allows the application to start without immediately initializing the backend context.
  - Context initialization now considers user-provided settings for Electrum and Monero nodes.
- Introduced a `ValidatedTextField` component for form inputs with validation logic.
  - Provides immediate feedback on input validity.
  - Used in the Settings page for Electrum and Monero node URLs.
- If the user provides an override Monero remote daemon, we check if it reachable and on the correct network before starting the `monero-wallet-rpc`
- Changed `bitcoin_confirmation_target` type from `usize` to `u16`.
2024-10-08 12:57:01 +02:00
Einliterflasche
7b79ad6abe
feat(cli+tauri): Send logs from host to guest (#90)
* feat(tauri): send logs from cli to tauri

---------

Co-authored-by: binarybaron <binarybaron@unstoppableswap.net>
Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
2024-09-26 17:09:46 +06:00
binarybaron
97510a8619
refactor(gui): Swap state stepper to use Tauri events (#77)
Previously we used the data we fetched via the rpc (`GetSwapInfo` call, saved in redux in `rpc.swapInfos`) to decide what to display in the state stepper to the user. The state stepper is displayed at the bottom of the `SwapDialog`.

However, we are moving away from our depedence on periodic rpc calls and towards relying more and more on the events we receive from the Host (from Tauri). Our goal is to rely solely on the Tauri events for everything displayed about the currently running swap.

This PR includes the following changes:
- refactor the `SwapStateStepper` such that it relies only on the Tauri events
- emit two new Tauri events (`EncryptedSignatureSent`, `CancelTimelockExpired`) in the state machine
- correctly emit `BtcRefunded` Tauri event after Bitcoin refund transaction is published
- differentiate between `"Waiting for them to redeem the Bitcoin"` and `"Revealing encrypted signature to the other party"` on the `SwapStatePage` (content displayed in the center of the `SwapDialog`)
2024-09-23 03:31:24 +06:00
binarybaron
f91255ff76
feat(cli): Add span with swap_id to all logs caused by swap (#96)
* feat(cli): Add span with swap_id to all logs caused by swap
2024-09-23 00:56:25 +06:00
binarybaron
167e031172
feat(gui): Allow discovery of sellers via connecting to rendezvous point (#83)
We,
- add a new list_sellers Tauri IPC command
- we rename the Seller struct to AliceAddress to name clash
2024-09-19 00:40:51 +02:00