ledger_hw_app_btc/
lib.rs

1//! https://github.com/edouardparis/ledger-hw
2//!
3//! Example:
4//!
5//! ```
6//! use std::str::FromStr;
7//! use bitcoin::util::bip32::DerivationPath;
8//! use ledger_hw_transport_hid::HidTransport;
9//!
10//! use ledger_hw_app_btc::{AddressFormat, get_wallet_public_key};
11//!
12//! #[tokio::main]
13//! async fn main() {
14//!     let transport = HidTransport::new().unwrap();
15//!     let path = DerivationPath::from_str("m/44'/0'/0'/0/0").unwrap();
16//!     let format = AddressFormat::Legacy;
17//!     let (pk, address, chaincode) = get_wallet_public_key(&transport, &path, true, format)
18//!         .await
19//!         .unwrap();
20//!     println!("pk: {}", pk);
21//!     println!("address: {}", address);
22//!     println!("chaincode: {}", chaincode);
23//! }
24//! ```
25
26pub mod constant;
27pub mod error;
28pub mod util;
29pub mod wallet;
30
31pub use util::get_firmware_version;
32pub use wallet::get_trusted_input;
33pub use wallet::get_wallet_public_key;
34pub use wallet::hash_output_full;
35pub use wallet::sign_message;
36pub use wallet::start_untrusted_hash_transaction_input;
37pub use wallet::untrusted_hash_sign;
38pub use wallet::AddressFormat;