moonproof-wallet 0.2.2

Native Rust wallet for the Midnight blockchain — HD derivation, coin balancing, Zswap/unshielded/dust transacting
Documentation
//! Wallet facade — the orchestrating layer over the three sub-wallets.
//!
//! Port of `@midnight-ntwrk/wallet-sdk-facade`. The facade combines
//! [`crate::shielded`], [`crate::unshielded`], and [`crate::dust`] into a
//! single API that builds, merges, finalizes, and submits transactions
//! across all three.
//!
//! ## Module layout
//!
//! - [`state`] — [`FacadeState`], the composite state bundle plus the
//!   aggregate [`FacadeSyncProgress`] that mirrors TS `FacadeState.isSynced`.
//!
//! Further slices (transfer, swap, registration, submission, sync) are
//! added as they land. See the module docs on each for the boundary with
//! the future `runtime` module.
//!
//! ## Partition line with a future `runtime` module
//!
//! The TS SDK splits "compose sub-wallets into an API" (`wallet-sdk-facade`)
//! from "manage protocol-version variants + long-lived sync coordination"
//! (`wallet-sdk-runtime`). Moonproof draws the line the same way: this
//! module owns composition; [`crate::runtime`] owns the long-lived
//! state cell and [`crate::session`] the sync loops. The facade's sync
//! helpers fold one batch of ticks; they don't own the "sync forever in
//! the background" loop themselves.

pub mod balancing;
pub mod capabilities;
pub mod outcome;
pub mod preview;
pub mod registration;
pub mod revert;
pub mod state;
pub mod submission;
pub mod swap;
pub mod sync;
pub mod transfer;

pub use balancing::{
    balance_sealed_recipe, balance_unbound_recipe, balance_unproven_transaction,
    finalize_sealed_recipe, finalize_unbound_recipe, imbalances_of, SealedBalancingRecipe,
    TransactionImbalances, UnboundBalancingRecipe,
};
pub use capabilities::{
    LedgerProvingCapability, MockProvingCapability, MockSubmissionCapability,
    NodeSubmissionCapability, ProvingCapability, SubmissionCapability,
};
pub use outcome::{ended_transaction_result, transaction_result, SubmissionEnd, SubmissionWatch};
pub use preview::{
    preview_deregistration, preview_registration, preview_swap, preview_transfer, PreviewCost,
    RegistrationPreview, SwapPreview, TransferPreview,
};
pub use registration::{
    build_deregistration_recipe, build_registration_recipe, RegistrationParams,
    SignedRegistrationRecipe, UnsignedRegistrationRecipe,
};
pub use state::{FacadeState, FacadeSyncProgress};
pub use submission::{
    balance_unbound_transaction, fetch_chain_parameters, finalize_recipe, finalized_tx_handles,
    serialize_finalized, submit_finalized, ChainParameters, FinalizedTransaction,
    FinalizedTransactionRecipe, FinalizedTxHandles, ProvenTransaction, SubmissionOptions,
};
pub use swap::{build_init_swap_recipe, init_swap, SwapInputs, SwapOptions, SwapSigningKeys};
pub use sync::{fold_dust_events, fold_shielded_ticks, fold_unshielded_ticks};
pub use transfer::{
    balance_dust_fee, build_combined_outputs, build_dust_balancing_tx, build_transfer_recipe,
    estimate_unproven_fee, has_dust_balancing_intent, parse_shielded_token_label,
    parse_unshielded_token_label, sign_recipe, sign_unshielded_inputs, CombinedTokenTransfer,
    FeeContext, ShieldedTokenTransfer, TransferOptions, TransferSigningKeys, UnprovenTransaction,
    UnprovenTransactionRecipe, UnshieldedTokenTransfer, PRIMARY_SEGMENT_ID,
};