Trait hardware_wallet::Wallet[][src]

pub trait Wallet<'a> {
    type Error;
    type Transaction;
    fn sign_transaction(
        &self,
        address: &Address,
        transaction: Self::Transaction
    ) -> Result<Signature, Self::Error>;
fn set_key_path(&self, key_path: KeyPath);
fn update_devices(
        &self,
        device_direction: DeviceDirection
    ) -> Result<usize, Self::Error>;
fn read_device(
        &self,
        usb: &HidApi,
        dev_info: &HidDeviceInfo
    ) -> Result<Device, Self::Error>;
fn list_devices(&self) -> Vec<WalletInfo>;
fn list_locked_devices(&self) -> Vec<String>;
fn get_wallet(&self, address: &Address) -> Option<WalletInfo>;
fn get_address(
        &self,
        device: &HidDevice
    ) -> Result<Option<Address>, Self::Error>;
fn open_path<R, F>(&self, f: F) -> Result<R, Self::Error>
    where
        F: Fn() -> Result<R, &'static str>
; }

Wallet trait

Associated Types

Error

Transaction data format

Required Methods

Sign transaction data with wallet managing address.

Set key derivation path for a chain.

Re-populate device list Note, this assumes all devices are iterated over and updated

Read device info

List connected and acknowledged wallets

List locked wallets This may be moved if it is the wrong assumption, for example this is not supported by Ledger Then this method return a empty vector

Get wallet info.

Generate ethereum address for a Wallet

Open a device using device path Note, f - is a closure that borrows HidResult HidDevice is in turn a type alias for a c_void function pointer For further information see: * https://github.com/paritytech/hidapi-rs * https://github.com/rust-lang/libc

Implementors