moonproof-wallet 0.2.2

Native Rust wallet for the Midnight blockchain — HD derivation, coin balancing, Zswap/unshielded/dust transacting
Documentation
//! Unshielded (public) wallet sub-surface.
//!
//! Port of `@midnight-ntwrk/wallet-sdk-unshielded-wallet`. This crate provides
//! the state machine that tracks public (transparent) UTXOs owned by a wallet:
//!
//! - `available` UTXOs (confirmed on chain, not yet spent)
//! - `pending` UTXOs (spent locally by a submitted tx; awaits chain confirmation)
//!
//! The balancer ([`crate::balancer`]) consumes `available` UTXOs to build txs.
//! Once a tx is broadcast, `spend` moves UTXOs to `pending`. On chain
//! confirmation, `apply_update(SUCCESS | PARTIAL_SUCCESS)` removes them from
//! `pending`; on failure, `apply_failed_update(FAILURE)` restores them to
//! `available`. Rollback paths are no-ops if the UTXO isn't tracked — matches
//! the TS reference, which is robust to indexer-vs-submit races.

mod balances;
pub mod ledger_adapter;
mod state;
pub mod sync;
mod transacting;

pub use balances::{filter_by_token, sum_by_token, BalanceSummary};
pub use state::{
    UnshieldedState, UnshieldedUpdate, UnshieldedUtxo, UpdateStatus, UtxoId, UtxoMeta, UtxoWithMeta,
};
pub use sync::{
    decode_and_extract_for_owner, decode_finalized_transaction, extract_utxos_for_owner,
    replay_unshielded_subscription, scan_transactions_for_owner, synthesize_claim_rewards_utxo,
};
pub use transacting::{
    build_balancing_recipe as build_unshielded_balancing_recipe,
    build_init_swap_recipe as build_init_swap_unshielded_recipe, build_transfer_recipe,
    TransferRecipe, UnshieldedOutputSpec, UnshieldedTransfer,
};