Skip to main content

walletkit_db/
lib.rs

1//! Encrypted on-device storage primitives for `WalletKit`.
2//!
3//! The crate provides building blocks shared by `walletkit-core::storage` and
4//! sibling SDKs (e.g. `OrbKit`'s `OrbPcpStore`):
5//!
6//! - [`Vault`] — encrypted-database wrapper around a caller-supplied schema,
7//!   exposing the underlying [`walletkit_sqlite::Connection`].
8//! - [`blobs`] — content-addressed blob storage (`ensure_schema`, `put`,
9//!   `get`), [`ContentId`], and [`compute_content_id`].
10//! - [`init_or_open_envelope_key`] — sealed intermediate key persisted via
11//!   [`AtomicBlobStore`].
12//! - [`Lock`] / [`LockGuard`] — cross-process exclusive lock (`flock` /
13//!   `LockFileEx` native, no-op on WASM).
14//! - [`Keystore`] / [`AtomicBlobStore`] — plain-Rust trait surface for
15//!   consumer-supplied platform integrations. Consumers that need FFI define
16//!   their own annotated traits and adapt to these.
17//!
18//! Consumers own their schemas, FFI surfaces, and storage policy on top of
19//! these primitives.
20
21pub mod blobs;
22
23mod envelope;
24mod error;
25mod lock;
26mod traits;
27mod vault;
28
29pub use blobs::{compute_content_id, ContentId};
30pub use envelope::init_or_open_envelope_key;
31pub use error::{StoreError, StoreResult};
32pub use lock::{Lock, LockGuard};
33pub use traits::{AtomicBlobStore, Keystore};
34pub use vault::Vault;