Skip to content

Commit 7e06752

Browse files
committed
chore(gui): Upgrade to MUI v5
1 parent 015c956 commit 7e06752

File tree

96 files changed

+793
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+793
-464
lines changed

rust-toolchain.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[toolchain]
2-
channel = "1.80" # also update this in the readme, changelog, and github actions
2+
# also update this in the readme, changelog, and github actions
3+
channel = "1.79"
34
components = ["clippy"]
45
targets = ["armv7-unknown-linux-gnueabihf"]

src-gui/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
65
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Tauri + React + Typescript</title>
6+
<title>UnstoppableSwap</title>
87
</head>
98

109
<body>

src-gui/package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
"tauri": "tauri"
1111
},
1212
"dependencies": {
13-
"@material-ui/core": "^4.12.4",
14-
"@material-ui/icons": "^4.11.3",
15-
"@material-ui/lab": "^4.0.0-alpha.61",
13+
"@emotion/react": "^11.13.3",
14+
"@emotion/styled": "^11.13.0",
15+
"@mui/icons-material": "^5.16.7",
16+
"@mui/lab": "^5.0.0-alpha.173",
17+
"@mui/material": "^5.16.7",
18+
"@mui/styles": "^5.16.7",
1619
"@reduxjs/toolkit": "^2.2.6",
1720
"@tauri-apps/api": "2.0.0-rc.1",
1821
"humanize-duration": "^3.32.1",
@@ -21,7 +24,7 @@
2124
"notistack": "^3.0.1",
2225
"pino": "^9.2.0",
2326
"pino-pretty": "^11.2.1",
24-
"react": "^18.2.0",
27+
"react": "^18.3.1",
2528
"react-dom": "^18.2.0",
2629
"react-qr-code": "^2.0.15",
2730
"react-redux": "^9.1.2",
@@ -35,7 +38,7 @@
3538
"@types/humanize-duration": "^3.27.4",
3639
"@types/lodash": "^4.17.6",
3740
"@types/node": "^20.14.10",
38-
"@types/react": "^18.2.15",
41+
"@types/react": "^18.3.1",
3942
"@types/react-dom": "^18.2.7",
4043
"@types/semver": "^7.5.8",
4144
"@vitejs/plugin-react": "^4.2.1",

src-gui/public/.gitignore

Whitespace-only changes.

src-gui/public/tauri.svg

-6
This file was deleted.

src-gui/public/vite.svg

-1
This file was deleted.

src-gui/src/models/tauriModel.ts

+134-105
Original file line numberDiff line numberDiff line change
@@ -21,165 +21,194 @@ export type PunishTimelock = number;
2121
export type Amount = number;
2222

2323
export interface BuyXmrArgs {
24-
seller: string;
25-
bitcoin_change_address: string;
26-
monero_receive_address: string;
24+
seller: string;
25+
bitcoin_change_address: string;
26+
monero_receive_address: string;
2727
}
2828

2929
export interface ResumeArgs {
30-
swap_id: string;
30+
swap_id: string;
3131
}
3232

3333
export interface CancelAndRefundArgs {
34-
swap_id: string;
34+
swap_id: string;
3535
}
3636

3737
export interface MoneroRecoveryArgs {
38-
swap_id: string;
38+
swap_id: string;
3939
}
4040

4141
export interface WithdrawBtcArgs {
42-
amount?: number;
43-
address: string;
42+
amount?: number;
43+
address: string;
4444
}
4545

4646
export interface BalanceArgs {
47-
force_refresh: boolean;
47+
force_refresh: boolean;
4848
}
4949

5050
export interface ListSellersArgs {
51-
rendezvous_point: string;
51+
rendezvous_point: string;
5252
}
5353

5454
export interface StartDaemonArgs {
55-
server_address: string;
55+
server_address: string;
5656
}
5757

5858
export interface GetSwapInfoArgs {
59-
swap_id: string;
59+
swap_id: string;
6060
}
6161

6262
export interface ResumeSwapResponse {
63-
result: string;
63+
result: string;
6464
}
6565

6666
export interface BalanceResponse {
67-
balance: number;
67+
balance: number;
6868
}
6969

7070
/** Represents a quote for buying XMR. */
7171
export interface BidQuote {
72-
/** The price at which the maker is willing to buy at. */
73-
price: number;
74-
/**
75-
* The minimum quantity the maker is willing to buy.
76-
* #[typeshare(serialized_as = "number")]
77-
*/
78-
min_quantity: number;
79-
/** The maximum quantity the maker is willing to buy. */
80-
max_quantity: number;
72+
/** The price at which the maker is willing to buy at. */
73+
price: number;
74+
/**
75+
* The minimum quantity the maker is willing to buy.
76+
* #[typeshare(serialized_as = "number")]
77+
*/
78+
min_quantity: number;
79+
/** The maximum quantity the maker is willing to buy. */
80+
max_quantity: number;
8181
}
8282

8383
export interface BuyXmrResponse {
84-
swap_id: string;
85-
quote: BidQuote;
84+
swap_id: string;
85+
quote: BidQuote;
8686
}
8787

8888
export interface GetHistoryEntry {
89-
swap_id: string;
90-
state: string;
89+
swap_id: string;
90+
state: string;
9191
}
9292

9393
export interface GetHistoryResponse {
94-
swaps: GetHistoryEntry[];
94+
swaps: GetHistoryEntry[];
9595
}
9696

9797
export interface Seller {
98-
peer_id: string;
99-
addresses: string[];
100-
}
101-
102-
export type ExpiredTimelocks =
103-
| { type: "None", content: {
104-
blocks_left: number;
105-
}}
106-
| { type: "Cancel", content: {
107-
blocks_left: number;
108-
}}
109-
| { type: "Punish", content?: undefined };
98+
peer_id: string;
99+
addresses: string[];
100+
}
101+
102+
export type ExpiredTimelocks =
103+
| {
104+
type: "None";
105+
content: {
106+
blocks_left: number;
107+
};
108+
}
109+
| {
110+
type: "Cancel";
111+
content: {
112+
blocks_left: number;
113+
};
114+
}
115+
| { type: "Punish"; content?: undefined };
110116

