{"id":19149571,"url":"https://github.com/zeriontech/hardware-wallet-connection","last_synced_at":"2025-10-10T10:39:35.919Z","repository":{"id":244940121,"uuid":"696353048","full_name":"zeriontech/hardware-wallet-connection","owner":"zeriontech","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-08T15:52:35.000Z","size":605,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-22T20:32:27.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeriontech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-25T15:19:17.000Z","updated_at":"2024-06-18T10:39:37.000Z","dependencies_parsed_at":"2024-06-18T13:25:43.778Z","dependency_job_id":"e7ffb88f-fca7-4f9e-ad5c-64ac04cbbf7f","html_url":"https://github.com/zeriontech/hardware-wallet-connection","commit_stats":null,"previous_names":["zeriontech/hardware-wallet-connection"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/zeriontech/hardware-wallet-connection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fhardware-wallet-connection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fhardware-wallet-connection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fhardware-wallet-connection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fhardware-wallet-connection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeriontech","download_url":"https://codeload.github.com/zeriontech/hardware-wallet-connection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fhardware-wallet-connection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003546,"owners_count":26083595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T08:08:46.049Z","updated_at":"2025-10-10T10:39:35.903Z","avatar_url":"https://github.com/zeriontech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hardware-wallet-connection\n\nThe `hardware-wallet-connection` module is a JavaScript library that provides methods for interacting with a Ledger hardware wallet. You can use it to connect to a Ledger device, check its status, retrieve addresses and sign transactions.\n\n## Installation\n\nYou can install `hardware-wallet-connection` via npm or yarn:\n\n```bash\nnpm install hardware-wallet-connection\n# OR\nyarn add hardware-wallet-connection\n```\n\n## Usage\n\n### Importing the Module\n\nTo use the `hardware-wallet-connection` module, import the required methods as follows:\n\n```javascript\nimport {\n  connectDevice,\n  checkDevice,\n  interpretError,\n  deniedByUser,\n  getAddressByDerivationPath,\n  getAddresses,\n  supportsLedger,\n  signTransaction,\n  serializeTransaction,\n} from \"hardware-wallet-connection\";\n```\n\n### Methods\n\n#### `connectDevice()`\n\nUse this method to establish a connection with a Ledger hardware wallet.\nFor first-time connection, browser will show a Permission Window\n\n```javascript\nconst device = await connectDevice();\n```\n\n#### `checkDevice()`\n\nCheck the status of the connected Ledger device.\nThis function checks if the device is connected without ever displaying device permission window. This check may be safely performed in background.\n\n```javascript\nconst deviceStatus = await checkDevice();\n```\n\n#### `interpretError(error: LedgerError)`\n\nInterpret Ledger error codes to provide more user-friendly error messages.\n\n```javascript\nconst errorMessage = interpretError(error);\n```\n\n#### `deniedByUser(error: LedgerError)`\n\nCheck if the user denied a Ledger action.\n\n```javascript\nconst isDenied = deniedByUser(error);\n```\n\n#### `getAddressByDerivationPath(appEth: AppEth, { derivationPath }: { derivationPath: string })`\n\nRetrieve an address from the Ledger device using a specified derivation path.\n\n```javascript\n// retrieved address for index: 1\nconst address = await getAddressByDerivationPath(appEth, {\n  derivationPath: \"44'/60'/1'/0/0\",\n});\n```\n\n#### `getAddresses(appEth: AppEth, { type, from, count }: { type: PathType; from: number; count: number })`\n\nRetrieve multiple addresses from the Ledger device using an array of derivation paths.\n\n```javascript\nconst addresses = getAddresses(appEth: AppEth, { type: 'ledgerLive', from: 0, count: 5 });\n```\n\n#### `supportsLedger()`\n\nCheck if the current environment supports Ledger hardware wallets.\n\n```javascript\nconst isSupported = supportsLedger();\n```\n\n#### `signTransaction(derivationPath: string, transaction: IncomingTransaction)`\n\nSign a transaction using the Ledger device.\n\n```javascript\nconst signedTransaction = signTransaction(\"44'/60'/1'/0/0\", transaction);\n```\n\n#### `serializeTransaction(transaction: IncomingTransaction)`\n\nSerialize a transaction for Ledger signing.\n\n```javascript\nconst serializedTransaction = serializeTransaction(transaction);\n```\n\n#### `personalSign(derivationPath: string, message: string)`\n\nSign a message using the Ledger device.\n\n```javascript\nconst signature = personalSign(\"44'/60'/1'/0/0\", message);\n```\n\n#### `signTypedData_v4(derivationPath: string, typedData: string | TypedData)`\n\nSign a typed EIP-712 message using the Ledger device.\n\n```javascript\nconst signature = signTypedData_v4(\"44'/60'/1'/0/0\", typedData);\n```\n\n## Author\n\neverdimension \u003ceverdimension@gmail.com\u003e\n\n---\n\n**Disclaimer**: This module is not affiliated with or endorsed by Ledger SAS. Use it at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fhardware-wallet-connection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeriontech%2Fhardware-wallet-connection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fhardware-wallet-connection/lists"}