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:
Mohan 2025-07-02 14:01:56 +02:00 committed by GitHub
parent b8982b5ac2
commit 7606982de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 22465 additions and 171 deletions

View file

@ -5,8 +5,10 @@ import {
isBitcoinSyncProgress,
isPendingBackgroundProcess,
isPendingLockBitcoinApprovalEvent,
isPendingSeedSelectionApprovalEvent,
PendingApprovalRequest,
PendingLockBitcoinApprovalRequest,
PendingSeedSelectionApprovalRequest,
} from "models/tauriModelExt";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import type { AppDispatch, RootState } from "renderer/store/storeRenderer";
@ -155,7 +157,9 @@ export function useNodes<T>(selector: (nodes: NodesSlice) => T): T {
export function usePendingApprovals(): PendingApprovalRequest[] {
const approvals = useAppSelector((state) => state.rpc.state.approvalRequests);
return Object.values(approvals).filter((c) => c.state === "Pending");
return Object.values(approvals).filter(
(c) => c.request_status.state === "Pending",
) as PendingApprovalRequest[];
}
export function usePendingLockBitcoinApproval(): PendingLockBitcoinApprovalRequest[] {
@ -163,6 +167,11 @@ export function usePendingLockBitcoinApproval(): PendingLockBitcoinApprovalReque
return approvals.filter((c) => isPendingLockBitcoinApprovalEvent(c));
}
export function usePendingSeedSelectionApproval(): PendingSeedSelectionApprovalRequest[] {
const approvals = usePendingApprovals();
return approvals.filter((c) => isPendingSeedSelectionApprovalEvent(c));
}
/// Returns all the pending background processes
/// In the format [id, {componentName, {type: "Pending", content: {consumed, total}}}]
export function usePendingBackgroundProcesses(): [