pub struct HWIClient { /* private fields */ }

Implementations

Lists all HW devices currently connected.

let devices = HWIClient::enumerate()?;
for device in devices {
    println!("I can see a {} here 😄", device.model);
}

Returns the HWIClient for a certain device. You can list all the available devices using enumerate.

Setting expert to true will enable additional output for some commands.

let devices = HWIClient::enumerate()?;
for device in devices {
    let client = HWIClient::get_client(&device, false, HWIChain::Test)?;
    let xpub = client.get_master_xpub(HWIAddressType::Tap, 0)?;
    println!(
        "I can see a {} here, and its xpub is {}",
        device.model,
        xpub.to_string()
    );
}

Returns the master xpub of a device, given the address type and the account number.

Signs a PSBT.

Returns the xpub of a device. If expert is set, additional output is returned.

Signs a message.

Returns an array of keys that can be imported in Bitcoin core using importmulti

  • keypool - keypool value in result. Check bitcoin core importmulti documentation for further information
  • internal - Whether to use internal (change) or external keys
  • addr_type - Address type to use
  • addr_all - Whether to return a multiple descriptors for every address type
  • account - Optional BIP43 account to use
  • path - The derivation path to derive the keys.
  • start - Keypool start
  • end - Keypool end

Returns device descriptors. You can optionally specify a BIP43 account to use.

Returns an address given a descriptor. Note that HWI doesn’t support descriptors checksums.

Returns an address given path and address type.

Install the udev rules to the local machine.

The rules will be copied from the source to the location; the default source location is ./udev, the default destination location is /lib/udev/rules.d

Set logging level

Arguments
  • level - Log level.

Toggle whether the device is using a BIP 39 passphrase.

Wipe a device

Get the installed version of hwilib. Returns None if hwi is not installed.

Install hwi for the current user via pip. If no version is specified, the default version from pip will be installed.

Trait Implementations

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.