@cdr-kit/react/Hooks/useAccessVault
useAccessVault
Imperative access to one vault. Returns a discriminated status + the decrypted bytes when ready. The state machine behind <VaultGate> and <Vault>.
import { useAccessVault } from "@cdr-kit/react"
Signature
function useAccessVault(uuid: number): {
access: (accessAuxData?: Hex) => Promise<Uint8Array>;
status: "idle" | "collecting-partials" | "ready" | "error";
data?: Uint8Array;
error?: CdrError;
progress?: { collected: number; threshold: number }; // mock-mode only
};States
idle— initial; callaccess()to begin.collecting-partials— the ~15s threshold read.ready—datapopulated.error— seeerrorfor the typed reason.