111117
export interface GetSwapInfoResponse {
112-
swap_id: string;
113-
seller: Seller;
114-
completed: boolean;
115-
start_date: string;
116-
state_name: string;
117-
xmr_amount: number;
118-
btc_amount: number;
119-
tx_lock_id: string;
120-
tx_cancel_fee: number;
121-
tx_refund_fee: number;
122-
tx_lock_fee: number;
123-
btc_refund_address: string;
124-
cancel_timelock: CancelTimelock;
125-
punish_timelock: PunishTimelock;
126-
timelock?: ExpiredTimelocks;
118+
swap_id: string;
119+
seller: Seller;
120+
completed: boolean;
121+
start_date: string;
122+
state_name: string;
123+
xmr_amount: number;
124+
btc_amount: number;
125+
tx_lock_id: string;
126+
tx_cancel_fee: number;
127+
tx_refund_fee: number;
128+
tx_lock_fee: number;
129+
btc_refund_address: string;
130+
cancel_timelock: CancelTimelock;
131+
punish_timelock: PunishTimelock;
132+
timelock?: ExpiredTimelocks;
127133
}
128134

129135
export interface WithdrawBtcResponse {
130-
amount: number;
131-
txid: string;
136+
amount: number;
137+
txid: string;
132138
}
133139

