Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4c8bee
add cooperative redeem key export to asb-controller, add XmrCooperati…
Einliterflasche Sep 11, 2025
7bd6659
remove state XmrCooperativelyRedeemable, go to BtcRedeemed instead
Einliterflasche Sep 11, 2025
748d561
fix: make logs in terminal colored again
Einliterflasche Sep 12, 2025
c1513de
fix: gui won't start on testnet
Einliterflasche Sep 12, 2025
c5581a0
fix: gui quirks with monero seed selection
Einliterflasche Sep 13, 2025
a96d4be
add migration to bring S_a_monero into later states, use it to verify…
Einliterflasche Sep 13, 2025
1a219e5
improve gui code
Einliterflasche Sep 13, 2025
5ee314a
add gui for manual cooperative redeem (untested)
Einliterflasche Sep 13, 2025
5f20b8d
add justfile command for running swap controller
Einliterflasche Sep 13, 2025
4775dec
fix: don't show second BTC after bitcoin balance
Einliterflasche Sep 13, 2025
969f748
add asb rpc server to test context, integration test for manual coope…
Einliterflasche Sep 13, 2025
cf1f760
add integration test for malicious cooperative redeem check
Einliterflasche Sep 14, 2025
943fce3
fix: code smells
Einliterflasche Sep 14, 2025
08242ec
improve gui code, use alert to show outcome
Einliterflasche Sep 14, 2025
9ed60ac
disable attempt button while attempt is in progress
Einliterflasche Sep 14, 2025
0b31cd8
use template string
Einliterflasche Sep 14, 2025
0e8c0c1
problem: asb not registering with rendezvous points on stagenet (conn…
Einliterflasche Sep 14, 2025
9066065
fix integration tests, resume swap from tauri_command after
Einliterflasche Sep 17, 2025
c79877b
Merge branch 'master' into feat/manual-cooperative-redeem
Einliterflasche Sep 18, 2025
9945bb2
fix tauri missing libwinpthread-1.dll
Einliterflasche Sep 19, 2025
d08cdb9
satisfy clippy
Einliterflasche Sep 25, 2025
5b16ee1
Merge branch 'master' into feat/manual-cooperative-redeem
Einliterflasche Sep 27, 2025
1997f18
fix test compilation errors
Einliterflasche Sep 27, 2025
67e8db3
fix tests
Einliterflasche Sep 27, 2025
45bee3d
add asb command manual-recovery export-cooperative-redeem-key --swap-…
Einliterflasche Oct 13, 2025
fa23dfa
fix logic bug
Einliterflasche Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ bdk_electrum = { version = "0.23.0", default-features = false }
bdk_wallet = "2.0.0"
bitcoin = { version = "0.32", features = ["rand", "serde"] }

# Crypto
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4" }

# Monero
monero-oxide = { git = "https://github.com/monero-oxide/monero-oxide", default-features = false, features = ["std"] }

swap-serde = { path = "./swap-serde" }

anyhow = "1"
backoff = { version = "0.4", features = ["futures", "tokio"] }
futures = { version = "0.3", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ swap:
cargo build -p swap-asb --bin asb && cd swap && cargo build --bin=swap

# Run the asb on testnet
asb-testnet:
asb:
cargo run -p swap-asb --bin asb -- --trace --testnet start --rpc-bind-port 9944 --rpc-bind-host 0.0.0.0

# Updates our submodules (currently only Monero C++ codebase)
Expand Down
2 changes: 1 addition & 1 deletion monero-seed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ curve25519-dalek = { version = "4", default-features = false, features = ["alloc

[dev-dependencies]
hex = { version = "0.4", default-features = false, features = ["std"] }
monero-oxide = { git = "https://github.com/monero-oxide/monero-oxide", default-features = false, features = ["std"] }
monero-oxide = { workspace = true }

[features]
std = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,34 @@ export default function ActionableMonospaceTextBox({
<Box
sx={{
display: "flex",
alignItems: "center",
alignItems: "space-between",
cursor: "pointer",
filter: spoilerText && !isRevealed ? "blur(8px)" : "none",
transition: "filter 0.3s ease",
filter: spoilerText && !isRevealed ? "blur(2px)" : "none",
transition: "filter 0.1s ease",
}}
>
<Box sx={{ flexGrow: 1 }} onClick={handleCopy}>
<MonospaceTextBox light={light}>
{content}
{displayCopyIcon && (
<IconButton
onClick={handleCopy}
size="small"
sx={{ marginLeft: 1 }}
>
<FileCopyOutlined />
</IconButton>
)}
<Box
sx={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
flex: 1,
}}
>
{content}
{displayCopyIcon && (
<IconButton
onClick={handleCopy}
size="small"
sx={{ marginLeft: 1 }}
>
<FileCopyOutlined />
</IconButton>
)}
</Box>

{enableQrCode && (
<Tooltip title="Show QR Code" arrow>
<IconButton
Expand Down Expand Up @@ -139,20 +149,12 @@ export default function ActionableMonospaceTextBox({
alignItems: "center",
justifyContent: "center",
cursor: "pointer",
bgcolor: "rgba(0, 0, 0, 0.1)",
borderRadius: 1,
bgcolor: "background.paper",
borderRadius: 2,
p: 2,
}}
>
<Box
sx={{
bgcolor: "background.paper",
p: 2,
borderRadius: 1,
boxShadow: 2,
}}
>
{spoilerText}
</Box>
{spoilerText}
</Box>
)}
</Box>
Expand Down
1 change: 1 addition & 0 deletions src-gui/src/renderer/components/other/MonospaceTextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function MonospaceTextBox({ children, light = false }: Props) {
lineHeight: 1.5,
display: "flex",
alignItems: "center",
flex: 1,
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function SeedPhraseButton({
};

return (
<MenuItem component="div">
<MenuItem>
<PromiseInvokeButton
onInvoke={getMoneroSeedAndRestoreHeight}
onSuccess={handleSeedPhraseSuccess}
Expand Down
62 changes: 44 additions & 18 deletions src-gui/src/renderer/components/pages/monero/SeedPhraseModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Alert,
Box,
Button,
Dialog,
Expand All @@ -8,51 +9,76 @@ import {
Typography,
} from "@mui/material";
import ActionableMonospaceTextBox from "../../other/ActionableMonospaceTextBox";
import {
GetMoneroSeedResponse,
GetRestoreHeightResponse,
} from "models/tauriModel";
import { useEffect, useState } from "react";
import { getMoneroSeedAndRestoreHeight } from "renderer/rpc";

interface SeedPhraseModalProps {
onClose: () => void;
seed: [GetMoneroSeedResponse, GetRestoreHeightResponse] | null;
open: boolean;
}

interface SeedInfo {
seed: string;
restoreHeight: number;
}

export default function SeedPhraseModal({
onClose,
seed,
open,
}: SeedPhraseModalProps) {
if (seed === null) {
return null;
}
const [info, setInfo] = useState<SeedInfo | null>(null);

// Fetch seed and restore height on mount
useEffect(() => {
getMoneroSeedAndRestoreHeight().then(([seed, height]) => {
setInfo({ seed: seed.seed, restoreHeight: height.height });
});
}, []);

return (
<Dialog open={true} onClose={onClose} maxWidth="md" fullWidth>
<DialogTitle>Wallet Seed Phrase</DialogTitle>
<Dialog open={open} onClose={onClose} maxWidth="md" fullWidth>
<DialogTitle>Export your Monero wallet's seed</DialogTitle>
<DialogContent>
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>
<Alert severity="info">
Never reveal your seed phrase to <i>anyone</i>. The developers will
never ask for your seed.
</Alert>

<Typography variant="body1">Seed phrase</Typography>

<ActionableMonospaceTextBox
content={seed[0].seed}
content={info == null ? "...loading..." : info.seed}
displayCopyIcon={true}
enableQrCode={false}
spoilerText="Press to reveal"
/>

<Typography variant="caption">
The seed phrase of your wallet is equivalent to the secret key.
</Typography>

<Typography variant="body1">Restore Block Height</Typography>

<ActionableMonospaceTextBox
content={seed[1].height.toString()}
content={
info == null ? "...loading..." : info.restoreHeight.toString()
}
displayCopyIcon={true}
enableQrCode={false}
/>

<Typography variant="caption">
The restore height will help other wallets determine which parts of
the blockchain to scan for funds.
</Typography>
</Box>

<Typography
variant="caption"
color="text.secondary"
sx={{ mt: 2, display: "block", fontStyle: "italic" }}
>
Keep this seed phrase safe and secure. Write it down on paper and
store it in a safe place. Keep the restore height in mind when you
restore your wallet on another device.
</Typography>
></Typography>
</DialogContent>
<DialogActions>
<Button onClick={onClose} variant="outlined">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
SwapHoriz as SwapIcon,
Restore as RestoreIcon,
MoreHoriz as MoreHorizIcon,
Lock,
} from "@mui/icons-material";
import { useState } from "react";
import { setMoneroRestoreHeight } from "renderer/rpc";
Expand Down Expand Up @@ -45,10 +46,8 @@ export default function WalletActionButtons({
const navigate = useNavigate();

const [sendDialogOpen, setSendDialogOpen] = useState(false);
const [seedDialogOpen, setSeedDialogOpen] = useState(false);
const [restoreHeightDialogOpen, setRestoreHeightDialogOpen] = useState(false);
const [seedPhrase, setSeedPhrase] = useState<
[GetMoneroSeedResponse, GetRestoreHeightResponse] | null
>(null);

const [menuAnchorEl, setMenuAnchorEl] = useState<null | HTMLElement>(null);
const menuOpen = Boolean(menuAnchorEl);
Expand All @@ -66,7 +65,10 @@ export default function WalletActionButtons({
open={restoreHeightDialogOpen}
onClose={() => setRestoreHeightDialogOpen(false)}
/>
<SeedPhraseModal onClose={() => setSeedPhrase(null)} seed={seedPhrase} />
<SeedPhraseModal
open={seedDialogOpen}
onClose={() => setSeedDialogOpen(false)}
/>
<SendTransactionModal
balance={balance}
open={sendDialogOpen}
Expand Down Expand Up @@ -112,10 +114,17 @@ export default function WalletActionButtons({
</ListItemIcon>
<Typography>Restore Height</Typography>
</MenuItem>
<SeedPhraseButton
onMenuClose={handleMenuClose}
onSeedPhraseSuccess={setSeedPhrase}
/>
<MenuItem
onClick={() => {
setSeedDialogOpen(true);
handleMenuClose();
}}
>
<ListItemIcon>
<Lock />
</ListItemIcon>
<Typography>Export Seed Phrase</Typography>
</MenuItem>
</Menu>
</Box>
</>
Expand Down
Loading
Loading