[][src]Struct hwi::interface::HWIDevice

pub struct HWIDevice {
    pub device_type: String,
    pub model: String,
    pub path: String,
    pub needs_pin_sent: bool,
    pub needs_passphrase_sent: bool,
    pub fingerprint: Fingerprint,
}

Fields

device_type: Stringmodel: Stringpath: Stringneeds_pin_sent: boolneeds_passphrase_sent: boolfingerprint: Fingerprint

Implementations

impl HWIDevice[src]

pub fn enumerate() -> Result<Vec<HWIDevice>, Error>[src]

Lists all HW devices currently connected.

pub fn get_master_xpub(&self, testnet: bool) -> Result<HWIExtendedPubKey, Error>[src]

Returns the master xpub of a device.

Arguments

  • testnet - Whether to use testnet or not.

pub fn sign_tx(
    &self,
    psbt: &PartiallySignedTransaction,
    testnet: bool
) -> Result<HWIPartiallySignedTransaction, Error>
[src]

Returns a psbt signed.

Arguments

  • psbt - The PSBT to be signed.
  • testnet - Whether to use testnet or not.

pub fn get_xpub(
    &self,
    path: &DerivationPath,
    testnet: bool
) -> Result<HWIExtendedPubKey, Error>
[src]

Returns the xpub of a device.

Arguments

  • path - The derivation path to derive the key.
  • testnet - Whether to use testnet or not.

pub fn sign_message(
    &self,
    message: &str,
    path: &DerivationPath,
    testnet: bool
) -> Result<HWISignature, Error>
[src]

Signs a message.

Arguments

  • message - The message to sign.
  • path - The derivation path to derive the key.
  • testnet - Whether to use testnet or not.

pub fn get_keypool(
    &self,
    keypool: bool,
    internal: bool,
    address_type: HWIAddressType,
    account: Option<u32>,
    path: Option<&DerivationPath>,
    start: u32,
    end: u32,
    testnet: bool
) -> Result<Vec<HWIKeyPoolElement>, Error>
[src]

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

Arguments

  • keypool - keypool value in result. Check bitcoin core importmulti documentation for further information
  • internal - Whether to use internal (change) or external keys
  • address type - HWIAddressType to use
  • account - Optional BIP43 account to use
  • path - The derivation path to derive the keys.
  • start - Keypool start
  • end - Keypool end
  • testnet - Whether to use testnet or not.

pub fn get_descriptors(
    &self,
    account: Option<u32>,
    testnet: bool
) -> Result<HWIDescriptor, Error>
[src]

Returns device descriptors

Arguments

  • account - Optional BIP43 account to use.
  • testnet - Whether to use testnet or not.

pub fn display_address_with_desc(
    &self,
    descriptor: &str,
    testnet: bool
) -> Result<HWIAddress, Error>
[src]

Returns an address given a descriptor.

Arguments

  • descriptor - The descriptor to use. HWI doesn't support descriptors checksums.
  • testnet - Whether to use testnet or not.

pub fn display_address_with_path(
    &self,
    path: &DerivationPath,
    address_type: HWIAddressType,
    testnet: bool
) -> Result<HWIAddress, Error>
[src]

Returns an address given pat and address type

Arguments

  • path - The derivation path to use.
  • address_type - Address type to use.
  • testnet - Whether to use testnet or not.

Trait Implementations

impl Clone for HWIDevice[src]

impl<'de> Deserialize<'de> for HWIDevice[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.