kobe_core/lib.rs
1//! Core wallet types for Kobe multi-chain wallet CLI.
2//!
3//! This crate provides the unified [`Wallet`] type that holds a BIP39 mnemonic
4//! and derives seeds for multiple cryptocurrencies.
5//!
6//! # Features
7//!
8//! - `std` (default): Enable standard library support
9//! - `alloc`: Enable heap allocation without full std (for `no_std` environments)
10//!
11//! # Example
12//!
13//! ```
14//! use kobe_core::Wallet;
15//!
16//! // Generate a new wallet (requires std or alloc feature with RNG)
17//! let wallet = Wallet::generate(12, None).unwrap();
18//!
19//! // Or with a passphrase (BIP39 optional password)
20//! let wallet = Wallet::generate(12, Some("my secret passphrase")).unwrap();
21//!
22//! // The same mnemonic can derive addresses for any coin
23//! let seed = wallet.seed();
24//! ```
25
26#![cfg_attr(not(feature = "std"), no_std)]
27
28#[cfg(feature = "alloc")]
29extern crate alloc;
30
31mod error;
32#[cfg(feature = "alloc")]
33mod wallet;
34
35pub use error::Error;
36#[cfg(feature = "alloc")]
37pub use wallet::Wallet;