{"id":13566948,"url":"https://github.com/hazae41/ledger","last_synced_at":"2026-02-26T09:59:39.107Z","repository":{"id":239004641,"uuid":"798223947","full_name":"hazae41/ledger","owner":"hazae41","description":"Private and supply-chain hardened Ledger controller for TypeScript","archived":false,"fork":false,"pushed_at":"2024-09-01T04:47:57.000Z","size":58,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-18T16:19:38.994Z","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/hazae41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["hazae41"],"patreon":"hazae41"}},"created_at":"2024-05-09T10:46:55.000Z","updated_at":"2024-09-01T04:48:01.000Z","dependencies_parsed_at":"2024-05-09T12:40:01.952Z","dependency_job_id":"776a3f3d-e503-4686-b98b-8cb6d5ea19b4","html_url":"https://github.com/hazae41/ledger","commit_stats":null,"previous_names":["hazae41/ledger"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fledger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fledger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fledger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fledger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazae41","download_url":"https://codeload.github.com/hazae41/ledger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249812025,"owners_count":21328907,"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","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-08-01T13:02:20.107Z","updated_at":"2026-02-26T09:59:39.065Z","avatar_url":"https://github.com/hazae41.png","language":"TypeScript","funding_links":["https://github.com/sponsors/hazae41","https://patreon.com/hazae41"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Ledger\n\nPrivate and supply-chain hardened Ledger controller for TypeScript\n\n```bash\nnpm i @hazae41/ledger\n```\n\n[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/ledger)\n\n## Features\n\n### Current features\n- 100% TypeScript and ESM\n- No external dependencies\n- Rust-like patterns\n- No network code\n- No tracking\n\n## Usage\n\n### Get USB connector\n\n```tsx\n/** Will open a popup using navigator.usb */\nconst device = Ledger.USB.getOrRequestDeviceOrThrow()\nconst connector = Ledger.USB.connectOrThrow(device)\n```\n\n### Get address and/or uncompressed public key at path\n\n```tsx\nimport { Ledger } from \"@hazae41/ledger\"\n\nconst { address, uncompressedPublicKey } = await Ledger.Ethereum.getAddressOrThrow(connector, \"44'/60'/0'/0/0\")\n```\n\n### Verify and get address and/or uncompressed public key at path\n\nAsk the user to verify the address and get it\n\n```tsx\nimport { Ledger } from \"@hazae41/ledger\"\n\nconst { address, uncompressedPublicKey } = await Ledger.Ethereum.verifyAndGetAddressOrThrow(connector, \"44'/60'/0'/0/0\")\n```\n\n### Sign a personal message at path\n\n```tsx\nimport { Ledger } from \"@hazae41/ledger\"\nimport { ZeroHexSignature } from \"@hazae41/cubane\"\n\nconst message = new TextEncoder().encode(\"Hello World\")\n\nconst rsvSignature = await Ledger.Ethereum.signPersonalMessageOrThrow(connector, \"44'/60'/0'/0/0\", message)\nconst zeroHexSignature = ZeroHexSignature.fromOrThrow(rsvSignature)\n```\n\n### Sign a transaction at path\n\n```tsx\nimport { Ledger } from \"@hazae41/ledger\"\nimport { ZeroHexSignature } from \"@hazae41/cubane\"\n\nconst transaction = ethers.utils.arrayify(ethers.Transaction.from({\n  chainId,\n  nonce,\n  to,\n  value,\n  data\n  gasLimit,\n  gasPrice,\n}).unsignedSerialized)\n\nconst rsvSignature = await Ledger.Ethereum.signTransactionOrThrow(connector, \"44'/60'/0'/0/0\", transaction)\nconst zeroHexSignature = ZeroHexSignature.fromOrThrow(rsvSignature)\n```\n\n### Sign EIP712 typed message at path\n\n```tsx\nimport { Ledger } from \"@hazae41/ledger\"\nimport { ZeroHexSignature } from \"@hazae41/cubane\"\n\nconst rsvSignature = await Ledger.Ethereum.signEIP712HashedMessageOrThrow(connector, \"44'/60'/0'/0/0\", domain, message)\nconst zeroHexSignature = ZeroHexSignature.fromOrThrow(rsvSignature)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fledger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazae41%2Fledger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fledger/lists"}