laron_wallet/lib.rs
1// This file is part of the laron-wallet.
2//
3// Copyright (C) 2023 Ade M Ramdani
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18//! 
19//! [](https://www.gnu.org/licenses/gpl-3.0)
20//! 
21//! [](https://app.fossa.com/projects/git%2Bgithub.com%2Fcuriousdev04%2Fwallet?ref=badge_shield)
22//!
23//! This is a library for generating and managing wallets. This library contains
24//! the following features:
25//! - BIP39 Mnemonic and Seed Generation
26//! - BIP32 HD Wallet Generation
27//!
28//! # TODO
29//! - [ ] Add support RPC calls
30//! - [ ] Add support for Contracts
31//!
32//! ## Example
33//! ```rust
34//! use laron_wallet::bips::bip39::{Mnemonic, MnemonicType};
35//! use laron_wallet::bips::wordlists::Language;
36//! use laron_wallet::bips::bip32::ExtendedKey;
37//! use laron_wallet::bips::DerivationPath;
38//! use laron_wallet::address::Address;
39//!
40//! let mnemonic = Mnemonic::new(MnemonicType::Words12, Language::English);
41//! let seed = mnemonic.to_seed("password");
42//! let master_key = ExtendedKey::new_master(&seed).unwrap();
43//!
44//! // define the path to derive, We will use ethereum path
45//! let path = DerivationPath::parse("m/44'/60'/0'/0/0").unwrap();
46//! let child_key = master_key.derive_path(&path).unwrap();
47//! let private_key = child_key.private_key();
48//! let public_key = private_key.public_key();
49//! let address = Address::from(&public_key);
50//! ```
51
52pub mod address;
53pub mod bips;