1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Note: `missing_docs` is intentionally NOT warned/denied at crate level.
// CI runs clippy with `-A missing_docs` to allow private/incomplete doc coverage
// on struct fields, variants, and methods. The crate-level attribute would
// otherwise override the command-line `-A` (rustc lint precedence).
// `WalletError::ReviewActions` and `::InvalidMerkleRoot` carry rich contextual
// data required by the TypeScript-parity wire format (matching WERR_* payloads).
// Boxing the variant would force an API-breaking change to a stable public
// error type used pervasively as `Result<_, WalletError>`. The size is
// intentional for API stability and wire-format parity.
//! BSV Wallet Toolbox - Production-ready BSV wallet implementation in Rust.
//!
//! This crate provides a complete, production-ready BSV wallet with persistent
//! storage, automatic transaction broadcasting, proof collection, and chain
//! monitoring. It translates the TypeScript wallet-toolbox into idiomatic Rust.
//!
//! # Modules
//!
//! - [`error`] - Unified error types with WERR codes
//! - [`status`] - Status enums for transactions, proofs, and sync
//! - [`types`] - Shared types (`Chain`, `StorageProvidedBy`)
//! - [`tables`] - Database table structs for all 16 entity types
//! - [`storage`] - Storage traits, manager, and SQLx implementation
//! - [`services`] - Network service providers (ARC, WhatsOnChain, etc.)
//! - [`signer`] - Transaction signing with BRC-29 key derivation
//! - [`wallet`] - High-level Wallet struct implementing WalletInterface
//! - [`monitor`] - Background task runner for proofs, sync, and chain monitoring
//! - [`utility`] - Cryptographic helpers and BRC-29 script templates
//! - [`logging`] - Structured logging initialization via tracing
/// Authentication manager for WAB-based wallet authentication flows.
/// Error types for wallet operations.
/// Structured logging initialization.
/// Background monitoring tasks for proofs and chain state.
/// Permission management for wallet operations.
/// Network service providers and traits.
/// Transaction signing and key derivation.
/// Macro for implementing sqlx traits on enums as string columns.
/// Block header tracking, storage, and chain reorganization detection.
/// Lenient NaiveDateTime serde helpers (handles trailing "Z" from TS).
/// Lenient serde helpers for TS interop (integer-as-bool, etc.).
/// Status enums for wallet entities.
/// Storage layer: traits, manager, and implementations.
/// Database table structs mapping to SQL schema.
/// Shared types used across subsystems.
/// Cryptographic utilities and BRC-29 script templates.
/// Wallet Authentication Backend (WAB) client for identity verification.
/// High-level wallet implementation.
/// Database migration helpers (feature-gated by database backend).
/// BSV transaction type from the SDK.
pub use Transaction;
/// The WalletInterface trait defining all 29 wallet operations.
pub use WalletInterface;
/// Key derivation for BRC-42/BRC-43 protocols.
pub use KeyDeriver;
/// Protocol wallet providing default WalletInterface implementations.
pub use ProtoWallet;
/// Unified wallet error type.
pub use WalletError;
/// Convenience Result alias for wallet operations.
pub use WalletResult;
/// Status of a proven transaction request.
pub use ProvenTxReqStatus;
/// Status of wallet synchronization.
pub use SyncStatus;
/// Status of a wallet transaction.
pub use TransactionStatus;
/// Trait for wallet setup and configuration.
pub use SetupWallet;
/// Builder for constructing configured Wallet instances.
pub use WalletBuilder;