Skip to main content

kobe_primitives/
lib.rs

1//! Multi-chain HD wallet derivation library.
2//!
3//! Core [`Wallet`] type holds a BIP-39 mnemonic and derives seeds for
4//! chain-specific derivers (`kobe-evm`, `kobe-btc`, `kobe-svm`, etc.).
5//!
6//! ```no_run
7//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
8//! let wallet = kobe_primitives::Wallet::from_mnemonic(
9//!     "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
10//!     None,
11//! )?;
12//! # Ok(())
13//! # }
14//! ```
15
16#![cfg_attr(not(feature = "std"), no_std)]
17
18#[cfg(feature = "alloc")]
19extern crate alloc;
20
21#[cfg(feature = "alloc")]
22mod derive;
23mod error;
24#[cfg(feature = "alloc")]
25mod wallet;
26
27#[cfg(feature = "bip32")]
28pub mod bip32;
29#[cfg(feature = "camouflage")]
30pub mod camouflage;
31#[cfg(feature = "alloc")]
32pub mod mnemonic;
33#[cfg(feature = "slip10")]
34pub mod slip10;
35
36pub use bip39::Language;
37#[cfg(feature = "rand_core")]
38pub use bip39::rand_core;
39#[cfg(feature = "alloc")]
40pub use derive::{Derive, DeriveExt, DerivedAccount};
41pub use error::DeriveError;
42#[cfg(feature = "alloc")]
43pub use wallet::Wallet;
44
45/// Convenient Result alias.
46pub type Result<T> = core::result::Result<T, DeriveError>;