feat(gui, swap): allow change-address to be omitted and default to internal wallet (#68)

This PR:
- allows --change-address to be omitted and default to internal wallet address (https://github.com/comit-network/xmr-btc-swap/pull/1709). This is a change that is merged from upstream into our fork
- adds the necessary components for the tauri integration and the ui components to allow toggling between internal vs external refund address

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
Co-authored-by: Einliterflasche <81313171+Einliterflasche@users.noreply.github.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
This commit is contained in:
binarybaron 2024-09-09 19:47:15 +02:00 committed by GitHub
parent 91482f1e16
commit 063f9dbf9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 118 additions and 50 deletions

View file

@ -89,14 +89,22 @@ export async function withdrawBtc(address: string): Promise<string> {
export async function buyXmr(
seller: Provider,
bitcoin_change_address: string,
bitcoin_change_address: string | null,
monero_receive_address: string,
) {
await invoke<BuyXmrArgs, BuyXmrResponse>("buy_xmr", {
seller: providerToConcatenatedMultiAddr(seller),
bitcoin_change_address,
monero_receive_address,
});
await invoke<BuyXmrArgs, BuyXmrResponse>(
"buy_xmr",
bitcoin_change_address == null
? {
seller: providerToConcatenatedMultiAddr(seller),
monero_receive_address,
}
: {
seller: providerToConcatenatedMultiAddr(seller),
monero_receive_address,
bitcoin_change_address,
},
);
}
export async function resumeSwap(swapId: string) {