xrpl_mithril_wallet/lib.rs
1#![doc(html_logo_url = "https://raw.githubusercontent.com/KyleWMiller/xrpl-mithril/main/assets/mithrilLogo.png")]
2//! Key generation, signing, and address management for the XRPL.
3//!
4//! This crate provides:
5//! - Key pair generation for secp256k1 (ECDSA) and Ed25519
6//! - Seed encoding/decoding (sXXX format)
7//! - Classic address and X-address conversion
8//! - Transaction signing (single-sign and multi-sign)
9//!
10//! # Crypto Backends
11//!
12//! By default, this crate uses pure-Rust cryptography:
13//! - `k256` for secp256k1 ECDSA
14//! - `ed25519-dalek` for Ed25519
15//!
16//! An optional `native-crypto` feature enables C-backed `secp256k1` for
17//! environments where performance is critical.
18//!
19//! # Quick Start
20//!
21//! ```
22//! use xrpl_mithril_wallet::{Wallet, Algorithm};
23//!
24//! // Generate a random Ed25519 wallet
25//! let wallet = Wallet::generate(Algorithm::Ed25519).unwrap();
26//! println!("Address: {}", wallet.classic_address());
27//! ```
28
29#![forbid(unsafe_code)]
30
31pub mod address;
32pub mod algorithm;
33pub mod error;
34pub mod keypair;
35pub mod seed;
36pub mod signer;
37
38// Re-exports for convenience
39pub use algorithm::Algorithm;
40pub use error::WalletError;
41pub use keypair::{Keypair, Wallet};
42pub use seed::Seed;
43pub use signer::{sign, multi_sign, combine_signatures, SignedTransaction, Signer};