mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-21 11:25:50 -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
|
|
@ -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(): [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue