Crate trezor_client

source ·
Expand description

Trezor API library

Connecting

Use the public top-level methods find_devices() and unique() to find devices. When using find_devices(), a list of different available devices is returned. To connect to one or more of them, use their connect() method.

Logging

We use the log package interface, so any logger that supports log can be attached. Please be aware that trace logging can contain sensitive data.

Re-exports

pub use client::ButtonRequest;
pub use client::ButtonRequestType;
pub use client::EntropyRequest;
pub use client::Features;
pub use client::InputScriptType;
pub use client::InteractionType;
pub use client::PassphraseRequest;
pub use client::PinMatrixRequest;
pub use client::PinMatrixRequestType;
pub use client::Trezor;
pub use client::TrezorResponse;
pub use client::WordCount;
pub use error::Error;
pub use error::Result;

Modules

Structs

A device found by the find_devices() method. It can be connected to using the connect() method.
Object to track the progress in the transaction signing flow. The device will ask for various parts of the transaction and dependent transactions and can at any point also ask for user interaction. The information asked for by the device is provided based on a PSBT object and the resulting extra signatures are also added to the PSBT file.

Enums

The different kind of Trezor device models.

Traits

! In this module we implement the message_type() getter for all protobuf message types. This trait extends the protobuf Message trait to also have a static getter for the message type code. This getter is implemented in this file for all the messages we use.

Functions

Search for all available devices. Most devices will show up twice both either debugging enables or disabled.
Search for old HID devices. This should only be used for older devices that don’t have the firmware updated to version 1.7.0 yet. Trying to connect to a post-1.7.0 device will fail.
Try to get a single device. Optionally specify whether debug should be enabled or not. Can error if there are multiple or no devices available. For more fine-grained device selection, use find_devices(). When using USB mode, the device will show up both with debug and without debug, so it’s necessary to specify the debug option in order to find a unique one.