mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
wip: WithdrawDialog migrated to Tauri IPC
This commit is contained in:
parent
92034a5be8
commit
47821cbe79
14 changed files with 185 additions and 166 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue