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