mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-22 03:48:01 -05:00
feat: Recover from / write down seed (#439)
* vendor: seed crate from monero-serai * refactor: make approval type generic over respone from frontend * progress * Raphaels Progress * feat(gui): seed import flow skeleton * fix(gui): Seed import in the development version * fix(gui): specify the imported seed type * remove initializeHandle, make tauri handle non optional in state, dont allow closing seed dialog * feat(gui): check if seed is valid dynamically * fix(gui): refine the dynamic seed validation * push * progress * progress * Fix pending trimeout --------- Co-authored-by: Maksim Kirillov <artist@eduroam-141-23-183-184.wlan.tu-berlin.de> Co-authored-by: Maksim Kirillov <artist@eduroam-141-23-189-144.wlan.tu-berlin.de> Co-authored-by: Maksim Kirillov <maksim.kirillov@staticlabs.de>
This commit is contained in:
parent
b8982b5ac2
commit
7606982de3
39 changed files with 22465 additions and 171 deletions
|
|
@ -17,6 +17,8 @@ import {
|
|||
GetSwapInfoArgs,
|
||||
ExportBitcoinWalletResponse,
|
||||
CheckMoneroNodeArgs,
|
||||
CheckSeedArgs,
|
||||
CheckSeedResponse,
|
||||
CheckMoneroNodeResponse,
|
||||
TauriSettings,
|
||||
CheckElectrumNodeArgs,
|
||||
|
|
@ -304,10 +306,16 @@ export async function initializeContext() {
|
|||
|
||||
logger.info("Initializing context with settings", tauriSettings);
|
||||
|
||||
await invokeUnsafe<void>("initialize_context", {
|
||||
settings: tauriSettings,
|
||||
testnet,
|
||||
});
|
||||
try {
|
||||
await invokeUnsafe<void>("initialize_context", {
|
||||
settings: tauriSettings,
|
||||
testnet,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error("Couldn't initialize context: " + error);
|
||||
}
|
||||
|
||||
logger.info("Initialized context");
|
||||
}
|
||||
|
||||
export async function getWalletDescriptor() {
|
||||
|
|
@ -395,7 +403,7 @@ export async function getDataDir(): Promise<string> {
|
|||
|
||||
export async function resolveApproval(
|
||||
requestId: string,
|
||||
accept: boolean,
|
||||
accept: object,
|
||||
): Promise<void> {
|
||||
await invoke<ResolveApprovalArgs, ResolveApprovalResponse>(
|
||||
"resolve_approval_request",
|
||||
|
|
@ -403,6 +411,16 @@ export async function resolveApproval(
|
|||
);
|
||||
}
|
||||
|
||||
export async function checkSeed(seed: string): Promise<boolean> {
|
||||
const response = await invoke<CheckSeedArgs, CheckSeedResponse>(
|
||||
"check_seed",
|
||||
{
|
||||
seed,
|
||||
},
|
||||
);
|
||||
return response.available;
|
||||
}
|
||||
|
||||
export async function saveLogFiles(
|
||||
zipFileName: string,
|
||||
content: Record<string, string>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue