Crates.io | ledger-hw-app-btc |
lib.rs | ledger-hw-app-btc |
version | 0.0.1 |
source | src |
created_at | 2020-04-25 14:13:45.857607 |
updated_at | 2020-04-25 14:13:45.857607 |
description | Helpers for Ledger Bitcoin app |
homepage | |
repository | https://github.com/edouardparis/ledger-hw.git |
max_upload_size | |
id | 233962 |
size | 57,091 |
A transport implementing the ledger_hw
trait is needed in most of the
helpers.
example:
use bitcoin::util::bip32;
use ledger_hw_app_btc::get_wallet_public_key;
use ledger_hw_app_btc::AddressFormat;
use ledger_hw_transport_hid::HidTransport;
use std::str::FromStr;
#[tokio::main]
async fn main() {
let transport = HidTransport::new().unwrap();
let path = bip32::DerivationPath::from_str("m/44'/0'/0'/0/0").unwrap();
let (pk, address, chaincode) = get_wallet_public_key(&transport, &path, true, AddressFormat::Legacy)
.await
.unwrap();
println!("pk: {}", pk);
println!("address: {}", address);
println!("chaincode: {}", chaincode);
}
TODO: