Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Zondax/ledger-rs
Rust crate to connect to Ledger devices
https://github.com/Zondax/ledger-rs
Last synced: 3 months ago
JSON representation
Rust crate to connect to Ledger devices
- Host: GitHub
- URL: https://github.com/Zondax/ledger-rs
- Owner: Zondax
- License: apache-2.0
- Created: 2018-07-29T10:50:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T14:45:13.000Z (6 months ago)
- Last Synced: 2024-08-10T21:15:27.115Z (5 months ago)
- Language: Rust
- Homepage:
- Size: 439 KB
- Stars: 37
- Watchers: 6
- Forks: 26
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - Zondax/ledger-rs - Rust crate to connect to Ledger devices (Rust)
README
# ledger-rs
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Github Actions](https://github.com/Zondax/ledger-rs/actions/workflows/main.yaml/badge.svg)](https://github.com/Zondax/ledger-rs)Communication library between Rust and Ledger Nano S/X devices
# How to use
## Developing an App interface
To develop an app interface it's recommended to depend on `ledger-transport` and make the API generic over the an `Exchange` (trait).
An example can be found in [`ledger-zondax-hid` tests](./ledger-zondax-hid/src/lib.rs#L380) (provided by `ledger-zondax-generic`) where `get_device_info` is independent of the transport used.## Using an App interface
To use an app interface, so when communicating with a ledger device (or emulator) the transports available are:
* `ledger-transport-hid`
* `ledger-transport-zemu`# How to publish to crates.io
Obviously only members of the Zondax/crates team are allowed to publish.
Afterwards, there's a correct order to publish the crates, based on the crate dependencies:
* ledger-apdu
* ledger-transport
* ledger-zondax-genericThen, the rest of the crates can be published in any order.
``sh
cargo login
cargo package -p ledger-apdu
cargo publish -p ledger-apducargo package -p ledger-transport
cargo publish -p ledger-transportcargo package -p ledger-zondax-generic
cargo publish -p ledger-zondax-genericcargo package -p ledger-transport-hid
cargo publish -p ledger-transport-hid
``