Crate ledger_hw_app_btc

Source
Expand description

https://github.com/edouardparis/ledger-hw

Example:

use std::str::FromStr;
use bitcoin::util::bip32::DerivationPath;
use ledger_hw_transport_hid::HidTransport;

use ledger_hw_app_btc::{AddressFormat, get_wallet_public_key};

#[tokio::main]
async fn main() {
    let transport = HidTransport::new().unwrap();
    let path = DerivationPath::from_str("m/44'/0'/0'/0/0").unwrap();
    let format = AddressFormat::Legacy;
    let (pk, address, chaincode) = get_wallet_public_key(&transport, &path, true, format)
        .await
        .unwrap();
    println!("pk: {}", pk);
    println!("address: {}", address);
    println!("chaincode: {}", chaincode);
}

Re-exports§

Modules§