Bitcoin–Monero Cross-chain Atomic Swap
Find a file
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
.cargo feat(asb + cli): Redact logs + unify tracing infrastructure (#1733) (#55) 2024-09-01 18:13:43 +02:00
.github fix(ci): update our ci toolchain to resolve toolchain conflicts 2025-02-27 18:52:28 +01:00
.vscode release(gui): 1.0.0 alpha.1 (#125) 2024-10-22 13:22:46 +02:00
dev-docs docs: Add backup rendezvous server to maker documentation (#277) 2025-03-17 15:16:59 +01:00
dev_scripts dev: Add code2prompt scripts to extract entire codebase into single file (#285) 2025-04-15 14:59:38 +02:00
docs docs: generally improve docs and add maker page (#242) 2025-01-21 16:05:05 +01:00
monero-harness chore(monero, monero_harness): bump tracing-subscriber to 0.3 2024-08-28 12:18:58 +02:00
monero-rpc feat: cargo project at root 2024-08-08 00:49:04 +02:00
monero-wallet chore(monero, monero_harness): bump tracing-subscriber to 0.3 2024-08-28 12:18:58 +02:00
src-gui feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291) 2025-04-18 01:51:55 +02:00
src-tauri feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291) 2025-04-18 01:51:55 +02:00
swap feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291) 2025-04-18 01:51:55 +02:00
utils/gpg_keys feat: cargo project at root 2024-08-08 00:49:04 +02:00
.gitignore refactor(swap): Upgrade libp2p to 0.53.2, reliable retry mechanisms (#109) 2024-11-11 00:14:42 +01:00
Cargo.lock feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291) 2025-04-18 01:51:55 +02:00
Cargo.toml feat: cargo project at root 2024-08-08 00:49:04 +02:00
CHANGELOG.md feat(gui): Approve dialog before publishing Bitcoin lock transaction (#291) 2025-04-18 01:51:55 +02:00
CONTRIBUTING.md feat: cargo project at root 2024-08-08 00:49:04 +02:00
Dockerfile fix(Dockerfile): Use swarm base debian version for builder and executor 2024-11-15 01:18:14 +01:00
dprint.json feat(gui, tauri): Accept --testnet flag, default to mainnet (#106) 2024-10-10 14:51:56 +02:00
LICENSE feat: cargo project at root 2024-08-08 00:49:04 +02:00
README.md docs: Refer to maker/taker docs on main page 2024-12-04 00:22:09 +01:00
rust-toolchain.toml fix(ci): upgrade rust toolchain to 1.80 2025-02-27 19:10:57 +01:00

UnstoppableSwap

This is the monorepo containing the source code for all of our core projects:

  • swap contains the source code for the main swapping binaries, asb and swap
  • gui contains the new tauri based user interface
  • tauri contains the tauri bindings between binaries and user interface
  • and other crates we use in our binaries

If you're just here for the software, head over to the releases tab and grab the binary for your operating system! If you're just looking for documentation, check out our docs page or our github docs.

Join our Matrix room to follow development more closely.

Screenshot 2024-11-21 at 6 19 03 PM