-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Electron TREZOR Support #1946
Electron TREZOR Support #1946
Conversation
const { chainId, ...strTx } = getTransactionFields(tx); | ||
const txFields = getTransactionFields(tx); | ||
|
||
if (process.env.BUILD_ELECTRON) { |
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.
It would be great to make a class that extends HardwareWallet that does this for you. @HenryNguyen5 how would you suggest this best be done?
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.
I'd probably just make a utility HOF instead that does the branching for you
package.json
Outdated
@@ -89,6 +91,7 @@ | |||
"@types/webpack-env": "1.13.4", | |||
"@types/zxcvbn": "4.4.0", | |||
"autodll-webpack-plugin": "0.3.9", | |||
"bchaddrjs": "0.2.1", |
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.
Note to self, this was fixed with trezor/trezor.js#58 so I can remove this.
* Initial scaffold of enclave * Cleanup types * Add comments * Do not truncate errors, pretty output * Introduce helpers for sagas * Update yarn lock * Convert enclave into its own lib. Implement client and server. * Check in progress * Initial types * Remove unused lib * Finish types * cleanup * Switch over to using electron protocol, remove code thats no longer necessary * Refactor Ledger and Trezor wallets to provide all functionality via libs. Run chain code generation thru Enclave. * Check in trezor work * Transaction signing * Message signing * Display address * Fix deallocation of trezor * Adjust API * Remove unused getAddresses * Fix imports and filenames to cooperate with internal typings * Fix type uncertainty * Add persistent message to Ledger unlock. * Update ledger help link to kb * Convert ledger over to updated libs * Fix jest config * Enclave README * Unnecessary assertion * Adjust tip * Type ledger errors * Reduce enclave client code. * No default exports * l18n user facing enclave errors * Reduce repeated enclave code by splitting it into its own wallet lib. Fix some types * tslint * Reduce repeated enclave code by splitting it into its own wallet lib. Fix some types and error messages. * Electron TREZOR Support (#1946) * Type trezor connect. * Check in trezor code * Implement TREZOR wallet * Convert TREZOR to use enclave class like Ledger. * Switch to mycrypto fork of trezor lib. Remove unused dependencies. * remove unnecessary window attachment * tslint
Builds off of #1836, finishes the other half of #1621.
Description
Implements the TREZOR side of hardware wallet integration in Electron using the enclave library introduced in #1621. Similar to that PR, there's an unfortunate amount of code duplication between the two wallet implementations. Any feedback on how to better unite those would be appreciated.
See "Steps to Test" for note about pending PR. I have personally tested that this all works.
Changes
TrezorConnect
.)Steps to Test
NOTE: This is still pending on trezor/trezor-link#9. If you wish to test this PR locally, you will have to manually make the changes proposed their to
node_modules/trezor-link/lib/http.js
.