Skip to content
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

handshake refactor #1469

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukasrosario
Copy link
Contributor

Summary

  • Introduces a "light" handshake that initializes a signer without requiring an eth_requestAccounts
  • After this light handshake, only wallet_sendCalls, wallet_sign, and wallet_getCallsStatus requests are allowed.
  • An app can use eth_requestAccounts before or after this light handshake and the rest of the flow will continue to work like usual.

How did you test your changes?

@cb-heimdall
Copy link
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

dropkick1325

This comment was marked as spam.

Comment on lines +61 to +67
const signerType = await this.requestSignerSelection(args);
const signer = this.initSigner(signerType);
await signer.lightHandshake?.(args);
this.signer = signer;
storeSignerType(signerType);

return signer.request(args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange to default any called RPC into this flow. This assumes intent that all apps are using smart wallet when thats not the case today. For example, calling eth_accounts should throw a 4100 err code (not authorized) where this now assumes intent to initialize a smart wallet signer. When walletlink is removed, thats becomes a "safer" assumption but ideally the SDK should remain somewhat agnostic to the connection type ensuring max compatibility in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants