-
Notifications
You must be signed in to change notification settings - Fork 834
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
WIP: Trezor Integration #4296
base: master
Are you sure you want to change the base?
WIP: Trezor Integration #4296
Conversation
@@ -2,5 +2,5 @@ | |||
. "$(dirname "$0")/_/husky.sh" | |||
|
|||
npx lint-staged | |||
node scripts/sync-expo-deps.js --dry-run | |||
#node scripts/sync-expo-deps.js --dry-run |
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.
This script references files I don't have upon cloning the repo and prevented me from commiting at all 🤔
// FIXME: Fix ETH Trezor properly | ||
new SolanaTrezorKeyringFactory() |
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.
How would you like to handle the absence of ETH integration for now?
private async trezorImport(walletDescriptor: WalletDescriptor): Promise<{ | ||
publicKey: string; | ||
name: string; | ||
}> { | ||
const blockchainKeyring = this.blockchains.get(walletDescriptor.blockchain); | ||
const trezorKeyring = blockchainKeyring!.trezorKeyring!; | ||
console.log( | ||
"[DEBUG] UserKeyring: trezorImport: walletDescriptor:", | ||
walletDescriptor, | ||
blockchainKeyring, | ||
trezorKeyring | ||
); | ||
|
||
throw new Error("Method not implemented."); |
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.
When are these import methods called (for ledger too)? I can't seem to get it to be called, even though it should be called on keyring creation.
this.responseQueue | ||
.filter((response) => response.portName === port.name) | ||
.forEach((response) => { | ||
console.log("[DEBUG] ToSecureUITransportSender: err 3", response); | ||
const responseWithId = { | ||
name: response.request.name, | ||
id: response.request.id, |
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.
The TrezorConnect popup throws this error -- I don't understand your transport layer enough to find out what's going wrong. Funnily enough, the data is returned correctly, but the transport fails here and the response doesn't reach the ImportWallets component.
Object.values(derivationPaths) | ||
); | ||
|
||
setProgress(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.
What's the point of thesetProgress
? is it ledger specific and can it be ommited?
console.log("[DEBUG] [TREZOR] SelectWallets result", result); | ||
currentRequest.respond({ | ||
walletDescriptors: result.map((descriptor) => ({ | ||
...descriptor, | ||
type: BlockchainWalletDescriptorType.HARDWARE, | ||
device: "trezor", | ||
})), | ||
}); |
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.
This goes through, issues occur somewhere after the respond is called.
* @returns boolean indicating validity | ||
*/ | ||
export function isLegalTrezorPath(path: string) { | ||
const pathRegex = /^m\/44'\/501'(\/\d'){0,2}$/; |
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.
Trezor wasn't accepting some paths from backpack, this filter ensures that the paths are accepted, though it leads to derivation paths fetched going from 118 paths to 21.
Removed a plugin disconnect call which was stopping trezor calls going through.
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
Opening this PR early as we talked about on Slack.
I'll leave questions in comments.