wip: WithdrawDialog migrated to Tauri IPC

This commit is contained in:
binarybaron 2024-08-09 19:03:28 +02:00
parent 92034a5be8
commit 47821cbe79
No known key found for this signature in database
GPG key ID: 99B75D3E1476A26E
14 changed files with 185 additions and 166 deletions

View file

@ -3,7 +3,6 @@ import { store } from "./store/storeRenderer";
import { rpcSetBalance, rpcSetSwapInfo } from "store/features/rpcSlice";
export async function checkBitcoinBalance() {
// TODO: use tauri-bindgen here
const response = (await invoke("get_balance")) as {
balance: number;
};
@ -16,3 +15,17 @@ export async function getRawSwapInfos() {
(response as any[]).forEach((info) => store.dispatch(rpcSetSwapInfo(info)));
}
export async function withdrawBtc(address: string): Promise<string> {
const response = (await invoke("withdraw_btc", {
args: {
address,
amount: null,
},
})) as {
txid: string;
amount: number;
};
return response.txid;
}