mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
feat: cargo project at root
This commit is contained in:
parent
aa0c0623ca
commit
709a2820c4
313 changed files with 1 additions and 740 deletions
18
src-gui/src/renderer/rpc.ts
Normal file
18
src-gui/src/renderer/rpc.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { BalanceBitcoinResponse } from "models/rpcModel";
|
||||
import { store } from "./store/storeRenderer";
|
||||
import { rpcSetBalance } from "store/features/rpcSlice";
|
||||
|
||||
export async function checkBitcoinBalance() {
|
||||
// TODO: use tauri-bindgen here
|
||||
const response = (await invoke("balance")) as {
|
||||
balance: number;
|
||||
};
|
||||
|
||||
store.dispatch(rpcSetBalance(response.balance));
|
||||
}
|
||||
|
||||
export async function getRawSwapInfos() {
|
||||
const response = await invoke("swap_infos");
|
||||
console.log(response);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue