1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! # lsdk
//!
//! A Rust SDK to talk to hardware wallets that run the BOLOS operating system
//! (Nano S, Nano S Plus, Nano X, Stax, Flex, Nano Gen5) over USB HID, from
//! native code or from the browser through WebHID.
//!
//! The crate is split in layers, each behind a cargo feature so you only pay
//! for what you use:
//!
//! | Layer | Feature | Content |
//! |-------|---------|---------|
//! | core | *(always)* | APDU encoding, status words, HID framing, device models, [`Transport`](transport::Transport) trait, dashboard commands ([`Device`]) |
//! | native HID | `hid` | [`transport::hid::HidTransport`] built on `hidapi` |
//! | WebHID | `webhid` | [`transport::webhid::WebHidTransport`] for `wasm32` |
//! | manager API | `manager-api` | [`manager::api::ManagerApi`]: app catalog, firmware metadata |
//! | HSM channel | `hsm` | [`hsm`]: the websocket secure channel used for genuine check, install, update |
//! | manager | `manager` | [`manager::ops`]: genuine check, install / uninstall apps, firmware update |
//! | apps | `eth`, `btc`, `sol` | app clients ([`apps`]) to derive addresses, build and sign transactions |
//!
//! ```no_run
//! # #[cfg(feature = "hid")]
//! # async fn demo() -> Result<(), lsdk::Error> {
//! use lsdk::{Device, transport::hid::HidTransport};
//!
//! let transport = HidTransport::open_first()?;
//! let device = Device::new(transport);
//! let version = device.get_version().await?;
//! println!("{} running {}", version.model().map(|m| m.name()).unwrap_or("?"), version.se_version);
//! # Ok(()) }
//! ```
pub use ;
pub use Device;
pub use ;
pub use DeviceModel;
pub use Transport;
/// USB vendor id used by all devices.
pub const VENDOR_ID: u16 = 0x2c97;