134140
export interface SuspendCurrentSwapResponse {
135-
swap_id: string;
136-
}
137-
138-
export type TauriSwapProgressEvent =
139-
| { type: "Initiated", content?: undefined }
140-
| { type: "ReceivedQuote", content: BidQuote }
141-
| { type: "WaitingForBtcDeposit", content: {
142-
deposit_address: string;
143-
max_giveable: number;
144-
min_deposit_until_swap_will_start: number;
145-
max_deposit_until_maximum_amount_is_reached: number;
146-
min_bitcoin_lock_tx_fee: number;
147-
quote: BidQuote;
148-
}}
149-
| { type: "Started", content: {
150-
btc_lock_amount: number;
151-
btc_tx_lock_fee: number;
152-
}}
153-
| { type: "BtcLockTxInMempool", content: {
154-
btc_lock_txid: string;
155-
btc_lock_confirmations: number;
156-
}}
157-
| { type: "XmrLockTxInMempool", content: {
158-
xmr_lock_txid: string;
159-
xmr_lock_tx_confirmations: number;
160-
}}
161-
| { type: "XmrLocked", content?: undefined }
162-
| { type: "BtcRedeemed", content?: undefined }
163-
| { type: "XmrRedeemInMempool", content: {
164-
xmr_redeem_txid: string;
165-
xmr_redeem_address: string;
166-
}}
167-
| { type: "BtcCancelled", content: {
168-
btc_cancel_txid: string;
169-
}}
170-
| { type: "BtcRefunded", content: {
171-
btc_refund_txid: string;
172-
}}
173-
| { type: "BtcPunished", content?: undefined }
174-
| { type: "AttemptingCooperativeRedeem", content?: undefined }
175-
| { type: "CooperativeRedeemAccepted", content?: undefined }
176-
| { type: "CooperativeRedeemRejected", content: {
177-
reason: string;
178-
}}
179-
| { type: "Released", content?: undefined };
141+
swap_id: string;
142+
}
143+
144+
export type TauriSwapProgressEvent =
145+
| { type: "Initiated"; content?: undefined }
146+
| { type: "ReceivedQuote"; content: BidQuote }
147+
| {
148+
type: "WaitingForBtcDeposit";
149+
content: {
150+
deposit_address: string;
151+
max_giveable: number;
152+
min_deposit_until_swap_will_start: number;
153+
max_deposit_until_maximum_amount_is_reached: number;
154+
min_bitcoin_lock_tx_fee: number;
155+
quote: BidQuote;
156+
};
157+
}
158+
| {
159+
type: "Started";
160+
content: {
161+
btc_lock_amount: number;
162+
btc_tx_lock_fee: number;
163+
};
164+
}
165+
| {
166+
type: "BtcLockTxInMempool";
167+
content: {
168+
btc_lock_txid: string;
169+
btc_lock_confirmations: number;
170+
};
171+
}
172+
| {
173+
type: "XmrLockTxInMempool";
174+
content: {
175+
xmr_lock_txid: string;
176+
xmr_lock_tx_confirmations: number;
177+
};
178+
}
179+
| { type: "XmrLocked"; content?: undefined }
180+
| { type: "BtcRedeemed"; content?: undefined }
181+
| {
182+
type: "XmrRedeemInMempool";
183+
content: {
184+
xmr_redeem_txid: string;
185+
xmr_redeem_address: string;
186+
};
187+
}
188+
| {
189+
type: "BtcCancelled";
190+
content: {
191+
btc_cancel_txid: string;
192+
};
193+
}
194+
| {
195+
type: "BtcRefunded";
196+
content: {
197+
btc_refund_txid: string;
198+
};
199+
}
200+
| { type: "BtcPunished"; content?: undefined }
201+
| { type: "AttemptingCooperativeRedeem"; content?: undefined }
202+
| { type: "CooperativeRedeemAccepted"; content?: undefined }
203+
| {
204+
type: "CooperativeRedeemRejected";
205+
content: {
206+
reason: string;
207+
};
208+
}
209+
| { type: "Released"; content?: undefined };
180210

181211
export interface TauriSwapProgressEventWrapper {
182-
swap_id: string;
183-
event: TauriSwapProgressEvent;
212+
swap_id: string;
213+
event: TauriSwapProgressEvent;
184214
}
185-

0 commit comments

Comments
 (0)