-
Notifications
You must be signed in to change notification settings - Fork 235
feat: add more trezor paths, export path type, add ledger bluetooth #710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gamalielhere
wants to merge
17
commits into
develop
Choose a base branch
from
devop/hw-wallets-update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
96a0984
feat: add more trezor paths, export path type, add ledger bluetooth
gamalielhere dd5709c
fix: conflicts
gamalielhere cca3fcd
devop: add minor note on readme
gamalielhere 4d029f1
devop: add path
gamalielhere 47ff858
devop: define sign transaction return value better
gamalielhere 1cabb24
fix: correct version
gamalielhere 59dc545
devop: update live common
gamalielhere 39569a6
devop: clean up
gamalielhere 95c33f0
devop: pull changes
gamalielhere 8b2069e
devop: add btc test
gamalielhere 80bbc5c
devop: cleanup
gamalielhere a888bf2
devop: revert the default change
gamalielhere 4bd0a69
devop: remove changelog
gamalielhere 2c07681
devop: merge class to one init function, attempt to fix ble transport…
gamalielhere 7832092
devop: fake address
gamalielhere de1b0c0
Merge branch 'develop' of github.com:enkryptcom/enKrypt into devop/hw…
gamalielhere 4c27c77
fix: conflicts:
gamalielhere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,84 @@ | ||
| # @enkryptcom/hw-wallets | ||
|
|
||
| ## v0.0.12 | ||
|
|
||
| ## Hardware wallet manager for enkrypt | ||
|
|
||
| ### Getting started | ||
|
|
||
| #### Minimum Node version | ||
|
|
||
| `node v20` | ||
|
|
||
| #### Installation | ||
|
|
||
| NPM: `npm install @enkryptcom/hw-wallets @enkryptcom/types` | ||
| Yarn: `yarn add @enkryptcom/hw-wallets @enkryptcom/types` | ||
| PNPM `pnpm add @enkryptcom/hw-wallets @enkryptcom/types` | ||
|
|
||
| ### How to use | ||
|
|
||
| 1. Create an instance of `HWwalletManager` | ||
|
|
||
| ``` | ||
| import HWwalletManager from @enkryptcom/hw-wallets | ||
|
|
||
| const hwManager = new HWwalletManager() | ||
| ``` | ||
|
|
||
| 2. Call methods within class, passing network names and providers. Class automatically handles which wallet to use. | ||
|
|
||
| ### API | ||
|
|
||
| #### `getAddress(options: getAddressRequest): Promise<AddressResponse>` | ||
|
|
||
| Returns wallet address based off of the path provided in the `getAddressRequest`. | ||
|
|
||
| #### `signPersonalMessage(options: SignMessageRequest): Promise<string>` | ||
|
|
||
| Signs personal message. | ||
|
|
||
| #### `signTransaction(options: SignTransactionRequest): Promise<string>` | ||
|
|
||
| Returns an RPC sign you can then add to a transaction object. | ||
|
|
||
| #### `getSupportedPaths(options: isConnectedRequest): Promise<PathType[]>` | ||
|
|
||
| Returns supported paths based on options provided. | ||
|
|
||
| #### `isNetworkSupported(networkName: NetworkNames): boolean` | ||
|
|
||
| Checks network name support. | ||
|
|
||
| #### `isConnected(options: isConnectedRequest): Promise<boolean>` | ||
|
|
||
| Checks connection status. | ||
|
|
||
| #### `close(): Promise<void>` | ||
|
|
||
| Closes all HW wallet connections | ||
|
|
||
| ### Types | ||
|
|
||
| `NetworkNames`: https://github.com/enkryptcom/enKrypt/blob/main/packages/types/src/networks.ts#L1 | ||
| `getAddressRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L74 | ||
| `AddressResponse`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L31 | ||
| `SignMessageRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L54 | ||
| `SignTransactionRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L65 | ||
| `isConnectedRequest`: https://github.com/enkryptcom/enKrypt/blob/main/packages/hw-wallets/src/types.ts#L78 | ||
|
|
||
| ### Adding more paths | ||
|
|
||
| Navigate to `src/configs.ts` and add your new derivation path at the bottom. | ||
| Make sure to follow the configuration in that file. | ||
| Import path in the corresponding `Trezor` provider `config.ts`. | ||
| See `src/trezor/ethereum/configs.ts` for example. | ||
|
|
||
| ### Notes | ||
|
|
||
| Connection request to hardware wallet actually happens on `getAddress()` request. | ||
| `Ledger` can't have any paths as each paths are defined by the corresponding app. | ||
|
|
||
| #### For Vue devs | ||
|
|
||
| `ref/reactive` will mess with how Vue compiles these classes because of how Vue utilizes proxies. If you want to store an instance into a ref or reactive, use [`makeRaw`](https://vuejs.org/api/reactivity-advanced#markraw). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 1532
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 382
Update hw-wallets/.nvmrc to align with Node >=20 requirement.
The package.json correctly specifies
engines.node: ">=20"and this is documented in the README. However,packages/hw-wallets/.nvmrccontainslts/fermium(Node 14), which creates a developer experience issue—tools like nvm will override to Node 14 despite the package requiring Node >=20. Update this file tov20or higher to match the enforced constraint.🤖 Prompt for AI Agents