* feat(gui): Monero wallet
* progress
* refactor
* progress, dont delete wallet, re-fetch approvals and background periodically
* show transaction history correctly
* Enable fetching tx hashes
* Try add the wallet listener event callbacks, not working
* fix: Redeem XMR to internal main wallet, not temp wallet
* type safety
* refactoring of callback system
* make free floating functions generic
* refactor: Format files
* refactor(gui): Split wallet components and redesign balanceOverview component
* refactor(gui): Add action buttons and transaction section
* wrapper event listener
* progress, compiles
* works!
* WORKS! Event received on balance change
* refactor: format and slight refactorings and comments
* refactor(gui): Start with implementation of send dialog
- new number input
- new button variant and size
* add @tauri-apps/plugin-dialog
* feat(gui): Add permissions for file dialog
* fix(monero-harness): Compile issue
* feat(gui): Extract seed from Monero wallet and use for derivation, allow opening existing wallet file
* feat(gui): Always refresh the approval list from frontend when resolving
* fix(monero-rpc-pool): Implement Into<String> for ServerInfo
* fix(monero-sys): Use oneshot channel for all wallets
* feat(gui, monero-sys): Display recently opened wallets
* small refactors
* fix(gui): Enable background_sync, display temp "Loading..." if values are null
* feat(gui): Remove headers from pages, show selected navigation item
* feat(gui): Explicitly tell user if no swaps have been made yet
* feat(gui): send sync and history updates
* feat(gui): Fetch monero wallet details when context becomes availiable
* feat(gui): Display Monero primary address without modal
* feat(gui): Make "swap" button on wallet page take you to "/swap"
* feat(gui): Rework send modal, adjust number input, added send to field
* feat(gui): set block restore height, not working
* refactor(gui): Optimize number input and add support for switching between currency
* feat(gui): Display real fiat currency prices in send modal
* feat(gui): Add error message for too high send amount
* feat(gui): Modern UI for SeedSelectionDialog
* feat(gui): Wrap MoneroWalletActions
* wip
* refactoring approval callback
* feat(gui): Send Direction of Transaction in History to Frontend
* feat(gui): Let user approve transaction before publishing
* feat: Display 8 digits for Monero amounts by default
* feat(monero-sys): Store pending (non published) transactions in Mutex map inside wallet thread
This allows seperating signing and publishing transactions cleanly
* dprint fmt
* fix(gui): Refresh Monero wallet history C++ struct before serializing
* feat(monero-rpc-pool): Fail after three JSON-RPC errors
* feat(monero-sys): Add wrapper around verify_wallet_password
* feat(gui): Allow opening password-protected Wallets
* refactor: fmt, remove receive button
* fix(gui): Convert to XMR before converting into Fiat
* feat(gui): Add dialog for setting restore height
* feat(gui): block height can be changed, blocks when too low
* refactor(monero-sys): Remove old WalletListener code
* feat(gui): Continually ask for user to select wallet and enter password, if user rejects, offer to select different wallet
* refactor(swap): Extract "select Monero wallet" into own function
* refactor(tauri): Dont kill monero-wallet-rpc
* refactor(tauri): Avoid multiple concurrent Contexts starting
* refactor: Change "Cancel" to "Change wallet" on PasswordEntryDialog
* feat(gui): show curent block height, fix blockage
* Cargo.lock update
* refactor(monero-sys): Use match instead of is_err() and expect(...)
* refactor: better context for WalletHandle constructor method errors handling
* refactor(monero-sys): Common open_with<F>(path: String, daemon: Daemon, wallet_op: F) function
* feat: check empty password before requeston password for wallet
* feat: Remove "Checking for available remote nodes" from frontend
* feat(gui): Allow sweeping entire Monero balance
* feat(monero-rpc-pool): Keep alive TCP connections, do not record JSON-RPC errors as failure if >=3 nodes failed
If >=3 nodes failed we assume it was an actual issue on our side, not an issue with the node
* refactor(swap): Remove dead code
* add comment to WalletHandleListener::on_refreshed{...}
* feat(gui): show current block height in the field
* refactor: remove unused UserCancelledError;
* refactor: No Arc<Mutex<_>> for Pending TXs map
* refactor: remove redundant } catch (error) {
* feat: add our new crates to `OUR_CRATES` in tracing util
* fix(gui): Add math.ceil to piconero conversion to ensure integer
* fix(gui): Close menu when option is clicked
* review and improve/reduce uses of unsafe, also remove unique_ptr wrapper around TransactionHistory to avoid double free
* fix(gui): Use monero amount from units.tsx
* fix(gui): Use PromiseInvokeButton for simplification for approving of send transaction
* update comment, rename function
* refactor(gui): Fix alignment of amounts
* refactor(gui): Remove sending and refreshing states from wallet
* fix(cli, gui): use old seed flow on no tauri, fix minor issues in gui
* fix: use the new named function
* refactor(gui): Add skeletons for monero wallet when still loading
* refactor(gui): Remove isLoading from wallet slice
* feat(gui): Add success dialog after send transaction was approved
* fix(gui): Floor piconero amount in sendMoneroTransaction
* feat(gui): Allow view on explorer button on send success modal
* feat(backend): save the wallet state on events
* fix(structure): move throttle into its own crate
* fix(log): remove spammy logs
* fix(logs): log folder in confid
* remove "sync progress: " log
* small refactors
* save wallet at most every 60s
* remove useless logs
* underscore unused variables
* feat(gui): Add timestamp of the tx
* feat(gui): Add the legacy wallet init option
* legac ybutton
* Fix(gui, asb): reverse the log config
remove log in bridge.h
cleanup
* use none for .store(..)
* display dot for running swap
---------
Co-authored-by: Maksim Kirillov <maksim.kirillov@staticlabs.de>
Co-authored-by: b-enedict <benedict.seuss@gmail.com>
Co-authored-by: einliterflasche <einliterflasche@pm.me>
* feat(swap): Allow discovery at multiple rendezvous points, request quotes from locally stored peers
- Ensure uniqueness of the peer_addresses table (no duplicate entries)
- Add peer to local database even if we just request a quote, and no swap (call to list_sellers)
- Refactor list_sellers to take multiple rendezvous points
- Allow db to be passed into list_sellers, if so request quote from all locally stored peers
* feat: editable list of rendezvous points in settings, new maker box on help page
* Recover old commits
* fix small compile errors due to rebase
* amend
* fixes
* fix(gui): Do not display "Core components are loading..." spinner
* fix(gui): Prefer makers with m.minSwapAmount > 0 BTC
* feat(cli, gui): Fetch version of maker
* feat: display progress bar
* 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>
* 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>
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.