moonproof-wallet 0.2.1

Native Rust wallet for the Midnight blockchain — HD derivation, coin balancing, Zswap/unshielded/dust transacting
Documentation
//! Session-level wallet orchestration: pick a network, derive a
//! wallet from a seed, sync facade state, prove + sign + submit
//! recipes.
//!
//! Lives inside `moonproof-wallet` because (1) the heavy lifting is
//! already in the wallet's facade primitives, and (2) every host that
//! consumes moonproof end-to-end (CLI, Flutter SDK, integration
//! tests) needs the same orchestration. Splitting this out into a
//! separate `wallet-session` crate would just move ceremony around;
//! the wallet crate already pulls in `moonproof-indexer-client`,
//! `moonproof-node-client`, `moonproof-prover`, and `tokio`.
//!
//! What's intentionally **not** in here:
//! - Persistence. Disk-backed snapshot save/load lives wherever the
//!   host wants it (CLI uses `crates/runtime/src/providers/wallet_store.rs`
//!   + `crates/cli/src/wallet/private_state.rs`).
//! - Host-config schemas. `NetworkConfig` is constructed by the host
//!   from whatever config layer it has (TOML, env, JSON) — the
//!   session module never reads files itself.
//! - Pending-tx / tx-history recording. `submit_signed_recipe` returns
//!   `(event, raw_tx_bytes)` so hosts that want to record the
//!   submission into their own store can do so without recomputing
//!   the wire payload.

pub mod builder;
pub mod connect;
pub mod connected;
pub mod network;
pub mod presets;
pub mod submit;
pub mod sync;

pub use builder::WalletSessionBuilder;
pub use connect::{connect_node, derive_wallet, WalletSession};
pub use connected::{pay_sealed, seal_unbound, sealed_bytes, ConnectedWallet};
pub use network::{network_id_for_chain_kind, NetworkConfig};
pub use presets::{
    all_presets, faucet_browser_url, faucet_url, preset_by_name, DEFAULT_LOCAL_PROOF_SERVER,
    PRESET_NAMES,
};
pub use submit::{
    build_engine_provider, default_submission_stage, finalize_with_backend, prove_signed_recipe,
    submit_signed_recipe, submit_signed_recipe_with_backend, translate_submission_error, ttl_from,
    wait_for_dust_balance, wait_for_native_balance, wait_until_indexed, ProvingBackend,
    SubmissionOutcome, TRANSACTION_TTL_SECS,
};
pub use sync::{
    chain_instance_id, drain_wallet_sync, resolve_indexer_sync_timeout, sync_wallet_fresh,
    sync_wallet_resumable, DrainedTicks, INDEXER_SYNC_TIMEOUT,
};