Ledger Signer provides a simple yet robust interface to interact with Ledger devices using TypeScript. It supports secure message signing, dynamic user input, comprehensive error handling, and includes utilities for logging and CLI prompting.
- Secure Message Signing: Interact with Ledger devices to sign messages.
- Modular Design: Clear separation of concerns with dedicated modules for logging, prompting, and signing.
- Robust Error Handling: Gracefully handles common Ledger errors and prompts users for corrective actions.
- TypeScript & Jest: Written in TypeScript with comprehensive test coverage using Jest.
Ensure you have Node.js installed (v14 or higher is recommended).
-
Clone the repository:
git clone https://github.com/TacitusXI/ledger-signer.git cd ledger-signer
-
Install dependencies:
npm install
Compile the TypeScript code to JavaScript:
npm run build
Start the application with:
npm run start
Check for code quality and consistency using ESLint:
npm run lint
Run the test suite with Jest:
npm run test
- build: Compiles the TypeScript files using tsc.
- start: Runs the application via ts-node src/index.ts.
- lint: Executes ESLint on .ts files to enforce coding standards.
- test: Runs tests using Jest.
Key dependencies include:
- @ledgerhq/hw-app-eth & @ledgerhq/hw-transport-node-hid: For Ledger device interaction.
- usb-detection: To monitor USB device status.
Dev dependencies include TypeScript, ESLint, and Jest for testing and code quality.