| Crates.io | ledger-sdk-transport |
| lib.rs | ledger-sdk-transport |
| version | 0.0.1 |
| created_at | 2025-09-23 09:04:27.495939+00 |
| updated_at | 2025-09-23 09:04:27.495939+00 |
| description | Transport abstraction layer for Ledger device communication |
| homepage | |
| repository | https://github.com/0xjojo1/ledger-sdk-rust |
| max_upload_size | |
| id | 1851172 |
| size | 9,995 |
A modular Rust SDK for communicating with Ledger hardware wallets, featuring comprehensive Ethereum app support including EIP-712 typed data signing.
| Crate | Description | Version |
|---|---|---|
ledger-apdu |
APDU types and helpers | |
ledger-transport |
Transport abstraction layer | |
ledger-transport-hid |
HID transport implementation | |
ledger-device-base |
Device and app information helpers | |
ledger-eth-app |
Ethereum app with EIP-712 support |
Add the desired crates to your Cargo.toml:
[dependencies]
ledger-sdk-eth-app = "0.0.1"
ledger-sdk-transport-hid = "0.0.1"
use ledger_sdk_eth_app::EthApp;
use ledger_sdk_transport_hid::TransportNativeHID;
use ledger_sdk_eth_app::types::BipPath;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create HID transport
let transport = TransportNativeHID::new()?;
// Create Ethereum app instance
let eth_app = EthApp::new();
// Get address for derivation path
let path = BipPath::from_string("44'/60'/0'/0/0")?;
let address = eth_app.get_address(&transport, &path).await?;
println!("Address: {}", address);
Ok(())
}
use ledger_sdk_eth_app::EthApp;
use ledger_sdk_eth_app::commands::eip712::SignEip712TypedData;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let transport = TransportNativeHID::new()?;
let eth_app = EthApp::new();
// EIP-712 typed data
let typed_data = json!({
"domain": {
"name": "MyApp",
"version": "1",
"chainId": 1,
"verifyingContract": "0x1234567890123456789012345678901234567890"
},
"types": {
"Person": [
{"name": "name", "type": "string"},
{"name": "wallet", "type": "address"}
]
},
"primaryType": "Person",
"message": {
"name": "Alice",
"wallet": "0x1234567890123456789012345678901234567890"
}
});
let path = BipPath::from_string("44'/60'/0'/0/0")?;
let signature = eth_app.sign_eip712_from_json(&transport, &path, &typed_data.to_string()).await?;
println!("Signature: {:?}", signature);
Ok(())
}
# Build all crates
cargo build
# Run tests
cargo test
# Run examples
cargo run --example basic_test
Check the examples/ directory for more comprehensive usage examples:
basic_test.rs - Basic Ethereum operationsusdc_permit_example.rs - USDC permit signing with EIP-712Licensed under the Apache License, Version 2.0. See LICENSE for details.
Portions of this code are derived from the Zondax ledger-rs project (Apache-2.0). See NOTICE for details.