feat: add Tron support to hdwallet-ledger#754
Conversation
Implements Tron support for Ledger hardware wallets following the established pattern for chain integrations. Changes: - Add @ledgerhq/hw-app-trx dependency (v6.31.9) - Create packages/hdwallet-ledger/src/tron.ts with: - tronGetAddress() - Derives Tron address from BIP44 path - tronSignTx() - Signs transactions using rawDataHex - tronGetAccountPaths() - Returns standard Tron BIP44 paths - tronNextAccountPath() - Account path iteration - Update LedgerHDWalletInfo to implement TronWalletInfo interface - Update LedgerHDWallet to implement TronWallet interface - Add Tron app name mapping (SLIP44: 195 -> "Tron") - Add "Tron" to LedgerTransportCoinType and type mappings - Add Tron case to describePath() Technical Details: - BIP44 Path: m/44'/195'/0'/0/0 (SLIP44 code 195) - Uses hw-app-trx library for Ledger device communication - Signature format: rawDataHex + signature (65 bytes) - Address format: Base58-encoded, starts with 'T' This enables users to manage Tron assets with Ledger hardware wallets, including native TRX and TRC20 token transactions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Auto-fix import order and array formatting to match project style. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add Tron coin case to translateCoinAndMethod in both WebUSB and WebHID transport implementations. This allows the Ledger device to properly route Tron method calls to the hw-app-trx library. Also added missing Cosmos, Solana, and Thorchain support to WebHID transport for feature parity with WebUSB. Changes: - Import Trx from @ledgerhq/hw-app-trx - Add "Tron" case to translateCoinAndMethod switch statements - WebHID: Add Cosmos, Solana, Thorchain cases for completeness This fixes the "TypeError: coin" error when trying to connect Tron accounts via Ledger hardware wallets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds Tron support to the Ledger HDWallet integration and expands Ledger webhid transport cases to include Cosmos, Solana, and Thorchain; updates transport types, introduces a new tron module with address/sign and account-path helpers, and bumps package versions and dependencies to 1.62.19 across many packages. Changes
Sequence DiagramsequenceDiagram
participant User
participant LedgerHDWallet
participant TronModule
participant Transport
participant LedgerDevice
User->>LedgerHDWallet: tronGetAddress(msg)
LedgerHDWallet->>TronModule: tronGetAddress(transport, msg)
TronModule->>TronModule: derive BIP32 path
TronModule->>Transport: Trx.getAddress(path)
Transport->>LedgerDevice: send APDU (path)
LedgerDevice-->>Transport: address response
Transport-->>TronModule: address
TronModule-->>LedgerHDWallet: return address
LedgerHDWallet-->>User: Promise<string>
User->>LedgerHDWallet: tronSignTx(msg)
LedgerHDWallet->>TronModule: tronSignTx(transport, msg)
TronModule->>TronModule: derive BIP32 path & prepare tx
TronModule->>Transport: Trx.signTransaction(path, tx)
Transport->>LedgerDevice: send APDU (path + tx)
LedgerDevice-->>Transport: signature
Transport-->>TronModule: signature
TronModule->>TronModule: format signed tx
TronModule-->>LedgerHDWallet: return TronSignedTx
LedgerHDWallet-->>User: Promise<TronSignedTx>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (27)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Remove ^ prefix from all 1.62.17 version references to use exact versions instead of ranges. This ensures consistent dependency resolution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Implements Ledger hardware wallet integration for Sui blockchain: - Add @mysten/ledgerjs-hw-app-sui dependency - Create sui.ts module for Ledger-specific Sui operations - Implement suiGetAddress() and suiSignTx() for Ledger transport - Add Sui support to LedgerHDWallet and LedgerHDWalletInfo classes - Update transport type system and implementations (WebUSB, WebHID) - Add Sui (784) to appNameBySlip44 mapping Follows same pattern as Tron Ledger implementation (PR #754). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>



Description
Does what it says on the box - test with web fren.
NOTE: You may run into out of energy issues, unrelated to this PR, pls focus on signing bits.
Issue
Screenshots
E2E: https://jam.dev/c/6dc34b03-2180-4639-802f-da50850f9c18
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.