kobe_sol/lib.rs
1//! Solana wallet utilities for Kobe CLI.
2//!
3//! Provides Solana address derivation from a unified [`kobe_core::Wallet`].
4//!
5//! # Features
6//!
7//! - `std` (default): Enable standard library support
8//! - `alloc`: Enable heap allocation without full std (for `no_std` environments)
9//! - `rand`: Enable random key generation for `StandardWallet`
10//!
11//! # Usage
12//!
13//! ```
14//! use kobe_core::Wallet;
15//! use kobe_sol::Deriver;
16//!
17//! // Create a wallet from mnemonic
18//! let wallet = Wallet::from_mnemonic(
19//! "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
20//! None
21//! ).unwrap();
22//!
23//! // Derive Solana addresses from the wallet
24//! let deriver = Deriver::new(&wallet);
25//! let addr = deriver.derive(0).unwrap();
26//! println!("Address: {}", addr.address);
27//! ```
28
29#![cfg_attr(not(feature = "std"), no_std)]
30
31#[cfg(feature = "alloc")]
32extern crate alloc;
33
34#[cfg(feature = "alloc")]
35mod deriver;
36mod error;
37#[cfg(feature = "alloc")]
38mod slip10;
39#[cfg(feature = "alloc")]
40mod standard_wallet;
41
42#[cfg(feature = "alloc")]
43pub use deriver::{DerivedAddress, Deriver};
44pub use error::Error;
45#[cfg(feature = "alloc")]
46pub use standard_wallet::StandardWallet;